[TD] split too long preferences dialogs

- as once discussed 2 of the dialogs are too long for smaller screens.

This commits splits the "Dimensions" dialog to "Dimensions" and "Annotation".
This commit is contained in:
donovaly
2020-04-13 23:42:02 +02:00
committed by WandererFan
parent f1a2063a14
commit 57328a136e
8 changed files with 825 additions and 604 deletions

View File

@@ -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<TechDrawGui::DlgPrefsTechDraw1Imp> ("TechDraw"); //General
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw2Imp> ("TechDraw"); //Scale
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw3Imp> ("TechDraw"); //Dimensions
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawAnnotationImp> ("TechDraw"); //Annotation
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawDimensionsImp>("TechDraw"); //Dimensions
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw5Imp> ("TechDraw"); //HLR
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw4Imp> ("TechDraw"); //Advanced

View File

@@ -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

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::DlgPrefsTechDraw3Imp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDraw3Imp">
<class>TechDrawGui::DlgPrefsTechDrawAnnotationImp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDrawAnnotationImp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>790</height>
<height>460</height>
</rect>
</property>
<property name="sizePolicy">
@@ -17,374 +17,9 @@
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dimensions</string>
<string>Annotation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="gbDim">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Dimensions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Standard and Style</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefComboBox" name="pcbStandardAndStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>184</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Standard to be used for dimensional values</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>StandardAndStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
<item>
<property name="text">
<string>ISO Oriented</string>
</property>
</item>
<item>
<property name="text">
<string>ISO Referencing</string>
</property>
</item>
<item>
<property name="text">
<string>ASME Inlined</string>
</property>
</item>
<item>
<property name="text">
<string>ASME Referencing</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbGlobalDecimals">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use system setting for number of decimals</string>
</property>
<property name="text">
<string>Use Global Decimals</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseGlobalDecimals</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowUnits">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Append unit to dimension values</string>
</property>
<property name="text">
<string>Show Units</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowUnits</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Alternate Decimals</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::PrefSpinBox" name="sbAltDecimals">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Number of decimals if 'Use Global Decimals' is not used</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<number>2</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>AltDecimals</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Font Size</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_FontSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Dimension text font size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>4.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>FontSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Diameter Symbol</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefLineEdit" name="leDiameter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="toolTip">
<string>Character used to indicate diameter dimensions</string>
</property>
<property name="text">
<string>⌀</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="prefEntry" stdset="0">
<cstring>DiameterSymbol</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Style</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefComboBox" name="pcbArrow">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead style</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Size</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_ArrowSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
@@ -1201,148 +836,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>85</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>500</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>500</height>
</size>
</property>
<property name="title">
<string>Conventions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_6" columnstretch="1,0,1">
<item row="0" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Projection Group Angle</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefComboBox" name="cbProjAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>184</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Use first- or third-angle mutliview projection convention</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ProjectionAngle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
<item>
<property name="text">
<string>First</string>
</property>
</item>
<item>
<property name="text">
<string>Third</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Hidden Line Style</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefComboBox" name="cbHiddenLineStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Style for hidden lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HiddenLine</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
<item>
<property name="text">
<string>Continuous</string>
</property>
<property name="icon">
<iconset resource="Resources/TechDraw.qrc">
<normaloff>:/icons/continuous-line.svg</normaloff>:/icons/continuous-line.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>Dashed</string>
</property>
<property name="icon">
<iconset resource="Resources/TechDraw.qrc">
<normaloff>:/icons/dash-line.svg</normaloff>:/icons/dash-line.svg</iconset>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<property name="font">
@@ -1383,11 +876,6 @@
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
@@ -1412,22 +900,5 @@
<resources>
<include location="Resources/TechDraw.qrc"/>
</resources>
<connections>
<connection>
<sender>cbGlobalDecimals</sender>
<signal>toggled(bool)</signal>
<receiver>sbAltDecimals</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>108</x>
<y>71</y>
</hint>
<hint type="destinationlabel">
<x>425</x>
<y>124</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* Copyright (c) 2020 FreeCAD Developers *
* Author: Uwe Stöhr <uwestoehr@lyx.org> *
* Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
@@ -31,105 +31,75 @@
#include <Base/Console.h>
#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<ParameterGrp> 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<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Dimensions");
int style = hGrp->GetInt("ArrowStyle", 0);
return style;
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDraw3Imp.cpp>
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawAnnotationImp.cpp>

View File

@@ -0,0 +1,51 @@
/**************************************************************************
* Copyright (c) 2020 FreeCAD Developers *
* Author: Uwe Stöhr <uwestoehr@lyx.org> *
* *
* 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 <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawAnnotation.h>
#include <Gui/PropertyPage.h>
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

View File

@@ -0,0 +1,617 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::DlgPrefsTechDrawDimensionsImp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDrawDimensionsImp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>425</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Dimensions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="gbDim">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Dimensions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Standard and Style</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefComboBox" name="pcbStandardAndStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>184</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Standard to be used for dimensional values</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>StandardAndStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
<item>
<property name="text">
<string>ISO Oriented</string>
</property>
</item>
<item>
<property name="text">
<string>ISO Referencing</string>
</property>
</item>
<item>
<property name="text">
<string>ASME Inlined</string>
</property>
</item>
<item>
<property name="text">
<string>ASME Referencing</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbGlobalDecimals">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use system setting for number of decimals</string>
</property>
<property name="text">
<string>Use Global Decimals</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseGlobalDecimals</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowUnits">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Append unit to dimension values</string>
</property>
<property name="text">
<string>Show Units</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowUnits</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Alternate Decimals</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::PrefSpinBox" name="sbAltDecimals">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Number of decimals if 'Use Global Decimals' is not used</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<number>2</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>AltDecimals</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Font Size</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_FontSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Dimension text font size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>4.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>FontSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Diameter Symbol</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefLineEdit" name="leDiameter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="toolTip">
<string>Character used to indicate diameter dimensions</string>
</property>
<property name="text">
<string>⌀</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="prefEntry" stdset="0">
<cstring>DiameterSymbol</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Style</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefComboBox" name="pcbArrow">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead style</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Size</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_ArrowSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>85</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>500</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>500</height>
</size>
</property>
<property name="title">
<string>Conventions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_6" columnstretch="1,0,1">
<item row="0" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Projection Group Angle</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefComboBox" name="cbProjAngle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>184</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Use first- or third-angle mutliview projection convention</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ProjectionAngle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
<item>
<property name="text">
<string>First</string>
</property>
</item>
<item>
<property name="text">
<string>Third</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Hidden Line Style</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefComboBox" name="cbHiddenLineStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Style for hidden lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HiddenLine</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
<item>
<property name="text">
<string>Continuous</string>
</property>
<property name="icon">
<iconset resource="Resources/TechDraw.qrc">
<normaloff>:/icons/continuous-line.svg</normaloff>:/icons/continuous-line.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>Dashed</string>
</property>
<property name="icon">
<iconset resource="Resources/TechDraw.qrc">
<normaloff>:/icons/dash-line.svg</normaloff>:/icons/dash-line.svg</iconset>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<property name="font">
<font>
<pointsize>12</pointsize>
<italic>true</italic>
</font>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>Items in italics are default values for new objects. They have no effect on existing objects.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefComboBox</class>
<extends>QComboBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefLineEdit</class>
<extends>QLineEdit</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefUnitSpinBox</class>
<extends>Gui::QuantitySpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="Resources/TechDraw.qrc"/>
</resources>
<connections>
<connection>
<sender>cbGlobalDecimals</sender>
<signal>toggled(bool)</signal>
<receiver>sbAltDecimals</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>108</x>
<y>71</y>
</hint>
<hint type="destinationlabel">
<x>425</x>
<y>124</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,119 @@
/***************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* 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 <App/Application.h>
#include <Base/Parameter.h>
#include <Base/Console.h>
#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<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Dimensions");
int style = hGrp->GetInt("ArrowStyle", 0);
return style;
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawDimensionsImp.cpp>

View File

@@ -1,7 +1,6 @@
/**************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* 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 <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw3.h>
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawDimensions.h>
#include <Gui/PropertyPage.h>
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