From 72121a83ec6cdc871ee104a250410e05f494e3fc Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Sun, 24 Feb 2013 21:00:48 +0000 Subject: [PATCH] Bugfixes pre 1.0 release --- G940LEDControl/Forms/MainFrm.dfm | 16 ++++++++-------- G940LEDControl/Forms/MainFrm.pas | 3 +++ G940LEDControl/G940LEDControl.dproj | 2 +- G940LEDControl/Units/Profile.pas | 6 +++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/G940LEDControl/Forms/MainFrm.dfm b/G940LEDControl/Forms/MainFrm.dfm index 8fdca19..e3e52ee 100644 --- a/G940LEDControl/Forms/MainFrm.dfm +++ b/G940LEDControl/Forms/MainFrm.dfm @@ -280,7 +280,7 @@ object MainForm: TMainForm Top = 67 Width = 41 Height = 41 - Caption = 'P1' + Caption = 'P&1' TabOrder = 3 end object btnP2: TButton @@ -288,7 +288,7 @@ object MainForm: TMainForm Top = 114 Width = 41 Height = 41 - Caption = 'P2' + Caption = 'P&2' TabOrder = 4 end object btnP3: TButton @@ -296,7 +296,7 @@ object MainForm: TMainForm Top = 161 Width = 41 Height = 41 - Caption = 'P3' + Caption = 'P&3' TabOrder = 5 end object btnP4: TButton @@ -304,7 +304,7 @@ object MainForm: TMainForm Top = 208 Width = 41 Height = 41 - Caption = 'P4' + Caption = 'P&4' TabOrder = 6 end object btnP5: TButton @@ -312,7 +312,7 @@ object MainForm: TMainForm Top = 255 Width = 41 Height = 41 - Caption = 'P5' + Caption = 'P&5' TabOrder = 7 end object btnP6: TButton @@ -320,7 +320,7 @@ object MainForm: TMainForm Top = 302 Width = 41 Height = 41 - Caption = 'P6' + Caption = 'P&6' TabOrder = 8 end object btnP7: TButton @@ -328,7 +328,7 @@ object MainForm: TMainForm Top = 349 Width = 41 Height = 41 - Caption = 'P7' + Caption = 'P&7' TabOrder = 9 end object btnP8: TButton @@ -336,7 +336,7 @@ object MainForm: TMainForm Top = 396 Width = 41 Height = 41 - Caption = 'P8' + Caption = 'P&8' TabOrder = 10 end object cmbProfiles: TComboBox diff --git a/G940LEDControl/Forms/MainFrm.pas b/G940LEDControl/Forms/MainFrm.pas index 3652440..b5ddb43 100644 --- a/G940LEDControl/Forms/MainFrm.pas +++ b/G940LEDControl/Forms/MainFrm.pas @@ -851,6 +851,9 @@ begin if InputQuery('Save profile as', 'Save this profile as:', name) then begin existingProfile := Profiles.Find(name); + if existingProfile = profile then + existingProfile := nil; + if Assigned(existingProfile) then begin case MessageBox(Self.Handle, PChar(Format('A profile named "%s" exists, do you want to overwrite it?', [name])), diff --git a/G940LEDControl/G940LEDControl.dproj b/G940LEDControl/G940LEDControl.dproj index 37832db..df155fb 100644 --- a/G940LEDControl/G940LEDControl.dproj +++ b/G940LEDControl/G940LEDControl.dproj @@ -8,7 +8,7 @@ VCL 13.4 True - Release + Debug Win32 1 Application diff --git a/G940LEDControl/Units/Profile.pas b/G940LEDControl/Units/Profile.pas index 1389b6a..dfd588d 100644 --- a/G940LEDControl/Units/Profile.pas +++ b/G940LEDControl/Units/Profile.pas @@ -261,7 +261,10 @@ begin begin FButtons.Add(button); end else + begin + FButtons.Add(nil); FreeAndNil(button); + end; finally AReader.EndSection; Inc(buttonIndex); @@ -280,7 +283,8 @@ begin begin if AWriter.BeginSection(SectionButton + IntToStr(buttonIndex)) then try - FButtons[buttonIndex].Save(AWriter); + if Assigned(FButtons[buttonIndex]) then + FButtons[buttonIndex].Save(AWriter); finally AWriter.EndSection; end;