Hide the backup window when the application is shutting down

CURA-8313
This commit is contained in:
Konstantinos Karmas 2021-06-22 16:31:37 +02:00
parent b1ee6d3d22
commit 51de50cd05

View file

@ -52,6 +52,7 @@ class DrivePluginExtension(QObject, Extension):
# Attach signals. # Attach signals.
CuraApplication.getInstance().getCuraAPI().account.loginStateChanged.connect(self._onLoginStateChanged) CuraApplication.getInstance().getCuraAPI().account.loginStateChanged.connect(self._onLoginStateChanged)
CuraApplication.getInstance().applicationShuttingDown.connect(self._onApplicationShuttingDown)
self._drive_api_service.restoringStateChanged.connect(self._onRestoringStateChanged) self._drive_api_service.restoringStateChanged.connect(self._onRestoringStateChanged)
self._drive_api_service.creatingStateChanged.connect(self._onCreatingStateChanged) self._drive_api_service.creatingStateChanged.connect(self._onCreatingStateChanged)
@ -75,6 +76,9 @@ class DrivePluginExtension(QObject, Extension):
if self._drive_window: if self._drive_window:
self._drive_window.show() self._drive_window.show()
def _onApplicationShuttingDown(self):
self._drive_window.hide()
def _autoBackup(self) -> None: def _autoBackup(self) -> None:
preferences = CuraApplication.getInstance().getPreferences() preferences = CuraApplication.getInstance().getPreferences()
if preferences.getValue(Settings.AUTO_BACKUP_ENABLED_PREFERENCE_KEY) and self._isLastBackupTooLongAgo(): if preferences.getValue(Settings.AUTO_BACKUP_ENABLED_PREFERENCE_KEY) and self._isLastBackupTooLongAgo():