diff options
author | jack <jackha@users.noreply.github.com> | 2016-12-12 12:41:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 12:41:49 +0300 |
commit | 8fdc0a40ce51bbc9305223fa23289fc655213dcc (patch) | |
tree | b5dbbd56f317901d5d2b573902c4752a7543366e /resources | |
parent | 7abebfde4edf01e705a56568e22fd0ec700813aa (diff) | |
parent | 19ca4ec964e6de84cbc3dec187667c75a233f3f3 (diff) |
Merge pull request #1235 from Ultimaker/project_save_dialog
Project save dialog
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/Cura.qml | 29 | ||||
-rw-r--r-- | resources/qml/Preferences/GeneralPage.qml | 14 | ||||
-rw-r--r-- | resources/qml/WorkspaceSummaryDialog.qml | 223 |
3 files changed, 258 insertions, 8 deletions
diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 8377241136..e78786c7a3 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -112,7 +112,17 @@ UM.MainWindow { id: saveWorkspaceMenu text: catalog.i18nc("@title:menu menubar:file","Save project") - onTriggered: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "file_type": "workspace" }); + onTriggered: + { + if(UM.Preferences.getValue("cura/dialog_on_project_save")) + { + saveWorkspaceDialog.open() + } + else + { + UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "file_type": "workspace" }) + } + } } MenuItem { action: Cura.Actions.reloadAll; } @@ -500,15 +510,18 @@ UM.MainWindow onVisibleChanged: { - if(!visible) - { - // When the dialog closes, switch to the General page. - // This prevents us from having a heavy page like Setting Visiblity active in the background. - setPage(0); - } + // When the dialog closes, switch to the General page. + // This prevents us from having a heavy page like Setting Visiblity active in the background. + setPage(0); } } + WorkspaceSummaryDialog + { + id: saveWorkspaceDialog + onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "file_type": "workspace" }) + } + Connections { target: Cura.Actions.preferences @@ -764,7 +777,7 @@ UM.MainWindow Connections { target: Cura.Actions.loadWorkspace - onTriggered:openWorkspaceDialog.open() + onTriggered: openWorkspaceDialog.open() } EngineLog diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index adbad802ef..eab5dbe938 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -304,6 +304,20 @@ UM.PreferencesPage } } + UM.TooltipArea { + width: childrenRect.width + height: childrenRect.height + text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") + + CheckBox + { + text: catalog.i18nc("@option:check", "Show summary dialog when saving project") + checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) + onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_project_save", checked) + } + } + + Item { //: Spacer diff --git a/resources/qml/WorkspaceSummaryDialog.qml b/resources/qml/WorkspaceSummaryDialog.qml new file mode 100644 index 0000000000..c8da87dc76 --- /dev/null +++ b/resources/qml/WorkspaceSummaryDialog.qml @@ -0,0 +1,223 @@ +// Copyright (c) 2016 Ultimaker B.V. +// Cura is released under the terms of the AGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 1.1 +import QtQuick.Layouts 1.1 +import QtQuick.Window 2.1 + +import UM 1.2 as UM +import Cura 1.0 as Cura + +UM.Dialog +{ + title: catalog.i18nc("@title:window", "Save Project") + + width: 550 + minimumWidth: 550 + maximumWidth: 550 + + height: 350 + minimumHeight: 350 + maximumHeight: 350 + property int spacerHeight: 10 + + property bool dontShowAgain: true + + signal yes(); + + + onClosing: + { + UM.Preferences.setValue("cura/asked_dialog_on_project_save", true) + UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked) + } + + onVisibleChanged: + { + if(visible) + { + if (UM.Preferences.getValue("cura/asked_dialog_on_project_save")) + { + dontShowAgain = true + } else { dontShowAgain = UM.Preferences.setValue("cura/dialog_on_project_save")} + } + } + + Item + { + anchors.fill: parent + UM.SettingDefinitionsModel + { + id: definitionsModel + containerId: Cura.MachineManager.activeDefinitionId + showAll: true + exclude: ["command_line_settings"] + showAncestors: true + expanded: ["*"] + visibilityHandler: UM.SettingPreferenceVisibilityHandler { } + } + UM.I18nCatalog + { + id: catalog; + name: "cura"; + } + + Column + { + anchors.fill: parent + spacing: 2 + Label + { + id: titleLabel + text: catalog.i18nc("@action:title", "Summary - Cura Project") + font.pixelSize: 22 + } + Rectangle + { + id: separator + color: "black" + width: parent.width + height: 1 + } + Item // Spacer + { + height: spacerHeight + width: height + } + + Label + { + text: catalog.i18nc("@action:label", "Printer settings") + font.bold: true + } + + Row + { + width: parent.width + height: childrenRect.height + Label + { + text: catalog.i18nc("@action:label", "Name") + width: parent.width / 3 + } + Label + { + text: Cura.MachineManager.activeMachineName + width: parent.width / 3 + } + + } + Item // Spacer + { + height: spacerHeight + width: height + } + + Label + { + text: catalog.i18nc("@action:label", "Profile settings") + font.bold: true + } + + Row + { + width: parent.width + height: childrenRect.height + Label + { + text: catalog.i18nc("@action:label", "Name") + width: parent.width / 3 + } + Label + { + text: Cura.MachineManager.activeQualityName + width: parent.width / 3 + } + + } + Item // Spacer + { + height: spacerHeight + width: height + } + + Label + { + text: catalog.i18nc("@action:label", "Material settings") + font.bold: true + } + + Repeater + { + model: Cura.MachineManager.activeMaterialNames + delegate: Row + { + width: parent.width + height: childrenRect.height + Label + { + text: catalog.i18nc("@action:label", "Name") + width: parent.width / 3 + } + Label + { + text: modelData + width: parent.width / 3 + } + } + } + + + Item // Spacer + { + height: spacerHeight + width: height + } + + Label + { + text: catalog.i18nc("@action:label", "Setting visibility") + font.bold: true + } + Row + { + width: parent.width + height: childrenRect.height + Label + { + text: catalog.i18nc("@action:label", "Visible settings:") + width: parent.width / 3 + } + Label + { + text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings) + width: parent.width / 3 + } + } + CheckBox + { + id: dontShowAgainCheckbox + text: catalog.i18nc("@action:label", "Don't show project summary on save again") + checked: dontShowAgain + } + } + } + rightButtons: [ + Button + { + id: cancel_button + text: catalog.i18nc("@action:button","Cancel"); + enabled: true + onClicked: close() + }, + Button + { + id: ok_button + text: catalog.i18nc("@action:button","Save"); + enabled: true + onClicked: { + close(); yes() } + } + ] +}
\ No newline at end of file |