BOPTools: Fix to work without the GUI
This commit is contained in:
parent
1c35bd8cd9
commit
39491713f2
|
@ -33,13 +33,12 @@ import Part
|
||||||
if FreeCAD.GuiUp:
|
if FreeCAD.GuiUp:
|
||||||
import FreeCADGui
|
import FreeCADGui
|
||||||
from PySide import QtCore, QtGui
|
from PySide import QtCore, QtGui
|
||||||
|
|
||||||
|
|
||||||
# -------------------------- common stuff --------------------------------------------------
|
# -------------------------- common stuff --------------------------------------------------
|
||||||
|
|
||||||
#-------------------------- translation-related code ----------------------------------------
|
#-------------------------- translation-related code ----------------------------------------
|
||||||
#Thanks, yorik! (see forum thread "A new Part tool is being born... JoinFeatures!"
|
#Thanks, yorik! (see forum thread "A new Part tool is being born... JoinFeatures!"
|
||||||
#http://forum.freecadweb.org/viewtopic.php?f=22&t=11112&start=30#p90239 )
|
#http://forum.freecadweb.org/viewtopic.php?f=22&t=11112&start=30#p90239 )
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_fromUtf8 = QtCore.QString.fromUtf8
|
_fromUtf8 = QtCore.QString.fromUtf8
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -52,8 +51,12 @@ try:
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QtGui.QApplication.translate(context, text, disambig)
|
return QtGui.QApplication.translate(context, text, disambig)
|
||||||
|
else:
|
||||||
|
def _translate(context, text, disambig):
|
||||||
|
return text
|
||||||
#--------------------------/translation-related code ----------------------------------------
|
#--------------------------/translation-related code ----------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def getParamRefine():
|
def getParamRefine():
|
||||||
return FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Part/Boolean").GetBool("RefineModel")
|
return FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Part/Boolean").GetBool("RefineModel")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user