mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Simplified version for validation need to show user agreement
CURA-4501
This commit is contained in:
parent
c0f1af94ab
commit
22aaf64b63
3 changed files with 4 additions and 13 deletions
|
@ -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()
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue