From 1d6e7fb4c6167904e260798ab39bee255f677dec Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Wed, 8 Jun 2011 21:47:00 +0200 Subject: Add an about dialog --- src/ppm.ui | 1 + src/ppm/Makefile.am | 1 + src/ppm/__init__.py.in | 1 + src/prepaid-manager-applet.py | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) diff --git a/src/ppm.ui b/src/ppm.ui index 2c2f4a5..c89f32b 100644 --- a/src/ppm.ui +++ b/src/ppm.ui @@ -56,6 +56,7 @@ False True True + diff --git a/src/ppm/Makefile.am b/src/ppm/Makefile.am index 8346110..65952cd 100644 --- a/src/ppm/Makefile.am +++ b/src/ppm/Makefile.am @@ -15,6 +15,7 @@ EXTRA_DIST = $(python_DATA) $(python_DATA_IN) %.py: $(srcdir)/%.py.in $(srcdir)/Makefile sed -e "s,::PACKAGE::,$(PACKAGE)," \ + -e "s,::VERSION::,$(PACKAGE_VERSION)," \ -e "s,::PYLIBDIR::,$(pkgdatadir)," \ -e "s,::GETTEXTDIR::,$(datadir)/locale," \ -e "s,::DATADIR::,$(datadir)," \ diff --git a/src/ppm/__init__.py.in b/src/ppm/__init__.py.in index ab3c59d..d1b0f13 100644 --- a/src/ppm/__init__.py.in +++ b/src/ppm/__init__.py.in @@ -3,3 +3,4 @@ gettext_app = '::PACKAGE::' gettext_dir = '::GETTEXTDIR::' ui_dir = '::PKGDATADIR::' +version = '::VERSION::' diff --git a/src/prepaid-manager-applet.py b/src/prepaid-manager-applet.py index 77de3ed..bf5ab8e 100755 --- a/src/prepaid-manager-applet.py +++ b/src/prepaid-manager-applet.py @@ -284,10 +284,22 @@ class PPMObject(object): # View class PPMDialog(GObject.GObject, PPMObject): + def _init_about_dialog(self): + self.about_dialog = Gtk.AboutDialog( + authors = ["Guido Günther "], + program_name = "GNOME Prepaid Manager", + website = "https://honk.sigxcpu.org/piki/projects/ppm/", + website_label = _("Website"), + comments = _("Manage balance of prepaid GSM SIM cards"), + wrap_license = True, + version = ppm.version, + license_type = Gtk.License.GPL_3_0) + def _init_subdialogs(self): self.provider_info_missing_dialog = PPMProviderInfoMissingDialog(self) self.provider_assistant = PPMProviderAssistant(self) self.modem_response = PPMModemResponse(self) + self._init_about_dialog() def _setup_ui(self): self.dialog = self.builder.get_object("ppm_dialog") @@ -325,6 +337,10 @@ class PPMDialog(GObject.GObject, PPMObject): self.clear_top_up_information() self.controller.top_up_balance() + def on_about_activated(self, dummy): + self.about_dialog.run() + self.about_dialog.hide() + def on_balance_info_renew_clicked(self, dummy): self.controller.fetch_balance() -- cgit v1.2.3