mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Add informative message in log panel after running SQL files, and play a short "OK" sound. This should probably be an "Error" sound when the file(s) had errors. See https://www.heidisql.com/forum.php?t=12800
This commit is contained in:
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: HeidiSQL\n"
|
||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||
"PO-Revision-Date: 2020-05-30 09:08+0200\n"
|
||||
"PO-Revision-Date: 2020-06-13 10:40+0200\n"
|
||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -4639,10 +4639,16 @@ msgstr " [Cancel] to cancel file opening."
|
||||
msgid "Execute query file(s)?"
|
||||
msgstr "Execute query file(s)?"
|
||||
|
||||
msgid "%s file(s) processed, in %s"
|
||||
msgstr "%s file(s) processed, in %s"
|
||||
|
||||
#: main.pas:2968
|
||||
msgid "Could not load file(s):"
|
||||
msgstr "Could not load file(s):"
|
||||
|
||||
msgid "File \"%s\" processed, with %s queries and %s affected rows"
|
||||
msgstr "File \"%s\" processed, with %s queries and %s affected rows"
|
||||
|
||||
msgid "Could not open file %s"
|
||||
msgstr "Could not open file %s"
|
||||
|
||||
|
||||
@@ -3766,7 +3766,7 @@ end;
|
||||
function TMainForm.RunQueryFiles(Filenames: TStrings; Encoding: TEncoding; ForceRun: Boolean): Boolean;
|
||||
var
|
||||
i: Integer;
|
||||
Filesize, FilesizeSum, CurrentPosition: Int64;
|
||||
Filesize, FilesizeSum, CurrentPosition, StartTime: Int64;
|
||||
msgtext: String;
|
||||
AbsentFiles, PopupFileList: TStringList;
|
||||
DoRunFiles: Boolean;
|
||||
@@ -3776,6 +3776,7 @@ var
|
||||
Conn: TDBConnection;
|
||||
ProgressDialog: IProgressDialog;
|
||||
Dummy: Pointer;
|
||||
TimeElapsed: Double;
|
||||
const
|
||||
RunFileSize = 5*SIZE_MB;
|
||||
begin
|
||||
@@ -3846,6 +3847,7 @@ begin
|
||||
ProgressDialog := CreateComObject(CLSID_ProgressDialog) as IProgressDialog;
|
||||
Dummy := nil;
|
||||
CurrentPosition := 0;
|
||||
StartTime := GetTickCount64;
|
||||
Conn := ActiveConnection;
|
||||
// PROGDLG_MODAL was used previously, but somehow that focuses some other application
|
||||
ProgressDialog.StartProgressDialog(Handle, nil, PROGDLG_NOMINIMIZE or PROGDLG_AUTOTIME, Dummy);
|
||||
@@ -3857,6 +3859,9 @@ begin
|
||||
end;
|
||||
// progress end
|
||||
ProgressDialog.StopProgressDialog;
|
||||
TimeElapsed := GetTickCount64 - StartTime;
|
||||
LogSQL(f_('%s file(s) processed, in %s', [FormatNumber(Filenames.Count), FormatTimeNumber(TimeElapsed/1000, True)]));
|
||||
MessageBeep(MB_OK);
|
||||
end;
|
||||
mrNo: Result := False;
|
||||
mrCancel: Result := True;
|
||||
@@ -3886,6 +3891,11 @@ var
|
||||
Queries.Free;
|
||||
Stream.Free;
|
||||
// BringToFront; // Not sure why I added this initially, but it steals focus from other applications
|
||||
LogSQL(f_('File "%s" processed, with %s queries and %s affected rows', [
|
||||
ExtractFileName(FileName),
|
||||
FormatNumber(QueryCount),
|
||||
FormatNumber(RowsAffected)
|
||||
]));
|
||||
end;
|
||||
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user