mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
If the specified filename in SQL export dialog is empty, disable the execute button. If the file cannot be created for some reason, do not pop up a message dialog. Instead, log the error message into the result list. Fixes issue #1627.
This commit is contained in:
@ -407,6 +407,7 @@ object frmTableTools: TfrmTableTools
|
||||
Anchors = [akLeft, akTop, akRight]
|
||||
TabOrder = 6
|
||||
Text = 'comboExportOutputTarget'
|
||||
OnChange = comboExportOutputTargetChange
|
||||
OnExit = comboExportOutputTargetExit
|
||||
end
|
||||
end
|
||||
|
@ -94,6 +94,7 @@ type
|
||||
procedure ValidateControls(Sender: TObject);
|
||||
procedure chkExportOptionClick(Sender: TObject);
|
||||
procedure btnExportOutputTargetSelectClick(Sender: TObject);
|
||||
procedure comboExportOutputTargetChange(Sender: TObject);
|
||||
procedure comboExportOutputTargetExit(Sender: TObject);
|
||||
procedure comboExportOutputTypeChange(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
@ -293,6 +294,8 @@ begin
|
||||
comboBulkTableEditCharset.Items := Mainform.Connection.CharsetList;
|
||||
if comboBulkTableEditCharset.Items.Count > 0 then
|
||||
comboBulkTableEditCharset.ItemIndex := 0;
|
||||
|
||||
ValidateControls(Sender);
|
||||
end;
|
||||
|
||||
|
||||
@ -331,7 +334,7 @@ begin
|
||||
btnExecute.Enabled := SomeChecked and (memoFindText.Text <> '');
|
||||
end else if tabsTools.ActivePage = tabSQLExport then begin
|
||||
btnExecute.Caption := 'Export';
|
||||
btnExecute.Enabled := SomeChecked;
|
||||
btnExecute.Enabled := SomeChecked and (comboExportOutputTarget.Text <> '');
|
||||
end else if tabsTools.ActivePage = tabBulkTableEdit then begin
|
||||
btnExecute.Caption := 'Update';
|
||||
chkBulkTableEditCollation.Enabled := Mainform.Connection.IsUnicode;
|
||||
@ -398,7 +401,6 @@ begin
|
||||
Mainform.DBtreeInitNode(Sender, ParentNode, Node, InitialStates);
|
||||
Node.CheckType := ctTriStateCheckBox;
|
||||
Node.CheckState := csUncheckedNormal;
|
||||
ValidateControls(Sender);
|
||||
end;
|
||||
|
||||
|
||||
@ -800,6 +802,12 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTableTools.comboExportOutputTargetChange(Sender: TObject);
|
||||
begin
|
||||
ValidateControls(Sender);
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTableTools.comboExportOutputTargetExit(Sender: TObject);
|
||||
var
|
||||
ItemList: TStringList;
|
||||
@ -946,7 +954,6 @@ begin
|
||||
ToDb := comboExportOutputType.Text = OUTPUT_DB;
|
||||
ToServer := Copy(comboExportOutputType.Text, 1, Length(OUTPUT_SERVER)) = OUTPUT_SERVER;
|
||||
StartTime := GetTickCount;
|
||||
try
|
||||
if ToDir then begin
|
||||
FreeAndNil(ExportStream);
|
||||
if not DirectoryExists(comboExportOutputTarget.Text) then
|
||||
@ -972,12 +979,6 @@ begin
|
||||
'/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=''NO_AUTO_VALUE_ON_ZERO'' */;';
|
||||
Output(Header, False, DBObj.Database<>ExportLastDatabase, True, False, False);
|
||||
end;
|
||||
except
|
||||
on E:Exception do begin
|
||||
MessageDlg(E.Message, mterror, [mbOK], 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
// Database structure. Do that only in single-file and server mode. drop/create/use in directory or database mode makes no sense
|
||||
FinalDbName := DBObj.Database;
|
||||
|
Reference in New Issue
Block a user