diff options
author | Guido Günther <agx@sigxcpu.org> | 2020-03-31 19:20:56 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2020-04-01 19:47:54 +0200 |
commit | 860ed6142e5f6a35495d4467b1817300e9fb1b54 (patch) | |
tree | 7d00f6565b17f09cd33bb74be9ac0d37a2810e6f /src | |
parent | 51e68f64fbca0688f5ac310be84892bdc03f9ee8 (diff) |
applet: Replace menu by a menu button
Diffstat (limited to 'src')
-rwxr-xr-x | src/prepaid-manager-applet.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/prepaid-manager-applet.py b/src/prepaid-manager-applet.py index eec3966..1c0b79c 100755 --- a/src/prepaid-manager-applet.py +++ b/src/prepaid-manager-applet.py @@ -349,6 +349,13 @@ class PPMDialog(Gtk.ApplicationWindow): self._init_infobars() self._init_subdialogs() + def _add_actions(self): + action = Gio.SimpleAction(name='about') + action.set_enabled(True) + action.connect('activate', self.on_about_activated, None) + + self.add_action(action) + def __init__(self, controller): Gtk.ApplicationWindow.__init__(self) self.code_len = 0 @@ -356,6 +363,7 @@ class PPMDialog(Gtk.ApplicationWindow): # Register ourself to the controller self.controller.view = self + self._add_actions() self._setup_ui() self.show() @@ -385,8 +393,7 @@ class PPMDialog(Gtk.ApplicationWindow): self.clear_top_up_information() self.controller.top_up_balance() - @Gtk.Template.Callback("on_about_activated") - def on_about_activated(self, dummy): + def on_about_activated(self, *argv): self.about_dialog.run() self.about_dialog.hide() |