mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Replace remaining loadXYZwindow() functions for dialogs by a more native way.
This commit is contained in:
@ -42,8 +42,6 @@ type
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
function CopyTableWindow(AOwner: TComponent): Boolean;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
@ -51,19 +49,6 @@ uses helpers, main;
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
{**
|
||||
Create form on demand
|
||||
@param TComponent Owner of form (should be calling form)
|
||||
@return Boolean Form closed using modalresult mrOK
|
||||
}
|
||||
function CopyTableWindow(AOwner: TComponent): Boolean;
|
||||
var
|
||||
f : TCopyTableForm;
|
||||
begin
|
||||
f := TCopyTableForm.Create(AOwner);
|
||||
Result := (f.ShowModal=mrOK);
|
||||
FreeAndNil(f);
|
||||
end;
|
||||
|
||||
|
||||
procedure TCopyTableForm.radioStructureClick(Sender: TObject);
|
||||
|
@ -72,7 +72,6 @@ type
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
function loaddataWindow(AOwner: TComponent): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -81,20 +80,6 @@ uses Main, helpers;
|
||||
{$R *.DFM}
|
||||
|
||||
|
||||
{**
|
||||
Create form on demand
|
||||
@param TComponent Owner of form (should be calling form)
|
||||
@return Boolean Form closed using modalresult mrOK
|
||||
}
|
||||
function loaddataWindow(AOwner: TComponent): Boolean;
|
||||
var
|
||||
f : Tloaddataform;
|
||||
begin
|
||||
f := Tloaddataform.Create(AOwner);
|
||||
Result := (f.ShowModal=mrOK);
|
||||
FreeAndNil(f);
|
||||
end;
|
||||
|
||||
|
||||
{**
|
||||
FormCreat
|
||||
|
@ -18,7 +18,7 @@ uses
|
||||
CommCtrl, Contnrs, Generics.Collections,
|
||||
routine_editor, trigger_editor, options, EditVar, helpers, createdatabase, table_editor,
|
||||
TableTools, View, Usermanager, SelectDBObject, connections, sqlhelp, mysql_connection,
|
||||
mysql_api, insertfiles, searchreplace;
|
||||
mysql_api, insertfiles, searchreplace, loaddata, copytable;
|
||||
|
||||
|
||||
type
|
||||
@ -791,6 +791,8 @@ type
|
||||
InsertFiles: TfrmInsertFiles;
|
||||
EditVariableForm: TfrmEditVariable;
|
||||
SearchReplaceDialog: TfrmSearchReplace;
|
||||
ImportTextfileDialog: Tloaddataform;
|
||||
CopyTableDialog: TCopyTableForm;
|
||||
|
||||
// Virtual Tree data arrays
|
||||
VTRowDataListVariables,
|
||||
@ -923,7 +925,7 @@ const
|
||||
implementation
|
||||
|
||||
uses
|
||||
About, loaddata, printlist, copytable, mysql_structures, UpdateCheck, uVistaFuncs, runsqlfile,
|
||||
About, printlist, mysql_structures, UpdateCheck, uVistaFuncs, runsqlfile,
|
||||
column_selection, data_sorting, grideditlinks;
|
||||
|
||||
|
||||
@ -1818,7 +1820,9 @@ end;
|
||||
procedure TMainForm.actImportCSVExecute(Sender: TObject);
|
||||
begin
|
||||
// Import Textfile
|
||||
loaddataWindow(self);
|
||||
if not Assigned(ImportTextfileDialog) then
|
||||
ImportTextfileDialog := Tloaddataform.Create(Self);
|
||||
ImportTextfileDialog.ShowModal;
|
||||
end;
|
||||
|
||||
procedure TMainForm.actPreferencesExecute(Sender: TObject);
|
||||
@ -1941,7 +1945,9 @@ end;
|
||||
procedure TMainForm.actCopyTableExecute(Sender: TObject);
|
||||
begin
|
||||
// copy table
|
||||
CopyTableWindow(self);
|
||||
if not Assigned(CopyTableDialog) then
|
||||
CopyTableDialog := TCopyTableForm.Create(Self);
|
||||
CopyTableDialog.ShowModal;
|
||||
end;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user