Added method to close the application (after clicking quit button) to prevent loss of custom material

CURA-3298
This commit is contained in:
alekseisasin 2017-08-02 16:32:09 +02:00 committed by Lipu Fei
parent c010f3203c
commit 3cbf0640a5
2 changed files with 7 additions and 1 deletions

View File

@ -367,6 +367,12 @@ class CuraApplication(QtApplication):
def _onEngineCreated(self): def _onEngineCreated(self):
self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider()) 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 ## A reusable dialogbox
# #
showMessageBox = pyqtSignal(str, str, str, str, int, int, arguments = ["title", "text", "informativeText", "detailedText", "buttons", "icon"]) showMessageBox = pyqtSignal(str, str, str, str, int, int, arguments = ["title", "text", "informativeText", "detailedText", "buttons", "icon"])

View File

@ -632,7 +632,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.quit target: Cura.Actions.quit
onTriggered: base.visible = false; onTriggered: CuraApplication.closeApplication();
} }
Connections Connections