mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 18:39:20 +02:00
PoChecker: use statusbar for displaying current test instead of panel with labels.
git-svn-id: trunk@46379 -
This commit is contained in:
parent
e02126bcdd
commit
743e043344
@ -24,8 +24,7 @@ resourcestring
|
|||||||
sTotalErrors = 'Total errors found: %d';
|
sTotalErrors = 'Total errors found: %d';
|
||||||
sTotalWarnings = 'Total warnings found: %d';
|
sTotalWarnings = 'Total warnings found: %d';
|
||||||
sNoErrorsFound = 'No errors found';
|
sNoErrorsFound = 'No errors found';
|
||||||
sCurrentTest = 'Current Test:';
|
sCurrentTest = 'Test: %s on %s';
|
||||||
sCurrentPoFile = 'Current po-file:';
|
|
||||||
sNoTestSelected = 'There are no tests selected.';
|
sNoTestSelected = 'There are no tests selected.';
|
||||||
|
|
||||||
//Result form
|
//Result form
|
||||||
|
@ -103,66 +103,10 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
OnClick = RunBtnClick
|
OnClick = RunBtnClick
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
end
|
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
|
object NoErrLabel: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 262
|
Top = 280
|
||||||
Width = 146
|
Width = 146
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
Caption = 'No errors found'
|
Caption = 'No errors found'
|
||||||
@ -182,7 +126,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
Width = 156
|
Width = 156
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'Find all translated PO files'
|
Caption = 'Find all translated PO files'
|
||||||
TabOrder = 4
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object SelectBasicBtn: TButton
|
object SelectBasicBtn: TButton
|
||||||
AnchorSideLeft.Control = TestListBox
|
AnchorSideLeft.Control = TestListBox
|
||||||
@ -196,7 +140,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
Caption = 'Select Basic Tests'
|
Caption = 'Select Basic Tests'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
OnClick = SelectBasicBtnClick
|
OnClick = SelectBasicBtnClick
|
||||||
TabOrder = 5
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object SelectAllBtn: TButton
|
object SelectAllBtn: TButton
|
||||||
AnchorSideLeft.Control = SelectBasicBtn
|
AnchorSideLeft.Control = SelectBasicBtn
|
||||||
@ -210,7 +154,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
Caption = 'Select All Tests'
|
Caption = 'Select All Tests'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
OnClick = SelectAllBtnClick
|
OnClick = SelectAllBtnClick
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
end
|
end
|
||||||
object UnselectAllBtn: TButton
|
object UnselectAllBtn: TButton
|
||||||
AnchorSideLeft.Control = SelectAllBtn
|
AnchorSideLeft.Control = SelectAllBtn
|
||||||
@ -224,7 +168,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
Caption = 'Unselect All Tests'
|
Caption = 'Unselect All Tests'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
OnClick = UnselectAllBtnClick
|
OnClick = UnselectAllBtnClick
|
||||||
TabOrder = 7
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
object IgnoreFuzzyCheckBox: TCheckBox
|
object IgnoreFuzzyCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = TestListBox
|
AnchorSideLeft.Control = TestListBox
|
||||||
@ -236,7 +180,14 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
Width = 152
|
Width = 152
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'sIgnoreFuzzyTranslations'
|
Caption = 'sIgnoreFuzzyTranslations'
|
||||||
TabOrder = 8
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
object StatusBar: TStatusBar
|
||||||
|
Left = 0
|
||||||
|
Height = 23
|
||||||
|
Top = 319
|
||||||
|
Width = 581
|
||||||
|
Panels = <>
|
||||||
end
|
end
|
||||||
object OpenDialog: TOpenDialog
|
object OpenDialog: TOpenDialog
|
||||||
Filter = 'po-files (*.po)|*.po|all files|*'
|
Filter = 'po-files (*.po)|*.po|all files|*'
|
||||||
|
@ -25,7 +25,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, LCLProc, CheckLst, Buttons, ExtCtrls,
|
StdCtrls, LCLProc, CheckLst, Buttons, ExtCtrls, ComCtrls,
|
||||||
{$IFDEF POCHECKERSTANDALONE}
|
{$IFDEF POCHECKERSTANDALONE}
|
||||||
Translations,
|
Translations,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -38,6 +38,7 @@ type
|
|||||||
{ TPoCheckerForm }
|
{ TPoCheckerForm }
|
||||||
|
|
||||||
TPoCheckerForm = class(TForm)
|
TPoCheckerForm = class(TForm)
|
||||||
|
StatusBar: TStatusBar;
|
||||||
private
|
private
|
||||||
PoFamily: TPoFamily;
|
PoFamily: TPoFamily;
|
||||||
FSelectedPoName: String;
|
FSelectedPoName: String;
|
||||||
@ -53,7 +54,7 @@ type
|
|||||||
function TrySelectFile(out Filename: String): Boolean;
|
function TrySelectFile(out Filename: String): Boolean;
|
||||||
function TryCreatePoFamily(Filename: String): Boolean;
|
function TryCreatePoFamily(Filename: String): Boolean;
|
||||||
procedure RunSelectedTests;
|
procedure RunSelectedTests;
|
||||||
procedure ClearAndDisableStatusPanel;
|
procedure ClearStatusBar;
|
||||||
procedure SetSelectedPoName(AFilename: String);
|
procedure SetSelectedPoName(AFilename: String);
|
||||||
procedure LoadConfig;
|
procedure LoadConfig;
|
||||||
procedure SaveConfig;
|
procedure SaveConfig;
|
||||||
@ -63,12 +64,7 @@ type
|
|||||||
SelectAllBtn: TButton;
|
SelectAllBtn: TButton;
|
||||||
SelectBasicBtn: TButton;
|
SelectBasicBtn: TButton;
|
||||||
FindAllPOsCheckBox: TCheckBox;
|
FindAllPOsCheckBox: TCheckBox;
|
||||||
CurTestHeaderLabel: TLabel;
|
|
||||||
CurPoHeaderLabel: TLabel;
|
|
||||||
CurTestLabel: TLabel;
|
|
||||||
CurPoLabel: TLabel;
|
|
||||||
NoErrLabel: TLabel;
|
NoErrLabel: TLabel;
|
||||||
StatusPanel: TPanel;
|
|
||||||
RunBtn: TBitBtn;
|
RunBtn: TBitBtn;
|
||||||
OpenBtn: TBitBtn;
|
OpenBtn: TBitBtn;
|
||||||
Button3: TButton;
|
Button3: TButton;
|
||||||
@ -93,6 +89,7 @@ implementation
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
|
|
||||||
procedure ShowPoCheckerForm();
|
procedure ShowPoCheckerForm();
|
||||||
begin
|
begin
|
||||||
if not Assigned(PoCheckerForm) then
|
if not Assigned(PoCheckerForm) then
|
||||||
@ -136,10 +133,8 @@ begin
|
|||||||
RunBtn.Caption := sRunSelectedTests;
|
RunBtn.Caption := sRunSelectedTests;
|
||||||
NoErrLabel.Caption := sNoErrorsFound;
|
NoErrLabel.Caption := sNoErrorsFound;
|
||||||
FillTestListBox;
|
FillTestListBox;
|
||||||
ClearAndDisableStatusPanel;
|
ClearStatusBar;
|
||||||
NoErrLabel.Visible := False;
|
NoErrLabel.Visible := False;
|
||||||
CurTestHeaderLabel.Caption := sCurrentTest;
|
|
||||||
CurPoHeaderLabel.Caption := sCurrentPoFile;
|
|
||||||
SelectAllBtn.Caption := sSelectAllTests;
|
SelectAllBtn.Caption := sSelectAllTests;
|
||||||
SelectBasicBtn.Caption := sSelectBasicTests;
|
SelectBasicBtn.Caption := sSelectBasicTests;
|
||||||
UnselectAllBtn.Caption := sUnselectAllTests;
|
UnselectAllBtn.Caption := sUnselectAllTests;
|
||||||
@ -206,8 +201,8 @@ end;
|
|||||||
procedure TPoCheckerForm.OnTestStart(const ATestName, APoFileName: string);
|
procedure TPoCheckerForm.OnTestStart(const ATestName, APoFileName: string);
|
||||||
begin
|
begin
|
||||||
//debugln('OnTestStart: ATestName = "',AtestName,'" APoFileName = "',APoFileName);
|
//debugln('OnTestStart: ATestName = "',AtestName,'" APoFileName = "',APoFileName);
|
||||||
CurTestLabel.Caption := ATestName;
|
StatusBar.SimplePanel := True;
|
||||||
CurPoLabel.Caption := APoFileName;
|
StatusBar.SimpleText := Format('Test: %s on %s',[ATestName,APoFileName]);
|
||||||
Application.ProcessMessages;
|
Application.ProcessMessages;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -393,7 +388,6 @@ begin
|
|||||||
SL := TStringList.Create;
|
SL := TStringList.Create;
|
||||||
mr := mrNone;
|
mr := mrNone;
|
||||||
try
|
try
|
||||||
StatusPanel.Enabled := True;
|
|
||||||
if (not (ptoFindAllChildren in TestOptions)) and Assigned(PoFamily.Child) and
|
if (not (ptoFindAllChildren in TestOptions)) and Assigned(PoFamily.Child) and
|
||||||
(PoFamily.ChildName <> FSelectedPoName) then
|
(PoFamily.ChildName <> FSelectedPoName) then
|
||||||
PoFamily.ChildName := FSelectedPoName;
|
PoFamily.ChildName := FSelectedPoName;
|
||||||
@ -422,17 +416,15 @@ begin
|
|||||||
finally
|
finally
|
||||||
if Assigned(SL) then
|
if Assigned(SL) then
|
||||||
SL.Free;
|
SL.Free;
|
||||||
ClearAndDisableStatusPanel;
|
ClearStatusBar;
|
||||||
end;
|
end;
|
||||||
if mr = mrOpenEditorFile then WindowState:= wsMinimized;
|
if mr = mrOpenEditorFile then WindowState:= wsMinimized;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TPoCheckerForm.ClearAndDisableStatusPanel;
|
procedure TPoCheckerForm.ClearStatusBar;
|
||||||
begin
|
begin
|
||||||
CurTestLabel.Caption := '';
|
StatusBar.SimpleText := '';
|
||||||
CurPoLabel.Caption := '';
|
|
||||||
StatusPanel.Enabled := False;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPoCheckerForm.SetSelectedPoName(AFilename: String);
|
procedure TPoCheckerForm.SetSelectedPoName(AFilename: String);
|
||||||
|
Loading…
Reference in New Issue
Block a user