translation cleanup (probe)

PathLog missing import

command name
This commit is contained in:
sliptonic
2022-01-21 10:13:09 -06:00
parent 4c0e9da7e1
commit caaa9005b6
2 changed files with 17 additions and 20 deletions

View File

@@ -27,8 +27,8 @@ import Path
import PathScripts.PathLog as PathLog
import PathScripts.PathOp as PathOp
import PathScripts.PathUtils as PathUtils
from PySide.QtCore import QT_TRANSLATE_NOOP
from PySide import QtCore
__title__ = "Path Probing Operation"
__author__ = "sliptonic (Brad Collette)"
@@ -42,11 +42,6 @@ else:
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
# Qt translation handling
def translate(context, text, disambig=None):
return QtCore.QCoreApplication.translate(context, text, disambig)
class ObjectProbing(PathOp.ObjectOp):
"""Proxy object for Probing operation."""
@@ -59,23 +54,19 @@ class ObjectProbing(PathOp.ObjectOp):
"App::PropertyLength",
"Xoffset",
"Probe",
QtCore.QT_TRANSLATE_NOOP(
"App::Property", "X offset between tool and probe"
),
QT_TRANSLATE_NOOP("App::Property", "X offset between tool and probe"),
)
obj.addProperty(
"App::PropertyLength",
"Yoffset",
"Probe",
QtCore.QT_TRANSLATE_NOOP(
"App::Property", "Y offset between tool and probe"
),
QT_TRANSLATE_NOOP("App::Property", "Y offset between tool and probe"),
)
obj.addProperty(
"App::PropertyInteger",
"PointCountX",
"Probe",
QtCore.QT_TRANSLATE_NOOP(
QT_TRANSLATE_NOOP(
"App::Property", "Number of points to probe in X direction"
),
)
@@ -83,7 +74,7 @@ class ObjectProbing(PathOp.ObjectOp):
"App::PropertyInteger",
"PointCountY",
"Probe",
QtCore.QT_TRANSLATE_NOOP(
QT_TRANSLATE_NOOP(
"App::Property", "Number of points to probe in Y direction"
),
)
@@ -91,7 +82,7 @@ class ObjectProbing(PathOp.ObjectOp):
"App::PropertyFile",
"OutputFileName",
"Path",
QtCore.QT_TRANSLATE_NOOP(
QT_TRANSLATE_NOOP(
"App::Property", "The output location for the probe data to be written"
),
)

View File

@@ -26,7 +26,9 @@ 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
import PathScripts.PathLog as PathLog
from PySide.QtCore import QT_TRANSLATE_NOOP
from PySide import QtCore, QtGui
__title__ = "Path Probing Operation UI"
@@ -35,9 +37,13 @@ __url__ = "http://www.freecadweb.org"
__doc__ = "Probing operation page controller and command implementation."
# Qt translation handling
def translate(context, text, disambig=None):
return QtCore.QCoreApplication.translate(context, text, disambig)
if False:
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
PathLog.trackModule(PathLog.thisModule())
else:
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
translate = FreeCAD.Qt.translate
class TaskPanelOpPage(PathOpGui.TaskPanelPage):
@@ -98,8 +104,8 @@ Command = PathOpGui.SetupOperation(
PathProbe.Create,
TaskPanelOpPage,
"Path_Probe",
QtCore.QT_TRANSLATE_NOOP("Probe", "Probe"),
QtCore.QT_TRANSLATE_NOOP("Probe", "Create a Probing Grid from a job stock"),
QtCore.QT_TRANSLATE_NOOP("Path_Probe", "Probe"),
QtCore.QT_TRANSLATE_NOOP("Path_Probe", "Create a Probing Grid from a job stock"),
PathProbe.SetupProperties,
)