From c36e52956fe09987c7d15d134988dee399c8d907 Mon Sep 17 00:00:00 2001 From: Jonathan Barnard Date: Sat, 21 Mar 2009 20:38:47 +0000 Subject: [PATCH] UnitMain: Make the Wine version selecting combo boxes read only. --- Functions/Initialization/UnitInitialization.pas | 3 + Functions/MainBackend/UnitMainBackend.pas | 152 +++++++++++++++++++++++- Functions/Misc/UnitMisc.pas | 96 ++++++++++++++- UnitMain.lfm | 19 +-- UnitMain.pas | 145 +++++++++++++--------- 5 files changed, 341 insertions(+), 74 deletions(-) diff --git a/Functions/Initialization/UnitInitialization.pas b/Functions/Initialization/UnitInitialization.pas index dc420ef..21abbc4 100644 --- a/Functions/Initialization/UnitInitialization.pas +++ b/Functions/Initialization/UnitInitialization.pas @@ -28,6 +28,8 @@ var HideChannel:boolean; {Used for scaning cd drive.} AsyncProcessScan:TAsyncProcess; + {Path to Wine "~/[WineUserFolder]/wine/"} + PathToWine:string; implementation uses @@ -39,6 +41,7 @@ begin HideChannel := true; WineUserFolder := 'wine-stuff'; ConfigPath := (GetEnvironmentVariable('HOME') + '/.config/WineLauncher'); + PathToWine := (GetEnvironmentVariable('HOME') + '/' + WineUserFolder + '/wine/'); {This is a show stopper.} {Check all the files and folders this program needs to access.} diff --git a/Functions/MainBackend/UnitMainBackend.pas b/Functions/MainBackend/UnitMainBackend.pas index e94f0a8..9a2a6f9 100644 --- a/Functions/MainBackend/UnitMainBackend.pas +++ b/Functions/MainBackend/UnitMainBackend.pas @@ -9,6 +9,11 @@ uses procedure SaveLastUsedConfig(); procedure LoadLastUsedConfig(); +procedure OnWineVersionChange(); +procedure WineVersionEditingDone(); +procedure ClearAll(); +procedure ClearFromDistributionVersion(); +procedure ClearFromArchitecture(); function RunWineCheck(ProgramNameOverRide:string; ProgramFlagsOverRide:string):boolean; function ListProgramsOnDisc(ModeMe:TStrings; DriveChar:char):boolean; @@ -54,8 +59,9 @@ end; procedure LoadLastUsedConfig(); var - LastUsedConfigVersion:string; + LastUsedConfigVersion:string; begin + {Only run this ones wine has being scanned for.} LastUsedConfigLoading := true; XmlLastUsedConfig:= TXMLConfig.Create(nil); @@ -74,10 +80,24 @@ begin Exit(); end; {1} - UnitMain.form1.ComboBox_DistributionName.Text := XmlLastUsedConfig.GetValue('WineVersionInfo/DistributionName', ''); - UnitMain.form1.ComboBox_DistributionVersion.Text := XmlLastUsedConfig.GetValue('WineVersionInfo/DistributionVersion', ''); - UnitMain.form1.ComboBox_Architecture.Text := XmlLastUsedConfig.GetValue('WineVersionInfo/Architecture', ''); - UnitMain.form1.ComboBox_WineVersion.Text := XmlLastUsedConfig.GetValue('WineVersionInfo/WineVersion', ''); + {Setting ItemIndex does not trigger OnEditingDone.} + {So we run Enter to update the list then we run EditingDone to check it} + SelectItem(UnitMain.form1.ComboBox_DistributionName, XmlLastUsedConfig.GetValue('WineVersionInfo/DistributionName', '')); + UnitMain.form1.ComboBox_DistributionNameEnter(form1); + UnitMain.form1.ComboBox_DistributionNameEditingDone(form1); + + SelectItem(UnitMain.form1.ComboBox_DistributionVersion, XmlLastUsedConfig.GetValue('WineVersionInfo/DistributionVersion', '')); + UnitMain.form1.ComboBox_DistributionVersionEnter(form1); + UnitMain.form1.ComboBox_DistributionVersionEditingDone(form1); + + SelectItem(UnitMain.form1.ComboBox_Architecture, XmlLastUsedConfig.GetValue('WineVersionInfo/Architecture', '')); + UnitMain.form1.ComboBox_ArchitectureEnter(form1); + UnitMain.form1.ComboBox_ArchitectureEditingDone(form1); + + SelectItem(UnitMain.form1.ComboBox_WineVersion, XmlLastUsedConfig.GetValue('WineVersionInfo/WineVersion', '')); + UnitMain.form1.ComboBox_WineVersionEnter(form1); + UnitMain.form1.ComboBox_WineVersionEditingDone(form1); + {2} UnitMain.form1.Check_Terminal.Checked := XmlLastUsedConfig.GetValue('WineVersionInfo/UsesTerminal', false); UnitMain.form1.CheckBox_UseSoundWrapper.Checked := XmlLastUsedConfig.GetValue('WineVersionInfo/UsesSoundWrapper', false); @@ -100,9 +120,12 @@ var ProgramName:string; WorkDir:string; UnixPathWithOutFile:string; + WinePath:string; {"~/[wine-stuff]/wine/[OS name]/[OS version]/[Architecture]/[Wine Version]"} begin ChannelLocal := ('RunWineCheck'); +WinePath := (PathToWine + UnitMain.form1.ComboBox_DistributionName.Text + '/' + UnitMain.form1.ComboBox_DistributionVersion.Text + '/' + UnitMain.form1.ComboBox_Architecture.Text + '/' + UnitMain.form1.ComboBox_WineVersion.Text); + {Get wine version info} if FileExistsAndIsExecutable((WinePath + '/wine'), false) = true then begin @@ -316,5 +339,124 @@ Result := true; end; +procedure OnWineVersionChange(); +begin + if UnitMain.form1.ComboBox_DistributionName.Text <> '' then + begin + if UnitMain.form1.ComboBox_DistributionVersion.Text <> '' then + begin + if UnitMain.form1.ComboBox_Architecture.Text <> '' then + begin + if UnitMain.form1.ComboBox_WineVersion.Text <> '' then + begin + UnitMain.form1.Btn_Run.Enabled := true; + Exit; + end; + end; + end; + end; +UnitMain.form1.Btn_Run.Enabled := false; + +end; + +procedure ClearAll(); +begin + //Log(0, '', 'ClearAll'); + FullClear(UnitMain.form1.ComboBox_DistributionName); + FullClear(UnitMain.form1.ComboBox_DistributionVersion); + FullClear(UnitMain.form1.ComboBox_Architecture); + FullClear(UnitMain.form1.ComboBox_WineVersion); +end; + +procedure ClearFromDistributionVersion(); +begin + //Log(0, '', 'ClearFromDistributionVersion'); + FullClear(UnitMain.form1.ComboBox_DistributionVersion); + FullClear(UnitMain.form1.ComboBox_Architecture); + FullClear(UnitMain.form1.ComboBox_WineVersion); +end; + +procedure ClearFromArchitecture(); +begin + //Log(0, '', 'ClearFromArchitecture'); + FullClear(UnitMain.form1.ComboBox_Architecture); + FullClear(UnitMain.form1.ComboBox_WineVersion); +end; + +procedure ClearFromWineVersion(); +begin + //Log(0, '', 'ClearFromWineVersion'); + FullClear(UnitMain.form1.ComboBox_WineVersion); +end; + +procedure WineVersionEditingDone(); +var + DistributionName:string; + DistributionVersion:string; + Architecture:string; + WineVersion:string; +begin + DistributionName := UnitMain.form1.ComboBox_DistributionName.Text; + DistributionVersion := UnitMain.form1.ComboBox_DistributionVersion.Text; + Architecture := UnitMain.form1.ComboBox_Architecture.Text; + WineVersion := UnitMain.form1.ComboBox_WineVersion.Text; + + if DistributionName <> '' then + begin + if DoesFolderExists(PathToWine + DistributionName) = false then + begin + ClearAll(); + Exit; + end; + end + else + begin + ClearFromDistributionVersion(); + Exit; + end; + + if DistributionVersion <> '' then + begin + if DoesFolderExists(PathToWine + DistributionName + '/' + DistributionVersion) = false then + begin + ClearFromDistributionVersion(); + Exit; + end; + end + else + begin + ClearFromArchitecture(); + Exit; + end; + + if Architecture <> '' then + begin + if DoesFolderExists(PathToWine + DistributionName + '/' + DistributionVersion + '/' + Architecture) = false then + begin + ClearFromArchitecture(); + Exit; + end; + end + else + begin + ClearFromWineVersion(); + Exit; + end; + + if WineVersion <> '' then + begin + if DoesFolderExists(PathToWine + DistributionName + '/' + DistributionVersion + '/' + Architecture + '/' + WineVersion) = false then + begin + ClearFromWineVersion(); + Exit; + end; + end + else + begin + {Do nothing.} + Exit; + end; +end; + end. diff --git a/Functions/Misc/UnitMisc.pas b/Functions/Misc/UnitMisc.pas index 64f5e02..3f33595 100644 --- a/Functions/Misc/UnitMisc.pas +++ b/Functions/Misc/UnitMisc.pas @@ -24,6 +24,7 @@ uses procedure Log(Level:integer; Channel:string; LogText:string); procedure ListFileDir({0} Path:string; {1} FileList:TStrings; {2} GroupList:TStrings; {3} DirListClean:TStrings; {4} DirListPath:TStrings; {5} isFileList:Boolean); + procedure FullClear(ComboBox:TComboBox); {$IFDEF LogVar} procedure LogVar(MyVar:string; MyVarName:string); {$ENDIF} @@ -35,6 +36,7 @@ uses function FileExistsAndIsExecutable(FullPath:string; JustCheckExists:boolean): boolean ; function WorkDirTemplate(FolderPath:string):string; function DoesFolderExists(Path:string; FolderName:string): boolean; + function DoesFolderExists(FullFolderPath:string): boolean; function DoesFoldersExists(Path:string; FolderNames:Tstrings): boolean; function DirExistsIfNotMakeIt(Path:string; FolderName:string ): boolean; function DirExistsIfNotMakeIt(PathWithFolder:string): boolean; @@ -46,6 +48,8 @@ uses function CutUpFlags(Flags:string):boolean; function FindPrefixInt(PrefixName:string):integer; function GetWinFileName(FullPath:string):string; + function FolderScan(ComboBox:TComboBox; Path:string):boolean; + function SelectItem(ComboBox:TComboBox; ItemName:string):boolean; //var @@ -125,8 +129,8 @@ ChannelLocal := 'DoesFolderExists'; if DirectoryExists(Path + FolderName) = true then begin Result := true ; - {$IFDEF MoreTrue } - UnitMain.form1.LogWithDebug(3, ChannelLocal, ('Folder' + Wrap(Path + FolderName) + 'exists.')); + {$IFDEF MoreTrue} + Log(3, ChannelLocal, ('Folder' + Wrap(Path + FolderName) + 'exists.')); {$ENDIF} end else @@ -136,6 +140,25 @@ ChannelLocal := 'DoesFolderExists'; end; end; +function DoesFolderExists(FullFolderPath:string): boolean; +var +ChannelLocal:string; +begin +ChannelLocal := 'DoesFolderExists'; + if DirectoryExists(FullFolderPath) = true then + begin + Result := true ; + {$IFDEF MoreTrue} + Log(3, ChannelLocal, ('Folder' + Wrap(FullFolderPath) + 'exists.')); + {$ENDIF} + end + else + begin + Result := false ; + Log(4, ChannelLocal, ('Folder' + Wrap(FullFolderPath) + 'does not exists.')); + end; +end; + procedure Log(Level:integer; Channel:string; LogText:string); var LevelString:string; @@ -580,6 +603,75 @@ begin end; end; +function FolderScan(ComboBox:TComboBox; Path:string):boolean; +var + Channel:string; + List:Tstringlist; + TempStr:string; + TempInt:integer; +begin + {When the list is updated the select item is losted.} + + List := TStringlist.Create; + ListFileDir({0} Path, {1} List, {2} nil, {3} nil, {4} nil, {5} false); + {$IFDEF LogVar} + {$IFDEF MOREDEBUG_FolderScan} + LogVar(Path, (ComboBox.Name + ' Path')); + Logvar(List.Text, (ComboBox.Name + ' List')); + {$ENDIF} + {$ENDIF} + + if ComboBox.Sorted = true then List.Sorted := true else List.Sorted := false; + + if List.Text <> ComboBox.Items.Text then + begin + {$IFDEF MOREDEBUG_FolderScan} + log(0, Channel, (ComboBox.Name + ' does not equal the new list.')); + {$ENDIF} + {Store selected item.} + if ComboBox.Text <> '' then TempStr := ComboBox.Text; + + {Having the caption set stops this code from working correctly on GTK1.} + FullClear(ComboBox); + ComboBox.Items := List; + {Reselect item.} + TempInt := ComboBox.Items.IndexOf(TempStr); + if TempInt <> -1 then ComboBox.ItemIndex := TempInt; + end; + + List.Destroy; + Result := true; +end; + +function SelectItem(ComboBox:TComboBox; ItemName:string):boolean; +var + TempInt:integer; + //Channel:string; +begin + {Need to add some debug logging.} + //Channel := 'SelectItem'; + + TempInt := ComboBox.Items.IndexOf(ItemName); + if TempInt <> -1 then + begin + if ComboBox.Items.Strings[TempInt] <> '' then + begin + ComboBox.ItemIndex := TempInt; + end + else + begin + //Log(0, Channel, ''); + end; + end; +end; + +procedure FullClear(ComboBox:TComboBox); +begin + {Having the caption set stops the code from working correctly on GTK1.} + {GTK2 with style set to csDropDownList never sets the caption.} + ComboBox.Caption := ''; + ComboBox.Clear; +end; end. diff --git a/UnitMain.lfm b/UnitMain.lfm index 7ac4876..ae3c57a 100644 --- a/UnitMain.lfm +++ b/UnitMain.lfm @@ -9,6 +9,7 @@ object Form1: TForm1 ClientWidth = 1014 Constraints.MinHeight = 600 Constraints.MinWidth = 600 + OnClose = FormClose OnCreate = FormCreate OnResize = FormResize Position = poDefault @@ -128,9 +129,10 @@ object Form1: TForm1 ItemWidth = 0 MaxLength = 65535 OnEditingDone = ComboBox_WineVersionEditingDone + OnEnter = ComboBox_WineVersionEnter Sorted = True + Style = csDropDownList TabOrder = 0 - Text = 'Pick a version' end object Btn_Run: TButton AnchorSideTop.Control = Btn_Settings @@ -153,7 +155,6 @@ object Form1: TForm1 Width = 111 BorderSpacing.Top = 14 Caption = 'Run in Terminal' - OnChange = Check_TerminalChange TabOrder = 3 end object Btn_DebugChannelsConfig: TButton @@ -222,7 +223,6 @@ object Form1: TForm1 Width = 137 BorderSpacing.Top = 3 Caption = 'Use Sound Wrapper' - OnChange = CheckBox_UseSoundWrapperChange TabOrder = 8 end object Btn_Settings: TButton @@ -292,8 +292,9 @@ object Form1: TForm1 ItemWidth = 0 MaxLength = 65535 OnEditingDone = ComboBox_DistributionNameEditingDone + OnEnter = ComboBox_DistributionNameEnter + Style = csDropDownList TabOrder = 12 - Text = 'ComboBox_DistributionName' end object ComboBox_DistributionVersion: TComboBox AnchorSideTop.Control = Label_DistributionVersion @@ -308,13 +309,14 @@ object Form1: TForm1 ItemWidth = 0 MaxLength = 65535 OnEditingDone = ComboBox_DistributionVersionEditingDone + OnEnter = ComboBox_DistributionVersionEnter + Style = csDropDownList TabOrder = 13 - Text = 'ComboBox_DistributionVersion' end object ComboBox_Architecture: TComboBox AnchorSideTop.Control = Label_Architecture AnchorSideTop.Side = asrBottom - Left = 9 + Left = 8 Height = 27 Top = 107 Width = 166 @@ -323,9 +325,10 @@ object Form1: TForm1 ItemHeight = 0 ItemWidth = 0 MaxLength = 65535 - OnChange = ComboBox_ArchitectureChange + OnEditingDone = ComboBox_ArchitectureEditingDone + OnEnter = ComboBox_ArchitectureEnter + Style = csDropDownList TabOrder = 14 - Text = 'ComboBox_Architecture' end object ComboBox_ProgramsList: TComboBox AnchorSideTop.Control = Label_ProgramsList diff --git a/UnitMain.pas b/UnitMain.pas index 2ad49eb..b3321f9 100644 --- a/UnitMain.pas +++ b/UnitMain.pas @@ -69,22 +69,24 @@ type procedure Btn_StopScanClick(Sender: TObject); procedure Button_RegeditClick(Sender: TObject); procedure Button_WinecfgClick(Sender: TObject); - procedure CheckBox_UseSoundWrapperChange(Sender: TObject); - procedure Check_TerminalChange(Sender: TObject); - procedure ComboBox_ArchitectureChange(Sender: TObject); + procedure ComboBox_ArchitectureEditingDone(Sender: TObject); + procedure ComboBox_ArchitectureEnter(Sender: TObject); procedure ComboBox_DistributionNameEditingDone(Sender: TObject); + procedure ComboBox_DistributionNameEnter(Sender: TObject); procedure ComboBox_DistributionVersionEditingDone(Sender: TObject); + procedure ComboBox_DistributionVersionEnter(Sender: TObject); procedure ComboBox_PreFixChange(Sender: TObject); procedure ComboBox_ProgramsListChange(Sender: TObject); procedure ComboBox_WineVersionEditingDone(Sender: TObject); + procedure ComboBox_WineVersionEnter(Sender: TObject); procedure EditBox_ProgramPathChange(Sender: TObject); + procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormCreate(Sender: TObject); procedure FormResize(Sender: TObject); procedure TogBtn_ListdriveChange(Sender: TObject); procedure TimerOnTimer(Sender: TObject); private { private declarations } - procedure CheckWineVersion(); public { public declarations } @@ -99,7 +101,6 @@ var Sh_Path:string; { Path for the shell } GetCurrentDir:string; Channel:string; { Debug channel name } - WinePath:string; { New var for "~/[wine-stuff]/wine/[OS name]/[OS version]/[Architecture] } UnixDirPath:string; { Needed for setting the working dir at 'Run'. } Mode:boolean; Timer:TTimer; {The timer is a workaround.} @@ -114,46 +115,6 @@ uses UnitSettings, UnitProgramsList; -procedure TForm1.CheckWineVersion(); -var -WineCheck:string; -begin -{ TODO : Add better filtering. } - -{Get Distribution name. } - WineCheck := ( GetEnvironmentVariable('HOME') + '/' + WineUserFolder + '/wine/' ); - ComboBox_DistributionName.Items.Clear; - ListFileDir( {0} WineCheck , {1} ComboBox_DistributionName.Items , {2} nil , {3} nil , {4} nil , {5} false ); - -{ Get Distribution version. } - if DoesFolderExists( WineCheck, ComboBox_DistributionName.Text ) = true then - begin - ComboBox_DistributionVersion.Items.Clear; - ListFileDir( {0} ( WineCheck + ComboBox_DistributionName.Text + '/' ) , {1} ComboBox_DistributionVersion.Items , {2} nil , {3} nil , {4} nil , {5} false ); - end; - -{ Get Architecture. } - WineCheck := ( WineCheck + ComboBox_DistributionName.Text ); - if DoesFolderExists( WineCheck, ( '/' + ComboBox_DistributionVersion.Text )) = true then - begin - ComboBox_Architecture.Items.Clear; - ListFileDir( {0} ( WineCheck + '/' + ComboBox_DistributionVersion.Text + '/' ) , {1} ComboBox_Architecture.Items , {2} nil , {3} nil , {4} nil , {5} false ); - end; - -{ Get Wine version. } - WineCheck := ( WineCheck + '/' + ComboBox_DistributionVersion.Text + '/' + ComboBox_Architecture.Text ); - ComboBox_WineVersion.Items.Clear; - ListFileDir( {0} WineCheck + '/' , {1} ComboBox_WineVersion.Items , {2} nil , {3} nil , {4} nil , {5} false ); - - WineCheck := ( WineCheck + '/' + ComboBox_WineVersion.Text ); - { Export var } - WinePath := WineCheck; - - { Save settings } - SaveLastUsedConfig(); - -end; - procedure TForm1.FormCreate(Sender: TObject); begin {The timer is a workaround.} @@ -166,13 +127,12 @@ begin if ComboBox_SoundWrapper.items.Count <> 0 then ComboBox_SoundWrapper.Text := ComboBox_SoundWrapper.Items[0]; if ComboBox_TerminalName.items.Count <> 0 then ComboBox_TerminalName.Text := ComboBox_TerminalName.Items[0]; + {Scan for wine.} + ComboBox_DistributionNameEnter(Self); + {Load LastUsedConfig.} LoadLastUsedConfig(); - {Get Wine path info.} - CheckWineVersion(); - - {$IFDEF GuiTest} Btn_StopScan.Visible := true; {$ENDIF} @@ -277,29 +237,66 @@ begin RunWineCheck( 'winecfg', '' ); end; -procedure TForm1.CheckBox_UseSoundWrapperChange(Sender: TObject); +procedure TForm1.ComboBox_ArchitectureEditingDone(Sender: TObject); begin - SaveLastUsedConfig(); + WineVersionEditingDone(); + OnWineVersionChange(); end; -procedure TForm1.Check_TerminalChange(Sender: TObject); +procedure TForm1.ComboBox_ArchitectureEnter(Sender: TObject); +var + ItemTextName:string; + ItemTextVersion:string; begin - SaveLastUsedConfig(); + //Log(0, '', 'Running Architecture'); + if ComboBox_DistributionName.ItemIndex <> -1 then + begin + ItemTextName := ComboBox_DistributionName.Items.Strings[ComboBox_DistributionName.ItemIndex]; + if ComboBox_DistributionVersion.ItemIndex <> -1 then + begin + ItemTextVersion := ComboBox_DistributionVersion.Items.Strings[ComboBox_DistributionVersion.ItemIndex]; + FolderScan(ComboBox_Architecture, (PathToWine + ItemTextName + '/' + ItemTextVersion + '/')); + ComboBox_WineVersionEnter(self); + end; + end; + OnWineVersionChange(); end; -procedure TForm1.ComboBox_ArchitectureChange(Sender: TObject); +procedure TForm1.ComboBox_DistributionNameEditingDone(Sender: TObject); begin - CheckWineVersion(); + WineVersionEditingDone(); + OnWineVersionChange(); end; -procedure TForm1.ComboBox_DistributionNameEditingDone(Sender: TObject); + +procedure TForm1.ComboBox_DistributionNameEnter(Sender: TObject); begin - CheckWineVersion(); + //Log(0, '', 'Running DistributionName'); + if DoesFolderExists(PathToWine) = true then + begin + FolderScan(ComboBox_DistributionName, PathToWine); + end; + ComboBox_DistributionVersionEnter(self); end; procedure TForm1.ComboBox_DistributionVersionEditingDone(Sender: TObject); begin - CheckWineVersion(); + WineVersionEditingDone(); + OnWineVersionChange(); +end; + +procedure TForm1.ComboBox_DistributionVersionEnter(Sender: TObject); +var + ItemText:string; + FullPath:string; +begin + //Log(0, '', 'Running DistributionVersion'); + if ComboBox_DistributionName.ItemIndex <> -1 then + begin + ItemText := ComboBox_DistributionName.Items.Strings[ComboBox_DistributionName.ItemIndex]; + FolderScan(ComboBox_DistributionVersion, (PathToWine + ComboBox_DistributionName.Text + '/')); + end; + ComboBox_ArchitectureEnter(self); end; procedure TForm1.ComboBox_PreFixChange(Sender: TObject); @@ -410,7 +407,32 @@ end; procedure TForm1.ComboBox_WineVersionEditingDone(Sender: TObject); begin - CheckWineVersion(); + WineVersionEditingDone(); + OnWineVersionChange(); +end; + +procedure TForm1.ComboBox_WineVersionEnter(Sender: TObject); +var + ItemTextName:string; + ItemTextVersion:string; + ItemTextArchitecture:string; +begin + //Log(0, '', 'Running WineVersion'); + if ComboBox_DistributionName.ItemIndex <> -1 then + begin + ItemTextName := ComboBox_DistributionName.Items.Strings[ComboBox_DistributionName.ItemIndex]; + if ComboBox_DistributionVersion.ItemIndex <> -1 then + begin + ItemTextVersion := ComboBox_DistributionVersion.Items.Strings[ComboBox_DistributionVersion.ItemIndex]; + if ComboBox_Architecture.ItemIndex <> -1 then + begin + ItemTextArchitecture := ComboBox_Architecture.Items.Strings[ComboBox_Architecture.ItemIndex]; + FolderScan(ComboBox_WineVersion, (PathToWine + ItemTextName + '/' + ItemTextVersion + '/' + ItemTextArchitecture + '/')); + end; + end; + + end; + OnWineVersionChange(); end; procedure TForm1.EditBox_ProgramPathChange(Sender: TObject); @@ -418,6 +440,11 @@ begin ColourCheck(EditBox_ProgramPath); end; +procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction); +begin + SaveLastUsedConfig(); +end; + procedure TForm1.Btn_AboutClick(Sender: TObject); begin -- 2.11.4.GIT