Undo emit transformationChanges (caused a crash), themed objects in objects list. CURA-4525

This commit is contained in:
Jack Ha 2017-12-21 16:53:43 +01:00
parent 2c831ceb05
commit 663ceab069
6 changed files with 19 additions and 15 deletions

View file

@ -34,8 +34,6 @@ class ArrangeArray:
if a.isEmpty: if a.isEmpty:
self._first_empty = i self._first_empty = i
self._has_empty = True self._has_empty = True
Logger.log("d", "lala %s %s", self._first_empty, self._has_empty)
return return
self._first_empty = None self._first_empty = None
self._has_empty = False self._has_empty = False

View file

@ -40,7 +40,11 @@ class BuildPlateModel(ListModel):
def maxBuildPlate(self): def maxBuildPlate(self):
return self._max_build_plate return self._max_build_plate
def updateMaxBuildPlate(self, source): def updateMaxBuildPlate(self, *args):
if args:
source = args[0]
else:
source = None
if not issubclass(type(source), SceneNode): if not issubclass(type(source), SceneNode):
return return
max_build_plate = self._calcMaxBuildPlate() max_build_plate = self._calcMaxBuildPlate()

View file

@ -1,6 +1,5 @@
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
from UM.Application import Application from UM.Scene.SceneNode import SceneNode
from UM.Logger import Logger
## Make a SceneNode build plate aware CuraSceneNode objects all have this decorator. ## Make a SceneNode build plate aware CuraSceneNode objects all have this decorator.
@ -14,13 +13,14 @@ class BuildPlateDecorator(SceneNodeDecorator):
# Make sure that groups are set correctly # Make sure that groups are set correctly
# setBuildPlateForSelection in CuraActions makes sure that no single childs are set. # setBuildPlateForSelection in CuraActions makes sure that no single childs are set.
self._build_plate_number = nr self._build_plate_number = nr
if self._node is not None: # if issubclass(type(self._node), SceneNode): # TODO: Crashes on ArrangeObjectsAllBuildPlatesJob
self._node.transformationChanged.emit() # self._node.transformationChanged.emit()
#self._node.transformationChanged.emit() #self._node.transformationChanged.emit()
if self._node and self._node.callDecoration("isGroup"): if self._node and self._node.callDecoration("isGroup"):
for child in self._node.getChildren(): for child in self._node.getChildren():
child.callDecoration("setBuildPlateNumber", nr) child.callDecoration("setBuildPlateNumber", nr)
child.transformationChanged.emit() # if issubclass(type(child), SceneNode):
# child.transformationChanged.emit()
def getBuildPlateNumber(self): def getBuildPlateNumber(self):
return self._build_plate_number return self._build_plate_number

View file

@ -316,7 +316,6 @@ Item
{ {
id: arrangeAllBuildPlatesAction; id: arrangeAllBuildPlatesAction;
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates");
//iconName: "document-open";
onTriggered: Printer.arrangeObjectsToAllBuildPlates(); onTriggered: Printer.arrangeObjectsToAllBuildPlates();
} }

View file

@ -146,6 +146,7 @@ Rectangle
onClicked: UM.Preferences.setValue("view/filter_current_build_plate", checked) onClicked: UM.Preferences.setValue("view/filter_current_build_plate", checked)
text: catalog.i18nc("@option:check","See only current build plate"); text: catalog.i18nc("@option:check","See only current build plate");
style: UM.Theme.styles.checkbox;
anchors anchors
{ {
@ -192,6 +193,7 @@ Rectangle
frameVisible: true frameVisible: true
height: UM.Theme.getSize("build_plate_selection_size").height height: UM.Theme.getSize("build_plate_selection_size").height
width: parent.width - 2 * UM.Theme.getSize("default_margin").height width: parent.width - 2 * UM.Theme.getSize("default_margin").height
style: UM.Theme.styles.scrollview
anchors anchors
{ {
@ -222,9 +224,8 @@ Rectangle
{ {
id: arrangeAllBuildPlatesButton; id: arrangeAllBuildPlatesButton;
text: catalog.i18nc("@action:button","Arrange to all build plates"); text: catalog.i18nc("@action:button","Arrange to all build plates");
//iconSource: UM.Theme.getIcon("load") style: UM.Theme.styles.sidebar_action_button
//style: UM.Theme.styles.tool_button height: UM.Theme.getSize("objects_menu_button").height;
height: 25
tooltip: ''; tooltip: '';
anchors anchors
{ {
@ -244,7 +245,8 @@ Rectangle
{ {
id: arrangeBuildPlateButton; id: arrangeBuildPlateButton;
text: catalog.i18nc("@action:button","Arrange current build plate"); text: catalog.i18nc("@action:button","Arrange current build plate");
height: 25 style: UM.Theme.styles.sidebar_action_button
height: UM.Theme.getSize("objects_menu_button").height;
tooltip: ''; tooltip: '';
anchors anchors
{ {

View file

@ -393,8 +393,9 @@
"jobspecs_line": [2.0, 2.0], "jobspecs_line": [2.0, 2.0],
"objects_menu_size": [17, 40], "objects_menu_size": [20, 40],
"objects_menu_size_collapsed": [15, 15], "objects_menu_size_collapsed": [15, 15],
"build_plate_selection_size": [15, 5] "build_plate_selection_size": [15, 5],
"objects_menu_button": [0.3, 2.7]
} }
} }