Skip to content

Commit

Permalink
Path: Allow PostUtils to be used in CLI mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnor committed Sep 8, 2015
1 parent b195afc commit 6f89398
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Mod/Path/PathScripts/PostUtils.py
Expand Up @@ -27,9 +27,12 @@
'''

from PySide import QtCore, QtGui
import FreeCADGui
import FreeCAD

FreeCADGui = None
if FreeCAD.GuiUp:
import FreeCADGui

class OldHighlighter(QtGui.QSyntaxHighlighter):
def highlightBlock(self, text):
myClassFormat = QtGui.QTextCharFormat()
Expand Down Expand Up @@ -76,7 +79,9 @@ def highlightBlock(self, text):


class GCodeEditorDialog(QtGui.QDialog):
def __init__(self, parent = FreeCADGui.getMainWindow()):
def __init__(self, parent = None):
if parent is None:
parent = FreeCADGui.getMainWindow()
QtGui.QDialog.__init__(self,parent)

layout = QtGui.QVBoxLayout(self)
Expand Down

0 comments on commit 6f89398

Please sign in to comment.