Incorporating comments and functionality frpm JP. Removed need to use tab_change signal, removed inheritance dependency on QAbstractItemModel, implemented option_changed property.

This commit is contained in:
mquezada
2018-05-04 19:40:09 -04:00
parent 8e4f081ac3
commit e971372d7c
4 changed files with 35 additions and 8 deletions

View File

@@ -24,7 +24,7 @@ class DblSidedTool(FlatCAMTool):
## Layer to mirror
self.object_combo = QtGui.QComboBox()
self.object_combo.setModel(self.app.collection)
self.object_combo.setModel(self.app.collection.model)
self.botlay_label = QtGui.QLabel("Bottom Layer:")
self.botlay_label.setToolTip(
"Layer to be mirrorer."
@@ -68,7 +68,7 @@ class DblSidedTool(FlatCAMTool):
self.point = EvalEntry()
self.point_box_container.addWidget(self.point)
self.box_combo = QtGui.QComboBox()
self.box_combo.setModel(self.app.collection)
self.box_combo.setModel(self.app.collection.model)
self.point_box_container.addWidget(self.box_combo)
self.box_combo.hide()
@@ -180,6 +180,12 @@ class DblSidedTool(FlatCAMTool):
px = 0.5 * (xmin + xmax)
py = 0.5 * (ymin + ymax)
# Ensure that the selected object will display when it is mirrored.
# If an object's plot setting is False it will still be available in
# the combo box. If the plot is not enforced to True then the user
# gets no feedback of the operation.
fcobj.options["plot"] = True;
fcobj.mirror(axis, [px, py])
fcobj.plot()