Oh indeed, missed the attachment somehow, sorry about that. And yes, there's an option already for that. But its on the 'advanced' tab with the default being "on" (changing this to "off" wouldn't probably be nice now) meaning couple of extra clicks which in case of dozens of servers gets quickly quite annoying.
On Mon, Jan 6, 2014 at 10:00 AM, Dave Page <dp...@pgadmin.org> wrote: > On Mon, Jan 6, 2014 at 7:57 AM, Guillaume Lelarge > <guilla...@lelarge.info> wrote: > > On Mon, 2014-01-06 at 09:59 +0530, Ashesh Vashi wrote: > >> Did you forget to attach the patch? > >> > > > > And isn't this already handled in the server's property? > > Yes, it is. > > >> On Mon, Jan 6, 2014 at 3:49 AM, Kaarel Moppel <kaarel.mop...@gmail.com > >wrote: > >> > >> > Checkbox resides under "Options-> Browser -> UI misc". > >> > > >> > NB! didn't add the embed-xrc generated xrcDialogs.cpp class due to > >> > verbosity, so it needs to executed by the code maintainer. > >> > > >> > >> > >> > > > > -- > > Guillaume > > http://blog.guillaume.lelarge.info > > http://www.dalibo.com > > > > > > > > -- > > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgadmin-hackers > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company >
From 7c777e0b6b4a023cc63191c9ee79c95990df114a Mon Sep 17 00:00:00 2001 From: kmoppel <kaarel.mop...@zalando.de> Date: Tue, 31 Dec 2013 14:00:09 +0100 Subject: [PATCH] Add a global option for disabling restoration of previous environment on reconnect --- pgadmin/frm/frmMain.cpp | 3 +++ pgadmin/frm/frmOptions.cpp | 3 +++ pgadmin/include/utils/sysSettings.h | 12 ++++++++++++ pgadmin/ui/frmOptions.xrc | 8 ++++++++ 4 files changed, 26 insertions(+) diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp index 675940a..ea21823 100644 --- a/pgadmin/frm/frmMain.cpp +++ b/pgadmin/frm/frmMain.cpp @@ -1056,6 +1056,9 @@ int frmMain::ReconnectServer(pgServer *server, bool restore) wxMilliSleep(100); wxSafeYield(); + // global (options->browser->UI misc) override for restore + restore = settings->GetRestoreEnvironments() ? restore : false; + int res = server->Connect(this, true, wxEmptyString, false, true); // Check the result, and handle it as appropriate diff --git a/pgadmin/frm/frmOptions.cpp b/pgadmin/frm/frmOptions.cpp index 9fcb1c4..1c7546f 100644 --- a/pgadmin/frm/frmOptions.cpp +++ b/pgadmin/frm/frmOptions.cpp @@ -91,6 +91,7 @@ #define chkAutoRollback CTRL_CHECKBOX("chkAutoRollback") #define chkDoubleClickProperties CTRL_CHECKBOX("chkDoubleClickProperties") #define chkShowNotices CTRL_CHECKBOX("chkShowNotices") +#define chkRestoreEnvironments CTRL_CHECKBOX("chkRestoreEnvironments") #define cbLanguage CTRL_COMBOBOX("cbLanguage") #define pickerSqlFont CTRL_FONTPICKER("pickerSqlFont") #define chkSuppressHints CTRL_CHECKBOX("chkSuppressHints") @@ -307,6 +308,7 @@ frmOptions::frmOptions(frmMain *parent) txtDecimalMark->SetValue(settings->GetDecimalMark()); chkColumnNames->SetValue(settings->GetColumnNames()); chkShowNotices->SetValue(settings->GetShowNotices()); + chkRestoreEnvironments->SetValue(settings->GetRestoreEnvironments()); txtPgHelpPath->SetValue(settings->GetPgHelpPath()); txtEdbHelpPath->SetValue(settings->GetEdbHelpPath()); @@ -671,6 +673,7 @@ void frmOptions::OnOK(wxCommandEvent &ev) settings->SetAutoRollback(chkAutoRollback->GetValue()); settings->SetDoubleClickProperties(chkDoubleClickProperties->GetValue()); settings->SetShowNotices(chkShowNotices->GetValue()); + settings->SetRestoreEnvironments(chkRestoreEnvironments->GetValue()); settings->SetUnicodeFile(chkUnicodeFile->GetValue()); settings->SetWriteBOM(chkWriteBOM->GetValue()); diff --git a/pgadmin/include/utils/sysSettings.h b/pgadmin/include/utils/sysSettings.h index 37bdf4d..17fad3f 100644 --- a/pgadmin/include/utils/sysSettings.h +++ b/pgadmin/include/utils/sysSettings.h @@ -733,6 +733,18 @@ public: WriteBool(wxT("ShowNotices"), newval); } + bool GetRestoreEnvironments() const + { + bool b; + Read(wxT("RestoreEnvironments"), &b, true); + return b; + } + + void SetRestoreEnvironments(const bool newval) + { + WriteBool(wxT("RestoreEnvironments"), newval); + } + wxString GetOptionsLastTreeItem() const { wxString s; diff --git a/pgadmin/ui/frmOptions.xrc b/pgadmin/ui/frmOptions.xrc index a57b0ce..f617265 100644 --- a/pgadmin/ui/frmOptions.xrc +++ b/pgadmin/ui/frmOptions.xrc @@ -364,6 +364,14 @@ <border>4</border> </object> <object class="sizeritem"> + <object class="wxCheckBox" name="chkRestoreEnvironments"> + <label>Restore previous environment on reconnect</label> + <checked>1</checked> + </object> + <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag> + <border>4</border> + </object> + <object class="sizeritem"> <object class="wxFlexGridSizer"> <cols>2</cols> <vgap>5</vgap> -- 1.7.9.5
-- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers