Commits

Rodrigo Bistolfi committed 6736ff8

Adapt some code to the new WizardApplication api

  • Participants
  • Parent commits 00a17ec

Comments (0)

Files changed (2)

vinstall/ui/gtk.py

 
 from __future__ import absolute_import
 
-import gtk
+import gtk, time
 from vinstall.core import core, model, command
 
 
         self.next_button.set_sensitive(True)
         self.back_button.set_sensitive(True)
 
+    def set_next_button_label(self, text):
+        """Set next button label
+
+        """
+        self.next_button.set_label(text)
+
+    def set_previous_button_label(self, text):
+        """Set previous button label
+
+        """
+        self.back_button.set_label(text)
+
+    def alert(self, text):
+        """Show a popup when tasks are complete
+
+        """
+        dialog = gtk.MessageDialog(parent=self.window,
+                flags=0,
+                type=gtk.MESSAGE_INFO,
+                buttons=gtk.BUTTONS_OK,
+                message_format=text)
+        dialog.run()
+        dialog.destroy()
+
     def run(self):
         """Start the main loop.
 
         item, result, completed, total = args
         total = float(total)
         self.progress_bar.set_fraction(completed / total)
+        time.sleep(0.15)
 
     def accept(self):
         """Return the top level widget.
 
         """
         return self.container
+
+

vinstall/ui/urwid.py

                 "button select")
         back_button = urwid.AttrWrap(self.back_button, "button normal",
                 "button select")
-        return urwid.GridFlow([next_button, back_button], 15, 2, 2,
+        return urwid.GridFlow([back_button, next_button], 15, 2, 2,
                 align="right")
 
     def get_body(self):
         self._input_disabled = False
         self.update()
 
+    def set_next_button_label(self, text):
+        """Set next button label
+
+        """
+        self.next_button.set_label(text)
+        self.update()
+
+    def set_previous_button_label(self, text):
+        """Set previous button label
+
+        """
+        self.back_button.set_label(text)
+        self.update()
+
     def refresh(self):
         """Force an update of the screen