mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 13:34:01 -06:00
Show welcome page if no printer
This commit is contained in:
parent
6843fb1ffb
commit
1dd48c5728
2 changed files with 7 additions and 6 deletions
|
@ -38,6 +38,7 @@ from UM.Settings.Validator import Validator
|
|||
from UM.Message import Message
|
||||
from UM.i18n import i18nCatalog
|
||||
from UM.Workspace.WorkspaceReader import WorkspaceReader
|
||||
import UM.Util
|
||||
|
||||
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
|
||||
from UM.Operations.GroupedOperation import GroupedOperation
|
||||
|
@ -548,11 +549,11 @@ class CuraApplication(QtApplication):
|
|||
|
||||
@pyqtProperty(bool)
|
||||
def needToShowUserAgreement(self) -> bool:
|
||||
return not self.getPreferences().getValue("general/accepted_user_agreement")
|
||||
return not UM.Util.parseBool(self.getPreferences().getValue("general/accepted_user_agreement"))
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def setNeedToShowUserAgreement(self, set_value = True) -> None:
|
||||
self.getPreferences().setValue("general/accepted_user_agreement", not set_value)
|
||||
def setNeedToShowUserAgreement(self, set_value: bool = True) -> None:
|
||||
self.getPreferences().setValue("general/accepted_user_agreement", str(not set_value))
|
||||
|
||||
@pyqtSlot(str, str)
|
||||
def writeToLog(self, severity: str, message: str) -> None:
|
||||
|
|
|
@ -74,13 +74,13 @@ UM.MainWindow
|
|||
Cura.Actions.parent = backgroundItem
|
||||
CuraApplication.purgeWindows()
|
||||
|
||||
if (CuraApplication.needToShowUserAgreement)
|
||||
if (CuraApplication.needToShowUserAgreement || Cura.MachineManager.activeMachine == null)
|
||||
{
|
||||
welcomeDialog.show()
|
||||
welcomeDialog.visible = true
|
||||
}
|
||||
else
|
||||
{
|
||||
welcomeDialog.close()
|
||||
welcomeDialog.visible = false
|
||||
}
|
||||
// TODO: While the new onboarding process contains the user-agreement,
|
||||
// it should probably not entirely rely on 'needToShowUserAgreement' for show/hide.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue