diff --git a/src/Mod/Fem/Gui/Resources/Fem.qrc b/src/Mod/Fem/Gui/Resources/Fem.qrc index 8777f6b4dc..351dad3e48 100755 --- a/src/Mod/Fem/Gui/Resources/Fem.qrc +++ b/src/Mod/Fem/Gui/Resources/Fem.qrc @@ -87,7 +87,6 @@ icons/FEM_PostBranchFilter.svg icons/FEM_PostPipelineFromResult.svg icons/FEM_PostLineplot.svg - icons/FEM_PostPlotline.svg icons/FEM_PostHistogram.svg icons/FEM_PostSpreadsheet.svg icons/FEM_PostField.svg diff --git a/src/Mod/Fem/Gui/Resources/icons/FEM_PostField.svg b/src/Mod/Fem/Gui/Resources/icons/FEM_PostField.svg index 5a42219430..a93343fd25 100644 --- a/src/Mod/Fem/Gui/Resources/icons/FEM_PostField.svg +++ b/src/Mod/Fem/Gui/Resources/icons/FEM_PostField.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="FEM_PostField.svg" - inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + inkscape:version="1.4.1 (93de688d07, 2025-03-30)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -25,36 +25,78 @@ inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:zoom="34.537747" - inkscape:cx="8.8743484" - inkscape:cy="9.6850556" + inkscape:cx="8.8598715" + inkscape:cy="9.6561018" inkscape:window-width="3132" inkscape:window-height="1772" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg1" /> - - + + + + + + - - + cx="4.0927677" + cy="12.27616" + rx="2.7138755" + ry="2.7138758" /> + diff --git a/src/Mod/Fem/Gui/Resources/icons/FEM_PostHistogram.svg b/src/Mod/Fem/Gui/Resources/icons/FEM_PostHistogram.svg index 4e6d52d4a1..333e138d83 100644 --- a/src/Mod/Fem/Gui/Resources/icons/FEM_PostHistogram.svg +++ b/src/Mod/Fem/Gui/Resources/icons/FEM_PostHistogram.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="FEM_PostHistogram.svg" - inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + inkscape:version="1.4.1 (93de688d07, 2025-03-30)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -24,17 +24,46 @@ inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" - inkscape:zoom="97.6875" - inkscape:cx="8" - inkscape:cy="8" + inkscape:zoom="48.84375" + inkscape:cx="9.4996801" + inkscape:cy="6.1932182" inkscape:window-width="3132" inkscape:window-height="1772" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg1" /> - + + + + diff --git a/src/Mod/Fem/Gui/Resources/icons/FEM_PostIndex.svg b/src/Mod/Fem/Gui/Resources/icons/FEM_PostIndex.svg index 36c93c04ba..9198dcdba0 100644 --- a/src/Mod/Fem/Gui/Resources/icons/FEM_PostIndex.svg +++ b/src/Mod/Fem/Gui/Resources/icons/FEM_PostIndex.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="FEM_PostIndex.svg" - inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + inkscape:version="1.4.1 (93de688d07, 2025-03-30)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -25,18 +25,18 @@ inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" inkscape:zoom="34.537747" - inkscape:cx="8.8453946" + inkscape:cx="7.7885798" inkscape:cy="9.6561018" - inkscape:window-width="3132" - inkscape:window-height="1772" + inkscape:window-width="1960" + inkscape:window-height="1308" inkscape:window-x="0" inkscape:window-y="0" - inkscape:window-maximized="1" + inkscape:window-maximized="0" inkscape:current-layer="svg1" /> + style="fill:#e5007e;stroke:#260013;stroke-width:0.4;stroke-linecap:square;stroke-linejoin:round;stroke-dasharray:none" + id="path1" + cx="7.9564848" + cy="7.9564848" + r="4.2860532" /> diff --git a/src/Mod/Fem/Gui/Resources/icons/FEM_PostLineplot.svg b/src/Mod/Fem/Gui/Resources/icons/FEM_PostLineplot.svg index 637dac60be..6e90515778 100644 --- a/src/Mod/Fem/Gui/Resources/icons/FEM_PostLineplot.svg +++ b/src/Mod/Fem/Gui/Resources/icons/FEM_PostLineplot.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="FEM_PostLineplot.svg" - inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + inkscape:version="1.4.1 (93de688d07, 2025-03-30)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -24,9 +24,9 @@ inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" - inkscape:zoom="97.6875" - inkscape:cx="8" - inkscape:cy="8" + inkscape:zoom="45.254834" + inkscape:cx="1.6793786" + inkscape:cy="9.534893" inkscape:window-width="3132" inkscape:window-height="1772" inkscape:window-x="0" @@ -34,8 +34,13 @@ inkscape:window-maximized="1" inkscape:current-layer="svg1" /> + id="rect1" + style="fill:#e5007e;fill-opacity:1;stroke:#260013;stroke-width:0.4;stroke-linecap:square;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 0.5234375,0.5390625 V 14.324219 15.548828 H 2.0332031 15.248047 V 14.324219 H 2.0332031 V 0.5390625 Z" + sodipodi:nodetypes="ccccccccc" /> + diff --git a/src/Mod/Fem/Gui/Resources/icons/FEM_PostPlotline.svg b/src/Mod/Fem/Gui/Resources/icons/FEM_PostPlotline.svg deleted file mode 100644 index a788318bac..0000000000 --- a/src/Mod/Fem/Gui/Resources/icons/FEM_PostPlotline.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - diff --git a/src/Mod/Fem/Gui/Resources/icons/FEM_PostSpreadsheet.svg b/src/Mod/Fem/Gui/Resources/icons/FEM_PostSpreadsheet.svg index 6220e8e87f..b8453c0756 100644 --- a/src/Mod/Fem/Gui/Resources/icons/FEM_PostSpreadsheet.svg +++ b/src/Mod/Fem/Gui/Resources/icons/FEM_PostSpreadsheet.svg @@ -8,7 +8,7 @@ version="1.1" id="svg1" sodipodi:docname="FEM_PostSpreadsheet.svg" - inkscape:version="1.4 (e7c3feb100, 2024-10-09)" + inkscape:version="1.4.1 (93de688d07, 2025-03-30)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -24,17 +24,41 @@ inkscape:pageopacity="0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#505050" - inkscape:zoom="97.6875" - inkscape:cx="8" - inkscape:cy="8" + inkscape:zoom="48.84375" + inkscape:cx="2.9277031" + inkscape:cy="8.4248241" inkscape:window-width="3132" inkscape:window-height="1772" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg1" /> + + style="fill:#e5007e;stroke:#260013;stroke-width:0.694259;stroke-linecap:square;stroke-linejoin:round;stroke-dasharray:none" + d="M 1.013422,5.2704734 H 15.11965" + id="path2" /> + + + + diff --git a/src/Mod/Fem/femguiutils/extract_link_view.py b/src/Mod/Fem/femguiutils/extract_link_view.py index 619ea358f1..ba0f151375 100644 --- a/src/Mod/Fem/femguiutils/extract_link_view.py +++ b/src/Mod/Fem/femguiutils/extract_link_view.py @@ -39,6 +39,8 @@ import FreeCADGui from . import post_visualization as pv +translate = FreeCAD.Qt.translate + # a model showing available visualizations and possible extractions # ################################################################# @@ -50,14 +52,14 @@ def build_new_visualization_tree_model(): visualizations = pv.get_registered_visualizations() for vis_name in visualizations: vis_icon = FreeCADGui.getIcon(visualizations[vis_name].icon) - vis_item = QtGui.QStandardItem(vis_icon, f"New {vis_name}") + vis_item = QtGui.QStandardItem(vis_icon, translate("FEM", "New {}").format(vis_name)) vis_item.setFlags(QtGui.Qt.ItemIsEnabled) vis_item.setData(visualizations[vis_name]) for ext in visualizations[vis_name].extractions: icon = FreeCADGui.getIcon(ext.icon) name = ext.name.removeprefix(vis_name) - ext_item = QtGui.QStandardItem(icon, f"with {name}") + ext_item = QtGui.QStandardItem(icon, translate("FEM", "with {}").format(name)) ext_item.setData(ext) vis_item.appendRow(ext_item) model.appendRow(vis_item) @@ -89,7 +91,7 @@ def build_add_to_visualization_tree_model(): for ext in visualizations[vis_type].extractions: icon = FreeCADGui.getIcon(ext.icon) name = ext.name.removeprefix(vis_type) - ext_item = QtGui.QStandardItem(icon, f"Add {name}") + ext_item = QtGui.QStandardItem(icon, translate("FEM", "Add {}").format(name)) ext_item.setData(ext) vis_item.appendRow(ext_item) @@ -101,7 +103,7 @@ def build_add_to_visualization_tree_model(): def build_post_object_item(post_object, extractions, vis_type): # definitely build a item and add the extractions - post_item = QtGui.QStandardItem(post_object.ViewObject.Icon, f"From {post_object.Label}") + post_item = QtGui.QStandardItem(post_object.ViewObject.Icon, translate("FEM", "From {}").format(post_object.Label)) post_item.setFlags(QtGui.Qt.ItemIsEnabled) post_item.setData(post_object) @@ -109,7 +111,7 @@ def build_post_object_item(post_object, extractions, vis_type): for ext in extractions: icon = FreeCADGui.getIcon(ext.icon) name = ext.name.removeprefix(vis_type) - ext_item = QtGui.QStandardItem(icon, f"add {name}") + ext_item = QtGui.QStandardItem(icon, translate("FEM", "add {}").format(name)) ext_item.setData(ext) post_item.appendRow(ext_item) @@ -268,7 +270,7 @@ class _SummaryWidget(QtGui.QWidget): self.viewButton.hide() self.warning = QtGui.QLabel(self) - self.warning.full_text = f"{extractor.Label}: Data source not available" + self.warning.full_text = translate("FEM", "{}: Data source not available").format(extractor.Label) self.rmButton = QtGui.QToolButton(self) self.rmButton.setIcon(QtGui.QIcon.fromTheme("delete")) @@ -462,9 +464,9 @@ class ExtractLinkView(QtGui.QWidget): self._scroll_view.setWidgetResizable(True) hbox = QtGui.QHBoxLayout() - label = QtGui.QLabel("Data used in:") + label = QtGui.QLabel(translate("FEM", "Data used in:")) if not self._is_source: - label.setText("Data used from:") + label.setText(translate("FEM", "Data used from:")) label.setAlignment(QtGui.Qt.AlignBottom) hbox.addWidget(label) @@ -473,19 +475,19 @@ class ExtractLinkView(QtGui.QWidget): if self._is_source: self._add = _TreeChoiceButton(build_add_to_visualization_tree_model()) - self._add.setText("Add data to") + self._add.setText(translate("FEM", "Add data to")) self._add.selection.connect(self.addExtractionToVisualization) hbox.addWidget(self._add) self._create = _TreeChoiceButton(build_new_visualization_tree_model()) - self._create.setText("New") + self._create.setText(translate("FEM", "New")) self._create.selection.connect(self.newVisualization) hbox.addWidget(self._create) else: vis_type = vis.get_visualization_type(self._object) self._add = _TreeChoiceButton(build_add_from_data_tree_model(vis_type)) - self._add.setText("Add data from") + self._add.setText(translate("FEM", "Add data from")) self._add.selection.connect(self.addExtractionToPostObject) hbox.addWidget(self._add) diff --git a/src/Mod/Fem/femguiutils/post_visualization.py b/src/Mod/Fem/femguiutils/post_visualization.py index d1bfc93898..ab895a9a8c 100644 --- a/src/Mod/Fem/femguiutils/post_visualization.py +++ b/src/Mod/Fem/femguiutils/post_visualization.py @@ -95,7 +95,8 @@ class _VisualizationGroupCommand: return 0 def GetResources(self): - return { 'MenuText': 'Data Visualizations', 'ToolTip': 'Different visualizations to show post processing data in'} + return { 'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM", 'Data Visualizations'), + 'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM", 'Different visualizations to show post processing data in')} def IsActive(self): if not FreeCAD.ActiveDocument: @@ -117,7 +118,7 @@ class _VisualizationCommand: return { "Pixmap": vis.icon, - "MenuText": QtCore.QT_TRANSLATE_NOOP(cmd, f"{self._visualization_type}"), + "MenuText": QtCore.QT_TRANSLATE_NOOP(cmd, "Create {}".format(self._visualization_type)), "Accel": "", "ToolTip": QtCore.QT_TRANSLATE_NOOP(cmd, tooltip), "CmdType": "AlterDoc" diff --git a/src/Mod/Fem/femguiutils/vtk_table_view.py b/src/Mod/Fem/femguiutils/vtk_table_view.py index 912aa2aba4..c1263150ac 100644 --- a/src/Mod/Fem/femguiutils/vtk_table_view.py +++ b/src/Mod/Fem/femguiutils/vtk_table_view.py @@ -37,6 +37,8 @@ import FreeCADGui from vtkmodules.vtkIOCore import vtkDelimitedTextWriter +translate = FreeCAD.Qt.translate + class VtkTableModel(QtCore.QAbstractTableModel): # Simple table model. Only supports single component columns # One can supply a header_names dict to replace the table column names @@ -160,14 +162,14 @@ class VtkTableView(QtGui.QWidget): csv_action = QtGui.QAction(self) csv_action.triggered.connect(self.exportCsv) csv_action.setIcon(FreeCADGui.getIcon("Std_Export")) - csv_action.setToolTip("Export to CSV") + csv_action.setToolTip(translate("FEM", "Export to CSV")) self.toolbar.addAction(csv_action) copy_action = QtGui.QAction(self) copy_action.triggered.connect(self.copyToClipboard) copy_action.setIcon(FreeCADGui.getIcon("edit-copy")) shortcut = QtGui.QKeySequence(QtGui.QKeySequence.Copy) - copy_action.setToolTip(f"Copy to clipboard ({shortcut.toString()})") + copy_action.setToolTip(translate("FEM", "Copy selection to clipboard ({})".format(shortcut.toString()))) copy_action.setShortcut(shortcut) self.toolbar.addAction(copy_action) @@ -195,9 +197,9 @@ class VtkTableView(QtGui.QWidget): @QtCore.Slot(bool) def exportCsv(self, state): - file_path, filter = QtGui.QFileDialog.getSaveFileName(None, "Save as csv file", "", "CSV (*.csv)") + file_path, filter = QtGui.QFileDialog.getSaveFileName(None, translate("FEM", "Save as csv file"), "", "CSV (*.csv)") if not file_path: - FreeCAD.Console.PrintMessage("CSV file export aborted: no filename selected") + FreeCAD.Console.PrintMessage(translate("FEM", "CSV file export aborted: no filename selected")) return writer = vtkDelimitedTextWriter() diff --git a/src/Mod/Fem/femobjects/base_fempostextractors.py b/src/Mod/Fem/femobjects/base_fempostextractors.py index 9e4ddac24f..e42d2adf1b 100644 --- a/src/Mod/Fem/femobjects/base_fempostextractors.py +++ b/src/Mod/Fem/femobjects/base_fempostextractors.py @@ -33,6 +33,8 @@ from vtkmodules.vtkCommonCore import vtkIntArray from vtkmodules.vtkCommonCore import vtkDoubleArray from vtkmodules.vtkCommonDataModel import vtkTable +from PySide.QtCore import QT_TRANSLATE_NOOP + from . import base_fempythonobject _PropHelper = base_fempythonobject._PropHelper @@ -78,14 +80,14 @@ class Extractor(base_fempythonobject.BaseFemPythonObject): type="Fem::PropertyPostDataObject", name="Table", group="Base", - doc="The data table that stores the extracted data", + doc=QT_TRANSLATE_NOOP("FEM", "The data table that stores the extracted data"), value=vtkTable(), ), _PropHelper( type="App::PropertyLink", name="Source", group="Base", - doc="The data source from which the data is extracted", + doc=QT_TRANSLATE_NOOP("FEM", "The data source from which the data is extracted"), value=None, ), ] @@ -140,14 +142,14 @@ class Extractor1D(Extractor): type="App::PropertyEnumeration", name="XField", group="X Data", - doc="The field to use as X data", + doc=QT_TRANSLATE_NOOP("FEM", "The field to use as X data"), value=[], ), _PropHelper( type="App::PropertyEnumeration", name="XComponent", group="X Data", - doc="Which part of the X field vector to use for the X axis", + doc=QT_TRANSLATE_NOOP("FEM", "Which part of the X field vector to use for the X axis"), value=[], ), ] @@ -278,14 +280,14 @@ class Extractor2D(Extractor1D): type="App::PropertyEnumeration", name="YField", group="Y Data", - doc="The field to use as Y data", + doc=QT_TRANSLATE_NOOP("FEM", "The field to use as Y data"), value=[], ), _PropHelper( type="App::PropertyEnumeration", name="YComponent", group="Y Data", - doc="Which part of the Y field vector to use for the Y axis", + doc=QT_TRANSLATE_NOOP("FEM", "Which part of the Y field vector to use for the Y axis"), value=[], ), ] diff --git a/src/Mod/Fem/femobjects/post_extract1D.py b/src/Mod/Fem/femobjects/post_extract1D.py index 425a594fae..987dfdabdd 100644 --- a/src/Mod/Fem/femobjects/post_extract1D.py +++ b/src/Mod/Fem/femobjects/post_extract1D.py @@ -39,6 +39,9 @@ from vtkmodules.vtkCommonCore import vtkDoubleArray from vtkmodules.vtkCommonDataModel import vtkTable from vtkmodules.vtkCommonExecutionModel import vtkStreamingDemandDrivenPipeline +from PySide.QtCore import QT_TRANSLATE_NOOP + + class PostFieldData1D(base_fempostextractors.Extractor1D): """ A post processing extraction of one dimensional field data @@ -54,7 +57,7 @@ class PostFieldData1D(base_fempostextractors.Extractor1D): type="App::PropertyBool", name="ExtractFrames", group="Multiframe", - doc="Specify if the field shall be extracted for every available frame", + doc=QT_TRANSLATE_NOOP("FEM", "Specify if the field shall be extracted for every available frame"), value=False, ), ] @@ -126,7 +129,7 @@ class PostIndexOverFrames1D(base_fempostextractors.Extractor1D): type="App::PropertyInteger", name="Index", group="X Data", - doc="Specify for which index the data should be extracted", + doc=QT_TRANSLATE_NOOP("FEM", "Specify for which index the data should be extracted"), value=0, ), ] diff --git a/src/Mod/Fem/femobjects/post_extract2D.py b/src/Mod/Fem/femobjects/post_extract2D.py index 0b9e5c528e..baa5f3d8c2 100644 --- a/src/Mod/Fem/femobjects/post_extract2D.py +++ b/src/Mod/Fem/femobjects/post_extract2D.py @@ -39,6 +39,9 @@ from vtkmodules.vtkCommonCore import vtkDoubleArray from vtkmodules.vtkCommonDataModel import vtkTable from vtkmodules.vtkCommonExecutionModel import vtkStreamingDemandDrivenPipeline +from PySide.QtCore import QT_TRANSLATE_NOOP + + class PostFieldData2D(base_fempostextractors.Extractor2D): """ A post processing extraction of two dimensional field data @@ -54,7 +57,7 @@ class PostFieldData2D(base_fempostextractors.Extractor2D): type="App::PropertyBool", name="ExtractFrames", group="Multiframe", - doc="Specify if the field shall be extracted for every available frame", + doc=QT_TRANSLATE_NOOP("FEM", "Specify if the field shall be extracted for every available frame"), value=False, ), ] @@ -142,7 +145,7 @@ class PostIndexOverFrames2D(base_fempostextractors.Extractor2D): type="App::PropertyInteger", name="Index", group="Data", - doc="Specify for which point index the data should be extracted", + doc=QT_TRANSLATE_NOOP("FEM", "Specify for which point index the data should be extracted"), value=0, ), ] diff --git a/src/Mod/Fem/femtaskpanels/base_fempostpanel.py b/src/Mod/Fem/femtaskpanels/base_fempostpanel.py index a9edb902ec..08c067de7f 100644 --- a/src/Mod/Fem/femtaskpanels/base_fempostpanel.py +++ b/src/Mod/Fem/femtaskpanels/base_fempostpanel.py @@ -37,6 +37,8 @@ import FreeCADGui from femguiutils import selection_widgets from . import base_femtaskpanel +translate = FreeCAD.Qt.translate + class _BasePostTaskPanel(base_femtaskpanel._BaseTaskPanel): """ @@ -60,6 +62,12 @@ class _BasePostTaskPanel(base_femtaskpanel._BaseTaskPanel): if button == QtGui.QDialogButtonBox.Apply: self.obj.Document.recompute() + def open(self): + # open a new transaction if non is open + if not FreeCAD.getActiveTransaction(): + FreeCAD.ActiveDocument.openTransaction(translate("FEM", "Edit {}").format(self.obj.Label)) + + # Helper functions # ################ diff --git a/src/Mod/Fem/femtaskpanels/task_post_histogram.py b/src/Mod/Fem/femtaskpanels/task_post_histogram.py index 79b4e4eeab..496fc1792a 100644 --- a/src/Mod/Fem/femtaskpanels/task_post_histogram.py +++ b/src/Mod/Fem/femtaskpanels/task_post_histogram.py @@ -38,6 +38,8 @@ from . import base_fempostpanel from femguiutils import extract_link_view as elv from femguiutils import vtk_table_view +translate = FreeCAD.Qt.translate + class _TaskPanel(base_fempostpanel._BasePostTaskPanel): """ The TaskPanel for editing properties of glyph filter @@ -50,10 +52,10 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): self.data_widget = QtGui.QWidget() hbox = QtGui.QHBoxLayout() self.data_widget.show_plot = QtGui.QPushButton() - self.data_widget.show_plot.setText("Show plot") + self.data_widget.show_plot.setText(translate("FEM", "Show plot")) hbox.addWidget(self.data_widget.show_plot) self.data_widget.show_table = QtGui.QPushButton() - self.data_widget.show_table.setText("Show data") + self.data_widget.show_table.setText(translate("FEM", "Show data")) hbox.addWidget(self.data_widget.show_table) vbox = QtGui.QVBoxLayout() vbox.addItem(hbox) @@ -63,7 +65,7 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): vbox.addWidget(extracts) self.data_widget.setLayout(vbox) - self.data_widget.setWindowTitle("Histogram data") + self.data_widget.setWindowTitle(translate("FEM", "Histogram data")) self.data_widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostHistogram.svg")) @@ -71,7 +73,7 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): self.view_widget = FreeCADGui.PySideUic.loadUi( FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/TaskPostHistogram.ui" ) - self.view_widget.setWindowTitle("Histogram view settings") + self.view_widget.setWindowTitle(translate("FEM", "Histogram view settings")) self.view_widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostHistogram.svg")) self.__init_widgets() diff --git a/src/Mod/Fem/femtaskpanels/task_post_lineplot.py b/src/Mod/Fem/femtaskpanels/task_post_lineplot.py index 507e6b3cbf..474d84b80b 100644 --- a/src/Mod/Fem/femtaskpanels/task_post_lineplot.py +++ b/src/Mod/Fem/femtaskpanels/task_post_lineplot.py @@ -38,6 +38,8 @@ from . import base_fempostpanel from femguiutils import extract_link_view as elv from femguiutils import vtk_table_view +translate = FreeCAD.Qt.translate + class _TaskPanel(base_fempostpanel._BasePostTaskPanel): """ The TaskPanel for editing properties of glyph filter @@ -50,10 +52,10 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): self.data_widget = QtGui.QWidget() hbox = QtGui.QHBoxLayout() self.data_widget.show_plot = QtGui.QPushButton() - self.data_widget.show_plot.setText("Show plot") + self.data_widget.show_plot.setText(translate("FEM", "Show plot")) hbox.addWidget(self.data_widget.show_plot) self.data_widget.show_table = QtGui.QPushButton() - self.data_widget.show_table.setText("Show data") + self.data_widget.show_table.setText(translate("FEM", "Show data")) hbox.addWidget(self.data_widget.show_table) vbox = QtGui.QVBoxLayout() vbox.addItem(hbox) @@ -63,7 +65,7 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): vbox.addWidget(extracts) self.data_widget.setLayout(vbox) - self.data_widget.setWindowTitle("Lineplot data") + self.data_widget.setWindowTitle(translate("FEM", "Lineplot data")) self.data_widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostLineplot.svg")) @@ -71,7 +73,7 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): self.view_widget = FreeCADGui.PySideUic.loadUi( FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/TaskPostLineplot.ui" ) - self.view_widget.setWindowTitle("Lineplot view settings") + self.view_widget.setWindowTitle(translate("FEM", "Lineplot view settings")) self.view_widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostLineplot.svg")) self.__init_widgets() diff --git a/src/Mod/Fem/femtaskpanels/task_post_table.py b/src/Mod/Fem/femtaskpanels/task_post_table.py index e17f584c01..b75549eeb9 100644 --- a/src/Mod/Fem/femtaskpanels/task_post_table.py +++ b/src/Mod/Fem/femtaskpanels/task_post_table.py @@ -38,6 +38,8 @@ from . import base_fempostpanel from femguiutils import extract_link_view as elv from femguiutils import vtk_table_view +translate = FreeCAD.Qt.translate + class _TaskPanel(base_fempostpanel._BasePostTaskPanel): """ The TaskPanel for editing properties of glyph filter @@ -49,7 +51,7 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): # data widget self.data_widget = QtGui.QWidget() self.data_widget.show_table = QtGui.QPushButton() - self.data_widget.show_table.setText("Show table") + self.data_widget.show_table.setText(translate("FEM", "Show table")) vbox = QtGui.QVBoxLayout() vbox.addWidget(self.data_widget.show_table) @@ -59,17 +61,9 @@ class _TaskPanel(base_fempostpanel._BasePostTaskPanel): vbox.addWidget(extracts) self.data_widget.setLayout(vbox) - self.data_widget.setWindowTitle("Table data") + self.data_widget.setWindowTitle(translate("FEM", "Table data")) self.data_widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostSpreadsheet.svg")) - - # histogram parameter widget - #self.view_widget = FreeCADGui.PySideUic.loadUi( - # FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/TaskPostTable.ui" - #) - #self.view_widget.setWindowTitle("Table view settings") - #self.view_widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostTable.svg")) - self.__init_widgets() # form made from param and selection widget diff --git a/src/Mod/Fem/femviewprovider/view_post_histogram.py b/src/Mod/Fem/femviewprovider/view_post_histogram.py index 69aed4101f..fdbd975300 100644 --- a/src/Mod/Fem/femviewprovider/view_post_histogram.py +++ b/src/Mod/Fem/femviewprovider/view_post_histogram.py @@ -35,6 +35,7 @@ import FreeCADGui import Plot import FemGui from PySide import QtGui, QtCore +from PySide.QtCore import QT_TRANSLATE_NOOP import io import numpy as np @@ -48,6 +49,7 @@ from femtaskpanels import task_post_histogram _GuiPropHelper = view_base_fempostvisualization._GuiPropHelper + class EditViewWidget(QtGui.QWidget): def __init__(self, obj, post_dialog): @@ -260,49 +262,49 @@ class VPPostHistogramFieldData(view_base_fempostextractors.VPPostExtractor): type="App::PropertyString", name="Legend", group="HistogramPlot", - doc="The name used in the plots legend", + doc=QT_TRANSLATE_NOOP("FEM", "The name used in the plots legend"), value="", ), _GuiPropHelper( type="App::PropertyColor", name="BarColor", group="HistogramBar", - doc="The color the data bin area is drawn with", + doc=QT_TRANSLATE_NOOP("FEM", "The color the data bin area is drawn with"), value=(0, 85, 255, 255), ), _GuiPropHelper( type="App::PropertyEnumeration", name="Hatch", group="HistogramBar", - doc="The hatch pattern drawn in the bar", + doc=QT_TRANSLATE_NOOP("FEM", "The hatch pattern drawn in the bar"), value=['None', '/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'], ), _GuiPropHelper( type="App::PropertyIntegerConstraint", name="HatchDensity", group="HistogramBar", - doc="The line width of the hatch", + doc=QT_TRANSLATE_NOOP("FEM", "The line width of the hatch)"), value=(1, 1, 99, 1), ), _GuiPropHelper( type="App::PropertyColor", name="LineColor", group="HistogramLine", - doc="The color the data bin area is drawn with", + doc=QT_TRANSLATE_NOOP("FEM", "The color the data bin area is drawn with"), value=(0, 0, 0, 1), # black ), _GuiPropHelper( type="App::PropertyFloatConstraint", name="LineWidth", group="HistogramLine", - doc="The width of the bar, between 0 and 1 (1 being without gaps)", + doc=QT_TRANSLATE_NOOP("FEM", "The width of the bar, between 0 and 1 (1 being without gaps)"), value=(1, 0, 99, 0.1), ), _GuiPropHelper( type="App::PropertyEnumeration", name="LineStyle", group="HistogramLine", - doc="The style the line is drawn in", + doc=QT_TRANSLATE_NOOP("FEM", "The style the line is drawn in"), value=['None', '-', '--', '-.', ':'], ), ] @@ -390,70 +392,70 @@ class VPPostHistogram(view_base_fempostvisualization.VPPostVisualization): type="App::PropertyBool", name="Cumulative", group="Histogram", - doc="If be the bars shoud show the cumulative sum left to rigth", + doc=QT_TRANSLATE_NOOP("FEM", "If be the bars shoud show the cumulative sum left to rigth"), value=False, ), _GuiPropHelper( type="App::PropertyEnumeration", name="Type", group="Histogram", - doc="The type of histogram plotted", + doc=QT_TRANSLATE_NOOP("FEM", "The type of histogram plotted"), value=["bar","barstacked", "step", "stepfilled"], ), _GuiPropHelper( type="App::PropertyFloatConstraint", name="BarWidth", group="Histogram", - doc="The width of the bar, between 0 and 1 (1 being without gaps)", + doc=QT_TRANSLATE_NOOP("FEM", "The width of the bar, between 0 and 1 (1 being without gaps)"), value=(0.9, 0, 1, 0.05), ), _GuiPropHelper( type="App::PropertyFloatConstraint", name="HatchLineWidth", group="Histogram", - doc="The line width of all drawn hatch patterns", + doc=QT_TRANSLATE_NOOP("FEM", "The line width of all drawn hatch patterns"), value=(1, 0, 99, 0.1), ), _GuiPropHelper( type="App::PropertyInteger", name="Bins", group="Histogram", - doc="The number of bins the data is split into", + doc=QT_TRANSLATE_NOOP("FEM", "The number of bins the data is split into"), value=10, ), _GuiPropHelper( type="App::PropertyString", name="Title", group="Plot", - doc="The histogram plot title", + doc=QT_TRANSLATE_NOOP("FEM", "The histogram plot title"), value="", ), _GuiPropHelper( type="App::PropertyString", name="XLabel", group="Plot", - doc="The label shown for the histogram X axis", + doc=QT_TRANSLATE_NOOP("FEM", "The label shown for the histogram X axis"), value="", ), _GuiPropHelper( type="App::PropertyString", name="YLabel", group="Plot", - doc="The label shown for the histogram Y axis", + doc=QT_TRANSLATE_NOOP("FEM", "The label shown for the histogram Y axis"), value="", ), _GuiPropHelper( type="App::PropertyBool", name="Legend", group="Plot", - doc="Determines if the legend is plotted", + doc=QT_TRANSLATE_NOOP("FEM", "Determines if the legend is plotted"), value=True, ), _GuiPropHelper( type="App::PropertyEnumeration", name="LegendLocation", group="Plot", - doc="Determines if the legend is plotted", + doc=QT_TRANSLATE_NOOP("FEM", "Determines if the legend is plotted"), value=['best','upper right','upper left','lower left','lower right','right', 'center left','center right','lower center','upper center','center'], ), diff --git a/src/Mod/Fem/femviewprovider/view_post_lineplot.py b/src/Mod/Fem/femviewprovider/view_post_lineplot.py index dfd7f2b5b4..9d2d821e66 100644 --- a/src/Mod/Fem/femviewprovider/view_post_lineplot.py +++ b/src/Mod/Fem/femviewprovider/view_post_lineplot.py @@ -35,6 +35,8 @@ import FreeCADGui import Plot import FemGui from PySide import QtGui, QtCore +from PySide.QtCore import QT_TRANSLATE_NOOP + import io import numpy as np @@ -265,43 +267,43 @@ class VPPostLineplotFieldData(view_base_fempostextractors.VPPostExtractor): type="App::PropertyString", name="Legend", group="Lineplot", - doc="The name used in the plots legend", + doc=QT_TRANSLATE_NOOP("FEM", "The name used in the plots legend"), value="", ), _GuiPropHelper( type="App::PropertyColor", name="Color", group="Lineplot", - doc="The color the line and the markers are drawn with", + doc=QT_TRANSLATE_NOOP("FEM", "The color the line and the markers are drawn with"), value=(0, 85, 255, 255), ), _GuiPropHelper( type="App::PropertyEnumeration", name="LineStyle", group="Lineplot", - doc="The style the line is drawn in", + doc=QT_TRANSLATE_NOOP("FEM", "The style the line is drawn in"), value=['-', '--', '-.', ':', 'None'], ), _GuiPropHelper( type="App::PropertyFloatConstraint", name="LineWidth", group="Lineplot", - doc="The width the line is drawn with", + doc=QT_TRANSLATE_NOOP("FEM", "The width the line is drawn with"), value=(1, 0.1, 99, 0.1), ), _GuiPropHelper( type="App::PropertyEnumeration", name="MarkerStyle", group="Lineplot", - doc="The style the data markers are drawn with", + doc=QT_TRANSLATE_NOOP("FEM", "The style the data markers are drawn with"), value=['None', '*', '+', 's', '.', 'o', 'x'], ), _GuiPropHelper( type="App::PropertyFloatConstraint", name="MarkerSize", group="Lineplot", - doc="The size the data markers are drawn in", - value=(10, 0.1, 99, 0.1), + doc=QT_TRANSLATE_NOOP("FEM", "The size the data markers are drawn in"), + value=(5, 0.1, 99, 0.1), ), ] return super()._get_properties() + prop @@ -389,49 +391,49 @@ class VPPostLineplot(view_base_fempostvisualization.VPPostVisualization): type="App::PropertyBool", name="Grid", group="Lineplot", - doc="If be the bars shoud show the cumulative sum left to rigth", + doc=QT_TRANSLATE_NOOP("FEM", "If be the bars shoud show the cumulative sum left to rigth"), value=True, ), _GuiPropHelper( type="App::PropertyEnumeration", name="Scale", group="Lineplot", - doc="The scale the axis are drawn in", + doc=QT_TRANSLATE_NOOP("FEM", "The scale the axis are drawn in"), value=["linear","semi-log x", "semi-log y", "log"], ), _GuiPropHelper( type="App::PropertyString", name="Title", group="Plot", - doc="The histogram plot title", + doc=QT_TRANSLATE_NOOP("FEM", "The histogram plot title"), value="", ), _GuiPropHelper( type="App::PropertyString", name="XLabel", group="Plot", - doc="The label shown for the histogram X axis", + doc=QT_TRANSLATE_NOOP("FEM", "The label shown for the histogram X axis"), value="", ), _GuiPropHelper( type="App::PropertyString", name="YLabel", group="Plot", - doc="The label shown for the histogram Y axis", + doc=QT_TRANSLATE_NOOP("FEM", "The label shown for the histogram Y axis"), value="", ), _GuiPropHelper( type="App::PropertyBool", name="Legend", group="Plot", - doc="Determines if the legend is plotted", + doc=QT_TRANSLATE_NOOP("FEM", "Determines if the legend is plotted"), value=True, ), _GuiPropHelper( type="App::PropertyEnumeration", name="LegendLocation", group="Plot", - doc="Determines if the legend is plotted", + doc=QT_TRANSLATE_NOOP("FEM", "Determines if the legend is plotted"), value=['best','upper right','upper left','lower left','lower right','right', 'center left','center right','lower center','upper center','center'], ), diff --git a/src/Mod/Fem/femviewprovider/view_post_table.py b/src/Mod/Fem/femviewprovider/view_post_table.py index 7b07cc785f..ac20fd2f01 100644 --- a/src/Mod/Fem/femviewprovider/view_post_table.py +++ b/src/Mod/Fem/femviewprovider/view_post_table.py @@ -35,6 +35,7 @@ import FreeCADGui import Plot import FemGui from PySide import QtGui, QtCore +from PySide.QtCore import QT_TRANSLATE_NOOP import io import numpy as np @@ -186,7 +187,7 @@ class VPPostTableFieldData(view_base_fempostextractors.VPPostExtractor): type="App::PropertyString", name="Name", group="Table", - doc="The name used in the table header. Default name is used if empty", + doc=QT_TRANSLATE_NOOP("FEM", "The name used in the table header. Default name is used if empty"), value="", ), ]