Small fixes for the quick connection selector dialog:
  - The connection name includes the specified role's name
  - The last rolename saved

Appliable onto the previous patch.
From efeffe0d4088c4f4fb38f3eab95512315561503e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Benedek=20L=C3=A1szl=C3=B3?= <l...@benedekl.tvnetwork.hu>
Date: Fri, 23 Jul 2010 23:26:08 +0200
Subject: [PATCH] Small fixes for the quick connection selector dialog

- The connection name includes the specified role
- The last rolename saved
---
 pgadmin/db/pgConn.cpp               |    5 +++++
 pgadmin/dlg/dlgSelectConnection.cpp |    2 +-
 pgadmin/ui/dlgSelectConnection.xrc  |   12 ++++++------
 pgadmin/ui/xrcDialogs.cpp           |   12 ++++++------
 4 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/pgadmin/db/pgConn.cpp b/pgadmin/db/pgConn.cpp
index e876c65..8537307 100644
--- a/pgadmin/db/pgConn.cpp
+++ b/pgadmin/db/pgConn.cpp
@@ -517,6 +517,11 @@ wxString pgConn::GetName() const
         str.Printf(_("%s on local socket"), save_database.c_str());
     else
         str.Printf(_("%s on %...@%s:%d"), save_database.c_str(), GetUser().c_str(), dbHost.c_str(), GetPort());
+
+    if (!GetRole().IsEmpty()) {
+        str += wxT(" ~") + GetRole();
+    }
+
     return str;
 }
 
diff --git a/pgadmin/dlg/dlgSelectConnection.cpp b/pgadmin/dlg/dlgSelectConnection.cpp
index 7f2a63d..06cb954 100644
--- a/pgadmin/dlg/dlgSelectConnection.cpp
+++ b/pgadmin/dlg/dlgSelectConnection.cpp
@@ -32,7 +32,6 @@ BEGIN_EVENT_TABLE(dlgSelectConnection, DialogWithHelp)
 	EVT_TEXT(CTRLID_CBSERVER,          dlgSelectConnection::OnTextChange)
 	EVT_TEXT(CTRLID_CBDATABASE,        dlgSelectConnection::OnTextChange)
 	EVT_TEXT(XRCID("cbUsername"),      dlgSelectConnection::OnTextChange)
-	EVT_TEXT(XRCID("txtRolename"),     dlgSelectConnection::OnTextChange)
     EVT_BUTTON (wxID_OK,               dlgSelectConnection::OnOK)
     EVT_BUTTON (wxID_CANCEL,           dlgSelectConnection::OnCancel)
 END_EVENT_TABLE()
@@ -253,6 +252,7 @@ pgConn *dlgSelectConnection::CreateConn(wxString& server, wxString& dbname, wxSt
 			settings->Write(wxT("QuickConnect/server"), cbServer->GetValue());
 			settings->Write(wxT("QuickConnect/database"), cbDatabase->GetValue());
 			settings->Write(wxT("QuickConnect/username"), cbUsername->GetValue());
+			settings->Write(wxT("QuickConnect/rolename"), txtRolename->GetValue());
 		}
 	}
 	return newconn;
diff --git a/pgadmin/ui/dlgSelectConnection.xrc b/pgadmin/ui/dlgSelectConnection.xrc
index b19c602..be90b66 100644
--- a/pgadmin/ui/dlgSelectConnection.xrc
+++ b/pgadmin/ui/dlgSelectConnection.xrc
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgSelectConnection">
     <title>Connect to Server</title>
-    <size>205,83d</size>
+    <size>205,98d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxCAPTION|wxSYSTEM_MENU</style>
     <object class="wxStaticText" name="stServer">
       <label>Server</label>
@@ -22,27 +22,27 @@
     </object>
     <object class="wxStaticText" name="stRolename">
       <label>Rolename</label>
-      <pos>5,37d</pos>
+      <pos>5,54d</pos>
     </object>
     <object class="wxTextCtrl" name="txtRolename">
-      <pos>65,35d</pos>
+      <pos>65,52d</pos>
       <size>135,-1d</size>
     </object>
     <object class="wxButton" name="wxID_HELP">
       <label>&amp;Help</label>
-      <pos>2,65d</pos>
+      <pos>2,80d</pos>
       <style></style>
     </object>
     <object class="wxButton" name="wxID_OK">
       <label>&amp;OK</label>
       <default>1</default>
-      <pos>97,65d</pos>
+      <pos>97,80d</pos>
       <style></style>
     </object>
     <object class="wxButton" name="wxID_CANCEL">
       <label>&amp;Cancel</label>
       <default>0</default>
-      <pos>150,65d</pos>
+      <pos>150,80d</pos>
     </object>
   </object>
 </resource>
diff --git a/pgadmin/ui/xrcDialogs.cpp b/pgadmin/ui/xrcDialogs.cpp
index 3bfc3f3..e9cc959 100644
--- a/pgadmin/ui/xrcDialogs.cpp
+++ b/pgadmin/ui/xrcDialogs.cpp
@@ -15926,7 +15926,7 @@ static unsigned char xml_res_file_43[] = {
 101,61,34,100,108,103,83,101,108,101,99,116,67,111,110,110,101,99,116,105,
 111,110,34,62,10,32,32,32,32,60,116,105,116,108,101,62,67,111,110,110,101,
 99,116,32,116,111,32,83,101,114,118,101,114,60,47,116,105,116,108,101,62,
-10,32,32,32,32,60,115,105,122,101,62,50,48,53,44,56,51,100,60,47,115,105,
+10,32,32,32,32,60,115,105,122,101,62,50,48,53,44,57,56,100,60,47,115,105,
 122,101,62,10,32,32,32,32,60,115,116,121,108,101,62,119,120,68,69,70,65,
 85,76,84,95,68,73,65,76,79,71,95,83,84,89,76,69,124,119,120,68,73,65,76,
 79,71,95,77,79,68,65,76,124,119,120,67,65,80,84,73,79,78,124,119,120,83,
@@ -15957,25 +15957,25 @@ static unsigned char xml_res_file_43[] = {
 105,99,84,101,120,116,34,32,110,97,109,101,61,34,115,116,82,111,108,101,
 110,97,109,101,34,62,10,32,32,32,32,32,32,60,108,97,98,101,108,62,82,111,
 108,101,110,97,109,101,60,47,108,97,98,101,108,62,10,32,32,32,32,32,32,
-60,112,111,115,62,53,44,51,55,100,60,47,112,111,115,62,10,32,32,32,32,60,
+60,112,111,115,62,53,44,53,52,100,60,47,112,111,115,62,10,32,32,32,32,60,
 47,111,98,106,101,99,116,62,10,32,32,32,32,60,111,98,106,101,99,116,32,
 99,108,97,115,115,61,34,119,120,84,101,120,116,67,116,114,108,34,32,110,
 97,109,101,61,34,116,120,116,82,111,108,101,110,97,109,101,34,62,10,32,
-32,32,32,32,32,60,112,111,115,62,54,53,44,51,53,100,60,47,112,111,115,62,
+32,32,32,32,32,60,112,111,115,62,54,53,44,53,50,100,60,47,112,111,115,62,
 10,32,32,32,32,32,32,60,115,105,122,101,62,49,51,53,44,45,49,100,60,47,
 115,105,122,101,62,10,32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,
 32,32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,61,34,119,120,66,
 117,116,116,111,110,34,32,110,97,109,101,61,34,119,120,73,68,95,72,69,76,
 80,34,62,10,32,32,32,32,32,32,60,108,97,98,101,108,62,38,97,109,112,59,
 72,101,108,112,60,47,108,97,98,101,108,62,10,32,32,32,32,32,32,60,112,111,
-115,62,50,44,54,53,100,60,47,112,111,115,62,10,32,32,32,32,32,32,60,115,
+115,62,50,44,56,48,100,60,47,112,111,115,62,10,32,32,32,32,32,32,60,115,
 116,121,108,101,47,62,10,32,32,32,32,60,47,111,98,106,101,99,116,62,10,
 32,32,32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,61,34,119,120,
 66,117,116,116,111,110,34,32,110,97,109,101,61,34,119,120,73,68,95,79,75,
 34,62,10,32,32,32,32,32,32,60,108,97,98,101,108,62,38,97,109,112,59,79,
 75,60,47,108,97,98,101,108,62,10,32,32,32,32,32,32,60,100,101,102,97,117,
 108,116,62,49,60,47,100,101,102,97,117,108,116,62,10,32,32,32,32,32,32,
-60,112,111,115,62,57,55,44,54,53,100,60,47,112,111,115,62,10,32,32,32,32,
+60,112,111,115,62,57,55,44,56,48,100,60,47,112,111,115,62,10,32,32,32,32,
 32,32,60,115,116,121,108,101,47,62,10,32,32,32,32,60,47,111,98,106,101,
 99,116,62,10,32,32,32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,
 61,34,119,120,66,117,116,116,111,110,34,32,110,97,109,101,61,34,119,120,
@@ -15983,7 +15983,7 @@ static unsigned char xml_res_file_43[] = {
 108,62,38,97,109,112,59,67,97,110,99,101,108,60,47,108,97,98,101,108,62,
 10,32,32,32,32,32,32,60,100,101,102,97,117,108,116,62,48,60,47,100,101,
 102,97,117,108,116,62,10,32,32,32,32,32,32,60,112,111,115,62,49,53,48,44,
-54,53,100,60,47,112,111,115,62,10,32,32,32,32,60,47,111,98,106,101,99,116,
+56,48,100,60,47,112,111,115,62,10,32,32,32,32,60,47,111,98,106,101,99,116,
 62,10,32,32,60,47,111,98,106,101,99,116,62,10,60,47,114,101,115,111,117,
 114,99,101,62,10};
 
-- 
1.7.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to