diff --git a/gemgraph/main.py b/gemgraph/main.py index 6c5e761..81e3aa3 100644 --- a/gemgraph/main.py +++ b/gemgraph/main.py @@ -36,6 +36,9 @@ class GemGraphApplication(Adw.Application): self.create_action('quit', self.quit, ['q']) self.create_action('about', self.on_about_action) self.create_action('preferences', self.on_preferences_action) + self.create_action('editmode', self.on_editmode_action, ['e']) + self.create_action('runmode', self.on_runmode_action, ['r']) + self.create_action('presentmode', self.on_presentmode_action, ['p']) def do_activate(self): """Called when the application is activated. @@ -58,6 +61,18 @@ class GemGraphApplication(Adw.Application): """Callback for the app.preferences action.""" print('app.preferences action activated') + def on_editmode_action(self, widget, _): + """Callback for the app.preferences action.""" + print('app.editmode action activated') + + def on_runmode_action(self, widget, _): + """Callback for the app.preferences action.""" + print('app.runmode action activated') + + def on_presentmode_action(self, widget, _): + """Callback for the app.preferences action.""" + print('app.presentmode action activated') + def create_action(self, name, callback, shortcuts=None): """Add an application action. @@ -77,4 +92,4 @@ class GemGraphApplication(Adw.Application): def main(version): """The application's entry point.""" app = GemGraphApplication() - return app.run(sys.argv) \ No newline at end of file + return app.run(sys.argv) diff --git a/ui/gemgraph.ui b/ui/gemgraph.ui index e889dba..dc80303 100644 --- a/ui/gemgraph.ui +++ b/ui/gemgraph.ui @@ -80,16 +80,22 @@ Switch session mode + document-edit-symbolic _Edit - app.switch_to_edit + app.editmode + True + run-start-symbolic _Run - app.switch_to_run + app.runmode + True + run-start-symbolic _Presentation - app.switch_to_presentation + app.presentmode + True