mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
d0925d6790
9 changed files with 54 additions and 15 deletions
|
@ -19,6 +19,7 @@ class AutoSave:
|
|||
self._change_timer.setInterval(self._application.getPreferences().getValue("cura/autosave_delay"))
|
||||
self._change_timer.setSingleShot(True)
|
||||
|
||||
self._enabled = True
|
||||
self._saving = False
|
||||
|
||||
def initialize(self):
|
||||
|
@ -32,6 +33,13 @@ class AutoSave:
|
|||
if not self._saving:
|
||||
self._change_timer.start()
|
||||
|
||||
def setEnabled(self, enabled: bool) -> None:
|
||||
self._enabled = enabled
|
||||
if self._enabled:
|
||||
self._change_timer.start()
|
||||
else:
|
||||
self._change_timer.stop()
|
||||
|
||||
def _onGlobalStackChanged(self):
|
||||
if self._global_stack:
|
||||
self._global_stack.propertyChanged.disconnect(self._triggerTimer)
|
||||
|
|
|
@ -51,8 +51,8 @@ class BackupsManager:
|
|||
## Here we try to disable the auto-save plug-in as it might interfere with
|
||||
# restoring a back-up.
|
||||
def _disableAutoSave(self) -> None:
|
||||
self._application.setSaveDataEnabled(False)
|
||||
self._application.getAutoSave().setEnabled(False)
|
||||
|
||||
## Re-enable auto-save after we're done.
|
||||
def _enableAutoSave(self) -> None:
|
||||
self._application.setSaveDataEnabled(True)
|
||||
self._application.getAutoSave().setEnabled(True)
|
||||
|
|
|
@ -258,7 +258,6 @@ class CuraApplication(QtApplication):
|
|||
|
||||
# Backups
|
||||
self._auto_save = None
|
||||
self._save_data_enabled = True
|
||||
|
||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||
self._container_registry_class = CuraContainerRegistry
|
||||
|
@ -669,12 +668,9 @@ class CuraApplication(QtApplication):
|
|||
self._message_box_callback = None
|
||||
self._message_box_callback_arguments = []
|
||||
|
||||
def setSaveDataEnabled(self, enabled: bool) -> None:
|
||||
self._save_data_enabled = enabled
|
||||
|
||||
# Cura has multiple locations where instance containers need to be saved, so we need to handle this differently.
|
||||
def saveSettings(self):
|
||||
if not self.started or not self._save_data_enabled:
|
||||
if not self.started:
|
||||
# Do not do saving during application start or when data should not be saved on quit.
|
||||
return
|
||||
ContainerRegistry.getInstance().saveDirtyContainers()
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
from PyQt5.QtCore import pyqtProperty, QUrl
|
||||
|
||||
from UM.Resources import Resources
|
||||
from UM.View.View import View
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
|
||||
# Since Cura has a few pre-defined "space claims" for the locations of certain components, we've provided some structure
|
||||
# to indicate this.
|
||||
|
@ -12,13 +15,20 @@ from UM.View.View import View
|
|||
# the stageMenuComponent returns an item that should be used somehwere in the stage menu. It's up to the active stage
|
||||
# to actually do something with this.
|
||||
class CuraView(View):
|
||||
def __init__(self, parent = None) -> None:
|
||||
def __init__(self, parent = None, use_empty_menu_placeholder: bool = False) -> None:
|
||||
super().__init__(parent)
|
||||
|
||||
self._empty_menu_placeholder_url = QUrl(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles,
|
||||
"EmptyViewMenuComponent.qml"))
|
||||
self._use_empty_menu_placeholder = use_empty_menu_placeholder
|
||||
|
||||
@pyqtProperty(QUrl, constant = True)
|
||||
def mainComponent(self) -> QUrl:
|
||||
return self.getDisplayComponent("main")
|
||||
|
||||
@pyqtProperty(QUrl, constant = True)
|
||||
def stageMenuComponent(self) -> QUrl:
|
||||
return self.getDisplayComponent("menu")
|
||||
url = self.getDisplayComponent("menu")
|
||||
if not url.toString() and self._use_empty_menu_placeholder:
|
||||
url = self._empty_menu_placeholder_url
|
||||
return url
|
||||
|
|
|
@ -10,21 +10,21 @@ from UM.Math.Color import Color
|
|||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Platform import Platform
|
||||
from UM.Event import Event
|
||||
from UM.View.View import View
|
||||
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
|
||||
|
||||
from UM.View.RenderBatch import RenderBatch
|
||||
from UM.View.GL.OpenGL import OpenGL
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.CuraView import CuraView
|
||||
from cura.Scene.ConvexHullNode import ConvexHullNode
|
||||
|
||||
from . import XRayPass
|
||||
|
||||
## View used to display a see-through version of objects with errors highlighted.
|
||||
class XRayView(View):
|
||||
class XRayView(CuraView):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
super().__init__(parent = None, use_empty_menu_placeholder = True)
|
||||
|
||||
self._xray_shader = None
|
||||
self._xray_pass = None
|
||||
|
|
|
@ -523,7 +523,7 @@
|
|||
"description": "The maximum speed for the motor of the X-direction.",
|
||||
"unit": "mm/s",
|
||||
"type": "float",
|
||||
"default_value": 500,
|
||||
"default_value": 299792458000,
|
||||
"settable_per_mesh": false,
|
||||
"settable_per_extruder": false,
|
||||
"settable_per_meshgroup": false
|
||||
|
@ -534,7 +534,7 @@
|
|||
"description": "The maximum speed for the motor of the Y-direction.",
|
||||
"unit": "mm/s",
|
||||
"type": "float",
|
||||
"default_value": 500,
|
||||
"default_value": 299792458000,
|
||||
"settable_per_mesh": false,
|
||||
"settable_per_extruder": false,
|
||||
"settable_per_meshgroup": false
|
||||
|
@ -545,7 +545,7 @@
|
|||
"description": "The maximum speed for the motor of the Z-direction.",
|
||||
"unit": "mm/s",
|
||||
"type": "float",
|
||||
"default_value": 5,
|
||||
"default_value": 299792458000,
|
||||
"settable_per_mesh": false,
|
||||
"settable_per_extruder": false,
|
||||
"settable_per_meshgroup": false
|
||||
|
@ -3527,6 +3527,20 @@
|
|||
"enabled": "retraction_hop_enabled and extruders_enabled_count > 1",
|
||||
"settable_per_mesh": false,
|
||||
"settable_per_extruder": true
|
||||
},
|
||||
"retraction_hop_after_extruder_switch_height":
|
||||
{
|
||||
"label": "Z Hop After Extruder Switch Height",
|
||||
"description": "The height difference when performing a Z Hop after extruder switch.",
|
||||
"unit": "mm",
|
||||
"type": "float",
|
||||
"default_value": 1,
|
||||
"value": "retraction_hop",
|
||||
"minimum_value_warning": "0",
|
||||
"maximum_value_warning": "10",
|
||||
"enabled": "retraction_enable and retraction_hop_after_extruder_switch",
|
||||
"settable_per_mesh": false,
|
||||
"settable_per_extruder": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
9
resources/qml/EmptyViewMenuComponent.qml
Normal file
9
resources/qml/EmptyViewMenuComponent.qml
Normal file
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
|
||||
// Empty placeholder
|
||||
Item { }
|
|
@ -53,6 +53,7 @@ Item
|
|||
anchors
|
||||
{
|
||||
top: titleLabel.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
bottom: nextButton.top
|
||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
left: parent.left
|
||||
|
|
|
@ -199,6 +199,7 @@ retraction_hop_enabled
|
|||
retraction_hop_only_when_collides
|
||||
retraction_hop
|
||||
retraction_hop_after_extruder_switch
|
||||
retraction_hop_after_extruder_switch_height
|
||||
|
||||
[cooling]
|
||||
cool_fan_enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue