Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] Reorganize the "File" menu #1856

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 58 additions & 40 deletions meshroom/ui/qml/main.qml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ ApplicationWindow {
settings_General.windowHeight = _window.height
}

Shortcut {
// Ensures the Ctrl+N shortcut is always valid and creates a default pipeline
sequence: "Ctrl+N"
context: Qt.ApplicationShortcut
onActivated: ensureSaved(function() { _reconstruction.new() })
}

MessageDialog {
id: unsavedDialog

Expand Down Expand Up @@ -483,11 +490,6 @@ ApplicationWindow {
palette.window: Qt.darker(activePalette.window, 1.15)
Menu {
title: "File"
Action {
text: "New"
shortcut: "Ctrl+N"
onTriggered: ensureSaved(function() { _reconstruction.new() })
}
Menu {
id: newPipelineMenu
title: "New Pipeline"
Expand Down Expand Up @@ -572,15 +574,33 @@ ApplicationWindow {
}
}
}
MenuSeparator { }
Action {
id: saveAction
text: "Save"
shortcut: "Ctrl+S"
enabled: _reconstruction ? (_reconstruction.graph && !_reconstruction.graph.filepath) || !_reconstruction.undoStack.clean : false
onTriggered: {
if(_reconstruction.graph.filepath) {
_reconstruction.save();
}
else
{
initFileDialogFolder(saveFileDialog);
saveFileDialog.open();
}
}
}
Action {
id: importProjectAction
text: "Import Project"
shortcut: "Ctrl+Shift+I"
id: saveAsAction
text: "Save As..."
shortcut: "Ctrl+Shift+S"
onTriggered: {
initFileDialogFolder(importProjectDialog);
importProjectDialog.open();
initFileDialogFolder(saveFileDialog);
saveFileDialog.open();
}
}
MenuSeparator { }
Action {
id: importImagesAction
text: "Import Images"
Expand Down Expand Up @@ -613,39 +633,37 @@ ApplicationWindow {
}
}
}

Action {
id: saveAction
text: "Save"
shortcut: "Ctrl+S"
enabled: _reconstruction ? (_reconstruction.graph && !_reconstruction.graph.filepath) || !_reconstruction.undoStack.clean : false
onTriggered: {
if(_reconstruction.graph.filepath) {
_reconstruction.save()
MenuSeparator { }
Menu {
id: advancedMenu
title: "Advanced"

Action {
id: saveAsTemplateAction
text: "Save As Template..."
shortcut: Shortcut {
sequence: "Ctrl+Shift+T"
context: Qt.ApplicationShortcut
onActivated: saveAsTemplateAction.triggered()
}
else
{
initFileDialogFolder(saveFileDialog);
saveFileDialog.open();
onTriggered: {
initFileDialogFolder(saveTemplateDialog);
saveTemplateDialog.open();
}
}
}
Action {
id: saveAsAction
text: "Save As..."
shortcut: "Ctrl+Shift+S"
onTriggered: {
initFileDialogFolder(saveFileDialog);
saveFileDialog.open();
}
}
Action {
id: saveAsTemplateAction
text: "Save As Template..."
shortcut: "Ctrl+Shift+T"
onTriggered: {
initFileDialogFolder(saveTemplateDialog);
saveTemplateDialog.open();

Action {
id: importProjectAction
text: "Import Project"
shortcut: Shortcut {
sequence: "Ctrl+Shift+I"
context: Qt.ApplicationShortcut
onActivated: importProjectAction.triggered()
}
onTriggered: {
initFileDialogFolder(importProjectDialog);
importProjectDialog.open();
}
}
}
MenuSeparator { }
Expand Down