Merge pull request #421 from dev-at-stellardeath-org/master
Fix non-GUI usage in BOPTools
This commit is contained in:
commit
5a370d6a78
|
@ -37,18 +37,18 @@ if FreeCAD.GuiUp:
|
||||||
#-------------------------- translation-related code ----------------------------------------
|
#-------------------------- translation-related code ----------------------------------------
|
||||||
#(see forum thread "A new Part tool is being born... JoinFeatures!"
|
#(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:
|
||||||
def _fromUtf8(s):
|
def _fromUtf8(s):
|
||||||
return s
|
return s
|
||||||
try:
|
try:
|
||||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||||
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)
|
||||||
#--------------------------/translation-related code ----------------------------------------
|
#--------------------------/translation-related code ----------------------------------------
|
||||||
|
|
||||||
def getIconPath(icon_dot_svg):
|
def getIconPath(icon_dot_svg):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user