From 9f69a93779e249754f680ed9a78cb6d37c59acb0 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Thu, 22 May 2008 11:59:52 +0000 Subject: Viewfile bugfixes on IMG. Disable buttons when no connection to server. git-svn-id: svn://svn.alpinelinux.org/acf/gnats/trunk@1174 ab2d0c66-481e-0410-8bed-d214d4d58bed --- gnats-controller.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gnats-controller.lua') diff --git a/gnats-controller.lua b/gnats-controller.lua index 25d1ee5..d85445d 100644 --- a/gnats-controller.lua +++ b/gnats-controller.lua @@ -232,6 +232,15 @@ function query(self) value="Submit", }) + -- Assume connection is down if you get no reply from it (disable buttons) + if not (query['severity']['option']) or (#query['severity']['option'] < 2) then + query.advanced_cmd.disabled="yes" + query.advanced_cmd.errtxt="Lost connection to the server!" + query.pr_cmd.disabled=query.advanced_cmd.disabled + query.pr_cmd.errtxt=query.advanced_cmd.errtxt + + end + return { option={ script=self.conf.script, prefix=self.conf.prefix, @@ -446,6 +455,13 @@ function report(self) value="Submit", type="submit", }) + -- Assume connection is down if you get no reply from it (disable buttons) + if not (reportform['severity']['option']) or (#reportform['severity']['option'] == 0) then + reportform.submit.disabled = "yes" + reportform.submit.errtxt = "Lost connection to the server!" + end + + if (self.clientdata.submit) then -- cgit v1.2.3