From 7ecb6330444bb1222a15acf39cf31a37d367b27f Mon Sep 17 00:00:00 2001 From: dpage Date: Thu, 11 Jun 2009 09:40:07 +0000 Subject: [PATCH] Disable SQL pane editing for pgAgent dialogues. git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7915 a7884b65-44f6-0310-8a51-81a127f17b15 --- pgadmin/agent/dlgJob.cpp | 2 ++ pgadmin/agent/dlgSchedule.cpp | 7 ++++++- pgadmin/agent/dlgStep.cpp | 8 +++++++- pgadmin/dlg/dlgProperty.cpp | 6 ++++++ pgadmin/include/dlg/dlgProperty.h | 1 + 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pgadmin/agent/dlgJob.cpp b/pgadmin/agent/dlgJob.cpp index c1681bfe5..662afd476 100644 --- a/pgadmin/agent/dlgJob.cpp +++ b/pgadmin/agent/dlgJob.cpp @@ -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 diff --git a/pgadmin/agent/dlgSchedule.cpp b/pgadmin/agent/dlgSchedule.cpp index 54e53d3d2..b6b889404 100644 --- a/pgadmin/agent/dlgSchedule.cpp +++ b/pgadmin/agent/dlgSchedule.cpp @@ -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; } diff --git a/pgadmin/agent/dlgStep.cpp b/pgadmin/agent/dlgStep.cpp index 937dbe618..b32af1b01 100644 --- a/pgadmin/agent/dlgStep.cpp +++ b/pgadmin/agent/dlgStep.cpp @@ -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; } diff --git a/pgadmin/dlg/dlgProperty.cpp b/pgadmin/dlg/dlgProperty.cpp index 51a3e5a16..7c05cd63e 100644 --- a/pgadmin/dlg/dlgProperty.cpp +++ b/pgadmin/dlg/dlgProperty.cpp @@ -208,6 +208,12 @@ void dlgProperty::EnableOK(bool enable) } +void dlgProperty::SetSqlReadOnly(bool readonly) +{ + chkReadOnly->Enable(!readonly); +} + + void dlgSecurityProperty::SetPrivilegesLayout() { securityPage->lbPrivileges->GetParent()->Layout(); diff --git a/pgadmin/include/dlg/dlgProperty.h b/pgadmin/include/dlg/dlgProperty.h index 38322a77f..e6d96d908 100644 --- a/pgadmin/include/dlg/dlgProperty.h +++ b/pgadmin/include/dlg/dlgProperty.h @@ -59,6 +59,7 @@ protected: ~dlgProperty(); void EnableOK(bool enable); + void SetSqlReadOnly(bool readonly); virtual bool IsUpToDate() { return true; }; void ShowObject(); -- 2.39.5