Merge branch 'master' of github.com:ultimaker/Cura into feature_material_editing

* 'master' of github.com:ultimaker/Cura: (110 commits)
  Rearrange MachineActions on Machines page
  Skip containers that can not be serialized
  Make PerObjectSettingVisiblityHandler inherit SettingVisiblityHandler and some other cleanup
  Use the right property for the property provider
  Clean up indentation
  Remove unused code
  Fix expanded settings for Per Object settings tool
  Use the expanded categories from Cura to expand the proper categories on startup
  Starting UMOCheckup before connection was established now works correctly
  Fixed layout
  Added missing decorator CURA-1385
  Restored accidental delete
  Removed extraneous space
  Refactoring; Renaming firstRunWizard to machineActionsWizard
  Added BedLevel as supported action to UMO
  Refactoring (Renaming variables so they are more clear & update documentation)
  Remove some trailing spaces CURA-1615
  GCodeProfileReader: Removing useless containername
  Reenable Per Object Settings tool in simple mode if the current printer has multiextrusion
  Fix minor codereview issues
  ...
This commit is contained in:
Arjen Hiemstra 2016-06-23 14:37:00 +02:00
commit f6866d703d
58 changed files with 1723 additions and 1412 deletions

View file

@ -44,12 +44,12 @@ from . import ZOffsetDecorator
from . import CuraSplashScreen
from . import MachineManagerModel
from . import ContainerSettingsModel
from . import MachineActionManager
from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS
from PyQt5.QtGui import QColor, QIcon
from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType
import ast #For literal eval of extruder setting types.
import platform
import sys
import os.path
@ -100,6 +100,8 @@ class CuraApplication(QtApplication):
SettingDefinition.addSupportedProperty("settable_globally", DefinitionPropertyType.Any, default = True)
SettingDefinition.addSettingType("extruder", int, str, UM.Settings.Validator)
self._machine_action_manager = MachineActionManager.MachineActionManager()
super().__init__(name = "cura", version = CuraVersion, buildtype = CuraBuildType)
self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))
@ -122,7 +124,8 @@ class CuraApplication(QtApplication):
self._i18n_catalog = None
self._previous_active_tool = None
self._platform_activity = False
self._scene_bounding_box = AxisAlignedBox()
self._scene_bounding_box = AxisAlignedBox.Null
self._job_name = None
self._center_after_select = False
self._camera_animation = None
@ -364,10 +367,12 @@ class CuraApplication(QtApplication):
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading interface..."))
ExtruderManager.ExtruderManager.getInstance() #Initialise extruder so as to listen to global container stack changes before the first global container stack is set.
# Initialise extruder so as to listen to global container stack changes before the first global container stack is set.
ExtruderManager.ExtruderManager.getInstance()
qmlRegisterSingletonType(MachineManagerModel.MachineManagerModel, "Cura", 1, 0, "MachineManager",
MachineManagerModel.createMachineManagerModel)
qmlRegisterSingletonType(MachineActionManager.MachineActionManager, "Cura", 1, 0, "MachineActionManager", self.getMachineActionManager)
self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml"))
self._qml_import_paths.append(Resources.getPath(self.ResourceTypes.QmlFiles))
self.initializeEngine()
@ -384,6 +389,12 @@ class CuraApplication(QtApplication):
self.exec_()
## Get the machine action manager
# We ignore any *args given to this, as we also register the machine manager as qml singleton.
# It wants to give this function an engine and script engine, but we don't care about that.
def getMachineActionManager(self, *args):
return self._machine_action_manager
## Handle Qt events
def event(self, event):
if event.type() == QEvent.FileOpen:
@ -470,12 +481,14 @@ class CuraApplication(QtApplication):
count += 1
if not scene_bounding_box:
scene_bounding_box = copy.deepcopy(node.getBoundingBox())
scene_bounding_box = node.getBoundingBox()
else:
scene_bounding_box += node.getBoundingBox()
other_bb = node.getBoundingBox()
if other_bb is not None:
scene_bounding_box = scene_bounding_box + node.getBoundingBox()
if not scene_bounding_box:
scene_bounding_box = AxisAlignedBox()
scene_bounding_box = AxisAlignedBox.Null
if repr(self._scene_bounding_box) != repr(scene_bounding_box):
self._scene_bounding_box = scene_bounding_box
@ -740,7 +753,6 @@ class CuraApplication(QtApplication):
# Add all individual nodes to the selection
Selection.add(child)
child.callDecoration("setConvexHull", None)
op.push()
# Note: The group removes itself from the scene once all its children have left it,