Commit 4957fc59 authored by Björn Daase's avatar Björn Daase
Browse files

feat(main): add shortcuts to open or create a new journal

parent 9d200b3b
...@@ -55,6 +55,16 @@ class Application(Gtk.Application): ...@@ -55,6 +55,16 @@ class Application(Gtk.Application):
self.add_action(save_as_action) self.add_action(save_as_action)
self.set_accels_for_action('app.save_as', ['<Ctrl><Shift>S']) self.set_accels_for_action('app.save_as', ['<Ctrl><Shift>S'])
new_action ='new', None)
new_action.connect('activate', self._new)
self.set_accels_for_action('', ['<Ctrl>N'])
open_action ='open', None)
open_action.connect('activate', self._open)
self.set_accels_for_action('', ['<Ctrl>O'])
def _quit(self, action, param): def _quit(self, action, param):
win = self.props.active_window win = self.props.active_window
win.close() win.close()
...@@ -67,6 +77,14 @@ class Application(Gtk.Application): ...@@ -67,6 +77,14 @@ class Application(Gtk.Application):
win = self.props.active_window win = self.props.active_window
win.save_file_as() win.save_file_as()
def _new(self, action, param):
win = self.props.active_window
def _open(self, action, param):
win = self.props.active_window
def main(version): def main(version):
app = Application() app = Application()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment