Hi ,

if pgAdmin is startet with option 'S' and there are no QuickConnect informations in the settings
the readonly comboboxes make no sense.

I tried following code:
if (form == NULL)
{
cbServer->SetValue(settings->Read(wxT("QuickConnect/server"), wxEmptyString));
        if (cbServer->IsEmpty())
cbServer->SetWindowStyleFlag(cbServer->GetWindowStyleFlag() & ~wxCB_READONLY); cbDatabase->SetValue(settings->Read(wxT("QuickConnect/database"), wxEmptyString));
        if (cbDatabase->IsEmpty())
cbDatabase->SetWindowStyleFlag(cbDatabase->GetWindowStyleFlag() & ~wxCB_READONLY); cbUsername->SetValue(settings->Read(wxT("QuickConnect/username"), wxEmptyString));
}

but the combobox didn't change to be editable.
So find another patch attached.
Also fixed height of username combobox.

Regards
Steffen
diff --git a/pgadmin/dlg/dlgSelectConnection.cpp b/pgadmin/dlg/dlgSelectConnection.cpp
index 9fd7800..89a8ad5 100644
--- a/pgadmin/dlg/dlgSelectConnection.cpp
+++ b/pgadmin/dlg/dlgSelectConnection.cpp
@@ -52,8 +52,14 @@ DialogWithHelp(form)
     SetIcon(wxIcon(connect_xpm));
     RestorePosition();
 
-	cbServer = new ctlComboBoxFix(this, CTRLID_CBSERVER, ConvertDialogToPixels(wxPoint(65,5)), ConvertDialogToPixels(wxSize(135,12)), wxCB_DROPDOWN | wxCB_READONLY);
-	cbDatabase = new wxComboBox(this, CTRLID_CBDATABASE, wxEmptyString, ConvertDialogToPixels(wxPoint(65,20)), ConvertDialogToPixels(wxSize(135,12)), NULL, wxCB_DROPDOWN | wxCB_READONLY);
+    if (form == NULL && settings->Read(wxT("QuickConnect/server"), wxEmptyString) == wxEmptyString)
+    	cbServer = new ctlComboBoxFix(this, CTRLID_CBSERVER, ConvertDialogToPixels(wxPoint(65,5)), ConvertDialogToPixels(wxSize(135,12)), wxCB_DROPDOWN);
+    else
+    	cbServer = new ctlComboBoxFix(this, CTRLID_CBSERVER, ConvertDialogToPixels(wxPoint(65,5)), ConvertDialogToPixels(wxSize(135,12)), wxCB_DROPDOWN | wxCB_READONLY);
+    if (form == NULL && settings->Read(wxT("QuickConnect/database"), wxEmptyString) == wxEmptyString)
+    	cbDatabase = new wxComboBox(this, CTRLID_CBDATABASE, wxEmptyString, ConvertDialogToPixels(wxPoint(65,20)), ConvertDialogToPixels(wxSize(135,12)), NULL, wxCB_DROPDOWN);
+    else
+    	cbDatabase = new wxComboBox(this, CTRLID_CBDATABASE, wxEmptyString, ConvertDialogToPixels(wxPoint(65,20)), ConvertDialogToPixels(wxSize(135,12)), NULL, wxCB_DROPDOWN | wxCB_READONLY);
 
 	if (form == NULL)
 	{
diff --git a/pgadmin/ui/dlgSelectConnection.xrc b/pgadmin/ui/dlgSelectConnection.xrc
index 6d41c36..f4a89b8 100644
--- a/pgadmin/ui/dlgSelectConnection.xrc
+++ b/pgadmin/ui/dlgSelectConnection.xrc
@@ -18,7 +18,7 @@
     </object>
     <object class="wxComboBox" name="cbUsername">
       <pos>65,35d</pos>
-      <size>135,-1d</size>
+      <size>135,12d</size>
     </object>
     <object class="wxButton" name="wxID_HELP">
       <label>&amp;Help</label>
-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to