SVN Commit by dpage: r4466 - trunk/pgadmin3/src/agent
SVN Commit by dpage: r4466 - trunk/pgadmin3/src/agent
От:
svn@pgadmin.org
Дата:
Author: dpage
Date: 2005-09-26 14:29:28 +0100 (Mon, 26 Sep 2005)
New Revision: 4466
Modified:
trunk/pgadmin3/src/agent/dlgStep.cpp
Log:
Correct job step database name handling per Regina Obe
Modified: trunk/pgadmin3/src/agent/dlgStep.cpp
===================================================================
--- trunk/pgadmin3/src/agent/dlgStep.cpp 2005-09-26 08:00:36 UTC (rev 4465)
+++ trunk/pgadmin3/src/agent/dlgStep.cpp 2005-09-26 13:29:28 UTC (rev 4466)
@@ -144,6 +144,16 @@
CheckValid(enable, !name.IsEmpty(), _("Please specify name."));
CheckValid(enable, sqlBox->GetLength() > 0, _("Please specify code to execute."));
+
+ // Disable/enable the database combo
+ if ((wxT("sb")[rbxKind->GetSelection()]) == 'b')
+ {
+ cbDatabase->SetSelection(0);
+ cbDatabase->Enable(false);
+ }
+ else
+ cbDatabase->Enable(true);
+
EnableOK(enable);
}
@@ -172,7 +182,7 @@
else
jstjobid = wxT("");
- db = qtString(cbDatabase->GetValue());
+ db = qtString(cbDatabase->GetValue().Trim());
sql = wxT("INSERT INTO pgagent.pga_jobstep (jstid, jstjobid, jstname, jstdesc, jstenabled, jstkind, jstonerror, jstcode, jstdbname)\n")
wxT("SELECT , ") + jstjobid + wxT(", ") + qtString(name) + wxT(", ") + qtString(txtComment->GetValue()) + wxT(", ")
@@ -212,7 +222,7 @@
vars.Append(wxT(", "));
if (!cbDatabase->GetSelection())
- vars.Append(wxT("jstdbname=NULL"));
+ vars.Append(wxT("jstdbname=''"));
else
vars.Append(wxT("jstdbname=") + qtString(cbDatabase->GetValue()));
}
Re: SVN Commit by dpage: r4466 - trunk/pgadmin3/src/agent
От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
svn@pgadmin.org wrote:
> Author: dpage
;
> +
> + // Disable/enable the database combo
> + if ((wxT("sb")[rbxKind->GetSelection()]) == 'b')
Um, if(rbxKind->GetSelection() == 1) seems to easy :-)
Hopefully, rbxKind->GetSelection() will never return -1...
Regards,
Andreas
Re: SVN Commit by dpage: r4466 - trunk/pgadmin3/src/agent
От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:
> -----Original Message-----
> From: Andreas Pflug [mailto:pgadmin@pse-consulting.de]
> Sent: 26 September 2005 18:49
> To: Dave Page
> Cc: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] SVN Commit by dpage: r4466 -
> trunk/pgadmin3/src/agent
>
> svn@pgadmin.org wrote:
> > Author: dpage
> ;
> > +
> > + // Disable/enable the database combo
> > + if ((wxT("sb")[rbxKind->GetSelection()]) == 'b')
>
> Um, if(rbxKind->GetSelection() == 1) seems to easy :-)
> Hopefully, rbxKind->GetSelection() will never return -1...
Yeah, well, that's what happens when I'm doing four things at once and
take a shortcut by copying your code :-P
/D