mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Find a well working replacement for platform specific SelectDirectory function in StdActns unit. Fixes a corresponding compiler warning about using FileCtrl unit.
This commit is contained in:
@ -29,7 +29,7 @@ uses
|
|||||||
SynEdit,
|
SynEdit,
|
||||||
SynMemo,
|
SynMemo,
|
||||||
ZDataSet,
|
ZDataSet,
|
||||||
FileCtrl, PngSpeedButton;
|
PngSpeedButton, StdActns;
|
||||||
|
|
||||||
type
|
type
|
||||||
TExportSQLForm = class(TForm)
|
TExportSQLForm = class(TForm)
|
||||||
@ -1553,14 +1553,16 @@ end;
|
|||||||
}
|
}
|
||||||
procedure TExportSQLForm.btnDirectoryBrowseClick(Sender: TObject);
|
procedure TExportSQLForm.btnDirectoryBrowseClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
chosenDirectory : String;
|
Browse: TBrowseForFolder;
|
||||||
begin
|
begin
|
||||||
// TODO: Find an alternative to SelectDirectory(), which causes
|
// Avoid using platform specific SelectDirectory()
|
||||||
// a platform compiler warning because it needs the FileCtrl unit
|
Browse := TBrowseForFolder.Create(Self);
|
||||||
// -> Q: What about using fx TOpenDialog for this purpose?
|
Browse.Folder := EditDirectory.Text;
|
||||||
chosenDirectory := EditDirectory.Text;
|
Browse.DialogCaption := 'Select output directory';
|
||||||
if SelectDirectory('Select output directory', '', chosenDirectory) then
|
// Enable "Create new folder" button
|
||||||
EditDirectory.Text := chosenDirectory;
|
Browse.BrowseOptions := Browse.BrowseOptions - [bifNoNewFolderButton] + [bifNewDialogStyle];
|
||||||
|
if Browse.Execute then
|
||||||
|
EditDirectory.Text := Browse.Folder;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user