diff --git a/src/main.py b/src/main.py index 4d51a73..351d6b7 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ class RosterApplication(Adw.Application): self.create_action('quit', lambda *_: self.quit(), ['q']) self.create_action('about', self.on_about_action) self.create_action('preferences', self.on_preferences_action) + self.create_action('shortcuts', self.on_shortcuts_action, ['question']) def do_activate(self): """Called when the application is activated. @@ -68,6 +69,13 @@ class RosterApplication(Adw.Application): """Callback for the app.preferences action.""" print('app.preferences action activated') + def on_shortcuts_action(self, widget, _): + """Callback for the app.shortcuts action.""" + builder = Gtk.Builder.new_from_resource('/cz/vesp/roster/shortcuts-dialog.ui') + shortcuts_window = builder.get_object('shortcuts_dialog') + shortcuts_window.set_transient_for(self.props.active_window) + shortcuts_window.present() + def create_action(self, name, callback, shortcuts=None): """Add an application action.