Skip to content

Commit

Permalink
Load PathGui in all modules which require gui resources to be loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Jan 27, 2021
1 parent 6c5b9cc commit eae6c32
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathCircularHoleBaseGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathLog as PathLog
import PathScripts.PathOpGui as PathOpGui

Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathCustomGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathCustom as PathCustom
import PathScripts.PathOpGui as PathOpGui

Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathDeburrGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathDeburr as PathDeburr
import PathScripts.PathGui as PathGui
import PathScripts.PathLog as PathLog
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathDressupPathBoundaryGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathDressupPathBoundary as PathDressupPathBoundary
import PathScripts.PathLog as PathLog

Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathDressupTagGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathGeom as PathGeom
import PathScripts.PathGetPoint as PathGetPoint
import PathScripts.PathDressupHoldingTags as PathDressupTag
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathDrillingGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathCircularHoleBaseGui as PathCircularHoleBaseGui
import PathScripts.PathDrilling as PathDrilling
import PathScripts.PathGui as PathGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathEngraveGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathEngrave as PathEngrave
import PathScripts.PathLog as PathLog
import PathScripts.PathOpGui as PathOpGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathHelixGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathCircularHoleBaseGui as PathCircularHoleBaseGui
import PathScripts.PathHelix as PathHelix
import PathScripts.PathLog as PathLog
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathJobGui.py
Expand Up @@ -31,6 +31,7 @@
import FreeCAD
import FreeCADGui

import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathJob as PathJob
import PathScripts.PathJobCmd as PathJobCmd
import PathScripts.PathJobDlg as PathJobDlg
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathOpGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathGeom as PathGeom
import PathScripts.PathGetPoint as PathGetPoint
import PathScripts.PathGui as PathGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathPocketBaseGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui

Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathPocketShapeGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathGeom as PathGeom
import PathScripts.PathGui as PathGui
import PathScripts.PathLog as PathLog
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathProbeGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathProbe as PathProbe
import PathScripts.PathOpGui as PathOpGui
import PathScripts.PathGui as PathGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathProfileGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui
import PathScripts.PathProfile as PathProfile
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/PathPropertyBagGui.py
Expand Up @@ -22,7 +22,7 @@

import FreeCAD
import FreeCADGui
import PathScripts.PathGui as PathGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathIconViewProvider as PathIconViewProvider
import PathScripts.PathLog as PathLog
import PathScripts.PathPropertyBag as PathPropertyBag
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathSetupSheetGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathGui as PathGui
import PathScripts.PathIconViewProvider as PathIconViewProvider
import PathScripts.PathLog as PathLog
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathSimulatorGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import Path
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathDressup as PathDressup
import PathScripts.PathGeom as PathGeom
import PathScripts.PathLog as PathLog
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathSlotGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathSlot as PathSlot
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathSurfaceGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathSurface as PathSurface
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathThreadMillingGui.py
Expand Up @@ -23,6 +23,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathCircularHoleBaseGui as PathCircularHoleBaseGui
import PathScripts.PathThreadMilling as PathThreadMilling
import PathScripts.PathGui as PathGui
Expand Down
26 changes: 14 additions & 12 deletions src/Mod/Path/PathScripts/PathToolBitLibraryGui.py
Expand Up @@ -24,23 +24,25 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathLog as PathLog
import PathScripts.PathPreferences as PathPreferences
import PathScripts.PathToolBit as PathToolBit
import PathScripts.PathToolBitGui as PathToolBitGui
import PathScripts.PathToolBitEdit as PathToolBitEdit
import PathScripts.PathToolBitGui as PathToolBitGui
import PathScripts.PathToolControllerGui as PathToolControllerGui
import PathScripts.PathUtilsGui as PathUtilsGui
from PySide import QtCore, QtGui
import PySide
import glob
import json
import os
import glob
import shutil
import uuid as UUID

from functools import partial
import shutil

# PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())

PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
# PathLog.trackModule(PathLog.thisModule())

_UuidRole = PySide.QtCore.Qt.UserRole + 1
Expand Down Expand Up @@ -208,10 +210,10 @@ def findLibraries(self, model):
for libFile in libFiles:
loc, fnlong = os.path.split(libFile)
fn, ext = os.path.splitext(fnlong)
libItem = QtGui.QStandardItem(fn)
libItem = PySide.QtGui.QStandardItem(fn)
libItem.setToolTip(loc)
libItem.setData(libFile, _PathRole)
libItem.setIcon(QtGui.QPixmap(':/icons/Path_ToolTable.svg'))
libItem.setIcon(PySide.QtGui.QPixmap(':/icons/Path_ToolTable.svg'))
model.appendRow(libItem)

PathLog.debug('model rows: {}'.format(model.rowCount()))
Expand Down Expand Up @@ -340,7 +342,7 @@ def selectedOrAllToolControllers(self, index=None):

def open(self, path=None):
''' load library stored in path and bring up ui'''
docs = FreeCADGui.getMainWindow().findChildren(QtGui.QDockWidget)
docs = FreeCADGui.getMainWindow().findChildren(PySide.QtGui.QDockWidget)
for doc in docs:
if doc.objectName() == "ToolSelector":
if doc.isVisible():
Expand All @@ -351,7 +353,7 @@ def open(self, path=None):
return

mw = FreeCADGui.getMainWindow()
mw.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.form,
mw.addDockWidget(PySide.QtCore.Qt.RightDockWidgetArea, self.form,
PySide.QtCore.Qt.Orientation.Vertical)


Expand Down Expand Up @@ -557,8 +559,8 @@ def toolEdit(self, selected):
self.temptool = PathToolBit.ToolBitFactory().CreateFrom(tbpath, 'temptool')
self.editor = PathToolBitEdit.ToolBitEditor(self.temptool, self.form.toolTableGroup, loadBitBody=False)

QBtn = QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel
buttonBox = QtGui.QDialogButtonBox(QBtn)
QBtn = PySide.QtGui.QDialogButtonBox.Ok | PySide.QtGui.QDialogButtonBox.Cancel
buttonBox = PySide.QtGui.QDialogButtonBox(QBtn)
buttonBox.accepted.connect(self.accept)
buttonBox.rejected.connect(self.reject)

Expand Down Expand Up @@ -652,7 +654,7 @@ def loadData(self, path=None):

if curIndex:
sm = self.form.TableList.selectionModel()
sm.select(curIndex, QtCore.QItemSelectionModel.Select)
sm.select(curIndex, PySide.QtCore.QItemSelectionModel.Select)

self.toolTableView.setUpdatesEnabled(True)
self.form.TableList.setUpdatesEnabled(True)
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathToolControllerGui.py
Expand Up @@ -22,6 +22,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts
import PathScripts.PathGui as PathGui
import PathScripts.PathLog as PathLog
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathUtilsGui.py
Expand Up @@ -21,6 +21,7 @@
# ***************************************************************************

import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts
import PathScripts.PathJobCmd as PathJobCmd
import PathScripts.PathUtils as PathUtils
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathVcarveGui.py
Expand Up @@ -23,6 +23,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathVcarve as PathVcarve
import PathScripts.PathLog as PathLog
import PathScripts.PathOpGui as PathOpGui
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathWaterlineGui.py
Expand Up @@ -24,6 +24,7 @@

import FreeCAD
import FreeCADGui
import PathGui as PGui # ensure Path/Gui/Resources are loaded
import PathScripts.PathWaterline as PathWaterline
import PathScripts.PathGui as PathGui
import PathScripts.PathOpGui as PathOpGui
Expand Down

0 comments on commit eae6c32

Please sign in to comment.