Le vendredi 24 juillet 2009 à 12:20:28, Dave Page a écrit :
> On Fri, Jul 24, 2009 at 11:14 AM, Guillaume
>
> Lelarge<[email protected]> wrote:
> > I've tried to check different parameters but failed. The only way I found
> > (and the last I tried) is using the tab count. The last because I don't
> > like it either. One other way is to loop though all the tabs and check if
> > we have an "SQL" tab. It should protect us enough of the issue you're
> > talking about?
>
> Can we set a flag at the point where we create the tabset, and check that
> later?
>

Another way to do it is to check the object before executing the Enable 
method. See patch attached.

> >> > New functionality:
> >> >  http://archives.postgresql.org/pgadmin-hackers/2009-07/msg00036.php
> >>
> >> Looks OK in principle. I've got a sneaking feeling we've had issues
> >> with using translated strings in SQL queries before though, but I
> >> can't think what/when that was though.
> >
> > We do this on all statistics methods, so we can use a common
> > DisplayStatistics function. I don't see another way to get this. If we
> > had an issue with this, I think we would have fixed it.
>
> OK. I think the issue I vaguely recall was in some other
> (non-statistics) code, but as I say, I can't recall the details.

Commited, thanks.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/agent/dlgStep.cpp
===================================================================
--- pgadmin/agent/dlgStep.cpp	(révision 7980)
+++ 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);
+
+    SetSqlReadOnly(true);
+
+    return returncode;
 }
 
 
Index: pgadmin/agent/dlgSchedule.cpp
===================================================================
--- pgadmin/agent/dlgSchedule.cpp	(révision 7980)
+++ pgadmin/agent/dlgSchedule.cpp	(copie de travail)
@@ -114,6 +114,8 @@
 
 int dlgSchedule::Go(bool modal)
 {
+    int returncode;
+
     if (schedule)
     {
         // edit mode
@@ -196,7 +198,11 @@
         // create mode
     }
 
-	return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    SetSqlReadOnly(true);
+
+    return returncode;
 }
 
 
Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp	(révision 7980)
+++ pgadmin/dlg/dlgProperty.cpp	(copie de travail)
@@ -122,6 +122,7 @@
     factory=f;
     item = (void *)NULL;
     owneritem = (void *)NULL;
+    chkReadOnly = (wxCheckBox *)NULL;
     wxWindowBase::SetFont(settings->GetSystemFont());
     LoadResource(frame, resName);
 
@@ -234,7 +235,8 @@
 
 void dlgProperty::SetSqlReadOnly(bool readonly)
 {
-    chkReadOnly->Enable(!readonly);
+    if (chkReadOnly)
+        chkReadOnly->Enable(!readonly);
 }
 
 
-- 
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