Added the ability to clear the script output from the Report view.
This commit is contained in:
parent
e99daaa469
commit
ac1d142598
|
@ -23,6 +23,25 @@ def clearActiveDocument():
|
||||||
for obj in doc.Objects:
|
for obj in doc.Objects:
|
||||||
doc.removeObject(obj.Label)
|
doc.removeObject(obj.Label)
|
||||||
|
|
||||||
|
class CadQueryClearOutput:
|
||||||
|
"""Allows the user to clear the reports view when it gets overwhelmed with output"""
|
||||||
|
|
||||||
|
def GetResources(self):
|
||||||
|
return {"MenuText": "Clear Output",
|
||||||
|
"ToolTip": "Clears the script output from the Reports view"}
|
||||||
|
|
||||||
|
def IsActive(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def Activated(self):
|
||||||
|
#Grab our code editor so we can interact with it
|
||||||
|
mw = FreeCADGui.getMainWindow()
|
||||||
|
|
||||||
|
reportView = mw.findChild(QtGui.QDockWidget, "Report view")
|
||||||
|
|
||||||
|
#Clear the view because it gets overwhelmed sometimes and won't scroll to the bottom
|
||||||
|
reportView.widget().clear()
|
||||||
|
|
||||||
|
|
||||||
class CadQueryCloseScript:
|
class CadQueryCloseScript:
|
||||||
"""Allows the user to close a file without saving"""
|
"""Allows the user to close a file without saving"""
|
||||||
|
|
|
@ -29,7 +29,7 @@ class CadQueryWorkbench (Workbench):
|
||||||
|
|
||||||
#We have our own CQ menu that's added when the user chooses our workbench
|
#We have our own CQ menu that's added when the user chooses our workbench
|
||||||
commands = ['CadQueryNewScript', 'CadQueryOpenScript', 'CadQuerySaveScript', 'CadQuerySaveAsScript',
|
commands = ['CadQueryNewScript', 'CadQueryOpenScript', 'CadQuerySaveScript', 'CadQuerySaveAsScript',
|
||||||
'CadQueryCloseScript', 'Separator', 'CadQueryExecuteScript']
|
'CadQueryCloseScript', 'Separator', 'CadQueryExecuteScript', 'CadQueryClearOutput']
|
||||||
self.appendMenu('CadQuery', commands)
|
self.appendMenu('CadQuery', commands)
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
|
@ -165,5 +165,6 @@ FreeCADGui.addCommand('CadQuerySaveScript', CadQuerySaveScript())
|
||||||
FreeCADGui.addCommand('CadQuerySaveAsScript', CadQuerySaveAsScript())
|
FreeCADGui.addCommand('CadQuerySaveAsScript', CadQuerySaveAsScript())
|
||||||
FreeCADGui.addCommand('CadQueryExecuteScript', CadQueryExecuteScript())
|
FreeCADGui.addCommand('CadQueryExecuteScript', CadQueryExecuteScript())
|
||||||
FreeCADGui.addCommand('CadQueryCloseScript', CadQueryCloseScript())
|
FreeCADGui.addCommand('CadQueryCloseScript', CadQueryCloseScript())
|
||||||
|
FreeCADGui.addCommand('CadQueryClearOutput', CadQueryClearOutput())
|
||||||
|
|
||||||
FreeCADGui.addWorkbench(CadQueryWorkbench())
|
FreeCADGui.addWorkbench(CadQueryWorkbench())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user