Simplified version for validation need to show user agreement

CURA-4501
This commit is contained in:
Aleksei S 2017-10-30 14:42:46 +01:00
parent c0f1af94ab
commit 22aaf64b63
3 changed files with 4 additions and 13 deletions

View file

@ -306,7 +306,6 @@ class CuraApplication(QtApplication):
preferences.addPreference("view/invert_zoom", False)
self._need_to_show_user_agreement = not Preferences.getInstance().getValue("general/accepted_user_agreement")
self._has_user_agreement_shown = False
for key in [
"dialog_load_path", # dialog_save_path is in LocalFileOutputDevicePlugin
@ -380,21 +379,13 @@ class CuraApplication(QtApplication):
def _onEngineCreated(self):
self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider())
onHasUserAgreementShownChanged = pyqtSignal()
@pyqtProperty(bool)
def needToShowUserAgreement(self):
return self._need_to_show_user_agreement
@pyqtProperty(bool, notify = onHasUserAgreementShownChanged)
def hasUserAgreementShown(self):
return self._has_user_agreement_shown
def setHasShownUserAgreement(self, shown = True):
emit_signal = self._has_user_agreement_shown != shown
self._has_user_agreement_shown = shown
if emit_signal:
self.onHasUserAgreementShownChanged.emit()
def setNeedToShowUserAgreement(self, set_value = True):
self._need_to_show_user_agreement = set_value
## The "Quit" button click event handler.
@pyqtSlot()

View file

@ -42,7 +42,7 @@ class UserAgreement(QObject, Extension):
Logger.log("i", "User did NOT agree to the user agreement")
Preferences.getInstance().setValue("general/accepted_user_agreement", False)
CuraApplication.getInstance().quit()
CuraApplication.getInstance().setHasShownUserAgreement(True)
CuraApplication.getInstance().setNeedToShowUserAgreement(False)
def createUserAgreementWindow(self):
path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath(self.getPluginId()), "UserAgreement.qml"))

View file

@ -897,7 +897,7 @@ UM.MainWindow
}
// check later if the user agreement dialog has been closed
if (CuraApplication.needToShowUserAgreement && !CuraApplication.hasUserAgreementShown)
if (CuraApplication.needToShowUserAgreement)
{
restart();
}