Draft: use functions from the utils module, not DraftGui

These functions were moved from DraftGui to individual
modules precisely to make them easy to import.
Otherwise we have to import the entire DraftGui module
which creates dependency problems when we want to use
some functions without the graphical interface.
This commit is contained in:
vocx-fc
2020-02-11 02:15:17 -06:00
committed by Yorik van Havre
parent a86e2a69b1
commit a150b3048d

View File

@@ -39,7 +39,8 @@ __url__ = "https://www.freecadweb.org"
import sys, os, FreeCAD, FreeCADGui, WorkingPlane, math, re, Draft, Draft_rc, DraftVecUtils
from FreeCAD import Vector
from PySide import QtCore,QtGui
from DraftGui import todo, translate, utf8_decode
from draftutils.todo import todo
from draftutils.translate import translate
import draftguitools.gui_snapper as gui_snapper
import DraftGui
import draftguitools.gui_trackers as trackers
@@ -2245,7 +2246,7 @@ class ShapeString(Creator):
pass
self.task = DraftGui.ShapeStringTaskPanel()
self.task.sourceCmd = self
DraftGui.todo.delay(FreeCADGui.Control.showDialog,self.task)
todo.delay(FreeCADGui.Control.showDialog,self.task)
else:
self.dialog = None
self.text = ''
@@ -4130,9 +4131,9 @@ class Scale(Modifier):
self.view.removeEventCallback("SoEvent",self.call)
self.task = DraftGui.ScaleTaskPanel()
self.task.sourceCmd = self
DraftGui.todo.delay(FreeCADGui.Control.showDialog,self.task)
DraftGui.todo.delay(self.task.xValue.selectAll,None)
DraftGui.todo.delay(self.task.xValue.setFocus,None)
todo.delay(FreeCADGui.Control.showDialog,self.task)
todo.delay(self.task.xValue.selectAll,None)
todo.delay(self.task.xValue.setFocus,None)
for ghost in self.ghosts:
ghost.on()
elif len(self.node) == 2: