← Back to team overview

clicompanion-devs team mailing list archive

[Merge] lp:~dcaro/clicompanion/fix-910249 into lp:clicompanion

 

David Caro has proposed merging lp:~dcaro/clicompanion/fix-910249 into lp:clicompanion.

Requested reviews:
  CLI Companion Development Team (clicompanion-devs)
Related bugs:
  Bug #910249 in CLI Companion: "Warning window (when wrong params issued) not working properly"
  https://bugs.launchpad.net/clicompanion/+bug/910249

For more details, see:
https://code.launchpad.net/~dcaro/clicompanion/fix-910249/+merge/87170

Now the popup is closed when clicking the button (also added a little tip for parameter passing).
And shows the parameter input dialog again until cancelled or parameters are passed ok.
-- 
https://code.launchpad.net/~dcaro/clicompanion/fix-910249/+merge/87170
Your team CLI Companion Development Team is requested to review the proposed merge of lp:~dcaro/clicompanion/fix-910249 into lp:clicompanion.
=== modified file 'clicompanionlib/controller.py'
--- clicompanionlib/controller.py	2011-11-18 23:56:17 +0000
+++ clicompanionlib/controller.py	2011-12-30 23:07:23 +0000
@@ -390,13 +390,17 @@
 
         if not view.CMNDS[row_int][1] == "": # command with user input
             c = ""
-            try:
-                text = self.get_info(self, liststore)
-                c = new_cmnd.format(text)
-            except: 
-                error = gtk.MessageDialog (None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
-                    _("You need to enter full input. Click on [x] to continue."))
-                error.run()
+            while True:
+                try:
+                    text = self.get_info(self, liststore)
+                    c = new_cmnd.format(text)
+                except IndexError: 
+                    error = gtk.MessageDialog (None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
+                        _("You need to enter full input. (Remember, space separated)"))
+                    error.connect('response', lambda err, *x: err.destroy())
+                    error.run()
+                    continue
+                break
             page_widget.feed_child(c+"\n") #send command w/ input
             page_widget.show()
             page_widget.grab_focus()