From e06b241d01b194d19fb203ec1c4fb878c329ef17 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Thu, 30 Jun 2022 23:52:12 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20ic=C3=B4nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gemgraph/main.py | 17 ++++++++++++++++- ui/gemgraph.ui | 12 +++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) 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