modified button constants to support GUI testing with PyUseCase
[wifi-assistant] / package / src / wifi_assistant / gui / about_dialog.py
index f7cee7e..d38c221 100644 (file)
@@ -6,9 +6,11 @@ def _(str):
 
 class AboutDialog():
     
-    BUG_BUTTON = 1
-    DONATE_BUTTON = 2
-    CLOSE_BUTTON = 3
+    BUG_BUTTON = gtk.RESPONSE_YES
+    DONATE_BUTTON = gtk.RESPONSE_ACCEPT
+    CLOSE_BUTTON = gtk.RESPONSE_HELP
+    
+    VERSION = "0.9.1"
     
     BUG_URL = 'http://wifi-assistant.garage.maemo.org/bugs/'
     DONATE_URL = 'http://wifi-assistant.garage.maemo.org/donate/'
@@ -19,7 +21,7 @@ class AboutDialog():
 
 
     def show(self):
-        dialog = gtk.Dialog(_('About Wifi Jail Brekaout Assistant'), self._parent_window)
+        dialog = gtk.Dialog(_('About Wifi Assistant') + ' ' + AboutDialog.VERSION, self._parent_window)
         text = "I got tired of not being able to connect easily to networks guarded by a login page, " + \
             "so I created this app to scratch that itch. It's free to use, inspect, adapt and share, " + \
             "licensed under a BSD type license.\nI hope you enjoy it!"
@@ -32,8 +34,10 @@ class AboutDialog():
         dialog.add_button(_('Donate'), AboutDialog.DONATE_BUTTON)
         dialog.add_button(_('Close'), AboutDialog.CLOSE_BUTTON)
         
-        dialog.show_all()
-        result = self._runDialog(dialog)
+        self._runDialog(dialog)
+    
+        
+    def _responseCallback(self, dialog, result):
         dialog.hide()
         
         if result == AboutDialog.BUG_BUTTON:
@@ -43,5 +47,5 @@ class AboutDialog():
     
 
     def _runDialog(self, dialog):
-        result = dialog.run()
-        return result
+        dialog.connect("response", self._responseCallback)
+        dialog.show_all()