Merge pull request #2731 from keymanapp/feat/developer/2727-always-save-option

feat(developer): always save options
This commit is contained in:
Marc Durdin 2020-02-26 13:59:51 +07:00 • committed by GitHub
commit df148365bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 408 additions and 36 deletions

View file

@ -80,7 +80,7 @@ uses
UfrmRegressionTestFailure in 'dialogs\UfrmRegressionTestFailure.pas' {frmRegressionTestFailure},
XString in '..\..\global\delphi\general\XString.pas',
debugkeyboard in 'debug\debugkeyboard.pas',
UfrmMustIncludeDebug in 'dialogs\UfrmMustIncludeDebug.pas' {frmMustIncludeDebug},
Keyman.Developer.UI.UfrmMessageDlgWithSave in 'dialogs\Keyman.Developer.UI.UfrmMessageDlgWithSave.pas' {frmMessageDlgWithSave},
debugdeadkeys in 'debug\debugdeadkeys.pas',
MessageIdentifiers in 'main\MessageIdentifiers.pas',
exceptionw in '..\..\global\delphi\general\exceptionw.pas',
@ -293,7 +293,8 @@ uses
Keyman.Developer.System.LexicalModelParser in 'main\Keyman.Developer.System.LexicalModelParser.pas',
Keyman.Developer.System.LexicalModelParserTypes in 'main\Keyman.Developer.System.LexicalModelParserTypes.pas',
Keyman.Developer.UI.UfrmWordlistEditor in 'child\Keyman.Developer.UI.UfrmWordlistEditor.pas' {frmWordlistEditor},
Keyman.Developer.UI.dmActionsModelEditor in 'actions\Keyman.Developer.UI.dmActionsModelEditor.pas' {modActionsModelEditor: TDataModule};
Keyman.Developer.UI.dmActionsModelEditor in 'actions\Keyman.Developer.UI.dmActionsModelEditor.pas' {modActionsModelEditor: TDataModule},
UfrmMustIncludeDebug in 'dialogs\UfrmMustIncludeDebug.pas' {frmMustIncludeDebug};
{$R *.RES}
{$R ICONS.RES}
@ -321,8 +322,8 @@ begin
if TikeActive then Exit;
InitClasses;
Application.CreateForm(TmodWebHttpServer, modWebHttpServer);
Application.CreateForm(TfrmKeymanDeveloper, frmKeymanDeveloper);
Application.Run;
Application.CreateForm(TfrmKeymanDeveloper, frmKeymanDeveloper);
Application.Run;
end;
finally
FInitializeCEF.Free;

View file

@ -7,7 +7,7 @@
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>18.7</ProjectVersion>
<ProjectVersion>18.8</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
@ -215,8 +215,8 @@
</DCCReference>
<DCCReference Include="..\..\global\delphi\general\XString.pas"/>
<DCCReference Include="debug\debugkeyboard.pas"/>
<DCCReference Include="dialogs\UfrmMustIncludeDebug.pas">
<Form>frmMustIncludeDebug</Form>
<DCCReference Include="dialogs\Keyman.Developer.UI.UfrmMessageDlgWithSave.pas">
<Form>frmMessageDlgWithSave</Form>
</DCCReference>
<DCCReference Include="debug\debugdeadkeys.pas"/>
<DCCReference Include="main\MessageIdentifiers.pas"/>
@ -553,6 +553,10 @@
<FormType>dfm</FormType>
<DesignClass>TDataModule</DesignClass>
</DCCReference>
<DCCReference Include="dialogs\UfrmMustIncludeDebug.pas">
<Form>frmMustIncludeDebug</Form>
<FormType>dfm</FormType>
</DCCReference>
<None Include="Profiling\AQtimeModule1.aqt"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
@ -670,12 +674,20 @@
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
@ -688,138 +700,242 @@
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
@ -889,6 +1005,9 @@
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
@ -1220,6 +1339,9 @@
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
@ -1263,6 +1385,10 @@
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
@ -1285,6 +1411,12 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
@ -1322,6 +1454,7 @@
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>

View file

@ -958,6 +958,10 @@ inherited frmKeymanWizard: TfrmKeymanWizard
object pageLayoutCode: TTabSheet
Caption = 'Code'
ImageIndex = -1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
end
end
@ -1004,10 +1008,16 @@ inherited frmKeymanWizard: TfrmKeymanWizard
object pageOnScreenKeyboard: TTabSheet
Caption = 'On-Screen'
ImageIndex = 7
ExplicitLeft = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
object pageTouchLayout: TTabSheet
Caption = 'Touch Layout'
ImageIndex = 16
ExplicitLeft = 0
ExplicitWidth = 0
ExplicitHeight = 0
object pagesTouchLayout: TPageControl
Left = 0
Top = 0
@ -1022,28 +1032,48 @@ inherited frmKeymanWizard: TfrmKeymanWizard
object pageTouchLayoutDesign: TTabSheet
Caption = 'Design'
ImageIndex = -1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
object pageTouchLayoutCode: TTabSheet
Caption = 'Code'
ImageIndex = -1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
end
end
object pageIncludeCodes: TTabSheet
Caption = 'Char Codes'
ImageIndex = 9
ExplicitLeft = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
object pageKMWEmbedJS: TTabSheet
Caption = 'Embedded JS'
ImageIndex = 9
ExplicitLeft = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
object pageKMWEmbedCSS: TTabSheet
Caption = 'Embedded CSS'
ImageIndex = 9
ExplicitLeft = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
object pageKMWHelp: TTabSheet
Caption = 'Embedded Help'
ImageIndex = 9
ExplicitLeft = 0
ExplicitWidth = 0
ExplicitHeight = 0
end
object pageCompile: TTabSheet
Caption = 'Build'
@ -1058,7 +1088,6 @@ inherited frmKeymanWizard: TfrmKeymanWizard
Color = 14211288
ParentBackground = False
TabOrder = 0
ExplicitTop = -3
object lblCongrats: TLabel
Left = 10
Top = 13

View file

@ -575,6 +575,7 @@ uses
Keyman.Developer.System.Project.ProjectLog,
Keyman.Developer.System.Project.kmnProjectFileAction,
Keyman.Developer.UI.Project.ProjectFileUI,
Keyman.Developer.UI.UfrmMessageDlgWithSave,
RegExpr,
ErrorControlledRegistry,
RedistFiles,
@ -1506,13 +1507,25 @@ begin
end;
function TfrmKeymanWizard.PrepareForBuild(var DebugReset: Boolean): Boolean; // I4504
var
FSave: Boolean;
begin
if IsDebugVisible then
begin
case MessageDlg('You must reset the debugger before recompiling your keyboard. Reset the debugger and recompile?',
mtConfirmation, mbYesNoCancel, 0) of
mrNo, mrCancel: Exit(False);
if not FKeymanDeveloperOptions.DebuggerAutoResetBeforeCompiling then
begin
if TfrmMessageDlgWithSave.Execute(
'You must reset the debugger before recompiling your keyboard. Reset the debugger and recompile?',
'Always reset the debugger automatically before compiling',
'', True, FSave) in [mrNo, mrCancel] then
Exit(False);
if FSave then
begin
FKeymanDeveloperOptions.DebuggerAutoResetBeforeCompiling := True;
FKeymanDeveloperOptions.Write;
end;
end;
DebugReset := True;
StopDebugging;
end;
@ -3207,6 +3220,8 @@ begin
end;
procedure TfrmKeymanWizard.cmdImportFromOnScreenClick(Sender: TObject); // I3945 // I4034
var
FSave: Boolean;
begin
if (FFeature[kfOSK].FileName = '') or not FKeyboardParser.Features.ContainsKey(kfOSK) then // I4058 // I4138
begin
@ -3216,8 +3231,24 @@ begin
if Self.Modified then // I4059
begin
ShowMessage('You must save changes to the keyboard before importing');
Exit;
if not FKeymanDeveloperOptions.OSKAutoSaveBeforeImporting then
begin
if TfrmMessageDlgWithSave.Execute(
'You must save changes to your keyboard before import. Save now and import?',
'Always save changes automatically before importing',
'', True, FSave) in [mrNo, mrCancel] then
Exit;
if FSave then
begin
FKeymanDeveloperOptions.OSKAutoSaveBeforeImporting := True;
FKeymanDeveloperOptions.Write;
end;
if not modActionsMain.actFileSave.Execute then
begin
Exit;
end;
end;
end;
Self.Modified := True;

View file

@ -0,0 +1,60 @@
inherited frmMessageDlgWithSave: TfrmMessageDlgWithSave
Left = 192
Top = 114
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Keyman Developer'
ClientHeight = 133
ClientWidth = 393
Font.Name = 'MS Sans Serif'
Position = poScreenCenter
ExplicitWidth = 399
ExplicitHeight = 162
PixelsPerInch = 96
TextHeight = 13
object lblMessage: TLabel
Left = 8
Top = 8
Width = 377
Height = 58
AutoSize = False
WordWrap = True
end
object cmdYes: TButton
Left = 65
Top = 100
Width = 73
Height = 25
Caption = '&Yes'
Default = True
ModalResult = 6
TabOrder = 1
end
object cmdNo: TButton
Left = 160
Top = 100
Width = 73
Height = 25
Caption = '&No'
ModalResult = 7
TabOrder = 2
end
object cmdCancel: TButton
Left = 255
Top = 100
Width = 73
Height = 25
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 3
end
object chkSave: TCheckBox
Left = 8
Top = 72
Width = 377
Height = 17
Caption = '&Remember this choice for next time'
TabOrder = 0
end
end

View file

@ -0,0 +1,63 @@
(*
Copyright (C) 2020 SIL International.
Show a message dialog with a check box to 'remember Yes choice
for next time'.
*)
unit Keyman.Developer.UI.UfrmMessageDlgWithSave;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, UfrmTike;
type
TfrmMessageDlgWithSave = class(TTikeForm)
lblMessage: TLabel;
cmdYes: TButton;
cmdNo: TButton;
cmdCancel: TButton;
chkSave: TCheckBox;
private
FHelpTopic: string;
protected
function GetHelpTopic: string; override;
public
// Always has Yes, No and Cancel
class function Execute(const Message, SaveCaption, HelpTopic: string; DefaultSaveChecked: Boolean; var SaveOption: Boolean): TModalResult;
end;
implementation
uses
Keyman.Developer.System.HelpTopics,
KeymanDeveloperOptions;
{$R *.DFM}
class function TfrmMessageDlgWithSave.Execute(const Message, SaveCaption, HelpTopic: string;
DefaultSaveChecked: Boolean; var SaveOption: Boolean): TModalResult;
var
dlg: TfrmMessageDlgWithSave;
begin
dlg := TfrmMessageDlgWithSave.Create(Application);
try
dlg.chkSave.Checked := DefaultSaveChecked;
dlg.chkSave.Caption := SaveCaption;
dlg.lblMessage.Caption := Message;
dlg.FHelpTopic := HelpTopic;
Result := dlg.ShowModal;
SaveOption := dlg.chkSave.Checked;
finally
dlg.Free;
end;
end;
function TfrmMessageDlgWithSave.GetHelpTopic: string;
begin
Result := FHelpTopic;
end;
end.

View file

@ -24,10 +24,6 @@ inherited frmOptions: TfrmOptions
object tabGeneral: TTabSheet
Caption = 'General'
ImageIndex = 2
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object cmdProxySettings: TButton
Left = 8
Top = 209
@ -118,13 +114,25 @@ inherited frmOptions: TfrmOptions
OnClick = cmdBrowseDefaultProjectPathClick
end
end
object chkAutoSaveBeforeCompiling: TCheckBox
Left = 152
Top = 182
Width = 218
Height = 17
Caption = '&Automatically save before compiling'
TabOrder = 7
end
object chkOSKAutoSaveBeforeImporting: TCheckBox
Left = 152
Top = 205
Width = 218
Height = 17
Caption = '&Automatically save before importing OSK'
TabOrder = 8
end
end
object tabEditor: TTabSheet
Caption = 'Editor'
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object gbEditorSpaces: TGroupBox
Left = 11
Top = 16
@ -244,15 +252,11 @@ inherited frmOptions: TfrmOptions
object tabDebugger: TTabSheet
Caption = 'Debugger'
ImageIndex = 3
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object gbDebuggerSettings: TGroupBox
Left = 8
Top = 8
Top = 7
Width = 313
Height = 129
Height = 146
Caption = 'Settings'
TabOrder = 0
object chkUseOldDebugger: TCheckBox
@ -289,16 +293,24 @@ inherited frmOptions: TfrmOptions
end
object chkDebuggerAutoRecompile: TCheckBox
Left = 8
Top = 100
Top = 101
Width = 289
Height = 17
Caption = '&Automatically recompile if no debug information available'
TabOrder = 4
end
object chkDebuggerAutoResetBeforeCompiling: TCheckBox
Left = 8
Top = 122
Width = 250
Height = 17
Caption = '&Automatically reset debugger before recompiling'
TabOrder = 5
end
end
object gbWebHost: TGroupBox
Left = 8
Top = 143
Top = 159
Width = 313
Height = 89
Caption = 'Web Host'
@ -324,10 +336,6 @@ inherited frmOptions: TfrmOptions
object tabCharMap: TTabSheet
Caption = 'Character Map'
ImageIndex = 4
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object gbCharMapCharacterLookups: TGroupBox
Left = 8
Top = 8
@ -442,7 +450,7 @@ inherited frmOptions: TfrmOptions
Top = 403
end
object dlgBrowseDefaultProjectPath: TBrowse4Folder
InitialDir = ''
InitialDir = 'C:\Users\mcdurdin\Desktop\'
Root = Desktop
Title = 'Browse for Default Project Folder'
Left = 176

View file

@ -98,6 +98,9 @@ type
editDefaultProjectPath: TEdit;
cmdBrowseDefaultProjectPath: TButton;
dlgBrowseDefaultProjectPath: TBrowse4Folder;
chkAutoSaveBeforeCompiling: TCheckBox;
chkOSKAutoSaveBeforeImporting: TCheckBox;
chkDebuggerAutoResetBeforeCompiling: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure cmdOKClick(Sender: TObject);
procedure cmdDefaultFontClick(Sender: TObject);
@ -178,6 +181,10 @@ begin
chkDebuggerShowStoreOffset.Checked := DebuggerShowStoreOffset;
chkDebuggerAutoRecompile.Checked := DebuggerAutoRecompileWithDebugInfo;
chkDebuggerAutoResetBeforeCompiling.Checked := DebuggerAutoResetBeforeCompiling;
chkAutoSaveBeforeCompiling.Checked := AutoSaveBeforeCompiling;
chkOSKAutoSaveBeforeImporting.Checked := OSKAutoSaveBeforeImporting;
chkCharMapAutoLookup.Checked := CharMapAutoLookup;
chkCharMapDisableDatabaseLookups.Checked := CharMapDisableDatabaseLookups;
@ -272,6 +279,10 @@ begin
DebuggerShowStoreOffset := chkDebuggerShowStoreOffset.Checked;
DebuggerAutoRecompileWithDebugInfo := chkDebuggerAutoRecompile.Checked;
DebuggerAutoResetBeforeCompiling := chkDebuggerAutoResetBeforeCompiling.Checked;
AutoSaveBeforeCompiling := chkAutoSaveBeforeCompiling.Checked;
OSKAutoSaveBeforeImporting := chkOSKAutoSaveBeforeImporting.Checked;
WebHostDefaultPort := StrToIntDef(editWebHostDefaultPort.Text, 8008); // I4021
CharMapAutoLookup := chkCharMapAutoLookup.Checked;

View file

@ -59,6 +59,9 @@ type
FEditorTheme: string;
FFix183_LadderLength: Integer;
FDefaultProjectPath: string;
FDebuggerAutoResetBeforeCompiling: Boolean;
FAutoSaveBeforeCompiling: Boolean;
FOSKAutoSaveBeforeImporting: Boolean;
procedure CloseRegistry;
procedure OpenRegistry;
function regReadString(const nm, def: string): string;
@ -88,6 +91,9 @@ type
property DebuggerSingleStepAfterBreak: Boolean read FDebuggerSingleStepAfterBreak write FDebuggerSingleStepAfterBreak;
property DebuggerShowStoreOffset: Boolean read FDebuggerShowStoreOffset write FDebuggerShowStoreOffset;
property DebuggerAutoRecompileWithDebugInfo: Boolean read FDebuggerAutoRecompileWithDebugInfo write FDebuggerAutoRecompileWithDebugInfo;
property DebuggerAutoResetBeforeCompiling: Boolean read FDebuggerAutoResetBeforeCompiling write FDebuggerAutoResetBeforeCompiling;
property AutoSaveBeforeCompiling: Boolean read FAutoSaveBeforeCompiling write FAutoSaveBeforeCompiling;
property OSKAutoSaveBeforeImporting: Boolean read FOSKAutoSaveBeforeImporting write FOSKAutoSaveBeforeImporting;
property WebHostDefaultPort: Integer read FWebHostDefaultPort write FWebHostDefaultPort; // I4021
@ -181,6 +187,9 @@ begin
FDebuggerSingleStepAfterBreak := regReadBool(SRegValue_IDEOptDebuggerSingleStepAfterBreak, False);
FDebuggerShowStoreOffset := regReadBool(SRegValue_IDEOptDebuggerShowStoreOffset, False);
FDebuggerAutoRecompileWithDebugInfo := regReadBool(SRegValue_IDEOptDebuggerAutoRecompileWithDebugInfo, False);
FDebuggerAutoResetBeforeCompiling := regReadBool(SRegValue_IDEOptDebuggerAutoResetBeforeCompiling, False);
FAutoSaveBeforeCompiling := regReadBool(SRegValue_IDEOptAutoSaveBeforeCompiling, False);
FOSKAutoSaveBeforeImporting := regReadBool(SRegValue_IDEOptOSKAutoSaveBeforeImporting, False);
FWebHostDefaultPort := regReadInt(SRegValue_IDEOptWebHostPort, 8008);
@ -224,8 +233,14 @@ begin
regWriteBool(SRegValue_IDEOptDebuggerShowStoreOffset, FDebuggerShowStoreOffset);
regWriteBool(SRegValue_IDEOptDebuggerAutoRecompileWithDebugInfo, FDebuggerAutoRecompileWithDebugInfo);
regWriteBool(SRegValue_IDEOptDebuggerAutoResetBeforeCompiling, FDebuggerAutoResetBeforeCompiling);
regWriteBool(SRegValue_IDEOptAutoSaveBeforeCompiling, FAutoSaveBeforeCompiling);
regWriteBool(SRegValue_IDEOptOSKAutoSaveBeforeImporting, FOSKAutoSaveBeforeImporting);
regWriteInt(SRegValue_IDEOptWebHostPort, FWebHostDefaultPort);
regWriteBool(SRegValue_IDEOptCharMapDisableDatabaseLookups, FCharMapDisableDatabaseLookups);
regWriteBool(SRegValue_IDEOptCharMapAutoLookup, FCharMapAutoLookup);

View file

@ -60,6 +60,8 @@ uses
Vcl.Graphics,
Vcl.Controls,
dmActionsMain,
Keyman.Developer.UI.UfrmMessageDlgWithSave,
UfrmMain,
UfrmFontHelper,
UfrmKeymanWizard,
@ -92,6 +94,8 @@ begin
end;
function TkmnProjectFileUI.CompileKeyboard(FSilent: Boolean): Boolean;
var
FSave: Boolean;
begin
Result := False;
@ -99,8 +103,21 @@ begin
begin
if not FSilent then
begin
if MessageDlg('The keyboard file has been modified. You must save before compiling.'+#13#10+'Save the keyboard and continue?',
mtConfirmation, mbOkCancel, 0) = mrCancel then Exit;
if not FKeymanDeveloperOptions.AutoSaveBeforeCompiling then
begin
if TfrmMessageDlgWithSave.Execute(
'The keyboard file has been modified. You must save before compiling.'+#13#10#13#10+
'Save the keyboard and continue?',
'Always save automatically before compiling',
'', True, FSave) in [mrNo, mrCancel] then
Exit(False);
if FSave then
begin
FKeymanDeveloperOptions.AutoSaveBeforeCompiling := True;
FKeymanDeveloperOptions.Write;
end;
end;
if not modActionsMain.actFileSave.Execute then Exit;
end
else

View file

@ -377,6 +377,10 @@ const
SRegValue_IDEOptDebuggerShowStoreOffset = 'debugger show store offset'; // CU
SRegValue_IDEOptDebuggerAutoRecompileWithDebugInfo = 'debugger recompile with debug info'; // CU
SRegValue_IDEOptDebuggerAutoResetBeforeCompiling = 'debugger auto reset before compilng'; // CU
SRegValue_IDEOptAutoSaveBeforeCompiling = 'auto save before compiling'; // CU
SRegValue_IDEOptOSKAutoSaveBeforeImporting = 'osk auto save before importing'; // CU
SRegValue_IDEOptWebHostPort = 'web host port'; // I4021
SRegValue_IDEOptCharMapDisableDatabaseLookups = 'char map disable database lookups'; // CU