Skip to content

Commit

Permalink
use Icons for Refine and Increase tolerance features
Browse files Browse the repository at this point in the history
  • Loading branch information
5263 authored and wwmayer committed Oct 11, 2014
1 parent f1283cf commit 05af920
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 63 deletions.
6 changes: 4 additions & 2 deletions src/Mod/OpenSCAD/InitGui.py
Expand Up @@ -93,6 +93,8 @@ class OpenSCADWorkbench ( Workbench ):
MenuText = "OpenSCAD"
ToolTip = "OpenSCAD workbench"
def Initialize(self):
def QT_TRANSLATE_NOOP(scope, text):
return text
import OpenSCAD_rc,OpenSCADCommands
commands=['OpenSCAD_ReplaceObject','OpenSCAD_RemoveSubtree',\
'OpenSCAD_RefineShapeFeature',\
Expand Down Expand Up @@ -124,9 +126,9 @@ def Initialize(self):
else:
FreeCAD.Console.PrintWarning('OpenSCAD executable not found\n')

self.appendToolbar("OpenSCADTools",toolbarcommands)
self.appendToolbar(QT_TRANSLATE_NOOP('Workbench','OpenSCADTools'),toolbarcommands)
self.appendMenu('OpenSCAD',commands)
self.appendToolbar('OpenSCAD Part tools',parttoolbarcommands)
self.appendToolbar(QT_TRANSLATE_NOOP('Workbech','OpenSCAD Part tools'),parttoolbarcommands)
#self.appendMenu('OpenSCAD',["AddOpenSCADElement"])
###self.appendCommandbar("&Generic Tools",["ColorCodeShape"])
FreeCADGui.addIconPath(":/icons")
Expand Down
64 changes: 5 additions & 59 deletions src/Mod/OpenSCAD/OpenSCADFeatures.py
Expand Up @@ -77,7 +77,11 @@ def claimChildren(self):
return objs

def getIcon(self):
#if self.Object.Proxy.__class__ == MatrixTransform:
import OpenSCAD_rc
if isinstance(self.Object.Proxy,RefineShape):
return(":/icons/OpenSCAD_RefineShapeFeature.svg")
if isinstance(self.Object.Proxy,IncreaseTolerance):
return(":/icons/OpenSCAD_IncreaseToleranceFeature.svg")
if isinstance(self.Object.Proxy,MatrixTransform):
return """/* XPM */
static char * matrix_xpm[] = {
Expand All @@ -101,64 +105,6 @@ def getIcon(self):
" ............. .",
" ......... .",
"................"};"""
elif False:
return """/* XPM */
static char * qm_xpm[] = {
"16 16 37 1",
" c None",
". c #FFFFFF",
"+ c #CBE3FF",
"@ c #70B3FF",
"# c #3092FF",
"$ c #0D7FFF",
"% c #047BFF",
"& c #1885FF",
"* c #56A6FF",
"= c #CFE5FF",
"- c #0079FF",
"; c #067CFF",
"> c #B9DAFF",
", c #88C0FF",
"' c #CAE3FF",
") c #F2F8FF",
"! c #FAFCFF",
"~ c #CEE5FF",
"{ c #459DFF",
"] c #2D90FF",
"^ c #EEF6FF",
"/ c #077CFF",
"( c #B1D6FF",
"_ c #3494FF",
": c #90C4FF",
"< c #037AFF",
"[ c #BCDBFF",
"} c #6EB2FF",
"| c #087DFF",
"1 c #A8D1FF",
"2 c #8AC1FF",
"3 c #1C87FF",
"4 c #CCE4FF",
"5 c #1F89FF",
"6 c #CDE4FF",
"7 c #027AFF",
"8 c #FDFDFF",
"....+@#$%&*=....",
"....-------;>...",
"....#,')!~{-]...",
"..........^-/...",
"..........(-_...",
".........:/<[...",
"........}-|1....",
".......2-34.....",
".......5-6......",
".......7-8......",
".......--.......",
"................",
"................",
".......--.......",
".......--.......",
".......--......."};
"""
else:
return """/* XPM */
static char * openscadlogo_xpm[] = {
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/OpenSCAD/exportCSG.py
Expand Up @@ -251,7 +251,8 @@ def export(exportList,filename):
csg = pythonopen(filename,'w')
print "Write Inital Output"
# Not sure if comments as per scad are allowed in csg file
csg.write("// CSG file generated from FreeCAD Export 0.1d\n")
csg.write("// CSG file generated from FreeCAD %s\n" % \
'.'.join(FreeCAD.Version()[0:3]))
#write initial group statements - not sure if required
csg.write("group() {\n group(){\n")
for ob in exportList:
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/OpenSCAD/importCSG.py
Expand Up @@ -92,7 +92,7 @@ def insert(filename,docname):
groupname = os.path.splitext(os.path.basename(filename))[0]
try:
doc=FreeCAD.getDocument(docname)
except FreeCAD.Base.FreeCADError:
except NameError:
doc=FreeCAD.newDocument(docname)
#importgroup = doc.addObject("App::DocumentObjectGroup",groupname)
if filename.lower().endswith('.scad'):
Expand Down

0 comments on commit 05af920

Please sign in to comment.