From 8367deb59241f406f36772d8e3b6e8088f2afd87 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 26 Aug 2008 19:38:49 +0000 Subject: [PATCH] Fix bug #613 Target database not remembered in Export window --- components/heidisql/include/const.inc | 1 + source/exportsql.pas | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/heidisql/include/const.inc b/components/heidisql/include/const.inc index 2fb66268..128139c4 100644 --- a/components/heidisql/include/const.inc +++ b/components/heidisql/include/const.inc @@ -142,6 +142,7 @@ const REGNAME_EXP_OUTFILE = 'exportfilename'; REGNAME_EXP_OUTDIR = 'ExportDirectory'; REGNAME_EXP_TARGET = 'ExportSQL_OutputTo'; + REGNAME_EXP_DESTDB = 'ExportSQL_DestDB'; REGNAME_EXP_WINWIDTH = 'ExportSQL_WindowWidth'; REGNAME_EXP_WINHEIGHT = 'ExportSQL_WindowHeight'; REGNAME_CSV_SEPARATOR = 'CSVSeparator'; diff --git a/source/exportsql.pas b/source/exportsql.pas index d65f4605..33d73330 100644 --- a/source/exportsql.pas +++ b/source/exportsql.pas @@ -1210,10 +1210,16 @@ begin end; procedure TExportSQLForm.fillcombo_anotherdb(Sender: TObject); +var + lastdb: WideString; begin comboOtherDatabase.Items := comboSelectDatabase.Items; comboOtherDatabase.Items.delete(comboSelectDatabase.ItemIndex); - if comboOtherDatabase.ItemIndex = -1 then + if comboOtherDatabase.ItemIndex = -1 then begin + lastdb := Utf8Decode(Mainform.GetRegValue(REGNAME_EXP_DESTDB, '')); + comboOtherDatabase.ItemIndex := comboOtherDatabase.Items.IndexOf(lastdb); + end; + if (comboOtherDatabase.ItemIndex = -1) and (comboOtherDatabase.Items.Count > 0) then comboOtherDatabase.ItemIndex := 0; end; @@ -1514,6 +1520,7 @@ begin else if radioOtherHost.checked then OutputTo := OUTPUT_HOST; WriteInteger(REGNAME_EXP_TARGET, OutputTo ); + WriteString(REGNAME_EXP_DESTDB, Utf8Encode(comboOtherDatabase.Text)); WriteInteger(REGNAME_EXP_WINWIDTH, Width ); WriteInteger(REGNAME_EXP_WINHEIGHT, Height ); CloseKey();