Draft: move DraftSnap to another module
And do not load the `Snapper` in `DraftGui`. The Snapper should be initialized by the module that imports `DraftGui`, most probably `DraftTools` or even by the `InitGui` of the workbench.
This commit is contained in:
@@ -10,7 +10,6 @@ SET(Draft_SRCS_base
|
||||
Draft.py
|
||||
DraftTools.py
|
||||
DraftGui.py
|
||||
DraftSnap.py
|
||||
DraftTrackers.py
|
||||
DraftVecUtils.py
|
||||
DraftGeomUtils.py
|
||||
@@ -85,6 +84,7 @@ SET(Draft_GUI_tools
|
||||
draftguitools/gui_polararray.py
|
||||
draftguitools/gui_arrays.py
|
||||
draftguitools/gui_snaps.py
|
||||
draftguitools/gui_snapper.py
|
||||
draftguitools/README.md
|
||||
)
|
||||
|
||||
|
||||
@@ -2452,6 +2452,3 @@ class ShapeStringTaskPanel:
|
||||
if not hasattr(FreeCADGui,"draftToolBar"):
|
||||
FreeCADGui.draftToolBar = DraftToolBar()
|
||||
#----End of Python Features Definitions----#
|
||||
|
||||
if not hasattr(FreeCADGui,"Snapper"):
|
||||
import DraftSnap
|
||||
|
||||
@@ -40,14 +40,14 @@ import sys, os, FreeCAD, FreeCADGui, WorkingPlane, math, re, Draft, Draft_rc, Dr
|
||||
from FreeCAD import Vector
|
||||
from PySide import QtCore,QtGui
|
||||
from DraftGui import todo, translate, utf8_decode
|
||||
import DraftSnap
|
||||
import draftguitools.gui_snapper as gui_snapper
|
||||
import DraftGui
|
||||
import DraftTrackers
|
||||
from DraftTrackers import *
|
||||
from pivy import coin
|
||||
|
||||
if not hasattr(FreeCADGui, "Snapper"):
|
||||
FreeCADGui.Snapper = DraftSnap.Snapper()
|
||||
FreeCADGui.Snapper = gui_snapper.Snapper()
|
||||
|
||||
if not hasattr(FreeCAD, "DraftWorkingPlane"):
|
||||
FreeCAD.DraftWorkingPlane = WorkingPlane.plane()
|
||||
|
||||
Reference in New Issue
Block a user