Merge pull request #84 from microelly2/master
make freecad-library ready to start by pluginmanager
This commit is contained in:
commit
21b256297f
1 changed files with 15 additions and 2 deletions
|
@ -52,9 +52,21 @@ which you can browse and install items from the library.
|
||||||
LIBRARYPATH = "/home/yorik/Sources/FreeCAD-library"
|
LIBRARYPATH = "/home/yorik/Sources/FreeCAD-library"
|
||||||
# END CONFIGURATION - THAT'S DONE, NO NEED TO EDIT ANYTHING MORE
|
# END CONFIGURATION - THAT'S DONE, NO NEED TO EDIT ANYTHING MORE
|
||||||
|
|
||||||
|
|
||||||
|
s=FreeCAD.ParamGet('User parameter:Plugins/partlib').GetString('destination')
|
||||||
|
print s
|
||||||
|
|
||||||
|
if s<>'':
|
||||||
|
LIBRARYPATH = s
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import FreeCAD, FreeCADGui, Part, zipfile, tempfile
|
import FreeCAD, FreeCADGui, Part, zipfile, tempfile
|
||||||
from PySide import QtGui, QtCore
|
from PySide import QtGui, QtCore
|
||||||
|
|
||||||
|
global ExpFileSystemModel
|
||||||
class ExpFileSystemModel(QtGui.QFileSystemModel):
|
class ExpFileSystemModel(QtGui.QFileSystemModel):
|
||||||
"a custom QFileSystemModel that displays freecad file icons"
|
"a custom QFileSystemModel that displays freecad file icons"
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -69,7 +81,7 @@ class ExpFileSystemModel(QtGui.QFileSystemModel):
|
||||||
class ExpDockWidget(QtGui.QDockWidget):
|
class ExpDockWidget(QtGui.QDockWidget):
|
||||||
"a library explorer dock widget"
|
"a library explorer dock widget"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self,LIBRARYPATH):
|
||||||
QtGui.QDockWidget.__init__(self)
|
QtGui.QDockWidget.__init__(self)
|
||||||
|
|
||||||
self.setObjectName("PartsLibrary")
|
self.setObjectName("PartsLibrary")
|
||||||
|
@ -135,8 +147,9 @@ if QtCore.QDir(LIBRARYPATH).exists():
|
||||||
else:
|
else:
|
||||||
w.show()
|
w.show()
|
||||||
else:
|
else:
|
||||||
m.addDockWidget(QtCore.Qt.RightDockWidgetArea,ExpDockWidget())
|
m.addDockWidget(QtCore.Qt.RightDockWidgetArea,ExpDockWidget(LIBRARYPATH))
|
||||||
else:
|
else:
|
||||||
print "Library path ", LIBRARYPATH, "not found."
|
print "Library path ", LIBRARYPATH, "not found."
|
||||||
print "Please set the correct path to your Parts library in the macro script"
|
print "Please set the correct path to your Parts library in the macro script"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue