JCF: Use a read-only TEdit for settings file name, add button for opening folder, tweak captions. Patch from Balázs.

git-svn-id: trunk@55504 -
This commit is contained in:
juha 2017-07-15 08:55:33 +00:00
parent ae97cba986
commit 2c08fed238
4 changed files with 69 additions and 32 deletions

View File

@ -276,12 +276,13 @@ begin
exit;
case peMessageType of
mtException,mtInputError,mtParseError: Urgency:=mluError;
mtCodeWarning: Urgency:=mluWarning;
mtFinalSummary: Urgency:=mluImportant;
mtProgress: Urgency:=mluProgress;
mtException,mtInputError,mtParseError: Urgency:=mluError;
mtCodeWarning: Urgency:=mluWarning;
mtFinalSummary: Urgency:=mluImportant;
mtProgress: Urgency:=mluProgress;
else Urgency:=mluNone; // Suppress compiler warning.
end;
lazMessages.AddCustomMessage(Urgency,psMessage, psFile, piY, piX, 'JCF')
lazMessages.AddCustomMessage(Urgency, psMessage, psFile, piY, piX, 'JCF')
end;
procedure TJcfIdeMain.MakeEditorConverter;

View File

@ -16,13 +16,14 @@ resourcestring
//Format File settings tab
lisFrFileConfirmFormat = 'Show confirmation dialog before format';
lisFrFilesFileIsWritable = 'File is writable';
lisFrFilesFormatFileIs = 'Format file is %s';
lisFrFilesOpenFolder = 'Open folder';
lisFrFilesSettingsFileIs = 'Settings file is:';
lisFrFilesFileNotFound = 'File not found';
lisFrFilesFileISReadOnly = 'File is read only';
lisFrFilesDateFileWritten = 'Date file written: %s';
lisFrFilesVersionThatWroteThisFile = 'Version that wrote this file: %s';
lisFrFilesDescription = 'Description:';
lisFrFilesFormatFile = 'Format File';
lisFrFilesSettingsFile = 'Settings File';
//Obfuscate settings tab
lisObfsObfuscate = 'Obfuscate';

View File

@ -2,18 +2,18 @@ object fFiles: TfFiles
Left = 0
Height = 281
Top = 0
Width = 338
Width = 395
ClientHeight = 281
ClientWidth = 338
ClientWidth = 395
OnResize = FrameResize
TabOrder = 0
DesignLeft = 597
DesignTop = 402
DesignLeft = 495
DesignTop = 342
object lblStatus: TLabel
Left = 8
Height = 15
Top = 56
Width = 45
Width = 53
Caption = 'lblStatus'
ParentColor = False
end
@ -21,7 +21,7 @@ object fFiles: TfFiles
Left = 8
Height = 15
Top = 78
Width = 37
Width = 43
Caption = 'lblDate'
ParentColor = False
end
@ -29,7 +29,7 @@ object fFiles: TfFiles
Left = 8
Height = 15
Top = 102
Width = 51
Width = 59
Caption = 'lblVersion'
ParentColor = False
end
@ -37,16 +37,16 @@ object fFiles: TfFiles
Left = 8
Height = 15
Top = 128
Width = 63
Width = 73
Caption = 'Description:'
ParentColor = False
end
object lblFormatFileName: TLabel
object lblSettingsFileName: TLabel
Left = 8
Height = 15
Top = 22
Width = 101
Caption = 'lblFormatFileName'
Top = 35
Width = 119
Caption = 'lblSettingsFileName'
ParentColor = False
end
object mDescription: TMemo
@ -54,14 +54,32 @@ object fFiles: TfFiles
Height = 89
Top = 148
Width = 301
TabOrder = 0
TabOrder = 2
end
object cbConfirmFormat: TCheckBox
Left = 8
Height = 19
Height = 20
Top = 2
Width = 233
Width = 268
Caption = 'Show confirmation dialog before format'
TabOrder = 0
end
object edFormatFile: TEdit
Left = 128
Height = 29
Top = 32
Width = 152
Color = clBtnFace
ReadOnly = True
TabOrder = 1
end
object bOpenFolder: TButton
Left = 296
Height = 25
Top = 31
Width = 91
Caption = 'Open folder'
OnClick = bOpenFolderClick
TabOrder = 3
end
end

View File

@ -40,13 +40,16 @@ type
{ TfFiles }
TfFiles = class(TAbstractIDEOptionsEditor)
bOpenFolder: TButton;
cbConfirmFormat: TCheckBox;
edFormatFile: TEdit;
lblStatus: TLabel;
lblDate: TLabel;
lblVersion: TLabel;
lblDescription: TLabel;
mDescription: TMemo;
lblFormatFileName: TLabel;
lblSettingsFileName: TLabel;
procedure bOpenFolderClick(Sender: TObject);
procedure FrameResize(Sender: TObject);
public
function GetTitle: String; override;
@ -62,7 +65,7 @@ implementation
uses
{ local }
JcfFileUtils, JcfRegistrySettings, JcfSettings, jcfuiconsts, LazFileUtils;
JcfFileUtils, JcfRegistrySettings, JcfSettings, jcfuiconsts, LazFileUtils, LCLIntf;
procedure TfFiles.ReadSettings(AOptions: TAbstractIDEOptions);
var
@ -74,8 +77,9 @@ begin
cbConfirmFormat.Caption := lisFrFileConfirmFormat;
cbConfirmFormat.Checked := FormattingSettings.ConfirmFormat;
lblFormatFileName.Caption := Format(lisFrFilesFormatFileIs, [lcSet.FormatConfigFileName]);
//lblFormatFileName.Caption := PathCompactPath(lblFormatFileName.Canvas.Handle, 'Format file is ' + lcSet.FormatConfigFileName, 450, cpCenter);
lblSettingsFileName.Caption := lisFrFilesSettingsFileIs;
edFormatFile.Text := lcSet.FormatConfigFileName;
bOpenFolder.Caption := lisFrFilesOpenFolder;
lblDate.Caption := '';
lblVersion.Caption := '';
@ -123,13 +127,21 @@ begin
cbConfirmFormat.Left := SPACING;
cbConfirmFormat.Top := 2;
lblFormatFileName.Left := SPACING;
lblFormatFileName.Width := ClientWidth - (lblFormatFileName.Left + SPACING);
lblFormatFileName.Top := cbConfirmFormat.Top + cbConfirmFormat.Height + SPACING;
lblSettingsFileName.Left := SPACING;
lblSettingsFileName.Top := cbConfirmFormat.Top + cbConfirmFormat.Height + SPACING;
// file name is varaible height due to wrap. Rest go below
edFormatFile.Left := lblSettingsFileName.Left + lblSettingsFileName.Width + 3;
edFormatFile.Width := ClientWidth - (lblSettingsFileName.Left +lblSettingsFileName.Width + bOpenFolder.Width + 2*SPACING);
edFormatFile.Top := lblSettingsFileName.Top - (edFormatFile.Height - lblSettingsFileName.Height) div 2;
bOpenFolder.Left := edFormatFile.Left + edFormatFile.Width + 3;
if bOpenFolder.Height < edFormatFile.Height then
bOpenFolder.Height := edFormatFile.Height;
bOpenFolder.Top := lblSettingsFileName.Top - (bOpenFolder.Height - lblSettingsFileName.Height) div 2;
// file name is variable height due to wrap. Rest go below
lblStatus.Left := SPACING;
lblStatus.Top := lblFormatFileName.Top + lblFormatFileName.Height + SPACING;
lblStatus.Top := lblSettingsFileName.Top + lblSettingsFileName.Height + SPACING;
lblDate.Left := SPACING;
lblDate.Top := lblStatus.Top + lblStatus.Height + SPACING;
@ -148,9 +160,14 @@ begin
mDescription.Width := ClientWidth - (mDescription.Left + SPACING);
end;
procedure TfFiles.bOpenFolderClick(Sender: TObject);
begin
OpenDocument(ExtractFilePath(edFormatFile.Text));
end;
function TfFiles.GetTitle: String;
begin
Result := lisFrFilesFormatFile;
Result := lisFrFilesSettingsFile;
end;
procedure TfFiles.Setup(ADialog: TAbstractOptionsEditorDialog);