From f47ee0f68d7126d03bd9d5e184bace0f8a2d1372 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 5 Oct 2022 08:20:09 +0200 Subject: [PATCH] Part: split DlgImportExportStep into sub-widgets in order to be used independently --- src/Mod/Part/Gui/CMakeLists.txt | 6 + src/Mod/Part/Gui/DlgExportHeaderStep.ui | 68 ++++++++ src/Mod/Part/Gui/DlgExportStep.cpp | 77 ++++++--- src/Mod/Part/Gui/DlgExportStep.h | 25 +++ src/Mod/Part/Gui/DlgExportStep.ui | 60 +------ src/Mod/Part/Gui/DlgImportStep.cpp | 109 ++++++++++++ src/Mod/Part/Gui/DlgImportStep.h | 55 ++++++ src/Mod/Part/Gui/DlgImportStep.ui | 217 ++++++++++++++++++++++++ src/Mod/Part/Gui/DlgSettingsGeneral.cpp | 131 +++----------- src/Mod/Part/Gui/DlgSettingsGeneral.h | 8 +- 10 files changed, 570 insertions(+), 186 deletions(-) create mode 100644 src/Mod/Part/Gui/DlgExportHeaderStep.ui create mode 100644 src/Mod/Part/Gui/DlgImportStep.cpp create mode 100644 src/Mod/Part/Gui/DlgImportStep.h create mode 100644 src/Mod/Part/Gui/DlgImportStep.ui diff --git a/src/Mod/Part/Gui/CMakeLists.txt b/src/Mod/Part/Gui/CMakeLists.txt index f89e1e0905..d05643ca03 100644 --- a/src/Mod/Part/Gui/CMakeLists.txt +++ b/src/Mod/Part/Gui/CMakeLists.txt @@ -49,7 +49,9 @@ set(PartGui_UIC_SRCS Mirroring.ui DlgBooleanOperation.ui DlgExportStep.ui + DlgExportHeaderStep.ui DlgExtrusion.ui + DlgImportStep.ui DlgFilletEdges.ui DlgImportExportIges.ui DlgImportExportStep.ui @@ -104,12 +106,16 @@ SET(PartGui_SRCS DlgExportStep.cpp DlgExportStep.h DlgExportStep.ui + DlgExportHeaderStep.ui DlgExtrusion.cpp DlgExtrusion.h DlgExtrusion.ui DlgFilletEdges.cpp DlgFilletEdges.h DlgFilletEdges.ui + DlgImportStep.cpp + DlgImportStep.h + DlgImportStep.ui DlgImportExportIges.ui DlgImportExportStep.ui DlgPartBox.ui diff --git a/src/Mod/Part/Gui/DlgExportHeaderStep.ui b/src/Mod/Part/Gui/DlgExportHeaderStep.ui new file mode 100644 index 0000000000..f982aebdfa --- /dev/null +++ b/src/Mod/Part/Gui/DlgExportHeaderStep.ui @@ -0,0 +1,68 @@ + + + PartGui::DlgExportHeaderStep + + + + 0 + 0 + 445 + 149 + + + + STEP + + + + + + If not empty, field contents will be used in the STEP file header. + + + Header + + + + + + Company + + + + + + + + + + Author + + + + + + + + + + Product + + + + + + + + + + + + + lineEditCompany + lineEditAuthor + lineEditProduct + + + + diff --git a/src/Mod/Part/Gui/DlgExportStep.cpp b/src/Mod/Part/Gui/DlgExportStep.cpp index 202eee11a1..b09b5ba10e 100644 --- a/src/Mod/Part/Gui/DlgExportStep.cpp +++ b/src/Mod/Part/Gui/DlgExportStep.cpp @@ -38,6 +38,7 @@ #include "DlgExportStep.h" #include "ui_DlgExportStep.h" +#include "ui_DlgExportHeaderStep.h" using namespace PartGui; @@ -54,22 +55,11 @@ DlgExportStep::DlgExportStep(QWidget* parent) ui->comboBoxSchema->setItemData(3, QByteArray("AP214IS")); ui->comboBoxSchema->setItemData(4, QByteArray("AP242DIS")); - ui->lineEditProduct->setReadOnly(true); - // https://tracker.dev.opencascade.org/view.php?id=25654 ui->checkBoxPcurves->setToolTip(tr("This parameter indicates whether parametric curves (curves in parametric space of surface)\n" "should be written into the STEP file. This parameter can be set to off in order to minimize\n" "the size of the resulting STEP file.")); - QRegExp rx; - rx.setPattern(QString::fromLatin1("[\\x00-\\x7F]+")); - QRegExpValidator* companyValidator = new QRegExpValidator(ui->lineEditCompany); - companyValidator->setRegExp(rx); - ui->lineEditCompany->setValidator(companyValidator); - QRegExpValidator* authorValidator = new QRegExpValidator(ui->lineEditAuthor); - authorValidator->setRegExp(rx); - ui->lineEditAuthor->setValidator(authorValidator); - Part::OCAF::ImportExportSettings settings; ui->checkBoxExportHiddenObj->setChecked(settings.getExportHiddenObject()); ui->checkBoxExportLegacy->setChecked(settings.getExportLegacy()); @@ -99,10 +89,6 @@ void DlgExportStep::saveSettings() QByteArray schema = ui->comboBoxSchema->itemData(ui->comboBoxSchema->currentIndex()).toByteArray(); settings.setScheme(schema); - // header info - settings.setCompany(ui->lineEditCompany->text().toLatin1()); - settings.setAuthor(ui->lineEditAuthor->text().toLatin1()); - // (h)STEP of Import module ui->checkBoxExportHiddenObj->onSave(); ui->checkBoxExportLegacy->onSave(); @@ -124,11 +110,6 @@ void DlgExportStep::loadSettings() if (index >= 0) ui->comboBoxSchema->setCurrentIndex(index); - // header info - ui->lineEditCompany->setText(QString::fromStdString(settings.getCompany())); - ui->lineEditAuthor->setText(QString::fromStdString(settings.getAuthor())); - ui->lineEditProduct->setText(QString::fromStdString(settings.getProductName())); - // (h)STEP of Import module ui->checkBoxExportHiddenObj->onRestore(); ui->checkBoxExportLegacy->onRestore(); @@ -159,6 +140,62 @@ void DlgExportStep::changeEvent(QEvent *e) // ---------------------------------------------------------------------------- +DlgExportHeaderStep::DlgExportHeaderStep(QWidget* parent) + : PreferencePage(parent) + , ui(new Ui_DlgExportHeaderStep) +{ + ui->setupUi(this); + + ui->lineEditProduct->setReadOnly(true); + + QRegExp rx; + rx.setPattern(QString::fromLatin1("[\\x00-\\x7F]+")); + QRegExpValidator* companyValidator = new QRegExpValidator(ui->lineEditCompany); + companyValidator->setRegExp(rx); + ui->lineEditCompany->setValidator(companyValidator); + QRegExpValidator* authorValidator = new QRegExpValidator(ui->lineEditAuthor); + authorValidator->setRegExp(rx); + ui->lineEditAuthor->setValidator(authorValidator); +} + +DlgExportHeaderStep::~DlgExportHeaderStep() +{ +} + +void DlgExportHeaderStep::saveSettings() +{ + Part::STEP::ImportExportSettings settings; + + // header info + settings.setCompany(ui->lineEditCompany->text().toLatin1()); + settings.setAuthor(ui->lineEditAuthor->text().toLatin1()); +} + +void DlgExportHeaderStep::loadSettings() +{ + Part::STEP::ImportExportSettings settings; + + // header info + ui->lineEditCompany->setText(QString::fromStdString(settings.getCompany())); + ui->lineEditAuthor->setText(QString::fromStdString(settings.getAuthor())); + ui->lineEditProduct->setText(QString::fromStdString(settings.getProductName())); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgExportHeaderStep::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + ui->retranslateUi(this); + } + else { + QWidget::changeEvent(e); + } +} + +// ---------------------------------------------------------------------------- + TaskExportStep::TaskExportStep(QWidget* parent) : QDialog(parent) , ui(new DlgExportStep(this)) diff --git a/src/Mod/Part/Gui/DlgExportStep.h b/src/Mod/Part/Gui/DlgExportStep.h index 02651f4674..4779226c94 100644 --- a/src/Mod/Part/Gui/DlgExportStep.h +++ b/src/Mod/Part/Gui/DlgExportStep.h @@ -40,6 +40,8 @@ struct StepSettings bool keepPlacement = false; }; +// ---------------------------------------------------------------------------- + class Ui_DlgExportStep; class DlgExportStep : public Gui::Dialog::PreferencePage { @@ -61,6 +63,29 @@ private: std::unique_ptr ui; }; +// ---------------------------------------------------------------------------- + +class Ui_DlgExportHeaderStep; +class DlgExportHeaderStep : public Gui::Dialog::PreferencePage +{ + Q_OBJECT + +public: + explicit DlgExportHeaderStep(QWidget* parent = nullptr); + ~DlgExportHeaderStep() override; + + void saveSettings() override; + void loadSettings() override; + +protected: + void changeEvent(QEvent *e) override; + +private: + std::unique_ptr ui; +}; + +// ---------------------------------------------------------------------------- + class PartGuiExport TaskExportStep : public QDialog { Q_OBJECT diff --git a/src/Mod/Part/Gui/DlgExportStep.ui b/src/Mod/Part/Gui/DlgExportStep.ui index b51dd23958..7659a8e78e 100644 --- a/src/Mod/Part/Gui/DlgExportStep.ui +++ b/src/Mod/Part/Gui/DlgExportStep.ui @@ -7,7 +7,7 @@ 0 0 445 - 426 + 278 @@ -155,61 +155,6 @@ it inside the Placement property. - - - - If not empty, field contents will be used in the STEP file header. - - - Header - - - - - - Company - - - - - - - - - - Author - - - - - - - - - - Product - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 82 - - - - @@ -223,9 +168,6 @@ it inside the Placement property. comboBoxUnits checkBoxPcurves checkBoxExportHiddenObj - lineEditCompany - lineEditAuthor - lineEditProduct diff --git a/src/Mod/Part/Gui/DlgImportStep.cpp b/src/Mod/Part/Gui/DlgImportStep.cpp new file mode 100644 index 0000000000..35418a53c8 --- /dev/null +++ b/src/Mod/Part/Gui/DlgImportStep.cpp @@ -0,0 +1,109 @@ +/*************************************************************************** + * Copyright (c) 2022 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" +#ifndef _PreComp_ +# include +# include +# include +# include +# include +# include +# include +#endif + +#include +#include +#include +#include + +#include "DlgImportStep.h" +#include "ui_DlgImportStep.h" + + +using namespace PartGui; + +DlgImportStep::DlgImportStep(QWidget* parent) + : PreferencePage(parent) + , ui(new Ui_DlgImportStep) +{ + ui->setupUi(this); + + Part::OCAF::ImportExportSettings settings; + ui->checkBoxMergeCompound->setChecked(settings.getReadShapeCompoundMode()); + ui->checkBoxImportHiddenObj->setChecked(settings.getImportHiddenObject()); + ui->checkBoxUseLinkGroup->setChecked(settings.getUseLinkGroup()); + ui->checkBoxUseBaseName->setChecked(settings.getUseBaseName()); + ui->checkBoxReduceObjects->setChecked(settings.getReduceObjects()); + ui->checkBoxExpandCompound->setChecked(settings.getExpandCompound()); + ui->checkBoxShowProgress->setChecked(settings.getShowProgress()); +} + +/** + * Destroys the object and frees any allocated resources + */ +DlgImportStep::~DlgImportStep() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgImportStep::saveSettings() +{ + // (h)STEP of Import module + ui->checkBoxMergeCompound->onSave(); + ui->checkBoxImportHiddenObj->onSave(); + ui->checkBoxUseLinkGroup->onSave(); + ui->checkBoxUseBaseName->onSave(); + ui->checkBoxReduceObjects->onSave(); + ui->checkBoxExpandCompound->onSave(); + ui->checkBoxShowProgress->onSave(); + ui->comboBoxImportMode->onSave(); +} + +void DlgImportStep::loadSettings() +{ + // (h)STEP of Import module + ui->checkBoxMergeCompound->onRestore(); + ui->checkBoxImportHiddenObj->onRestore(); + ui->checkBoxUseLinkGroup->onRestore(); + ui->checkBoxUseBaseName->onRestore(); + ui->checkBoxReduceObjects->onRestore(); + ui->checkBoxExpandCompound->onRestore(); + ui->checkBoxShowProgress->onRestore(); + ui->comboBoxImportMode->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgImportStep::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + ui->retranslateUi(this); + } + else { + QWidget::changeEvent(e); + } +} + + +#include "moc_DlgImportStep.cpp" diff --git a/src/Mod/Part/Gui/DlgImportStep.h b/src/Mod/Part/Gui/DlgImportStep.h new file mode 100644 index 0000000000..c623780b12 --- /dev/null +++ b/src/Mod/Part/Gui/DlgImportStep.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (c) 2022 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef PARTGUI_DLGIMPORTSTEP_H +#define PARTGUI_DLGIMPORTSTEP_H + +#include + +class QButtonGroup; +class QCheckBox; + +namespace PartGui { + +class Ui_DlgImportStep; +class DlgImportStep : public Gui::Dialog::PreferencePage +{ + Q_OBJECT + +public: + explicit DlgImportStep(QWidget* parent = nullptr); + ~DlgImportStep() override; + + void saveSettings() override; + void loadSettings() override; + +protected: + void changeEvent(QEvent *e) override; + +private: + std::unique_ptr ui; +}; + +} // namespace PartGui + +#endif // PARTGUI_DLGIMPORTSTEP_H diff --git a/src/Mod/Part/Gui/DlgImportStep.ui b/src/Mod/Part/Gui/DlgImportStep.ui new file mode 100644 index 0000000000..e079dd2960 --- /dev/null +++ b/src/Mod/Part/Gui/DlgImportStep.ui @@ -0,0 +1,217 @@ + + + PartGui::DlgImportStep + + + + 0 + 0 + 445 + 292 + + + + STEP + + + + + + Import + + + + + + If checked, no Compound merge will be done +during file reading (slower but higher details). + + + Enable STEP Compound merge + + + ReadShapeCompoundMode + + + Mod/Import/hSTEP + + + + + + + Select this to use App::LinkGroup as group container, or else use App::Part. + + + Use LinkGroup + + + UseLinkGroup + + + Mod/Import + + + + + + + Select this to not import any invisible objects. + + + Import invisible objects + + + ImportHiddenObject + + + Mod/Import + + + + + + + Reduce number of objects using Link array + + + Reduce number of objects + + + ReduceObjects + + + Mod/Import + + + + + + + Expand compound shape with multiple solids + + + Expand compound shape + + + ExpandCompound + + + Mod/Import + + + + + + + Show progress bar when importing + + + Show progress bar when importing + + + ShowProgress + + + Mod/Import + + + + + + + Do not use instance name. Useful for some legacy STEP file with non-meaningful auto generated instance names. + + + Ignore instance names + + + UseBaseName + + + Mod/Import + + + + + + + + + Mode + + + + + + + + 0 + 0 + + + + ImportMode + + + Mod/Import + + + + Single document + + + + + Assembly per document + + + + + Assembly per document in sub-directory + + + + + Object per document + + + + + Object per document in sub-directory + + + + + + + + + + + + + + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
+
+ + checkBoxMergeCompound + checkBoxUseLinkGroup + checkBoxImportHiddenObj + checkBoxReduceObjects + checkBoxExpandCompound + checkBoxShowProgress + checkBoxUseBaseName + comboBoxImportMode + + + +
diff --git a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp index 86e896e3fe..e93551604c 100644 --- a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp +++ b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp @@ -23,6 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ # include +# include # include # include # include @@ -39,6 +40,8 @@ #include "ui_DlgSettingsGeneral.h" #include "ui_DlgImportExportIges.h" #include "ui_DlgImportExportStep.h" +#include "DlgExportStep.h" +#include "DlgImportStep.h" using namespace PartGui; @@ -169,45 +172,23 @@ void DlgImportExportIges::changeEvent(QEvent *e) // ---------------------------------------------------------------------------- DlgImportExportStep::DlgImportExportStep(QWidget* parent) - : PreferencePage(parent), ui(new Ui_DlgImportExportStep) + : PreferencePage(parent) + , exportStep(new DlgExportStep(this)) + , importStep(new DlgImportStep(this)) + , headerStep(new DlgExportHeaderStep(this)) { - ui->setupUi(this); + setWindowTitle(tr("STEP")); + QVBoxLayout* layout = new QVBoxLayout(this); + layout->setSpacing(0); + layout->setContentsMargins(0, 0, 0, 0); + setLayout(layout); - ui->comboBoxSchema->setItemData(0, QByteArray("AP203")); - ui->comboBoxSchema->setItemData(1, QByteArray("AP214CD")); - ui->comboBoxSchema->setItemData(2, QByteArray("AP214DIS")); - ui->comboBoxSchema->setItemData(3, QByteArray("AP214IS")); - ui->comboBoxSchema->setItemData(4, QByteArray("AP242DIS")); + layout->addWidget(exportStep); + layout->addWidget(importStep); + layout->addWidget(headerStep); - ui->lineEditProduct->setReadOnly(true); - //ui->radioButtonAP203->setToolTip(tr("Configuration controlled 3D designs of mechanical parts and assemblies")); - //ui->radioButtonAP214->setToolTip(tr("Core data for automotive mechanical design processes")); - - // https://tracker.dev.opencascade.org/view.php?id=25654 - ui->checkBoxPcurves->setToolTip(tr("This parameter indicates whether parametric curves (curves in parametric space of surface)\n" - "should be written into the STEP file. This parameter can be set to off in order to minimize\n" - "the size of the resulting STEP file.")); - - QRegExp rx; - rx.setPattern(QString::fromLatin1("[\\x00-\\x7F]+")); - QRegExpValidator* companyValidator = new QRegExpValidator(ui->lineEditCompany); - companyValidator->setRegExp(rx); - ui->lineEditCompany->setValidator(companyValidator); - QRegExpValidator* authorValidator = new QRegExpValidator(ui->lineEditAuthor); - authorValidator->setRegExp(rx); - ui->lineEditAuthor->setValidator(authorValidator); - - Part::OCAF::ImportExportSettings settings; - ui->checkBoxMergeCompound->setChecked(settings.getReadShapeCompoundMode()); - ui->checkBoxExportHiddenObj->setChecked(settings.getExportHiddenObject()); - ui->checkBoxImportHiddenObj->setChecked(settings.getImportHiddenObject()); - ui->checkBoxExportLegacy->setChecked(settings.getExportLegacy()); - ui->checkBoxKeepPlacement->setChecked(settings.getExportKeepPlacement()); - ui->checkBoxUseLinkGroup->setChecked(settings.getUseLinkGroup()); - ui->checkBoxUseBaseName->setChecked(settings.getUseBaseName()); - ui->checkBoxReduceObjects->setChecked(settings.getReduceObjects()); - ui->checkBoxExpandCompound->setChecked(settings.getExpandCompound()); - ui->checkBoxShowProgress->setChecked(settings.getShowProgress()); + QSpacerItem* verticalSpacer = new QSpacerItem(20, 82, QSizePolicy::Minimum, QSizePolicy::Expanding); + layout->addItem(verticalSpacer); } /** @@ -220,82 +201,22 @@ DlgImportExportStep::~DlgImportExportStep() void DlgImportExportStep::saveSettings() { - // General - Part::STEP::ImportExportSettings settings; - settings.setWriteSurfaceCurveMode(ui->checkBoxPcurves->isChecked()); - - // STEP - int unit = ui->comboBoxUnits->currentIndex(); - settings.setUnit(static_cast(unit)); - - // scheme - // possible values: AP203, AP214CD (1996), AP214DIS (1998), AP214IS (2002), AP242DIS - QByteArray schema = ui->comboBoxSchema->itemData(ui->comboBoxSchema->currentIndex()).toByteArray(); - settings.setScheme(schema); - - // header info - settings.setCompany(ui->lineEditCompany->text().toLatin1()); - settings.setAuthor(ui->lineEditAuthor->text().toLatin1()); - - // (h)STEP of Import module - ui->checkBoxMergeCompound->onSave(); - ui->checkBoxExportHiddenObj->onSave(); - ui->checkBoxExportLegacy->onSave(); - ui->checkBoxKeepPlacement->onSave(); - ui->checkBoxImportHiddenObj->onSave(); - ui->checkBoxUseLinkGroup->onSave(); - ui->checkBoxUseBaseName->onSave(); - ui->checkBoxReduceObjects->onSave(); - ui->checkBoxExpandCompound->onSave(); - ui->checkBoxShowProgress->onSave(); - ui->comboBoxImportMode->onSave(); + exportStep->saveSettings(); + importStep->saveSettings(); + headerStep->saveSettings(); } void DlgImportExportStep::loadSettings() { - // General - Part::STEP::ImportExportSettings settings; - ui->checkBoxPcurves->setChecked(settings.getWriteSurfaceCurveMode()); - - // STEP - ui->comboBoxUnits->setCurrentIndex(static_cast(settings.getUnit())); - - // scheme - QByteArray ap(settings.getScheme().c_str()); - int index = ui->comboBoxSchema->findData(QVariant(ap)); - if (index >= 0) - ui->comboBoxSchema->setCurrentIndex(index); - - // header info - ui->lineEditCompany->setText(QString::fromStdString(settings.getCompany())); - ui->lineEditAuthor->setText(QString::fromStdString(settings.getAuthor())); - ui->lineEditProduct->setText(QString::fromStdString(settings.getProductName())); - - // (h)STEP of Import module - ui->checkBoxMergeCompound->onRestore(); - ui->checkBoxExportHiddenObj->onRestore(); - ui->checkBoxExportLegacy->onRestore(); - ui->checkBoxKeepPlacement->onRestore(); - ui->checkBoxImportHiddenObj->onRestore(); - ui->checkBoxUseLinkGroup->onRestore(); - ui->checkBoxUseBaseName->onRestore(); - ui->checkBoxReduceObjects->onRestore(); - ui->checkBoxExpandCompound->onRestore(); - ui->checkBoxShowProgress->onRestore(); - ui->comboBoxImportMode->onRestore(); + exportStep->loadSettings(); + importStep->loadSettings(); + headerStep->loadSettings(); } -/** - * Sets the strings of the subwidgets using the current language. - */ -void DlgImportExportStep::changeEvent(QEvent *e) +void DlgImportExportStep::changeEvent(QEvent *) { - if (e->type() == QEvent::LanguageChange) { - ui->retranslateUi(this); - } - else { - QWidget::changeEvent(e); - } + // do nothing } + #include "moc_DlgSettingsGeneral.cpp" diff --git a/src/Mod/Part/Gui/DlgSettingsGeneral.h b/src/Mod/Part/Gui/DlgSettingsGeneral.h index 25935dc9b6..1d34553c80 100644 --- a/src/Mod/Part/Gui/DlgSettingsGeneral.h +++ b/src/Mod/Part/Gui/DlgSettingsGeneral.h @@ -67,7 +67,9 @@ private: QButtonGroup* bg; }; -class Ui_DlgImportExportStep; +class DlgExportStep; +class DlgImportStep; +class DlgExportHeaderStep; class DlgImportExportStep : public Gui::Dialog::PreferencePage { Q_OBJECT @@ -82,7 +84,9 @@ protected: void changeEvent(QEvent *e) override; private: - std::unique_ptr ui; + DlgExportStep* exportStep; + DlgImportStep* importStep; + DlgExportHeaderStep* headerStep; }; } // namespace Gui