Dave Page a écrit :
> On Tue, Jun 9, 2009 at 9:06 PM, Guillaume Lelarge<guilla...@lelarge.info> 
> wrote:
>>>> I think it's still useful to display the SQL, if only to allow the
>>>> user to see what pgAdmin is going to do. Disabling (better yet,
>>>> removing) the checkbox on those dialogues seems like the right answer.
>>>>
>>>> Can you do that in the next day or so?
>>>>
>>> I'll work on a patch for this tonight.
>>>
>> Here it is.
> 
> Hmm, not sure I like that - it assumes that we'll never be able to
> edit pgAgent SQL, and does so far away from the pgAgent code which
> could easily lead to future confusion.
> 
> Can we disable/hide the control on each individual dialogue please?
> 

Yes, we can. I was lazy yesterday, and didn't want to go much deeper in
the code :)

New patch is attached.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/include/dlg/dlgProperty.h
===================================================================
--- pgadmin/include/dlg/dlgProperty.h	(révision 7911)
+++ pgadmin/include/dlg/dlgProperty.h	(copie de travail)
@@ -59,6 +59,7 @@
     ~dlgProperty();
 
     void EnableOK(bool enable);
+	void EnableReadOnly(bool enable);
 	virtual bool IsUpToDate() { return true; };
     void ShowObject();
 	
Index: pgadmin/agent/dlgJob.cpp
===================================================================
--- pgadmin/agent/dlgJob.cpp	(révision 7911)
+++ pgadmin/agent/dlgJob.cpp	(copie de travail)
@@ -217,6 +217,8 @@
     }
 
     returncode = dlgProperty::Go(modal);
+	
+	EnableReadOnly(false);
 
     // This fixes a UI glitch on MacOS X
     // Because of the new layout code, the Columns pane doesn't size itself properly
Index: pgadmin/agent/dlgStep.cpp
===================================================================
--- pgadmin/agent/dlgStep.cpp	(révision 7911)
+++ pgadmin/agent/dlgStep.cpp	(copie de travail)
@@ -84,6 +84,8 @@
 
 int dlgStep::Go(bool modal)
 {
+	int returncode;
+	
     hasConnStrSupport = connection->TableHasColumn(wxT("pgagent"), wxT("pga_jobstep"), wxT("jstconnstr"));
     cbDatabase->Append(wxT(" "));
     cbDatabase->SetSelection(0);
@@ -139,7 +141,11 @@
             rbLocalConn->Enable(false);
     }
 
-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+	
+	EnableReadOnly(false);
+
+	return returncode;
 }
 
 
Index: pgadmin/agent/dlgSchedule.cpp
===================================================================
--- pgadmin/agent/dlgSchedule.cpp	(révision 7911)
+++ pgadmin/agent/dlgSchedule.cpp	(copie de travail)
@@ -114,6 +114,7 @@
 
 int dlgSchedule::Go(bool modal)
 {
+	int returncode;
 
     if (schedule)
     {
@@ -197,7 +198,11 @@
         // create mode
     }
 
-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+	
+	EnableReadOnly(false);
+
+	return returncode;
 }
 
 
Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp	(révision 7911)
+++ pgadmin/dlg/dlgProperty.cpp	(copie de travail)
@@ -208,6 +208,12 @@
 }
 
 
+void dlgProperty::EnableReadOnly(bool enable)
+{
+    chkReadOnly->Enable(enable);
+}
+
+
 void dlgSecurityProperty::SetPrivilegesLayout()
 {
     securityPage->lbPrivileges->GetParent()->Layout();
-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to