mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-17 20:05:55 +08:00
Added loadWorkspace option to menu
CURA-1263
This commit is contained in:
parent
efc9719ff0
commit
a859c9883c
@ -11,6 +11,7 @@ import Cura 1.0 as Cura
|
||||
Item
|
||||
{
|
||||
property alias open: openAction;
|
||||
property alias loadWorkspace: loadWorkspaceAction;
|
||||
property alias quit: quitAction;
|
||||
|
||||
property alias undo: undoAction;
|
||||
@ -286,6 +287,12 @@ Item
|
||||
shortcut: StandardKey.Open;
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: loadWorkspaceAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","&Load Workspace...");
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: showEngineLogAction;
|
||||
|
@ -67,9 +67,14 @@ UM.MainWindow
|
||||
id: fileMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel","&File");
|
||||
|
||||
MenuItem {
|
||||
MenuItem
|
||||
{
|
||||
action: Cura.Actions.open;
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
action: Cura.Actions.loadWorkspace
|
||||
}
|
||||
|
||||
RecentFilesMenu { }
|
||||
|
||||
@ -712,6 +717,38 @@ UM.MainWindow
|
||||
onTriggered: openDialog.open()
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: openWorkspaceDialog;
|
||||
|
||||
//: File open dialog title
|
||||
title: catalog.i18nc("@title:window","Open workspace")
|
||||
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
|
||||
selectMultiple: false
|
||||
nameFilters: UM.WorkspaceFileHandler.supportedReadFileTypes;
|
||||
folder: CuraApplication.getDefaultPath("dialog_load_path")
|
||||
onAccepted:
|
||||
{
|
||||
//Because several implementations of the file dialog only update the folder
|
||||
//when it is explicitly set.
|
||||
var f = folder;
|
||||
folder = f;
|
||||
|
||||
CuraApplication.setDefaultPath("dialog_load_path", folder);
|
||||
|
||||
for(var i in fileUrls)
|
||||
{
|
||||
UM.WorkspaceFileHandler.readLocalFile(fileUrls[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.Actions.loadWorkspace
|
||||
onTriggered:openWorkspaceDialog.open()
|
||||
}
|
||||
|
||||
EngineLog
|
||||
{
|
||||
id: engineLog;
|
||||
|
Loading…
x
Reference in New Issue
Block a user