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):
self.add_action(save_as_action)
self.set_accels_for_action('app.save_as', ['<Ctrl><Shift>S'])
new_action = Gio.SimpleAction.new('new', None)
new_action.connect('activate', self._new)
self.add_action(new_action)
self.set_accels_for_action('app.new', ['<Ctrl>N'])
open_action = Gio.SimpleAction.new('open', None)
open_action.connect('activate', self._open)
self.add_action(open_action)
self.set_accels_for_action('app.open', ['<Ctrl>O'])
def _quit(self, action, param):
win = self.props.active_window
win.close()
......@@ -67,6 +77,14 @@ class Application(Gtk.Application):
win = self.props.active_window
win.save_file_as()
def _new(self, action, param):
win = self.props.active_window
win.new_journal()
def _open(self, action, param):
win = self.props.active_window
win.open_file()
def main(version):
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