mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Remove setting visibility for Ucp
show settings expanded by default CURA-11403
This commit is contained in:
parent
db88a48982
commit
f67d2ed5fe
@ -212,6 +212,11 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
return global_stack_file_list[0], extruder_stack_file_list
|
||||
|
||||
def preRead(self, file_name, show_dialog=True, *args, **kwargs):
|
||||
result = self._preRead(file_name, show_dialog)
|
||||
self._is_ucp = False
|
||||
return result
|
||||
|
||||
def _preRead(self, file_name, show_dialog=True):
|
||||
"""Read some info so we can make decisions
|
||||
|
||||
:param file_name:
|
||||
@ -662,8 +667,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
self._dialog.setVariantType(variant_type_name)
|
||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().platformActivity)
|
||||
self._dialog.setMissingPackagesMetadata(missing_package_metadata)
|
||||
self._dialog.setHasVisibleSelectSameProfileChanged(self._is_ucp)
|
||||
self._dialog.setAllowCreatemachine(not self._is_ucp)
|
||||
self._dialog.setIsUcp(self._is_ucp)
|
||||
self._dialog.show()
|
||||
|
||||
|
||||
@ -721,7 +726,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
if key not in containers_found_dict or strategy is not None:
|
||||
continue
|
||||
self._resolve_strategies[key] = "override" if containers_found_dict[key] else "new"
|
||||
self._is_ucp = False
|
||||
return WorkspaceReader.PreReadResult.accepted
|
||||
|
||||
@call_on_qt_thread
|
||||
|
@ -74,10 +74,10 @@ class WorkspaceDialog(QObject):
|
||||
self._is_abstract_machine = False
|
||||
self._is_networked_machine = False
|
||||
self._is_compatible_machine = False
|
||||
self._has_visible_select_same_profile = False
|
||||
self._select_same_profile_checked = True
|
||||
self._allow_create_machine = True
|
||||
self._exported_settings_model = SpecificSettingsModel()
|
||||
self._is_ucp = False
|
||||
|
||||
machineConflictChanged = pyqtSignal()
|
||||
qualityChangesConflictChanged = pyqtSignal()
|
||||
@ -102,7 +102,7 @@ class WorkspaceDialog(QObject):
|
||||
isPrinterGroupChanged = pyqtSignal()
|
||||
missingPackagesChanged = pyqtSignal()
|
||||
isCompatibleMachineChanged = pyqtSignal()
|
||||
hasVisibleSelectSameProfileChanged = pyqtSignal()
|
||||
isUcpChanged = pyqtSignal()
|
||||
selectSameProfileCheckedChanged = pyqtSignal()
|
||||
|
||||
@pyqtProperty(bool, notify = isPrinterGroupChanged)
|
||||
@ -318,14 +318,14 @@ class WorkspaceDialog(QObject):
|
||||
def isCompatibleMachine(self) -> bool:
|
||||
return self._is_compatible_machine
|
||||
|
||||
def setHasVisibleSelectSameProfileChanged(self, has_visible_select_same_profile):
|
||||
if has_visible_select_same_profile != self._has_visible_select_same_profile:
|
||||
self._has_visible_select_same_profile = has_visible_select_same_profile
|
||||
self.hasVisibleSelectSameProfileChanged.emit()
|
||||
def setIsUcp(self, isUcp: bool) -> None:
|
||||
if isUcp != self._is_ucp:
|
||||
self._is_ucp = isUcp
|
||||
self.isUcpChanged.emit()
|
||||
|
||||
@pyqtProperty(bool, notify = hasVisibleSelectSameProfileChanged)
|
||||
def hasVisibleSelectSameProfile(self):
|
||||
return self._has_visible_select_same_profile
|
||||
@pyqtProperty(bool, notify=isUcpChanged)
|
||||
def isUcp(self):
|
||||
return self._is_ucp
|
||||
|
||||
def setSelectSameProfileChecked(self, select_same_profile_checked):
|
||||
if select_same_profile_checked != self._select_same_profile_checked:
|
||||
|
@ -185,14 +185,14 @@ UM.Dialog
|
||||
{
|
||||
leftLabelText: catalog.i18nc("@action:label", "Not in profile")
|
||||
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
|
||||
visible: manager.numUserSettings != 0 && manager.selectSameProfileChecked && manager.isCompatibleMachine
|
||||
visible: manager.numUserSettings != 0 && manager.isCompatibleMachine
|
||||
}
|
||||
|
||||
WorkspaceRow
|
||||
{
|
||||
leftLabelText: catalog.i18nc("@action:label", "Derivative from")
|
||||
rightLabelText: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
|
||||
visible: manager.numSettingsOverridenByQualityChanges != 0 && manager.selectSameProfileChecked && manager.isCompatibleMachine
|
||||
visible: manager.numSettingsOverridenByQualityChanges != 0 && manager.isCompatibleMachine
|
||||
}
|
||||
|
||||
WorkspaceRow
|
||||
@ -200,7 +200,7 @@ UM.Dialog
|
||||
leftLabelText: catalog.i18nc("@action:label", "Specific settings")
|
||||
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.exportedSettingModel.rowCount()).arg(manager.exportedSettingModel.rowCount())
|
||||
buttonText: tableViewSpecificSettings.shouldBeVisible ? catalog.i18nc("@action:button", "Hide settings") : catalog.i18nc("@action:button", "Show settings")
|
||||
visible: !manager.selectSameProfileChecked || !manager.isCompatibleMachine
|
||||
visible: manager.isUcp
|
||||
onButtonClicked: tableViewSpecificSettings.shouldBeVisible = !tableViewSpecificSettings.shouldBeVisible
|
||||
}
|
||||
|
||||
@ -209,8 +209,8 @@ UM.Dialog
|
||||
id: tableViewSpecificSettings
|
||||
width: parent.width - parent.leftPadding - UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("card").height
|
||||
visible: shouldBeVisible && (!manager.selectSameProfileChecked || !manager.isCompatibleMachine)
|
||||
property bool shouldBeVisible: false
|
||||
visible: shouldBeVisible && manager.isUcp
|
||||
property bool shouldBeVisible: true
|
||||
|
||||
columnHeaders:
|
||||
[
|
||||
@ -232,7 +232,7 @@ UM.Dialog
|
||||
text: catalog.i18nc("@action:checkbox", "Select the same profile")
|
||||
onEnabledChanged: manager.selectSameProfileChecked = enabled
|
||||
tooltip: enabled ? "" : catalog.i18nc("@tooltip", "You can use the same profile only if you have the same printer as the project was published with")
|
||||
visible: manager.hasVisibleSelectSameProfile && manager.isCompatibleMachine
|
||||
visible: manager.isUcp
|
||||
|
||||
checked: manager.selectSameProfileChecked
|
||||
onCheckedChanged: manager.selectSameProfileChecked = checked
|
||||
@ -330,6 +330,7 @@ UM.Dialog
|
||||
id: visibilitySection
|
||||
title: catalog.i18nc("@action:label", "Setting visibility")
|
||||
iconSource: UM.Theme.getIcon("Eye")
|
||||
visible : !manager.isUcp
|
||||
content: Column
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
Loading…
x
Reference in New Issue
Block a user