mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-28 21:31:15 -07:00
Added notification icon in recomended mode. The notification icon is only
active if one of custom settings is changed CURA-4333
This commit is contained in:
parent
2cdec7e47f
commit
b318dc7087
3 changed files with 126 additions and 0 deletions
|
|
@ -400,6 +400,8 @@ class CuraApplication(QtApplication):
|
|||
# ALWAYS ask whether to keep or discard the profile
|
||||
self.showDiscardOrKeepProfileChanges.emit()
|
||||
|
||||
sidebarSimpleDiscardOrKeepProfileChanges = pyqtSignal()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def discardOrKeepProfileChangesClosed(self, option):
|
||||
if option == "discard":
|
||||
|
|
@ -409,6 +411,10 @@ class CuraApplication(QtApplication):
|
|||
|
||||
global_stack.getTop().clear()
|
||||
|
||||
#event handler for SidebarSimple, which will update sliders view visibility (like:sliders..)
|
||||
if Preferences.getInstance().getValue("cura/active_mode") == 0:
|
||||
self.sidebarSimpleDiscardOrKeepProfileChanges.emit()
|
||||
|
||||
@pyqtSlot(int)
|
||||
def messageBoxClosed(self, button):
|
||||
if self._message_box_callback:
|
||||
|
|
|
|||
|
|
@ -413,6 +413,42 @@ class MachineManager(QObject):
|
|||
|
||||
return False
|
||||
|
||||
## Check whether user containers have adjusted settings or not
|
||||
# \param skip_keys \type{list} List of setting keys which will be not taken into account ("support_enable" , "infill_sparse_density"...)
|
||||
# \return \type{boole} Return true if user containers have any of adjusted settings
|
||||
@pyqtSlot("QVariantList", result = bool)
|
||||
def hasUserCustomSettings(self, skip_keys = []) -> bool:
|
||||
|
||||
user_setting_keys = []
|
||||
try:
|
||||
if not self._global_container_stack:
|
||||
return False
|
||||
|
||||
allContainers = self._global_container_stack.getContainers()
|
||||
|
||||
for container in allContainers:
|
||||
meta = container.getMetaData()
|
||||
if meta and meta["type"] and meta["type"] == "user":
|
||||
user_setting_keys.extend(container.getAllKeys())
|
||||
|
||||
stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
||||
for stack in stacks:
|
||||
|
||||
for container in stack.getContainers():
|
||||
meta = container.getMetaData()
|
||||
if meta and meta["type"] and meta["type"] == "user":
|
||||
user_setting_keys.extend(container.getAllKeys())
|
||||
|
||||
for skip_key in skip_keys:
|
||||
if skip_key in user_setting_keys:
|
||||
user_setting_keys.remove(skip_key)
|
||||
|
||||
except:
|
||||
Logger.log("e", "While checking user custom settings occured error. skip_keys: %s", skip_keys )
|
||||
return False
|
||||
|
||||
return len(user_setting_keys) > 0
|
||||
|
||||
@pyqtProperty(int, notify = activeStackValueChanged)
|
||||
def numUserSettings(self) -> int:
|
||||
if not self._global_container_stack:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue