diff --git a/src/Mod/OpenSCAD/InitGui.py b/src/Mod/OpenSCAD/InitGui.py index 3eb71f867..ca192b39b 100644 --- a/src/Mod/OpenSCAD/InitGui.py +++ b/src/Mod/OpenSCAD/InitGui.py @@ -93,6 +93,8 @@ static char * openscadlogo_xpm[] = { 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',\ @@ -124,9 +126,9 @@ static char * openscadlogo_xpm[] = { 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") diff --git a/src/Mod/OpenSCAD/OpenSCADFeatures.py b/src/Mod/OpenSCAD/OpenSCADFeatures.py index 667c598a9..ae4408b8b 100644 --- a/src/Mod/OpenSCAD/OpenSCADFeatures.py +++ b/src/Mod/OpenSCAD/OpenSCADFeatures.py @@ -77,7 +77,11 @@ class ViewProviderTree: 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[] = { @@ -101,64 +105,6 @@ static char * matrix_xpm[] = { " ............. .", " ......... .", "................"};""" - 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[] = { diff --git a/src/Mod/OpenSCAD/exportCSG.py b/src/Mod/OpenSCAD/exportCSG.py index 7a8024ec8..1cc583a96 100644 --- a/src/Mod/OpenSCAD/exportCSG.py +++ b/src/Mod/OpenSCAD/exportCSG.py @@ -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: diff --git a/src/Mod/OpenSCAD/importCSG.py b/src/Mod/OpenSCAD/importCSG.py index b25766e0c..feba25e44 100644 --- a/src/Mod/OpenSCAD/importCSG.py +++ b/src/Mod/OpenSCAD/importCSG.py @@ -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'):