Merge 3.2 into master

This commit is contained in:
Lipu Fei 2018-02-07 13:20:24 +01:00
commit ffa4df6a06
12 changed files with 277 additions and 55 deletions

View file

@ -116,6 +116,8 @@ class CuraApplication(QtApplication):
# changes of the settings.
SettingVersion = 4
Created = False
class ResourceTypes:
QmlFiles = Resources.UserType + 1
Firmware = Resources.UserType + 2
@ -136,7 +138,6 @@ class CuraApplication(QtApplication):
stacksValidationFinished = pyqtSignal() # Emitted whenever a validation is finished
def __init__(self, **kwargs):
# this list of dir names will be used by UM to detect an old cura directory
for dir_name in ["extruders", "machine_instances", "materials", "plugins", "quality", "user", "variants"]:
Resources.addExpectedDirNameInData(dir_name)
@ -227,6 +228,10 @@ class CuraApplication(QtApplication):
tray_icon_name = "cura-icon-32.png",
**kwargs)
# FOR TESTING ONLY
if kwargs["parsed_command_line"].get("trigger_early_crash", False):
assert not "This crash is triggered by the trigger_early_crash command line argument."
self.default_theme = "cura-light"
self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
@ -260,7 +265,7 @@ class CuraApplication(QtApplication):
self._center_after_select = False
self._camera_animation = None
self._cura_actions = None
self._started = False
self.started = False
self._message_box_callback = None
self._message_box_callback_arguments = []
@ -375,6 +380,8 @@ class CuraApplication(QtApplication):
self.getCuraSceneController().setActiveBuildPlate(0) # Initialize
CuraApplication.Created = True
@pyqtSlot(str, result = str)
def getVisibilitySettingPreset(self, settings_preset_name) -> str:
result = self._loadPresetSettingVisibilityGroup(settings_preset_name)
@ -461,7 +468,6 @@ class CuraApplication(QtApplication):
return result
def _onEngineCreated(self):
self._engine.addImageProvider("camera", CameraImageProvider.CameraImageProvider())
@ -556,7 +562,7 @@ class CuraApplication(QtApplication):
#
# Note that the AutoSave plugin also calls this method.
def saveSettings(self):
if not self._started: # Do not do saving during application start
if not self.started: # Do not do saving during application start
return
ContainerRegistry.getInstance().saveDirtyContainers()
@ -734,7 +740,7 @@ class CuraApplication(QtApplication):
for file_name in self._open_file_queue: # Open all the files that were queued up while plug-ins were loading.
self._openFile(file_name)
self._started = True
self.started = True
self.exec_()
## Run Cura without GUI elements and interaction (server mode).