@@ -34,10 +34,9 @@ import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import Draft_rc # include resources, icons, ui files
|
||||
import DraftVecUtils
|
||||
import draftutils.utils as utils
|
||||
|
||||
from FreeCAD import Units as U
|
||||
from draftutils.messages import _msg, _wrn, _err, _log
|
||||
from draftutils import params
|
||||
from draftutils.messages import _err, _log, _msg, _wrn
|
||||
from draftutils.translate import translate
|
||||
|
||||
# The module is used to prevent complaints from code checkers (flake8)
|
||||
@@ -136,8 +135,8 @@ class TaskPanelCircularArray:
|
||||
self.form.input_c_z.setProperty('rawValue', self.center.z)
|
||||
self.form.input_c_z.setProperty('unit', length_unit)
|
||||
|
||||
self.fuse = utils.get_param("Draft_array_fuse", False)
|
||||
self.use_link = utils.get_param("Draft_array_Link", True)
|
||||
self.fuse = params.get_param("Draft_array_fuse")
|
||||
self.use_link = params.get_param("Draft_array_Link")
|
||||
|
||||
self.form.checkbox_fuse.setChecked(self.fuse)
|
||||
self.form.checkbox_link.setChecked(self.use_link)
|
||||
@@ -344,7 +343,7 @@ class TaskPanelCircularArray:
|
||||
"""Execute as a callback when the fuse checkbox changes."""
|
||||
self.fuse = self.form.checkbox_fuse.isChecked()
|
||||
self.print_fuse_state(self.fuse)
|
||||
utils.set_param("Draft_array_fuse", self.fuse)
|
||||
params.set_param("Draft_array_fuse", self.fuse)
|
||||
|
||||
def print_link_state(self, use_link):
|
||||
"""Print the link state translated."""
|
||||
@@ -358,7 +357,7 @@ class TaskPanelCircularArray:
|
||||
"""Execute as a callback when the link checkbox changes."""
|
||||
self.use_link = self.form.checkbox_link.isChecked()
|
||||
self.print_link_state(self.use_link)
|
||||
utils.set_param("Draft_array_Link", self.use_link)
|
||||
params.set_param("Draft_array_Link", self.use_link)
|
||||
|
||||
def print_messages(self):
|
||||
"""Print messages about the operation."""
|
||||
|
||||
@@ -34,10 +34,9 @@ import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import Draft_rc # include resources, icons, ui files
|
||||
import DraftVecUtils
|
||||
import draftutils.utils as utils
|
||||
|
||||
from FreeCAD import Units as U
|
||||
from draftutils.messages import _msg, _err, _log
|
||||
from draftutils import params
|
||||
from draftutils.messages import _err, _log, _msg
|
||||
from draftutils.translate import translate
|
||||
|
||||
# The module is used to prevent complaints from code checkers (flake8)
|
||||
@@ -137,8 +136,8 @@ class TaskPanelOrthoArray:
|
||||
self.form.spinbox_n_Y.setValue(self.n_y)
|
||||
self.form.spinbox_n_Z.setValue(self.n_z)
|
||||
|
||||
self.fuse = utils.get_param("Draft_array_fuse", False)
|
||||
self.use_link = utils.get_param("Draft_array_Link", True)
|
||||
self.fuse = params.get_param("Draft_array_fuse")
|
||||
self.use_link = params.get_param("Draft_array_Link")
|
||||
|
||||
self.form.checkbox_fuse.setChecked(self.fuse)
|
||||
self.form.checkbox_link.setChecked(self.use_link)
|
||||
@@ -347,7 +346,7 @@ class TaskPanelOrthoArray:
|
||||
"""Execute as a callback when the fuse checkbox changes."""
|
||||
self.fuse = self.form.checkbox_fuse.isChecked()
|
||||
self.print_fuse_state(self.fuse)
|
||||
utils.set_param("Draft_array_fuse", self.fuse)
|
||||
params.set_param("Draft_array_fuse", self.fuse)
|
||||
|
||||
def print_link_state(self, use_link):
|
||||
"""Print the link state translated."""
|
||||
@@ -361,7 +360,7 @@ class TaskPanelOrthoArray:
|
||||
"""Execute as a callback when the link checkbox changes."""
|
||||
self.use_link = self.form.checkbox_link.isChecked()
|
||||
self.print_link_state(self.use_link)
|
||||
utils.set_param("Draft_array_Link", self.use_link)
|
||||
params.set_param("Draft_array_Link", self.use_link)
|
||||
|
||||
def print_messages(self):
|
||||
"""Print messages about the operation."""
|
||||
|
||||
@@ -34,10 +34,9 @@ import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import Draft_rc # include resources, icons, ui files
|
||||
import DraftVecUtils
|
||||
import draftutils.utils as utils
|
||||
|
||||
from FreeCAD import Units as U
|
||||
from draftutils.messages import _msg, _wrn, _err, _log
|
||||
from draftutils import params
|
||||
from draftutils.messages import _err, _log, _msg, _wrn
|
||||
from draftutils.translate import translate
|
||||
|
||||
# The module is used to prevent complaints from code checkers (flake8)
|
||||
@@ -124,8 +123,8 @@ class TaskPanelPolarArray:
|
||||
self.form.input_c_z.setProperty('rawValue', self.center.z)
|
||||
self.form.input_c_z.setProperty('unit', length_unit)
|
||||
|
||||
self.fuse = utils.get_param("Draft_array_fuse", False)
|
||||
self.use_link = utils.get_param("Draft_array_Link", True)
|
||||
self.fuse = params.get_param("Draft_array_fuse")
|
||||
self.use_link = params.get_param("Draft_array_Link")
|
||||
|
||||
self.form.checkbox_fuse.setChecked(self.fuse)
|
||||
self.form.checkbox_link.setChecked(self.use_link)
|
||||
@@ -299,7 +298,7 @@ class TaskPanelPolarArray:
|
||||
"""Execute as a callback when the fuse checkbox changes."""
|
||||
self.fuse = self.form.checkbox_fuse.isChecked()
|
||||
self.print_fuse_state(self.fuse)
|
||||
utils.set_param("Draft_array_fuse", self.fuse)
|
||||
params.set_param("Draft_array_fuse", self.fuse)
|
||||
|
||||
def print_link_state(self, use_link):
|
||||
"""Print the link state translated."""
|
||||
@@ -313,7 +312,7 @@ class TaskPanelPolarArray:
|
||||
"""Execute as a callback when the link checkbox changes."""
|
||||
self.use_link = self.form.checkbox_link.isChecked()
|
||||
self.print_link_state(self.use_link)
|
||||
utils.set_param("Draft_array_Link", self.use_link)
|
||||
params.set_param("Draft_array_Link", self.use_link)
|
||||
|
||||
def print_messages(self):
|
||||
"""Print messages about the operation."""
|
||||
|
||||
@@ -35,7 +35,7 @@ import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import Draft
|
||||
import Draft_rc
|
||||
|
||||
from draftutils import params
|
||||
from draftutils.translate import translate
|
||||
|
||||
# So the resource file doesn't trigger errors from code checkers (flake8)
|
||||
@@ -46,7 +46,7 @@ class ScaleTaskPanel:
|
||||
"""The task panel for the Draft Scale tool."""
|
||||
|
||||
def __init__(self):
|
||||
decimals = App.ParamGet("User parameter:BaseApp/Preferences/Units").GetInt("Decimals", 2)
|
||||
decimals = params.get_param("Decimals", path="Units")
|
||||
self.sourceCmd = None
|
||||
self.form = QtGui.QWidget()
|
||||
self.form.setWindowIcon(QtGui.QIcon(":/icons/Draft_Scale.svg"))
|
||||
@@ -73,19 +73,19 @@ class ScaleTaskPanel:
|
||||
self.zValue.setValue(1)
|
||||
layout.addWidget(self.zValue,2,1,1,1)
|
||||
self.lock = QtGui.QCheckBox()
|
||||
self.lock.setChecked(App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("ScaleUniform", False))
|
||||
self.lock.setChecked(params.get_param("ScaleUniform"))
|
||||
layout.addWidget(self.lock,3,0,1,2)
|
||||
self.relative = QtGui.QCheckBox()
|
||||
self.relative.setChecked(App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("ScaleRelative", False))
|
||||
self.relative.setChecked(params.get_param("ScaleRelative"))
|
||||
layout.addWidget(self.relative,4,0,1,2)
|
||||
self.isCopy = QtGui.QCheckBox()
|
||||
self.isCopy.setChecked(App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("ScaleCopy", False))
|
||||
self.isCopy.setChecked(params.get_param("ScaleCopy"))
|
||||
layout.addWidget(self.isCopy,5,0,1,2)
|
||||
self.isSubelementMode = QtGui.QCheckBox()
|
||||
layout.addWidget(self.isSubelementMode,6,0,1,2)
|
||||
self.isClone = QtGui.QCheckBox()
|
||||
layout.addWidget(self.isClone,7,0,1,2)
|
||||
self.isClone.setChecked(App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("ScaleClone", False))
|
||||
self.isClone.setChecked(params.get_param("ScaleClone"))
|
||||
self.pickrefButton = QtGui.QPushButton()
|
||||
layout.addWidget(self.pickrefButton,8,0,1,2)
|
||||
QtCore.QObject.connect(self.xValue,QtCore.SIGNAL("valueChanged(double)"),self.setValue)
|
||||
@@ -101,7 +101,7 @@ class ScaleTaskPanel:
|
||||
|
||||
def setLock(self, state):
|
||||
"""Set the uniform scaling."""
|
||||
App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").SetBool("ScaleUniform", state)
|
||||
params.set_param("ScaleUniform", state)
|
||||
if state:
|
||||
val = self.xValue.value()
|
||||
self.yValue.setValue(val)
|
||||
@@ -109,13 +109,13 @@ class ScaleTaskPanel:
|
||||
|
||||
def setRelative(self, state):
|
||||
"""Set the relative scaling."""
|
||||
App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").SetBool("ScaleRelative", state)
|
||||
params.set_param("ScaleRelative", state)
|
||||
if self.sourceCmd:
|
||||
self.sourceCmd.scaleGhost(self.xValue.value(),self.yValue.value(),self.zValue.value(),self.relative.isChecked())
|
||||
|
||||
def setCopy(self, state):
|
||||
"""Set the scale and copy option."""
|
||||
App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").SetBool("ScaleCopy", state)
|
||||
params.set_param("ScaleCopy", state)
|
||||
if state and self.isClone.isChecked():
|
||||
self.isClone.setChecked(False)
|
||||
|
||||
@@ -128,7 +128,7 @@ class ScaleTaskPanel:
|
||||
|
||||
def setClone(self, state):
|
||||
"""Set the clone and scale option."""
|
||||
App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").SetBool("ScaleClone", state)
|
||||
params.set_param("ScaleClone", state)
|
||||
if state and self.isCopy.isChecked():
|
||||
self.isCopy.setChecked(False)
|
||||
if state and self.isSubelementMode.isChecked():
|
||||
|
||||
@@ -34,13 +34,11 @@ import PySide.QtGui as QtGui
|
||||
import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import Draft_rc
|
||||
|
||||
import draftguitools.gui_tool_utils as gui_tool_utils
|
||||
|
||||
from DraftVecUtils import toString
|
||||
from draftutils.utils import get_param
|
||||
from draftguitools import gui_tool_utils
|
||||
from draftutils.messages import _err, _msg
|
||||
from draftutils.params import get_param
|
||||
from draftutils.translate import translate
|
||||
from draftutils.messages import _msg, _err
|
||||
from DraftVecUtils import toString
|
||||
|
||||
# So the resource file doesn't trigger errors from code checkers (flake8)
|
||||
True if Draft_rc.__name__ else False
|
||||
@@ -69,7 +67,7 @@ class ShapeStringTaskPanel:
|
||||
self.stringText = string if string else translate("draft", "Default")
|
||||
self.form.leString.setText(self.stringText)
|
||||
self.platWinDialog("Overwrite")
|
||||
self.fileSpec = font if font else get_param("FontFile", "")
|
||||
self.fileSpec = font if font else get_param("FontFile")
|
||||
self.form.fcFontFile.setFileName(self.fileSpec)
|
||||
self.point = point
|
||||
self.pointPicked = False
|
||||
@@ -116,15 +114,7 @@ class ShapeStringTaskPanel:
|
||||
"""Handle the type of dialog depending on the platform."""
|
||||
ParamGroup = App.ParamGet("User parameter:BaseApp/Preferences/Dialog")
|
||||
if flag == "Overwrite":
|
||||
GroupContent = ParamGroup.GetContents()
|
||||
found = False
|
||||
if GroupContent:
|
||||
for ParamSet in GroupContent:
|
||||
if ParamSet[1] == "DontUseNativeFontDialog":
|
||||
found = True
|
||||
break
|
||||
|
||||
if found is False:
|
||||
if "DontUseNativeFontDialog" not in ParamGroup.GetBools():
|
||||
# initialize nonexisting one
|
||||
ParamGroup.SetBool("DontUseNativeFontDialog", True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user