diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp index b8833756f9..810708cfd5 100644 --- a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp +++ b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp @@ -41,7 +41,8 @@ #include "DlgPrefsTechDraw1Imp.h" #include "DlgPrefsTechDraw2Imp.h" -#include "DlgPrefsTechDraw3Imp.h" +#include "DlgPrefsTechDrawAnnotationImp.h" +#include "DlgPrefsTechDrawDimensionsImp.h" #include "DlgPrefsTechDraw4Imp.h" #include "DlgPrefsTechDraw5Imp.h" #include "ViewProviderPage.h" @@ -151,7 +152,8 @@ PyMOD_INIT_FUNC(TechDrawGui) // register preferences pages new Gui::PrefPageProducer ("TechDraw"); //General new Gui::PrefPageProducer ("TechDraw"); //Scale - new Gui::PrefPageProducer ("TechDraw"); //Dimensions + new Gui::PrefPageProducer ("TechDraw"); //Annotation + new Gui::PrefPageProducer("TechDraw"); //Dimensions new Gui::PrefPageProducer ("TechDraw"); //HLR new Gui::PrefPageProducer ("TechDraw"); //Advanced diff --git a/src/Mod/TechDraw/Gui/CMakeLists.txt b/src/Mod/TechDraw/Gui/CMakeLists.txt index 43ab8e5eeb..35edc2ce17 100644 --- a/src/Mod/TechDraw/Gui/CMakeLists.txt +++ b/src/Mod/TechDraw/Gui/CMakeLists.txt @@ -46,7 +46,8 @@ set(TechDrawGui_MOC_HDRS TaskProjGroup.h DlgPrefsTechDraw1Imp.h DlgPrefsTechDraw2Imp.h - DlgPrefsTechDraw3Imp.h + DlgPrefsTechDrawAnnotationImp.h + DlgPrefsTechDrawDimensionsImp.h DlgPrefsTechDraw4Imp.h DlgPrefsTechDraw5Imp.h TaskLinkDim.h @@ -86,7 +87,8 @@ endif() set(TechDrawGui_UIC_SRCS DlgPrefsTechDraw1.ui DlgPrefsTechDraw2.ui - DlgPrefsTechDraw3.ui + DlgPrefsTechDrawAnnotation.ui + DlgPrefsTechDrawDimensions.ui DlgPrefsTechDraw4.ui DlgPrefsTechDraw5.ui TaskProjGroup.ui @@ -151,9 +153,12 @@ SET(TechDrawGui_SRCS DlgPrefsTechDraw2.ui DlgPrefsTechDraw2Imp.cpp DlgPrefsTechDraw2Imp.h - DlgPrefsTechDraw3.ui - DlgPrefsTechDraw3Imp.cpp - DlgPrefsTechDraw3Imp.h + DlgPrefsTechDrawAnnotation.ui + DlgPrefsTechDrawAnnotationImp.cpp + DlgPrefsTechDrawAnnotationImp.h + DlgPrefsTechDrawDimensions.ui + DlgPrefsTechDrawDimensionsImp.cpp + DlgPrefsTechDrawDimensionsImp.h DlgPrefsTechDraw4.ui DlgPrefsTechDraw4Imp.cpp DlgPrefsTechDraw4Imp.h diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui similarity index 63% rename from src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui rename to src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui index c2d313e355..088c917a31 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui @@ -1,13 +1,13 @@ - TechDrawGui::DlgPrefsTechDraw3Imp - + TechDrawGui::DlgPrefsTechDrawAnnotationImp + 0 0 460 - 790 + 460 @@ -17,374 +17,9 @@ - Dimensions + Annotation - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 0 - - - - Dimensions - - - - - - - - - 0 - 0 - - - - Standard and Style - - - - - - - - 0 - 0 - - - - - 184 - 22 - - - - Standard to be used for dimensional values - - - StandardAndStyle - - - /Mod/TechDraw/Dimensions - - - - ISO Oriented - - - - - ISO Referencing - - - - - ASME Inlined - - - - - ASME Referencing - - - - - - - - - 0 - 0 - - - - Use system setting for number of decimals - - - Use Global Decimals - - - true - - - UseGlobalDecimals - - - /Mod/TechDraw/Dimensions - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - Append unit to dimension values - - - Show Units - - - ShowUnits - - - /Mod/TechDraw/Dimensions - - - - - - - Alternate Decimals - - - - - - - false - - - - 0 - 0 - - - - - 0 - 22 - - - - Number of decimals if 'Use Global Decimals' is not used - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 2 - - - AltDecimals - - - /Mod/TechDraw/Dimensions - - - - - - - - true - - - - Font Size - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - Dimension text font size - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 4.000000000000000 - - - FontSize - - - /Mod/TechDraw/Dimensions - - - - - - - Diameter Symbol - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - 12 - - - - Character used to indicate diameter dimensions - - - ⌀ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - DiameterSymbol - - - /Mod/TechDraw/Dimensions - - - - - - - - true - - - - Arrow Style - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - Arrowhead style - - - -1 - - - ArrowStyle - - - Mod/TechDraw/Dimensions - - - - - - - - true - - - - Arrow Size - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - Arrowhead size - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 5.000000000000000 - - - ArrowSize - - - Mod/TechDraw/Dimensions - - - - - - - - + @@ -1201,148 +836,6 @@ - - - - - 0 - 0 - - - - - 0 - 85 - - - - - 16777215 - 500 - - - - - 0 - 500 - - - - Conventions - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Projection Group Angle - - - - - - - - 0 - 0 - - - - - 184 - 0 - - - - Use first- or third-angle mutliview projection convention - - - ProjectionAngle - - - Mod/TechDraw/General - - - - First - - - - - Third - - - - - - - - Hidden Line Style - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Style for hidden lines - - - HiddenLine - - - Mod/TechDraw/General - - - - Continuous - - - - :/icons/continuous-line.svg:/icons/continuous-line.svg - - - - - Dashed - - - - :/icons/dash-line.svg:/icons/dash-line.svg - - - - - - - - - @@ -1383,11 +876,6 @@ QWidget
Gui/QuantitySpinBox.h
- - Gui::PrefSpinBox - QSpinBox -
Gui/PrefWidgets.h
-
Gui::PrefCheckBox QCheckBox @@ -1412,22 +900,5 @@ - - - cbGlobalDecimals - toggled(bool) - sbAltDecimals - setDisabled(bool) - - - 108 - 71 - - - 425 - 124 - - - - +
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp similarity index 66% rename from src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp rename to src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp index 624527ce47..22eb09e6d3 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (c) 2015 FreeCAD Developers * - * Author: WandererFan * + * Copyright (c) 2020 FreeCAD Developers * + * Author: Uwe Stöhr * * Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp * * * * This file is part of the FreeCAD CAx development system. * @@ -31,105 +31,75 @@ #include #include "DrawGuiUtil.h" -#include "DlgPrefsTechDraw3Imp.h" +#include "DlgPrefsTechDrawAnnotationImp.h" using namespace TechDrawGui; using namespace TechDraw; -DlgPrefsTechDraw3Imp::DlgPrefsTechDraw3Imp( QWidget* parent ) +DlgPrefsTechDrawAnnotationImp::DlgPrefsTechDrawAnnotationImp( QWidget* parent ) : PreferencePage( parent ) { this->setupUi(this); - plsb_FontSize->setUnit(Base::Unit::Length); - plsb_FontSize->setMinimum(0); - plsb_ArrowSize->setUnit(Base::Unit::Length); - plsb_ArrowSize->setMinimum(0); pdsbBalloonKink->setUnit(Base::Unit::Length); pdsbBalloonKink->setMinimum(0); } -DlgPrefsTechDraw3Imp::~DlgPrefsTechDraw3Imp() +DlgPrefsTechDrawAnnotationImp::~DlgPrefsTechDrawAnnotationImp() { // no need to delete child widgets, Qt does it all for us } -void DlgPrefsTechDraw3Imp::saveSettings() +void DlgPrefsTechDrawAnnotationImp::saveSettings() { cbAutoHoriz->onSave(); - cbGlobalDecimals->onSave(); - cbHiddenLineStyle->onSave(); cbPrintCenterMarks->onSave(); - cbProjAngle->onSave(); cbPyramidOrtho->onSave(); cbSectionLineStd->onSave(); cbShowCenterMarks->onSave(); - cbShowUnits->onSave(); - leDiameter->onSave(); leLineGroup->onSave(); - pcbArrow->onSave(); pcbBalloonArrow->onSave(); pcbBalloonShape->onSave(); pcbCenterStyle->onSave(); pcbMatting->onSave(); pcbSectionStyle->onSave(); - pcbStandardAndStyle->onSave(); pdsbBalloonKink->onSave(); - plsb_ArrowSize->onSave(); - plsb_FontSize->onSave(); - sbAltDecimals->onSave(); cbCutSurface->onSave(); pcbHighlightStyle->onSave(); } -void DlgPrefsTechDraw3Imp::loadSettings() +void DlgPrefsTechDrawAnnotationImp::loadSettings() { //set defaults for Quantity widgets if property not found //Quantity widgets do not use preset value since they are based on //QAbstractSpinBox double kinkDefault = 5.0; pdsbBalloonKink->setValue(kinkDefault); - double arrowDefault = 5.0; - plsb_ArrowSize->setValue(arrowDefault); - double fontDefault = 4.0; - plsb_FontSize->setValue(fontDefault); cbAutoHoriz->onRestore(); - cbGlobalDecimals->onRestore(); - cbHiddenLineStyle->onRestore(); cbPrintCenterMarks->onRestore(); - cbProjAngle->onRestore(); cbPyramidOrtho->onRestore(); cbSectionLineStd->onRestore(); cbShowCenterMarks->onRestore(); - cbShowUnits->onRestore(); - leDiameter->onRestore(); leLineGroup->onRestore(); - pcbArrow->onRestore(); pcbBalloonArrow->onRestore(); pcbBalloonShape->onRestore(); pcbCenterStyle->onRestore(); pcbMatting->onRestore(); pcbSectionStyle->onRestore(); - pcbStandardAndStyle->onRestore(); pdsbBalloonKink->onRestore(); - plsb_ArrowSize->onRestore(); - plsb_FontSize->onRestore(); - sbAltDecimals->onRestore(); cbCutSurface->onRestore(); pcbHighlightStyle->onRestore(); DrawGuiUtil::loadArrowBox(pcbBalloonArrow); pcbBalloonArrow->setCurrentIndex(prefBalloonArrow()); - DrawGuiUtil::loadArrowBox(pcbArrow); - pcbArrow->setCurrentIndex(prefArrowStyle()); } /** * Sets the strings of the subwidgets using the current language. */ -void DlgPrefsTechDraw3Imp::changeEvent(QEvent *e) +void DlgPrefsTechDrawAnnotationImp::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { saveSettings(); @@ -141,7 +111,7 @@ void DlgPrefsTechDraw3Imp::changeEvent(QEvent *e) } } -int DlgPrefsTechDraw3Imp::prefBalloonArrow(void) const +int DlgPrefsTechDrawAnnotationImp::prefBalloonArrow(void) const { Base::Reference hGrp = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")-> @@ -150,15 +120,4 @@ int DlgPrefsTechDraw3Imp::prefBalloonArrow(void) const return end; } -int DlgPrefsTechDraw3Imp::prefArrowStyle(void) const -{ - Base::Reference hGrp = App::GetApplication().GetUserParameter(). - GetGroup("BaseApp")->GetGroup("Preferences")-> - GetGroup("Mod/TechDraw/Dimensions"); - int style = hGrp->GetInt("ArrowStyle", 0); - return style; -} - - - -#include +#include diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.h new file mode 100644 index 0000000000..22b9ed283c --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.h @@ -0,0 +1,51 @@ + /************************************************************************** + * Copyright (c) 2020 FreeCAD Developers * + * Author: Uwe Stöhr * + * * + * 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 DRAWINGGUI_DLGPREFSTECHDRAWIMPANNOTATION_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMPANNOTATION_H + +#include +#include + +namespace TechDrawGui { + +class DlgPrefsTechDrawAnnotationImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawAnnotationImp +{ + Q_OBJECT + +public: + DlgPrefsTechDrawAnnotationImp( QWidget* parent = 0 ); + ~DlgPrefsTechDrawAnnotationImp(); + +protected: + void saveSettings(); + void loadSettings(); + void changeEvent(QEvent *e); + + int prefBalloonArrow(void) const; +}; + +} // namespace TechDrawGui + +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMPANNOTATION_H diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui new file mode 100644 index 0000000000..7246bbd49f --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui @@ -0,0 +1,617 @@ + + + TechDrawGui::DlgPrefsTechDrawDimensionsImp + + + + 0 + 0 + 460 + 425 + + + + + 0 + 0 + + + + Dimensions + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + + + Dimensions + + + + + + + + + 0 + 0 + + + + Standard and Style + + + + + + + + 0 + 0 + + + + + 184 + 22 + + + + Standard to be used for dimensional values + + + StandardAndStyle + + + /Mod/TechDraw/Dimensions + + + + ISO Oriented + + + + + ISO Referencing + + + + + ASME Inlined + + + + + ASME Referencing + + + + + + + + + 0 + 0 + + + + Use system setting for number of decimals + + + Use Global Decimals + + + true + + + UseGlobalDecimals + + + /Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + Append unit to dimension values + + + Show Units + + + ShowUnits + + + /Mod/TechDraw/Dimensions + + + + + + + Alternate Decimals + + + + + + + false + + + + 0 + 0 + + + + + 0 + 22 + + + + Number of decimals if 'Use Global Decimals' is not used + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 2 + + + AltDecimals + + + /Mod/TechDraw/Dimensions + + + + + + + + true + + + + Font Size + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + Dimension text font size + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 4.000000000000000 + + + FontSize + + + /Mod/TechDraw/Dimensions + + + + + + + Diameter Symbol + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + 12 + + + + Character used to indicate diameter dimensions + + + ⌀ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + DiameterSymbol + + + /Mod/TechDraw/Dimensions + + + + + + + + true + + + + Arrow Style + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + Arrowhead style + + + -1 + + + ArrowStyle + + + Mod/TechDraw/Dimensions + + + + + + + + true + + + + Arrow Size + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + Arrowhead size + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + ArrowSize + + + Mod/TechDraw/Dimensions + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 85 + + + + + 16777215 + 500 + + + + + 0 + 500 + + + + Conventions + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Projection Group Angle + + + + + + + + 0 + 0 + + + + + 184 + 0 + + + + Use first- or third-angle mutliview projection convention + + + ProjectionAngle + + + Mod/TechDraw/General + + + + First + + + + + Third + + + + + + + + Hidden Line Style + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Style for hidden lines + + + HiddenLine + + + Mod/TechDraw/General + + + + Continuous + + + + :/icons/continuous-line.svg:/icons/continuous-line.svg + + + + + Dashed + + + + :/icons/dash-line.svg:/icons/dash-line.svg + + + + + + + + + + + + + + 12 + true + + + + QFrame::Box + + + Items in italics are default values for new objects. They have no effect on existing objects. + + + true + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + Gui::QuantitySpinBox + QWidget +
Gui/QuantitySpinBox.h
+
+ + Gui::PrefSpinBox + QSpinBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefLineEdit + QLineEdit +
Gui/PrefWidgets.h
+
+ + Gui::PrefUnitSpinBox + Gui::QuantitySpinBox +
Gui/PrefWidgets.h
+
+
+ + + + + + cbGlobalDecimals + toggled(bool) + sbAltDecimals + setDisabled(bool) + + + 108 + 71 + + + 425 + 124 + + + + +
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp new file mode 100644 index 0000000000..bb35d48211 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp @@ -0,0 +1,119 @@ +/*************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp * + * * + * 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" + +#include + +#include +#include + +#include "DrawGuiUtil.h" +#include "DlgPrefsTechDrawDimensionsImp.h" + + +using namespace TechDrawGui; +using namespace TechDraw; + + +DlgPrefsTechDrawDimensionsImp::DlgPrefsTechDrawDimensionsImp( QWidget* parent ) + : PreferencePage( parent ) +{ + this->setupUi(this); + plsb_FontSize->setUnit(Base::Unit::Length); + plsb_FontSize->setMinimum(0); + plsb_ArrowSize->setUnit(Base::Unit::Length); + plsb_ArrowSize->setMinimum(0); +} + +DlgPrefsTechDrawDimensionsImp::~DlgPrefsTechDrawDimensionsImp() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgPrefsTechDrawDimensionsImp::saveSettings() +{ + cbGlobalDecimals->onSave(); + cbHiddenLineStyle->onSave(); + cbProjAngle->onSave(); + cbShowUnits->onSave(); + leDiameter->onSave(); + pcbArrow->onSave(); + pcbStandardAndStyle->onSave(); + plsb_ArrowSize->onSave(); + plsb_FontSize->onSave(); + sbAltDecimals->onSave(); +} + +void DlgPrefsTechDrawDimensionsImp::loadSettings() +{ + //set defaults for Quantity widgets if property not found + //Quantity widgets do not use preset value since they are based on + //QAbstractSpinBox + double arrowDefault = 5.0; + plsb_ArrowSize->setValue(arrowDefault); + double fontDefault = 4.0; + plsb_FontSize->setValue(fontDefault); + + cbGlobalDecimals->onRestore(); + cbHiddenLineStyle->onRestore(); + cbProjAngle->onRestore(); + cbShowUnits->onRestore(); + leDiameter->onRestore(); + pcbArrow->onRestore(); + pcbStandardAndStyle->onRestore(); + plsb_ArrowSize->onRestore(); + plsb_FontSize->onRestore(); + sbAltDecimals->onRestore(); + + DrawGuiUtil::loadArrowBox(pcbArrow); + pcbArrow->setCurrentIndex(prefArrowStyle()); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgPrefsTechDrawDimensionsImp::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + saveSettings(); + retranslateUi(this); + loadSettings(); + } + else { + QWidget::changeEvent(e); + } +} + +int DlgPrefsTechDrawDimensionsImp::prefArrowStyle(void) const +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter(). + GetGroup("BaseApp")->GetGroup("Preferences")-> + GetGroup("Mod/TechDraw/Dimensions"); + int style = hGrp->GetInt("ArrowStyle", 0); + return style; +} + +#include diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.h similarity index 80% rename from src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.h rename to src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.h index 5f54564c0a..da6f747646 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.h +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.h @@ -1,7 +1,6 @@ /************************************************************************** * Copyright (c) 2015 FreeCAD Developers * * Author: WandererFan * - * Based on src/Mod/FEM/Gui/DlgPrefsTechDraw3Imp.cpp * * * * This file is part of the FreeCAD CAx development system. * * * @@ -23,33 +22,31 @@ ***************************************************************************/ -#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H -#define DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H +#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPDIMENSIONS_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMPDIMENSIONS_H -#include +#include #include namespace TechDrawGui { -class DlgPrefsTechDraw3Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw3Imp +class DlgPrefsTechDrawDimensionsImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawDimensionsImp { Q_OBJECT public: - DlgPrefsTechDraw3Imp( QWidget* parent = 0 ); - ~DlgPrefsTechDraw3Imp(); + DlgPrefsTechDrawDimensionsImp( QWidget* parent = 0 ); + ~DlgPrefsTechDrawDimensionsImp(); protected: void saveSettings(); void loadSettings(); void changeEvent(QEvent *e); - - int prefBalloonArrow(void) const; - int prefArrowStyle(void) const; + int prefArrowStyle(void) const; }; } // namespace TechDrawGui -#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMPDIMENSIONS_H