mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-22 21:59:37 +08:00
Replace old User-Agreement-page with new Welcome-Pages. [CURA-6057]
This commit is contained in:
parent
2693eecd33
commit
0f116fa3f4
@ -555,11 +555,18 @@ class CuraApplication(QtApplication):
|
||||
def needToShowUserAgreement(self) -> bool:
|
||||
return self._need_to_show_user_agreement
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def setNeedToShowUserAgreement(self, set_value = True) -> None:
|
||||
self._need_to_show_user_agreement = set_value
|
||||
|
||||
@pyqtSlot(str, str)
|
||||
def writeToLog(self, severity: str, message: str) -> None:
|
||||
Logger.log(severity, message)
|
||||
|
||||
# DO NOT call this function to close the application, use checkAndExitApplication() instead which will perform
|
||||
# pre-exit checks such as checking for in-progress USB printing, etc.
|
||||
# Except for the 'Decline and close' in the 'User Agreement'-step in the Welcome-pages, that should be a hard exit.
|
||||
@pyqtSlot()
|
||||
def closeApplication(self) -> None:
|
||||
Logger.log("i", "Close application")
|
||||
main_window = self.getMainWindow()
|
||||
|
@ -24,10 +24,11 @@ class UserAgreement(QObject, Extension):
|
||||
self.showUserAgreement()
|
||||
|
||||
def showUserAgreement(self):
|
||||
if not self._user_agreement_window:
|
||||
self.createUserAgreementWindow()
|
||||
|
||||
self._user_agreement_window.show()
|
||||
# if not self._user_agreement_window:
|
||||
# self.createUserAgreementWindow()
|
||||
#
|
||||
# self._user_agreement_window.show()
|
||||
pass
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def didAgree(self, user_choice):
|
||||
|
@ -45,7 +45,7 @@ UM.MainWindow
|
||||
WelcomeDialog
|
||||
{
|
||||
id: welcomeDialog
|
||||
visible: false
|
||||
visible: CuraApplication.needToShowUserAgreement
|
||||
}
|
||||
|
||||
Rectangle
|
||||
|
@ -62,7 +62,12 @@ Item
|
||||
text: catalog.i18nc("@button", "Agree")
|
||||
width: 140
|
||||
fixedWidthMode: true
|
||||
onClicked: base.showNextPage()
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.writeToLog("i", "User accepted the User-Agreement.")
|
||||
CuraApplication.setNeedToShowUserAgreement(false)
|
||||
base.showNextPage()
|
||||
}
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
@ -74,6 +79,11 @@ Item
|
||||
text: catalog.i18nc("@button", "Decline and close")
|
||||
width: 140
|
||||
fixedWidthMode: true
|
||||
onClicked: base.showNextPage() // TODO: quit
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.writeToLog("i", "User declined the User Agreement.")
|
||||
base.passLastPage()
|
||||
CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user