Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/FreeCAD/FreeCAD
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 28, 2016
2 parents 35cb586 + 801f36c commit b59bbff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -206,6 +206,8 @@ def getIcon(self,obj):
return QtGui.QIcon(obj.ViewObject.Proxy.getIcon())
elif obj.isDerivedFrom("Sketcher::SketchObject"):
return QtGui.QIcon(":/icons/Sketcher_Sketch.svg")
elif obj.isDerivedFrom("App::DocumentObjectGroup"):
return QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_DirIcon)
else:
return QtGui.QIcon(":/icons/Tree_Part.svg")

Expand Down Expand Up @@ -233,7 +235,8 @@ def update(self):
Oattrib = [Oattrib]
for o in Oattrib:
item = QtGui.QTreeWidgetItem()
item.setText(0,o.Name)
item.setText(0,o.Label)
item.setToolTip(0,o.Name)
item.setIcon(0,self.getIcon(o))
Tattrib.addChild(item)
self.tree.expandItem(Tattrib)
Expand All @@ -253,7 +256,7 @@ def addElement(self):
def removeElement(self):
it = self.tree.currentItem()
if it:
comp = FreeCAD.ActiveDocument.getObject(str(it.text(0)))
comp = FreeCAD.ActiveDocument.getObject(str(it.toolTip(0)))
removeFromComponent(self.obj,comp)
self.update()

Expand All @@ -264,7 +267,7 @@ def accept(self):

def editObject(self,wid,col):
if wid.parent():
obj = FreeCAD.ActiveDocument.getObject(str(wid.text(0)))
obj = FreeCAD.ActiveDocument.getObject(str(wid.toolTip(0)))
if obj:
self.obj.ViewObject.Transparency = 80
self.obj.ViewObject.Selectable = False
Expand Down
9 changes: 6 additions & 3 deletions src/Mod/Arch/ArchSectionPlane.py
Expand Up @@ -145,7 +145,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill=
else:
shapes.append(o.Shape)
else:
FreeCAD.Console.PrintWarning(translate("Arch","Skipping invalid object: ")+o.Name)
print section.Label,": Skipping invalid object:",o.Label
cutface,cutvolume,invcutvolume = ArchCommands.getCutVolume(section.Shape.copy(),shapes)
if cutvolume:
nsh = []
Expand Down Expand Up @@ -583,6 +583,8 @@ def getIcon(self,obj):
return QtGui.QIcon(obj.ViewObject.Proxy.getIcon())
elif obj.isDerivedFrom("Sketcher::SketchObject"):
return QtGui.QIcon(":/icons/Sketcher_Sketch.svg")
elif obj.isDerivedFrom("App::DocumentObjectGroup"):
return QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_DirIcon)
else:
return QtGui.QIcon(":/icons/Tree_Part.svg")

Expand All @@ -592,7 +594,8 @@ def update(self):
if self.obj:
for o in self.obj.Objects:
item = QtGui.QTreeWidgetItem(self.tree)
item.setText(0,o.Name)
item.setText(0,o.Label)
item.setToolTip(0,o.Name)
item.setIcon(0,self.getIcon(o))
self.retranslateUi(self.form)

Expand All @@ -606,7 +609,7 @@ def removeElement(self):
if self.obj:
it = self.tree.currentItem()
if it:
comp = FreeCAD.ActiveDocument.getObject(str(it.text(0)))
comp = FreeCAD.ActiveDocument.getObject(str(it.toolTip(0)))
ArchComponent.removeFromComponent(self.obj,comp)
self.update()

Expand Down

0 comments on commit b59bbff

Please sign in to comment.