X-Git-Url: http://git.maemo.org/git/?p=wifi-assistant;a=blobdiff_plain;f=package%2Fsrc%2Fwifi_assistant%2Fgui%2Fabout_dialog.py;fp=package%2Fsrc%2Fwifi_assistant%2Fgui%2Fabout_dialog.py;h=f7cee7ea1bbbd48e91749942087e96c6be520183;hp=0000000000000000000000000000000000000000;hb=2c5cc9a7c1fcda9a2bd5cb11756695d8f26caebd;hpb=e7a3beb9bc9268dc18110d9365b5697efe0ecdda diff --git a/package/src/wifi_assistant/gui/about_dialog.py b/package/src/wifi_assistant/gui/about_dialog.py new file mode 100644 index 0000000..f7cee7e --- /dev/null +++ b/package/src/wifi_assistant/gui/about_dialog.py @@ -0,0 +1,47 @@ +#!/usr/bin/python2.5 +import gtk, hildon + +def _(str): + return str + +class AboutDialog(): + + BUG_BUTTON = 1 + DONATE_BUTTON = 2 + CLOSE_BUTTON = 3 + + BUG_URL = 'http://wifi-assistant.garage.maemo.org/bugs/' + DONATE_URL = 'http://wifi-assistant.garage.maemo.org/donate/' + + def __init__(self, launcher, parent_window): + self._launcher = launcher + self._parent_window = parent_window + + + def show(self): + dialog = gtk.Dialog(_('About Wifi Jail Brekaout Assistant'), 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!" + + about_label = gtk.Label(_(text)) + about_label.set_line_wrap(True) + dialog.vbox.add(about_label) + + dialog.add_button(_('File a bug'), AboutDialog.BUG_BUTTON) + dialog.add_button(_('Donate'), AboutDialog.DONATE_BUTTON) + dialog.add_button(_('Close'), AboutDialog.CLOSE_BUTTON) + + dialog.show_all() + result = self._runDialog(dialog) + dialog.hide() + + if result == AboutDialog.BUG_BUTTON: + self._launcher.openUrl(_(AboutDialog.BUG_URL)) + if result == AboutDialog.DONATE_BUTTON: + self._launcher.openUrl(_(AboutDialog.DONATE_URL)) + + + def _runDialog(self, dialog): + result = dialog.run() + return result