fixed erronous gconf path in postins script (thanks to hutchinsfairy)
[wifi-assistant] / package / src / wifi_assistant / gui / about_dialog.py
1 #!/usr/bin/python2.5
2 import gtk, hildon
3
4 def _(str):
5     return str
6
7 class AboutDialog():
8     
9     BUG_BUTTON = gtk.RESPONSE_YES
10     DONATE_BUTTON = gtk.RESPONSE_ACCEPT
11     CLOSE_BUTTON = gtk.RESPONSE_HELP
12     
13     # this field is updated from the Makefile's compile target
14     VERSION = "0.9.1"
15     
16     BUG_URL = 'http://wifi-assistant.garage.maemo.org/bugs/'
17     DONATE_URL = 'http://wifi-assistant.garage.maemo.org/donate/'
18
19     def __init__(self, launcher, parent_window):
20         self._launcher = launcher
21         self._parent_window = parent_window
22
23
24     def show(self):
25         dialog = gtk.Dialog(_('About Wifi Assistant') + ' ' + AboutDialog.VERSION, self._parent_window)
26         text = "I got tired of not being able to connect easily to networks guarded by a login page, " + \
27             "so I created this app to scratch that itch. It's free to use, inspect, adapt and share, " + \
28             "licensed under a BSD type license.\nI hope you enjoy it!"
29
30         about_label = gtk.Label(_(text))
31         about_label.set_line_wrap(True)
32         dialog.vbox.add(about_label)
33         
34         dialog.add_button(_('File a bug'), AboutDialog.BUG_BUTTON)
35         dialog.add_button(_('Donate'), AboutDialog.DONATE_BUTTON)
36         dialog.add_button(_('Close'), AboutDialog.CLOSE_BUTTON)
37         
38         self._runDialog(dialog)
39     
40         
41     def _responseCallback(self, dialog, result):
42         dialog.hide()
43         
44         if result == AboutDialog.BUG_BUTTON:
45             self._launcher.openUrl(_(AboutDialog.BUG_URL))
46         if result == AboutDialog.DONATE_BUTTON:
47             self._launcher.openUrl(_(AboutDialog.DONATE_URL))
48     
49
50     def _runDialog(self, dialog):
51         dialog.connect("response", self._responseCallback)
52         dialog.show_all()