BOPTools: Fix to work without the GUI
This commit is contained in:
parent
1c35bd8cd9
commit
39491713f2
|
@ -33,26 +33,29 @@ import Part
|
|||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
|
||||
# -------------------------- common stuff --------------------------------------------------
|
||||
|
||||
#-------------------------- translation-related code ----------------------------------------
|
||||
#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 )
|
||||
try:
|
||||
_fromUtf8 = QtCore.QString.fromUtf8
|
||||
except Exception:
|
||||
def _fromUtf8(s):
|
||||
return s
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
# -------------------------- common stuff --------------------------------------------------
|
||||
|
||||
#-------------------------- translation-related code ----------------------------------------
|
||||
#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 )
|
||||
|
||||
try:
|
||||
_fromUtf8 = QtCore.QString.fromUtf8
|
||||
except Exception:
|
||||
def _fromUtf8(s):
|
||||
return s
|
||||
try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
else:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||
except AttributeError:
|
||||
def _translate(context, text, disambig):
|
||||
return QtGui.QApplication.translate(context, text, disambig)
|
||||
#--------------------------/translation-related code ----------------------------------------
|
||||
return text
|
||||
#--------------------------/translation-related code ----------------------------------------
|
||||
|
||||
|
||||
def getParamRefine():
|
||||
return FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Part/Boolean").GetBool("RefineModel")
|
||||
|
|
Loading…
Reference in New Issue
Block a user