[ui] shortcuts: add Ctrl+N for new + allow Ctrl+S for initial save

This commit is contained in:
Yann Lanthony 2018-08-03 14:26:25 +02:00
parent 30f99b01f2
commit 494cb71d3f

View file

@ -257,6 +257,7 @@ ApplicationWindow {
title: "File"
Action {
text: "New"
shortcut: "Ctrl+N"
onTriggered: ensureSaved(function() { _reconstruction.new() })
}
Action {
@ -268,8 +269,8 @@ ApplicationWindow {
id: saveAction
text: "Save"
shortcut: "Ctrl+S"
enabled: _reconstruction.graph.filepath != "" && !_reconstruction.undoStack.clean
onTriggered: _reconstruction.save()
enabled: !_reconstruction.graph.filepath || !_reconstruction.undoStack.clean
onTriggered: _reconstruction.graph.filepath ? _reconstruction.save() : saveFileDialog.open()
}
Action {
id: saveAsAction