Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-15 Thread pgAdmin Trac
#209: Connect to Server dialog buggy
--+-
  Reporter:  brsa |   Owner:  ashesh   
  Type:  bug  |  Status:  closed   
  Priority:  major|   Milestone:  1.12 
 Component:  pgadmin  | Version:   
Resolution:  fixed|Keywords:  querytool
  Platform:  windows  |  
--+-
Changes (by gleu):

  * status:  assigned = closed
  * resolution:  = fixed


Comment:

 Fixed in r8467.

-- 
Ticket URL: http://code.pgadmin.org/trac/ticket/209#comment:3
pgAdmin III http://code.pgadmin.org/trac/
pgAdmin III

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-12 Thread pgAdmin Trac
#209: Connect to Server dialog buggy
+---
 Reporter:  brsa|   Owner:  ashesh  
 Type:  bug |  Status:  assigned
 Priority:  major   |   Milestone:  1.12
Component:  pgadmin | Version:  
 Keywords:  SQL editor  |Platform:  windows 
+---
Changes (by dpage):

  * owner:  dpage = ashesh
  * status:  new = assigned


-- 
Ticket URL: http://code.pgadmin.org/trac/ticket/209#comment:1
pgAdmin III http://code.pgadmin.org/trac/
pgAdmin III

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-12 Thread Guillaume Lelarge
Le 12/07/2010 02:50, pgAdmin Trac a écrit :
 [...]
  Wishlist item: a way to close a connection without closing the SQL editor
  window.
 

Another one on how to use a bugtracker :)

You should have made two tickets for this one, one for the wishlist
item, and one for the bug. They won't have the same version and
milestone. They also won't have the same code patch. Etc, etc.


-- 
Guillaume
 http://www.postgresql.fr
 http://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


Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-12 Thread pgAdmin Trac
#209: Connect to Server dialog buggy
---+
 Reporter:  brsa   |   Owner:  ashesh  
 Type:  bug|  Status:  assigned
 Priority:  major  |   Milestone:  1.12
Component:  pgadmin| Version:  
 Keywords:  querytool  |Platform:  windows 
---+
Changes (by gleu):

  * keywords:  SQL editor = querytool


Old description:

 Testing v1.12beta3 (rev. 8448) on Windows XP Pro. Server = pg 8.4.4 on
 Debian Lenny.

 In the SQL editor try to connect to another server by choosing new
 connection from the connection combobox.

 - Selecting a different server triggers an immediate attempt to connect.
 (happens sometimes)

 The Username combobox behaves differently from the 2 other comboboxes:
 - The first user shown is the alphabetically first in the list, but it
 should be the user of the same name as in the current connection - if
 such a user exists. (happens always)
 - A click into the field does not open the list. (happens always)
 - Typed text is not completed, not even after moving the focus to another
 control. Only after clicking on the down arrow. (happens always)
 - This way I can enter non-existing users and try to connect with these.
 - pgAdmin randomly crashes when I try to use the feature. (happens
 sometimes)

 I had to try like 6 times, 3 times of which pgadmin crashed completely
 until I managed to open another connection.

 Wishlist item: a way to close a connection without closing the SQL editor
 window.

New description:

 Testing v1.12beta3 (rev. 8448) on Windows XP Pro. Server = pg 8.4.4 on
 Debian Lenny.

 In the SQL editor try to connect to another server by choosing new
 connection from the connection combobox.

 - Selecting a different server triggers an immediate attempt to connect.
 (happens sometimes)

 The Username combobox behaves differently from the 2 other comboboxes:
 - The first user shown is the alphabetically first in the list, but it
 should be the user of the same name as in the current connection - if such
 a user exists. (happens always)
 - A click into the field does not open the list. (happens always)
 - Typed text is not completed, not even after moving the focus to another
 control. Only after clicking on the down arrow. (happens always)
 - This way I can enter non-existing users and try to connect with these.
 - pgAdmin randomly crashes when I try to use the feature. (happens
 sometimes)

 I had to try like 6 times, 3 times of which pgadmin crashed completely
 until I managed to open another connection.

--

Comment:

 The wishlist item has been removed from this ticket. The ticket #211 will
 deal with it.

-- 
Ticket URL: http://code.pgadmin.org/trac/ticket/209#comment:2
pgAdmin III http://code.pgadmin.org/trac/
pgAdmin III

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-12 Thread Ashesh Vashi
Hi Dave,

Please find the patch for the same.

*--**
**Thanks  Regards,**

**Ashesh Vashi**
**EnterpriseDB INDIA:* Enterprise Postgres Companyhttp://www.enterprisedb.com


On Mon, Jul 12, 2010 at 12:58 PM, Dave Page dp...@pgadmin.org wrote:

 Please look at this.

 Thanks.


 -- Forwarded message --
 From: pgAdmin Trac t...@code.pgadmin.org
 Date: Mon, Jul 12, 2010 at 1:50 AM
 Subject: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog
 buggy
 To:
 Cc: pgadmin-hackers@postgresql.org


 #209: Connect to Server dialog buggy

 +---
  Reporter:  brsa|   Owner:  dpage
 Type:  bug |  Status:  new
  Priority:  major   |   Milestone:  1.12
 Component:  pgadmin | Version:
  Keywords:  SQL editor  |Platform:  windows

 +---
  Testing v1.12beta3 (rev. 8448) on Windows XP Pro. Server = pg 8.4.4 on
  Debian Lenny.

  In the SQL editor try to connect to another server by choosing new
  connection from the connection combobox.

  - Selecting a different server triggers an immediate attempt to connect.
  (happens sometimes)

  The Username combobox behaves differently from the 2 other comboboxes:
  - The first user shown is the alphabetically first in the list, but it
  should be the user of the same name as in the current connection - if such
  a user exists. (happens always)
  - A click into the field does not open the list. (happens always)
  - Typed text is not completed, not even after moving the focus to another
  control. Only after clicking on the down arrow. (happens always)
  - This way I can enter non-existing users and try to connect with these.
  - pgAdmin randomly crashes when I try to use the feature. (happens
  sometimes)

  I had to try like 6 times, 3 times of which pgadmin crashed completely
  until I managed to open another connection.

  Wishlist item: a way to close a connection without closing the SQL editor
  window.

 --
 Ticket URL: http://code.pgadmin.org/trac/ticket/209
 pgAdmin III http://code.pgadmin.org/trac/
 pgAdmin III

 --
 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
 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise Postgres Company

Index: pgAdmin3.cpp
===
--- pgAdmin3.cpp	(revision 8461)
+++ pgAdmin3.cpp	(working copy)
@@ -448,7 +448,8 @@
 int rc=dlg.Go(conn, NULL);
 if (rc != wxID_OK)
 return false;
-conn = dlg.CreateConn(applicationname);
+bool dummyRes;
+conn = dlg.CreateConn(applicationname, dummyRes);
 }
 else if (cmdParser.Found(wxT(Sc), connstr))
 {
@@ -539,7 +540,8 @@
 int rc=dlg.Go(conn, NULL);
 if (rc != wxID_OK)
 return false;
-conn = dlg.CreateConn(applicationname);
+bool dummyRes;
+conn = dlg.CreateConn(applicationname, dummyRes);
 }
 else if (cmdParser.Found(wxT(qc), connstr))
 {
Index: include/dlg/dlgSelectConnection.h
===
--- include/dlg/dlgSelectConnection.h	(revision 8461)
+++ include/dlg/dlgSelectConnection.h	(working copy)
@@ -24,7 +24,7 @@
 ~dlgSelectConnection();
 wxString GetHelpPage() const;
 pgServer *GetServer() { return remoteServer; }
-	pgConn *CreateConn(wxString applicationame);
+	pgConn *CreateConn(wxString applicationame, bool createdNew);
 	pgConn *CreateConn(wxString server, wxString dbname, wxString username, int port, int sslmode, wxString applicationame, bool writeMRU = false);
 	wxString GetServerName();
 wxString GetDatabase();
Index: frm/frmQuery.cpp
===
--- frm/frmQuery.cpp	(revision 8461)
+++ frm/frmQuery.cpp	(working copy)
@@ -981,9 +981,10 @@
 int rc=dlg.Go(conn, cbConnection);
 if (rc == wxID_OK)
 {
+bool createdNewConn;
 wxString applicationname = _(pgAdmin - Query Tool);
-conn = dlg.CreateConn(applicationname);
-if (conn)
+conn = dlg.CreateConn(applicationname, createdNewConn);
+if (conn  createdNewConn)
 {
 cbConnection-Insert(conn-GetName(), CreateBitmap(GetServerColour()), sel, (void*)conn);
 cbConnection-SetSelection(sel);
Index: dlg/dlgSelectConnection.cpp
===
--- dlg/dlgSelectConnection.cpp	(revision 8461)
+++ dlg/dlgSelectConnection.cpp	(working copy)
@@ -84,6 +84,7 @@
 		return;
 
 cbDatabase-Clear

Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-12 Thread Dave Page
On Mon, Jul 12, 2010 at 11:39 AM, Ashesh Vashi
ashesh.va...@enterprisedb.com wrote:
 Hi Dave,
 Please find the patch for the same.

Thanks. This looks good to me following some quick testing, but I
uncovered some other issues - could you look at them please?

- We seem to stop populating the server combo box as soon as we find
the one we're currently connected to. This happens at ~ line 286 in
dlgSelectConnection.cpp, where we set foundServer = true. I can't see
why we do this, but it seems fairly deliberate. Any guesses? Should we
just remove that?

- It seems like we ignore sslmode when we create new connections. We
need to honour the server config.

Note that I haven't tested to ensure this doesn't break anything in
command line startup mode (eg. with -q). Can you please ensure this
mode is unaffected?

Thanks.

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-12 Thread Ashesh Vashi
Hi Dave,

PFA the updated patch.
[Please check my inline answers.]

On Mon, Jul 12, 2010 at 4:37 PM, Dave Page dp...@pgadmin.org wrote:

 On Mon, Jul 12, 2010 at 11:39 AM, Ashesh Vashi
 ashesh.va...@enterprisedb.com wrote:
  Hi Dave,
  Please find the patch for the same.

 Thanks. This looks good to me following some quick testing, but I
 uncovered some other issues - could you look at them please?

 - We seem to stop populating the server combo box as soon as we find
 the one we're currently connected to. This happens at ~ line 286 in
 dlgSelectConnection.cpp, where we set foundServer = true. I can't see
 why we do this, but it seems fairly deliberate. Any guesses? Should we
 just remove that?

My mistake - I introduced that variable in the previous patch.


 - It seems like we ignore sslmode when we create new connections. We
 need to honour the server config.

Done.


 Note that I haven't tested to ensure this doesn't break anything in
 command line startup mode (eg. with -q). Can you please ensure this
 mode is unaffected?

Tested.
*
--**
**Thanks  Regards,**

**Ashesh Vashi**
**EnterpriseDB INDIA:* Enterprise Postgres Companyhttp://www.enterprisedb.com



 Thanks.

 --
 Dave Page
 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise Postgres Company

Index: pgAdmin3.cpp
===
--- pgAdmin3.cpp	(revision 8466)
+++ pgAdmin3.cpp	(working copy)
@@ -448,7 +448,8 @@
 int rc=dlg.Go(conn, NULL);
 if (rc != wxID_OK)
 return false;
-conn = dlg.CreateConn(applicationname);
+bool dummyRes;
+conn = dlg.CreateConn(applicationname, dummyRes);
 }
 else if (cmdParser.Found(wxT(Sc), connstr))
 {
@@ -539,7 +540,8 @@
 int rc=dlg.Go(conn, NULL);
 if (rc != wxID_OK)
 return false;
-conn = dlg.CreateConn(applicationname);
+bool dummyRes;
+conn = dlg.CreateConn(applicationname, dummyRes);
 }
 else if (cmdParser.Found(wxT(qc), connstr))
 {
Index: include/dlg/dlgSelectConnection.h
===
--- include/dlg/dlgSelectConnection.h	(revision 8466)
+++ include/dlg/dlgSelectConnection.h	(working copy)
@@ -24,7 +24,7 @@
 ~dlgSelectConnection();
 wxString GetHelpPage() const;
 pgServer *GetServer() { return remoteServer; }
-	pgConn *CreateConn(wxString applicationame);
+	pgConn *CreateConn(wxString applicationame, bool createdNew);
 	pgConn *CreateConn(wxString server, wxString dbname, wxString username, int port, int sslmode, wxString applicationame, bool writeMRU = false);
 	wxString GetServerName();
 wxString GetDatabase();
Index: frm/frmQuery.cpp
===
--- frm/frmQuery.cpp	(revision 8466)
+++ frm/frmQuery.cpp	(working copy)
@@ -981,9 +981,10 @@
 int rc=dlg.Go(conn, cbConnection);
 if (rc == wxID_OK)
 {
+bool createdNewConn;
 wxString applicationname = _(pgAdmin - Query Tool);
-conn = dlg.CreateConn(applicationname);
-if (conn)
+conn = dlg.CreateConn(applicationname, createdNewConn);
+if (conn  createdNewConn)
 {
 cbConnection-Insert(conn-GetName(), CreateBitmap(GetServerColour()), sel, (void*)conn);
 cbConnection-SetSelection(sel);
Index: dlg/dlgSelectConnection.cpp
===
--- dlg/dlgSelectConnection.cpp	(revision 8466)
+++ dlg/dlgSelectConnection.cpp	(working copy)
@@ -84,6 +84,7 @@
 		return;
 
 cbDatabase-Clear();
+cbUsername-Clear();
 
 int sel=cbServer-GetCurrentSelection();
 if (sel = 0)
@@ -169,12 +170,14 @@
 EndModal(wxID_CANCEL);
 }
 
-pgConn *dlgSelectConnection::CreateConn(wxString applicationname)
+pgConn *dlgSelectConnection::CreateConn(wxString applicationname, bool createdNew)
 {
 /* gcc requires that we store this in temporary variables for some reason... */
 wxString serv = cbServer-GetValue();
 wxString db = cbDatabase-GetValue();
 
+createdNew = true;
+
 	long port = 0;
 	if (serv.Find(':')  0)
 	{
@@ -188,7 +191,28 @@
 
 wxString user = cbUsername-GetValue();
 
-	return CreateConn(serv, db, user, port, 0, applicationname, true);
+if (cbConnection)
+{
+/* Check if selected combination already exists */
+for (unsigned int index = 0; index  cbConnection-GetCount() - 1; index++)
+{
+pgConn* conn = (pgConn*)cbConnection-GetClientData(index);
+if (conn 
+conn-GetHost() == serv 
+conn-GetPort() == port 
+conn-GetUser() == user 
+conn-GetDbname() == db)
+{
+createdNew 

[pgadmin-hackers] [pgAdmin III] #209: Connect to Server dialog buggy

2010-07-11 Thread pgAdmin Trac
#209: Connect to Server dialog buggy
+---
 Reporter:  brsa|   Owner:  dpage  
 Type:  bug |  Status:  new
 Priority:  major   |   Milestone:  1.12   
Component:  pgadmin | Version: 
 Keywords:  SQL editor  |Platform:  windows
+---
 Testing v1.12beta3 (rev. 8448) on Windows XP Pro. Server = pg 8.4.4 on
 Debian Lenny.

 In the SQL editor try to connect to another server by choosing new
 connection from the connection combobox.

 - Selecting a different server triggers an immediate attempt to connect.
 (happens sometimes)

 The Username combobox behaves differently from the 2 other comboboxes:
 - The first user shown is the alphabetically first in the list, but it
 should be the user of the same name as in the current connection - if such
 a user exists. (happens always)
 - A click into the field does not open the list. (happens always)
 - Typed text is not completed, not even after moving the focus to another
 control. Only after clicking on the down arrow. (happens always)
 - This way I can enter non-existing users and try to connect with these.
 - pgAdmin randomly crashes when I try to use the feature. (happens
 sometimes)

 I had to try like 6 times, 3 times of which pgadmin crashed completely
 until I managed to open another connection.

 Wishlist item: a way to close a connection without closing the SQL editor
 window.

-- 
Ticket URL: http://code.pgadmin.org/trac/ticket/209
pgAdmin III http://code.pgadmin.org/trac/
pgAdmin III

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers