From 3cbf0640a512b0b3742bbf64fb27eb177554f189 Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Wed, 2 Aug 2017 16:32:09 +0200 Subject: [PATCH] Added method to close the application (after clicking quit button) to prevent loss of custom material CURA-3298 --- cura/CuraApplication.py | 6 ++++++ resources/qml/Cura.qml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 49c036f1ce..96b2f4b01c 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -367,6 +367,12 @@ class CuraApplication(QtApplication): def _onEngineCreated(self): self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider()) + ## The "Quit" button click event handler. + @pyqtSlot() + def closeApplication(self): + Logger.log("i", "Close application") + self._main_window.close() + ## A reusable dialogbox # showMessageBox = pyqtSignal(str, str, str, str, int, int, arguments = ["title", "text", "informativeText", "detailedText", "buttons", "icon"]) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 2c76bb0914..3aaf63a2fd 100755 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -632,7 +632,7 @@ UM.MainWindow Connections { target: Cura.Actions.quit - onTriggered: base.visible = false; + onTriggered: CuraApplication.closeApplication(); } Connections