mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:39:02 +08:00
Only show Welcome-Pages when needed. [CURA-6057]
This commit is contained in:
parent
0f116fa3f4
commit
4a95564277
@ -245,8 +245,6 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
self._update_platform_activity_timer = None
|
self._update_platform_activity_timer = None
|
||||||
|
|
||||||
self._need_to_show_user_agreement = True
|
|
||||||
|
|
||||||
self._sidebar_custom_menu_items = [] # type: list # Keeps list of custom menu items for the side bar
|
self._sidebar_custom_menu_items = [] # type: list # Keeps list of custom menu items for the side bar
|
||||||
|
|
||||||
self._plugins_loaded = False
|
self._plugins_loaded = False
|
||||||
@ -530,8 +528,6 @@ class CuraApplication(QtApplication):
|
|||||||
preferences.addPreference("cura/expanded_brands", "")
|
preferences.addPreference("cura/expanded_brands", "")
|
||||||
preferences.addPreference("cura/expanded_types", "")
|
preferences.addPreference("cura/expanded_types", "")
|
||||||
|
|
||||||
self._need_to_show_user_agreement = not preferences.getValue("general/accepted_user_agreement")
|
|
||||||
|
|
||||||
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",
|
||||||
@ -553,11 +549,11 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
@pyqtProperty(bool)
|
@pyqtProperty(bool)
|
||||||
def needToShowUserAgreement(self) -> bool:
|
def needToShowUserAgreement(self) -> bool:
|
||||||
return self._need_to_show_user_agreement
|
return not self.getPreferences().getValue("general/accepted_user_agreement")
|
||||||
|
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def setNeedToShowUserAgreement(self, set_value = True) -> None:
|
def setNeedToShowUserAgreement(self, set_value = True) -> None:
|
||||||
self._need_to_show_user_agreement = set_value
|
self.getPreferences().setValue("general/accepted_user_agreement", not set_value)
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str, str)
|
||||||
def writeToLog(self, severity: str, message: str) -> None:
|
def writeToLog(self, severity: str, message: str) -> None:
|
||||||
|
@ -45,7 +45,7 @@ UM.MainWindow
|
|||||||
WelcomeDialog
|
WelcomeDialog
|
||||||
{
|
{
|
||||||
id: welcomeDialog
|
id: welcomeDialog
|
||||||
visible: CuraApplication.needToShowUserAgreement
|
visible: true // True, so if somehow no preferences are found/loaded, it's shown anyway.
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
@ -83,6 +83,13 @@ UM.MainWindow
|
|||||||
// This has been fixed for QtQuick Controls 2 since the Shortcut item has a context property.
|
// This has been fixed for QtQuick Controls 2 since the Shortcut item has a context property.
|
||||||
Cura.Actions.parent = backgroundItem
|
Cura.Actions.parent = backgroundItem
|
||||||
CuraApplication.purgeWindows()
|
CuraApplication.purgeWindows()
|
||||||
|
|
||||||
|
if (CuraApplication.needToShowUserAgreement)
|
||||||
|
{
|
||||||
|
welcomeDialog.visible = true;
|
||||||
|
welcomeDialog.currentStep = 0;
|
||||||
|
welcomeDialog.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user