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
|
return global_stack_file_list[0], extruder_stack_file_list
|
||||||
|
|
||||||
def preRead(self, file_name, show_dialog=True, *args, **kwargs):
|
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
|
"""Read some info so we can make decisions
|
||||||
|
|
||||||
:param file_name:
|
:param file_name:
|
||||||
@ -662,8 +667,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
self._dialog.setVariantType(variant_type_name)
|
self._dialog.setVariantType(variant_type_name)
|
||||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().platformActivity)
|
self._dialog.setHasObjectsOnPlate(Application.getInstance().platformActivity)
|
||||||
self._dialog.setMissingPackagesMetadata(missing_package_metadata)
|
self._dialog.setMissingPackagesMetadata(missing_package_metadata)
|
||||||
self._dialog.setHasVisibleSelectSameProfileChanged(self._is_ucp)
|
|
||||||
self._dialog.setAllowCreatemachine(not self._is_ucp)
|
self._dialog.setAllowCreatemachine(not self._is_ucp)
|
||||||
|
self._dialog.setIsUcp(self._is_ucp)
|
||||||
self._dialog.show()
|
self._dialog.show()
|
||||||
|
|
||||||
|
|
||||||
@ -721,7 +726,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
if key not in containers_found_dict or strategy is not None:
|
if key not in containers_found_dict or strategy is not None:
|
||||||
continue
|
continue
|
||||||
self._resolve_strategies[key] = "override" if containers_found_dict[key] else "new"
|
self._resolve_strategies[key] = "override" if containers_found_dict[key] else "new"
|
||||||
self._is_ucp = False
|
|
||||||
return WorkspaceReader.PreReadResult.accepted
|
return WorkspaceReader.PreReadResult.accepted
|
||||||
|
|
||||||
@call_on_qt_thread
|
@call_on_qt_thread
|
||||||
|
@ -74,10 +74,10 @@ class WorkspaceDialog(QObject):
|
|||||||
self._is_abstract_machine = False
|
self._is_abstract_machine = False
|
||||||
self._is_networked_machine = False
|
self._is_networked_machine = False
|
||||||
self._is_compatible_machine = False
|
self._is_compatible_machine = False
|
||||||
self._has_visible_select_same_profile = False
|
|
||||||
self._select_same_profile_checked = True
|
self._select_same_profile_checked = True
|
||||||
self._allow_create_machine = True
|
self._allow_create_machine = True
|
||||||
self._exported_settings_model = SpecificSettingsModel()
|
self._exported_settings_model = SpecificSettingsModel()
|
||||||
|
self._is_ucp = False
|
||||||
|
|
||||||
machineConflictChanged = pyqtSignal()
|
machineConflictChanged = pyqtSignal()
|
||||||
qualityChangesConflictChanged = pyqtSignal()
|
qualityChangesConflictChanged = pyqtSignal()
|
||||||
@ -102,7 +102,7 @@ class WorkspaceDialog(QObject):
|
|||||||
isPrinterGroupChanged = pyqtSignal()
|
isPrinterGroupChanged = pyqtSignal()
|
||||||
missingPackagesChanged = pyqtSignal()
|
missingPackagesChanged = pyqtSignal()
|
||||||
isCompatibleMachineChanged = pyqtSignal()
|
isCompatibleMachineChanged = pyqtSignal()
|
||||||
hasVisibleSelectSameProfileChanged = pyqtSignal()
|
isUcpChanged = pyqtSignal()
|
||||||
selectSameProfileCheckedChanged = pyqtSignal()
|
selectSameProfileCheckedChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = isPrinterGroupChanged)
|
@pyqtProperty(bool, notify = isPrinterGroupChanged)
|
||||||
@ -318,14 +318,14 @@ class WorkspaceDialog(QObject):
|
|||||||
def isCompatibleMachine(self) -> bool:
|
def isCompatibleMachine(self) -> bool:
|
||||||
return self._is_compatible_machine
|
return self._is_compatible_machine
|
||||||
|
|
||||||
def setHasVisibleSelectSameProfileChanged(self, has_visible_select_same_profile):
|
def setIsUcp(self, isUcp: bool) -> None:
|
||||||
if has_visible_select_same_profile != self._has_visible_select_same_profile:
|
if isUcp != self._is_ucp:
|
||||||
self._has_visible_select_same_profile = has_visible_select_same_profile
|
self._is_ucp = isUcp
|
||||||
self.hasVisibleSelectSameProfileChanged.emit()
|
self.isUcpChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = hasVisibleSelectSameProfileChanged)
|
@pyqtProperty(bool, notify=isUcpChanged)
|
||||||
def hasVisibleSelectSameProfile(self):
|
def isUcp(self):
|
||||||
return self._has_visible_select_same_profile
|
return self._is_ucp
|
||||||
|
|
||||||
def setSelectSameProfileChecked(self, select_same_profile_checked):
|
def setSelectSameProfileChecked(self, select_same_profile_checked):
|
||||||
if select_same_profile_checked != 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")
|
leftLabelText: catalog.i18nc("@action:label", "Not in profile")
|
||||||
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
|
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
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
leftLabelText: catalog.i18nc("@action:label", "Derivative from")
|
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)
|
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
|
WorkspaceRow
|
||||||
@ -200,7 +200,7 @@ UM.Dialog
|
|||||||
leftLabelText: catalog.i18nc("@action:label", "Specific settings")
|
leftLabelText: catalog.i18nc("@action:label", "Specific settings")
|
||||||
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.exportedSettingModel.rowCount()).arg(manager.exportedSettingModel.rowCount())
|
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")
|
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
|
onButtonClicked: tableViewSpecificSettings.shouldBeVisible = !tableViewSpecificSettings.shouldBeVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,8 +209,8 @@ UM.Dialog
|
|||||||
id: tableViewSpecificSettings
|
id: tableViewSpecificSettings
|
||||||
width: parent.width - parent.leftPadding - UM.Theme.getSize("default_margin").width
|
width: parent.width - parent.leftPadding - UM.Theme.getSize("default_margin").width
|
||||||
height: UM.Theme.getSize("card").height
|
height: UM.Theme.getSize("card").height
|
||||||
visible: shouldBeVisible && (!manager.selectSameProfileChecked || !manager.isCompatibleMachine)
|
visible: shouldBeVisible && manager.isUcp
|
||||||
property bool shouldBeVisible: false
|
property bool shouldBeVisible: true
|
||||||
|
|
||||||
columnHeaders:
|
columnHeaders:
|
||||||
[
|
[
|
||||||
@ -232,7 +232,7 @@ UM.Dialog
|
|||||||
text: catalog.i18nc("@action:checkbox", "Select the same profile")
|
text: catalog.i18nc("@action:checkbox", "Select the same profile")
|
||||||
onEnabledChanged: manager.selectSameProfileChecked = enabled
|
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")
|
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
|
checked: manager.selectSameProfileChecked
|
||||||
onCheckedChanged: manager.selectSameProfileChecked = checked
|
onCheckedChanged: manager.selectSameProfileChecked = checked
|
||||||
@ -330,6 +330,7 @@ UM.Dialog
|
|||||||
id: visibilitySection
|
id: visibilitySection
|
||||||
title: catalog.i18nc("@action:label", "Setting visibility")
|
title: catalog.i18nc("@action:label", "Setting visibility")
|
||||||
iconSource: UM.Theme.getIcon("Eye")
|
iconSource: UM.Theme.getIcon("Eye")
|
||||||
|
visible : !manager.isUcp
|
||||||
content: Column
|
content: Column
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
|
Loading…
x
Reference in New Issue
Block a user