SVN Commit by andreas: r4453 - in trunk/pgadmin3/src: ctl dlg frm include include/ctl - Mailing list pgadmin-hackers
From | svn@pgadmin.org |
---|---|
Subject | SVN Commit by andreas: r4453 - in trunk/pgadmin3/src: ctl dlg frm include include/ctl |
Date | |
Msg-id | 200509181849.j8IInXrC031799@developer.pgadmin.org Whole thread Raw |
List | pgadmin-hackers |
Author: andreas Date: 2005-09-18 19:49:33 +0100 (Sun, 18 Sep 2005) New Revision: 4453 Modified: trunk/pgadmin3/src/ctl/ctlSQLResult.cpp trunk/pgadmin3/src/dlg/dlgSelectConnection.cpp trunk/pgadmin3/src/frm/frmQuery.cpp trunk/pgadmin3/src/include/ctl/ctlSQLResult.h trunk/pgadmin3/src/include/dlgSelectConnection.h Log: Allow Query Tool to use multiple connections Modified: trunk/pgadmin3/src/ctl/ctlSQLResult.cpp =================================================================== --- trunk/pgadmin3/src/ctl/ctlSQLResult.cpp 2005-09-18 18:01:51 UTC (rev 4452) +++ trunk/pgadmin3/src/ctl/ctlSQLResult.cpp 2005-09-18 18:49:33 UTC (rev 4453) @@ -34,6 +34,12 @@ } +void ctlSQLResult::SetConnection(pgConn *_conn) +{ + conn=_conn; +} + + bool ctlSQLResult::Export() { if (rowsRetrieved>0 || (thread && thread->DataSet()->NumRows() > 0)) Modified: trunk/pgadmin3/src/dlg/dlgSelectConnection.cpp =================================================================== --- trunk/pgadmin3/src/dlg/dlgSelectConnection.cpp 2005-09-18 18:01:51 UTC (rev 4452) +++ trunk/pgadmin3/src/dlg/dlgSelectConnection.cpp 2005-09-18 18:49:33 UTC (rev 4453) @@ -33,13 +33,13 @@ -dlgSelectConnection::dlgSelectConnection(frmMain *form) : +dlgSelectConnection::dlgSelectConnection(wxWindow *parent, frmMain *form) : DialogWithHelp(form) { wxLogInfo(wxT("Creating a select connection dialogue")); wxWindowBase::SetFont(settings->GetSystemFont()); - LoadResource((wxWindow*)form, wxT("dlgSelectConnection")); + LoadResource(parent, wxT("dlgSelectConnection")); appearanceFactory->SetIcons(this); CenterOnParent(); Modified: trunk/pgadmin3/src/frm/frmQuery.cpp =================================================================== --- trunk/pgadmin3/src/frm/frmQuery.cpp 2005-09-18 18:01:51 UTC (rev 4452) +++ trunk/pgadmin3/src/frm/frmQuery.cpp 2005-09-18 18:49:33 UTC (rev 4453) @@ -271,8 +271,12 @@ settings->SetExplainVerbose(queryMenu->IsChecked(MNU_VERBOSE)); sqlResult->Abort(); // to make sure conn is unused - if (conn) - delete conn; + + while (cbConnection->GetCount() > 1) + { + delete (pgConn*)cbConnection->GetClientData(0); + cbConnection->Delete(0); + } } @@ -386,7 +390,7 @@ if (sel == cbConnection->GetCount()-1) { // new Connection - dlgSelectConnection dlg(mainForm); + dlgSelectConnection dlg(this, mainForm); int rc=dlg.Go(); if (rc == wxID_OK) { @@ -416,6 +420,7 @@ else { conn = (pgConn*)cbConnection->GetClientData(sel); + sqlResult->SetConnection(conn); title = wxT("pgAdmin III Query - ") + cbConnection->GetValue(); setExtendedTitle(); } Modified: trunk/pgadmin3/src/include/ctl/ctlSQLResult.h =================================================================== --- trunk/pgadmin3/src/include/ctl/ctlSQLResult.h 2005-09-18 18:01:51 UTC (rev 4452) +++ trunk/pgadmin3/src/include/ctl/ctlSQLResult.h 2005-09-18 18:49:33 UTC (rev 4453) @@ -32,6 +32,7 @@ int Execute(const wxString &query, int resultToDisplay=0); // > 0: resultset to display, <=0: last result + void SetConnection(pgConn *conn); long NumRows() const; long InsertedCount() const; OID InsertedOid() const; Modified: trunk/pgadmin3/src/include/dlgSelectConnection.h =================================================================== --- trunk/pgadmin3/src/include/dlgSelectConnection.h 2005-09-18 18:01:51 UTC (rev 4452) +++ trunk/pgadmin3/src/include/dlgSelectConnection.h 2005-09-18 18:49:33 UTC (rev 4453) @@ -19,7 +19,7 @@ class dlgSelectConnection : public DialogWithHelp { public: - dlgSelectConnection(frmMain *form); + dlgSelectConnection(wxWindow *parent, frmMain *form); ~dlgSelectConnection(); wxString GetHelpPage() const; pgServer *GetServer() { return remoteServer; }
pgadmin-hackers by date: