PoChecker: use statusbar for displaying current test instead of panel with labels.

git-svn-id: trunk@46379 -
This commit is contained in:
bart 2014-09-30 19:33:51 +00:00
parent e02126bcdd
commit 743e043344
3 changed files with 24 additions and 82 deletions

View File

@ -24,8 +24,7 @@ resourcestring
sTotalErrors = 'Total errors found: %d';
sTotalWarnings = 'Total warnings found: %d';
sNoErrorsFound = 'No errors found';
sCurrentTest = 'Current Test:';
sCurrentPoFile = 'Current po-file:';
sCurrentTest = 'Test: %s on %s';
sNoTestSelected = 'There are no tests selected.';
//Result form

View File

@ -103,66 +103,10 @@ object PoCheckerForm: TPoCheckerForm
OnClick = RunBtnClick
TabOrder = 2
end
object StatusPanel: TPanel
Left = 0
Height = 49
Top = 293
Width = 581
Align = alBottom
BevelOuter = bvLowered
ClientHeight = 49
ClientWidth = 581
TabOrder = 3
object CurTestHeaderLabel: TLabel
Left = 8
Height = 15
Top = 8
Width = 68
Caption = 'Current Test:'
ParentColor = False
end
object CurPoHeaderLabel: TLabel
AnchorSideLeft.Control = CurTestHeaderLabel
AnchorSideTop.Control = CurTestHeaderLabel
AnchorSideTop.Side = asrBottom
Left = 8
Height = 15
Top = 23
Width = 81
Caption = 'Current po-file:'
ParentColor = False
end
object CurTestLabel: TLabel
AnchorSideLeft.Control = CurTestHeaderLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CurTestHeaderLabel
AnchorSideTop.Side = asrCenter
Left = 82
Height = 15
Top = 8
Width = 69
BorderSpacing.Around = 6
Caption = 'CurTestLabel'
ParentColor = False
end
object CurPoLabel: TLabel
AnchorSideLeft.Control = CurPoHeaderLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = CurPoHeaderLabel
AnchorSideTop.Side = asrCenter
Left = 95
Height = 15
Top = 23
Width = 61
BorderSpacing.Around = 6
Caption = 'CurPoLabel'
ParentColor = False
end
end
object NoErrLabel: TLabel
Left = 8
Height = 25
Top = 262
Top = 280
Width = 146
Anchors = [akLeft, akBottom]
Caption = 'No errors found'
@ -182,7 +126,7 @@ object PoCheckerForm: TPoCheckerForm
Width = 156
BorderSpacing.Top = 6
Caption = 'Find all translated PO files'
TabOrder = 4
TabOrder = 3
end
object SelectBasicBtn: TButton
AnchorSideLeft.Control = TestListBox
@ -196,7 +140,7 @@ object PoCheckerForm: TPoCheckerForm
Caption = 'Select Basic Tests'
Enabled = False
OnClick = SelectBasicBtnClick
TabOrder = 5
TabOrder = 4
end
object SelectAllBtn: TButton
AnchorSideLeft.Control = SelectBasicBtn
@ -210,7 +154,7 @@ object PoCheckerForm: TPoCheckerForm
Caption = 'Select All Tests'
Enabled = False
OnClick = SelectAllBtnClick
TabOrder = 6
TabOrder = 5
end
object UnselectAllBtn: TButton
AnchorSideLeft.Control = SelectAllBtn
@ -224,7 +168,7 @@ object PoCheckerForm: TPoCheckerForm
Caption = 'Unselect All Tests'
Enabled = False
OnClick = UnselectAllBtnClick
TabOrder = 7
TabOrder = 6
end
object IgnoreFuzzyCheckBox: TCheckBox
AnchorSideLeft.Control = TestListBox
@ -236,7 +180,14 @@ object PoCheckerForm: TPoCheckerForm
Width = 152
BorderSpacing.Top = 6
Caption = 'sIgnoreFuzzyTranslations'
TabOrder = 8
TabOrder = 7
end
object StatusBar: TStatusBar
Left = 0
Height = 23
Top = 319
Width = 581
Panels = <>
end
object OpenDialog: TOpenDialog
Filter = 'po-files (*.po)|*.po|all files|*'

View File

@ -25,7 +25,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, LCLProc, CheckLst, Buttons, ExtCtrls,
StdCtrls, LCLProc, CheckLst, Buttons, ExtCtrls, ComCtrls,
{$IFDEF POCHECKERSTANDALONE}
Translations,
{$ELSE}
@ -38,6 +38,7 @@ type
{ TPoCheckerForm }
TPoCheckerForm = class(TForm)
StatusBar: TStatusBar;
private
PoFamily: TPoFamily;
FSelectedPoName: String;
@ -53,7 +54,7 @@ type
function TrySelectFile(out Filename: String): Boolean;
function TryCreatePoFamily(Filename: String): Boolean;
procedure RunSelectedTests;
procedure ClearAndDisableStatusPanel;
procedure ClearStatusBar;
procedure SetSelectedPoName(AFilename: String);
procedure LoadConfig;
procedure SaveConfig;
@ -63,12 +64,7 @@ type
SelectAllBtn: TButton;
SelectBasicBtn: TButton;
FindAllPOsCheckBox: TCheckBox;
CurTestHeaderLabel: TLabel;
CurPoHeaderLabel: TLabel;
CurTestLabel: TLabel;
CurPoLabel: TLabel;
NoErrLabel: TLabel;
StatusPanel: TPanel;
RunBtn: TBitBtn;
OpenBtn: TBitBtn;
Button3: TButton;
@ -93,6 +89,7 @@ implementation
{$R *.lfm}
procedure ShowPoCheckerForm();
begin
if not Assigned(PoCheckerForm) then
@ -136,10 +133,8 @@ begin
RunBtn.Caption := sRunSelectedTests;
NoErrLabel.Caption := sNoErrorsFound;
FillTestListBox;
ClearAndDisableStatusPanel;
ClearStatusBar;
NoErrLabel.Visible := False;
CurTestHeaderLabel.Caption := sCurrentTest;
CurPoHeaderLabel.Caption := sCurrentPoFile;
SelectAllBtn.Caption := sSelectAllTests;
SelectBasicBtn.Caption := sSelectBasicTests;
UnselectAllBtn.Caption := sUnselectAllTests;
@ -206,8 +201,8 @@ end;
procedure TPoCheckerForm.OnTestStart(const ATestName, APoFileName: string);
begin
//debugln('OnTestStart: ATestName = "',AtestName,'" APoFileName = "',APoFileName);
CurTestLabel.Caption := ATestName;
CurPoLabel.Caption := APoFileName;
StatusBar.SimplePanel := True;
StatusBar.SimpleText := Format('Test: %s on %s',[ATestName,APoFileName]);
Application.ProcessMessages;
end;
@ -393,7 +388,6 @@ begin
SL := TStringList.Create;
mr := mrNone;
try
StatusPanel.Enabled := True;
if (not (ptoFindAllChildren in TestOptions)) and Assigned(PoFamily.Child) and
(PoFamily.ChildName <> FSelectedPoName) then
PoFamily.ChildName := FSelectedPoName;
@ -422,17 +416,15 @@ begin
finally
if Assigned(SL) then
SL.Free;
ClearAndDisableStatusPanel;
ClearStatusBar;
end;
if mr = mrOpenEditorFile then WindowState:= wsMinimized;
end;
procedure TPoCheckerForm.ClearAndDisableStatusPanel;
procedure TPoCheckerForm.ClearStatusBar;
begin
CurTestLabel.Caption := '';
CurPoLabel.Caption := '';
StatusPanel.Enabled := False;
StatusBar.SimpleText := '';
end;
procedure TPoCheckerForm.SetSelectedPoName(AFilename: String);