remove UnicodeUTF8

This commit is contained in:
wmayer 2016-12-27 18:31:05 +01:00
parent bf94b19116
commit 0f53d8224b
8 changed files with 72 additions and 144 deletions

View File

@ -54,8 +54,7 @@ class PlotWorkbench(Workbench):
msg = QtGui.QApplication.translate(
"plot_console",
"matplotlib not found, Plot module will be disabled",
None,
QtGui.QApplication.UnicodeUTF8)
None)
FreeCAD.Console.PrintMessage(msg + '\n')

View File

@ -43,8 +43,7 @@ except ImportError:
msg = PySide.QtGui.QApplication.translate(
"plot_console",
"matplotlib not found, so Plot module can not be loaded",
None,
PySide.QtGui.QApplication.UnicodeUTF8)
None)
FreeCAD.Console.PrintMessage(msg + '\n')
raise ImportError("matplotlib not installed")

View File

@ -97,8 +97,7 @@ class Grid:
msg = QtGui.QApplication.translate(
"plot_console",
"The grid must be activated on top of a plot document",
None,
QtGui.QApplication.UnicodeUTF8)
None)
FreeCAD.Console.PrintError(msg + "\n")
return
flag = plt.isGrid()
@ -126,8 +125,7 @@ class Legend:
msg = QtGui.QApplication.translate(
"plot_console",
"The legend must be activated on top of a plot document",
None,
QtGui.QApplication.UnicodeUTF8)
None)
FreeCAD.Console.PrintError(msg + "\n")
return
flag = plt.isLegend()

View File

@ -175,139 +175,114 @@ class TaskPanel:
form.setWindowTitle(QtGui.QApplication.translate(
"plot_axes",
"Configure axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "axesLabel").setText(
QtGui.QApplication.translate("plot_axes",
"Active axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "allAxes").setText(
QtGui.QApplication.translate("plot_axes",
"Apply to all axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "dimLabel").setText(
QtGui.QApplication.translate("plot_axes",
"Dimensions",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "xPosLabel").setText(
QtGui.QApplication.translate("plot_axes",
"X axis position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "yPosLabel").setText(
QtGui.QApplication.translate("plot_axes",
"Y axis position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "scalesLabel").setText(
QtGui.QApplication.translate("plot_axes",
"Scales",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "xAuto").setText(
QtGui.QApplication.translate("plot_axes",
"X auto",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "yAuto").setText(
QtGui.QApplication.translate("plot_axes",
"Y auto",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "allAxes").setText(
QtGui.QApplication.translate("plot_axes",
"Apply to all axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "dimLabel").setText(
QtGui.QApplication.translate("plot_axes",
"Dimensions",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "xPosLabel").setText(
QtGui.QApplication.translate("plot_axes",
"X axis position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "yPosLabel").setText(
QtGui.QApplication.translate("plot_axes",
"Y axis position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "axesIndex").setToolTip(
QtGui.QApplication.translate("plot_axes",
"Index of the active axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QPushButton, "newAxesButton").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Add new axes to the plot",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QPushButton, "delAxesButton").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Remove selected axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "allAxes").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Check it to apply transformations to all axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSlider, "posXMin").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Left bound of axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSlider, "posXMax").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Right bound of axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSlider, "posYMin").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Bottom bound of axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSlider, "posYMax").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Top bound of axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "xOffset").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Outward offset of X axis",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "yOffset").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Outward offset of Y axis",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "xAuto").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"X axis scale autoselection",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "yAuto").setToolTip(
QtGui.QApplication.translate(
"plot_axes",
"Y axis scale autoselection",
None,
QtGui.QApplication.UnicodeUTF8))
None))
def onAxesId(self, value):
"""Executed when axes index is modified."""
@ -365,8 +340,7 @@ class TaskPanel:
msg = QtGui.QApplication.translate(
"plot_console",
"Axes 0 can not be deleted",
None,
QtGui.QApplication.UnicodeUTF8)
None)
App.Console.PrintError(msg + "\n")
return
# Remove axes

View File

@ -133,69 +133,57 @@ class TaskPanel:
self.form.setWindowTitle(QtGui.QApplication.translate(
"plot_labels",
"Set labels",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "axesLabel").setText(
QtGui.QApplication.translate("plot_labels",
"Active axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "titleLabel").setText(
QtGui.QApplication.translate("plot_labels",
"Title",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "xLabel").setText(
QtGui.QApplication.translate("plot_labels",
"X label",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "yLabel").setText(
QtGui.QApplication.translate("plot_labels",
"Y label",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "axesIndex").setToolTip(QtGui.QApplication.translate(
"plot_labels",
"Index of the active axes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLineEdit, "title").setToolTip(
QtGui.QApplication.translate(
"plot_labels",
"Title (associated to active axes)",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "titleSize").setToolTip(
QtGui.QApplication.translate(
"plot_labels",
"Title font size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLineEdit, "titleX").setToolTip(
QtGui.QApplication.translate(
"plot_labels",
"X axis title",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "xSize").setToolTip(
QtGui.QApplication.translate(
"plot_labels",
"X axis title font size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLineEdit, "titleY").setToolTip(
QtGui.QApplication.translate(
"plot_labels",
"Y axis title",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "ySize").setToolTip(
QtGui.QApplication.translate(
"plot_labels",
"Y axis title font size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
def onAxesId(self, value):
""" Executed when axes index is modified. """

View File

@ -121,44 +121,37 @@ class TaskPanel:
self.form.setWindowTitle(QtGui.QApplication.translate(
"plot_positions",
"Set positions and sizes",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "posLabel").setText(
QtGui.QApplication.translate(
"plot_positions",
"Position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "sizeLabel").setText(
QtGui.QApplication.translate(
"plot_positions",
"Size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QListWidget, "items").setToolTip(
QtGui.QApplication.translate(
"plot_positions",
"List of modificable items",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QDoubleSpinBox, "x").setToolTip(
QtGui.QApplication.translate(
"plot_positions",
"X item position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QDoubleSpinBox, "y").setToolTip(
QtGui.QApplication.translate(
"plot_positions",
"Y item position",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QDoubleSpinBox, "size").setToolTip(
QtGui.QApplication.translate(
"plot_positions",
"Item size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
def onItem(self, row):
""" Executed when selected item is modified. """

View File

@ -42,8 +42,7 @@ class TaskPanel:
msg = QtGui.QApplication.translate(
"plot_console",
"Plot document must be selected in order to save it",
None,
QtGui.QApplication.UnicodeUTF8)
None)
App.Console.PrintError(msg + "\n")
return False
mw = self.getMainWindow()
@ -128,51 +127,43 @@ class TaskPanel:
self.form.setWindowTitle(QtGui.QApplication.translate(
"plot_save",
"Save figure",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "sizeLabel").setText(
QtGui.QApplication.translate(
"plot_save",
"Inches",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "dpiLabel").setText(
QtGui.QApplication.translate(
"plot_save",
"Dots per Inch",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLineEdit, "path").setToolTip(
QtGui.QApplication.translate(
"plot_save",
"Output image file path",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QPushButton, "pathButton").setToolTip(
QtGui.QApplication.translate(
"plot_save",
"Show a file selection dialog",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QDoubleSpinBox, "sizeX").setToolTip(
QtGui.QApplication.translate(
"plot_save",
"X image size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QDoubleSpinBox, "sizeY").setToolTip(
QtGui.QApplication.translate(
"plot_save",
"Y image size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "dpi").setToolTip(
QtGui.QApplication.translate(
"plot_save",
"Dots per point, with size will define output image"
" resolution",
None,
QtGui.QApplication.UnicodeUTF8))
None))
def updateUI(self):
""" Setup UI controls values if possible """

View File

@ -149,86 +149,72 @@ class TaskPanel:
self.form.setWindowTitle(QtGui.QApplication.translate(
"plot_series",
"Configure series",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "isLabel").setText(
QtGui.QApplication.translate(
"plot_series",
"No label",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QPushButton, "remove").setText(
QtGui.QApplication.translate(
"plot_series",
"Remove serie",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "styleLabel").setText(
QtGui.QApplication.translate(
"plot_series",
"Line style",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLabel, "markerLabel").setText(
QtGui.QApplication.translate(
"plot_series",
"Marker",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QListWidget, "items").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"List of available series",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QLineEdit, "label").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Line title",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QCheckBox, "isLabel").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"If checked serie will not be considered for legend",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QComboBox, "lineStyle").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Line style",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QComboBox, "markers").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Marker style",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QDoubleSpinBox, "lineWidth").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Line width",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QSpinBox, "markerSize").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Marker size",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QPushButton, "color").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Line and marker color",
None,
QtGui.QApplication.UnicodeUTF8))
None))
self.widget(QtGui.QPushButton, "remove").setToolTip(
QtGui.QApplication.translate(
"plot_series",
"Removes this serie",
None,
QtGui.QApplication.UnicodeUTF8))
None))
def fillStyles(self):
"""Fill the style combo boxes with the availabel ones."""