mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-03 15:05:09 +08:00
Show Add Machine dialog after User Agreement dialog is closed
CURA-4501
This commit is contained in:
parent
b5904cd239
commit
aab601927c
@ -300,6 +300,9 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
preferences.addPreference("view/invert_zoom", False)
|
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 [
|
for key in [
|
||||||
"dialog_load_path", # dialog_save_path is in LocalFileOutputDevicePlugin
|
"dialog_load_path", # dialog_save_path is in LocalFileOutputDevicePlugin
|
||||||
"dialog_profile_path",
|
"dialog_profile_path",
|
||||||
@ -372,6 +375,22 @@ class CuraApplication(QtApplication):
|
|||||||
def _onEngineCreated(self):
|
def _onEngineCreated(self):
|
||||||
self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider())
|
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()
|
||||||
|
|
||||||
## The "Quit" button click event handler.
|
## The "Quit" button click event handler.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def closeApplication(self):
|
def closeApplication(self):
|
||||||
|
@ -42,7 +42,7 @@ class UserAgreement(QObject, Extension):
|
|||||||
Logger.log("i", "User did NOT agree to the user agreement")
|
Logger.log("i", "User did NOT agree to the user agreement")
|
||||||
Preferences.getInstance().setValue("general/accepted_user_agreement", False)
|
Preferences.getInstance().setValue("general/accepted_user_agreement", False)
|
||||||
CuraApplication.getInstance().quit()
|
CuraApplication.getInstance().quit()
|
||||||
|
CuraApplication.getInstance().setHasShownUserAgreement(True)
|
||||||
|
|
||||||
def createUserAgreementWindow(self):
|
def createUserAgreementWindow(self):
|
||||||
path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath(self.getPluginId()), "UserAgreement.qml"))
|
path = QUrl.fromLocalFile(os.path.join(PluginRegistry.getInstance().getPluginPath(self.getPluginId()), "UserAgreement.qml"))
|
||||||
|
@ -894,6 +894,11 @@ UM.MainWindow
|
|||||||
if(!base.visible)
|
if(!base.visible)
|
||||||
{
|
{
|
||||||
base.visible = true;
|
base.visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check later if the user agreement dialog has been closed
|
||||||
|
if (CuraApplication.needToShowUserAgreement && !CuraApplication.hasUserAgreementShown)
|
||||||
|
{
|
||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
else if(Cura.MachineManager.activeMachineId == null || Cura.MachineManager.activeMachineId == "")
|
else if(Cura.MachineManager.activeMachineId == null || Cura.MachineManager.activeMachineId == "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user