diff --git a/frm/frmOptions.cpp b/frm/frmOptions.cpp index 9cb276e..9e0dbb7 100644 --- a/frm/frmOptions.cpp +++ b/frm/frmOptions.cpp @@ -131,6 +131,7 @@ #define pickerSQLCaretColour CTRL_COLOURPICKER("pickerSQLCaretColour") #define chkKeywordsInUppercase CTRL_CHECKBOX("chkKeywordsInUppercase") #define chkASUTPstyle CTRL_CHECKBOX("chkASUTPstyle") +#define chkHideQueryHistory CTRL_CHECKBOX("chkHideQueryHistory") #define menus CTRL_TREE("menus") #define pnlBrowserDisplay CTRL_PANEL("pnlBrowserDisplay") #define pnlBrowserProperties CTRL_PANEL("pnlBrowserProperties") @@ -363,6 +364,7 @@ frmOptions::frmOptions(frmMain *parent) chkKeywordsInUppercase->SetValue(settings->GetSQLKeywordsInUppercase()); chkASUTPstyle->SetValue(settings->GetASUTPstyle()); + chkHideQueryHistory->SetValue(settings->GetHideQueryHistory()); cbLanguage->Append(_("Default")); int sel = 0; wxLanguage langId = settings->GetCanonicalLanguage(); @@ -875,6 +877,11 @@ void frmOptions::OnOK(wxCommandEvent &ev) changed = true; settings->SetASUTPstyle(chkASUTPstyle->GetValue()); } + if (settings->GetHideQueryHistory() != chkHideQueryHistory->GetValue()) + { + changed = true; + settings->SetHideQueryHistory(chkHideQueryHistory->GetValue()); + } // Change the language last, as it will affect our tests for changes // in the display object types. diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index 070fb89..d9018d7 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -685,9 +685,8 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w btnDeleteAll = new wxButton(pnlQuery, CTL_DELETEALLBTN, _("Delete All")); btnDeleteAll->Enable(sqlQueries->GetCount() > 0); boxHistory->Add(btnDeleteAll, 0, wxALL | wxALIGN_CENTER_VERTICAL, 1); - boxQuery->Add(boxHistory, 0, wxEXPAND | wxALL, 1); - + boxHistory->ShowItems(!settings->GetHideQueryHistory()); // Create the other inner box sizer // This one will contain the SQL box wxBoxSizer *boxSQL = new wxBoxSizer(wxHORIZONTAL); diff --git a/include/utils/sysSettings.h b/include/utils/sysSettings.h index 9189a79..bfdeb45 100644 --- a/include/utils/sysSettings.h +++ b/include/utils/sysSettings.h @@ -814,6 +814,16 @@ public: { WriteBool(wxT("ASUTPstyle"), newval); } + bool GetHideQueryHistory() const + { + bool b; + Read(wxT("HideQueryHistory"), &b, false); + return b; + } + void SetHideQueryHistory(const bool newval) + { + WriteBool(wxT("HideQueryHistory"), newval); + } bool GetVisibleDbNameTree() const { bool b; diff --git a/ui/frmOptions.xrc b/ui/frmOptions.xrc index 8e3a6c2..2891d93 100644 --- a/ui/frmOptions.xrc +++ b/ui/frmOptions.xrc @@ -575,6 +575,21 @@ wxEXPAND|wxTOP|wxLEFT|wxRIGHT 4 + + + + + wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT + 4 + + + + + 1 + + wxEXPAND|wxTOP|wxLEFT|wxRIGHT + 4 + wxEXPAND|wxTOP|wxLEFT|wxRIGHT