Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Björn Daase
Journable
Commits
4957fc59
Commit
4957fc59
authored
Apr 07, 2020
by
Björn Daase
Browse files
feat(main): add shortcuts to open or create a new journal
parent
9d200b3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.py
View file @
4957fc59
...
@@ -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
=
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
):
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
win
.
new_journal
()
def
_open
(
self
,
action
,
param
):
win
=
self
.
props
.
active_window
win
.
open_file
()
def
main
(
version
):
def
main
(
version
):
app
=
Application
()
app
=
Application
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment