Disable SQL pane editing for pgAgent dialogues.
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Thu, 11 Jun 2009 09:40:07 +0000 (09:40 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Thu, 11 Jun 2009 09:40:07 +0000 (09:40 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7915 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/agent/dlgJob.cpp
pgadmin/agent/dlgSchedule.cpp
pgadmin/agent/dlgStep.cpp
pgadmin/dlg/dlgProperty.cpp
pgadmin/include/dlg/dlgProperty.h

index c1681bfe5b8b641fac42fce3471f992322cbbf15..662afd476b17bf5336a4cf66570b5e88b80672a4 100644 (file)
@@ -217,6 +217,8 @@ int dlgJob::Go(bool modal)
     }
 
     returncode = dlgProperty::Go(modal);
+       
+       SetSqlReadOnly(true);
 
     // This fixes a UI glitch on MacOS X
     // Because of the new layout code, the Columns pane doesn't size itself properly
index 54e53d3d25db42347712b2a07e9551ced002078b..b6b889404ea4b79074c3e09a283ff905301e0442 100644 (file)
@@ -114,6 +114,7 @@ void dlgSchedule::OnChangeSize(wxSizeEvent &ev)
 
 int dlgSchedule::Go(bool modal)
 {
+       int returncode;
 
     if (schedule)
     {
@@ -197,7 +198,11 @@ int dlgSchedule::Go(bool modal)
         // create mode
     }
 
-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+       
+       SetSqlReadOnly(true);
+
+       return returncode;
 }
 
 
index 937dbe618d2cd0e02e0b130e01cc022f3c17c571..b32af1b01d60e395df5646556d956ec5bd2d180b 100644 (file)
@@ -84,6 +84,8 @@ pgObject *dlgStep::GetObject()
 
 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 @@ int dlgStep::Go(bool modal)
             rbLocalConn->Enable(false);
     }
 
-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+       
+       SetSqlReadOnly(true);
+
+       return returncode;
 }
 
 
index 51a3e5a16e12e62ec4099af63b984ac715f7f49f..7c05cd63edb5878d10af4ee4587e2044150797c9 100644 (file)
@@ -208,6 +208,12 @@ void dlgProperty::EnableOK(bool enable)
 }
 
 
+void dlgProperty::SetSqlReadOnly(bool readonly)
+{
+    chkReadOnly->Enable(!readonly);
+}
+
+
 void dlgSecurityProperty::SetPrivilegesLayout()
 {
     securityPage->lbPrivileges->GetParent()->Layout();
index 38322a77faddedbad90626ac35f5e96edfb08e20..e6d96d908a64b74b75d2ffca65b4d1551b46fb40 100644 (file)
@@ -59,6 +59,7 @@ protected:
     ~dlgProperty();
 
     void EnableOK(bool enable);
+       void SetSqlReadOnly(bool readonly);
        virtual bool IsUpToDate() { return true; };
     void ShowObject();