mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 08:45:54 +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
|
Item
|
||||||
{
|
{
|
||||||
property alias open: openAction;
|
property alias open: openAction;
|
||||||
|
property alias loadWorkspace: loadWorkspaceAction;
|
||||||
property alias quit: quitAction;
|
property alias quit: quitAction;
|
||||||
|
|
||||||
property alias undo: undoAction;
|
property alias undo: undoAction;
|
||||||
@ -286,6 +287,12 @@ Item
|
|||||||
shortcut: StandardKey.Open;
|
shortcut: StandardKey.Open;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
id: loadWorkspaceAction
|
||||||
|
text: catalog.i18nc("@action:inmenu menubar:file","&Load Workspace...");
|
||||||
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: showEngineLogAction;
|
id: showEngineLogAction;
|
||||||
|
@ -67,9 +67,14 @@ UM.MainWindow
|
|||||||
id: fileMenu
|
id: fileMenu
|
||||||
title: catalog.i18nc("@title:menu menubar:toplevel","&File");
|
title: catalog.i18nc("@title:menu menubar:toplevel","&File");
|
||||||
|
|
||||||
MenuItem {
|
MenuItem
|
||||||
|
{
|
||||||
action: Cura.Actions.open;
|
action: Cura.Actions.open;
|
||||||
}
|
}
|
||||||
|
MenuItem
|
||||||
|
{
|
||||||
|
action: Cura.Actions.loadWorkspace
|
||||||
|
}
|
||||||
|
|
||||||
RecentFilesMenu { }
|
RecentFilesMenu { }
|
||||||
|
|
||||||
@ -712,6 +717,38 @@ UM.MainWindow
|
|||||||
onTriggered: openDialog.open()
|
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
|
EngineLog
|
||||||
{
|
{
|
||||||
id: engineLog;
|
id: engineLog;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user