[TD]Preferences: reorganize and add missing

This commit is contained in:
wandererfan
2020-01-24 23:25:29 -05:00
committed by WandererFan
parent 3ea761dbcb
commit c282924064
25 changed files with 3839 additions and 1257 deletions

View File

@@ -81,8 +81,8 @@ DrawView::DrawView(void):
ADD_PROPERTY_TYPE(Rotation, (0.0), group, App::Prop_None, "Rotation in degrees counterclockwise");
ScaleType.setEnums(ScaleTypeEnums);
ADD_PROPERTY_TYPE(ScaleType, ((long)0), group, App::Prop_None, "Scale Type");
ADD_PROPERTY_TYPE(Scale, (1.0), group, App::Prop_None, "Scale factor of the view");
ADD_PROPERTY_TYPE(ScaleType, (prefScaleType()), group, App::Prop_None, "Scale Type");
ADD_PROPERTY_TYPE(Scale, (prefScale()), group, App::Prop_None, "Scale factor of the view");
Scale.setConstraints(&scaleRange);
ADD_PROPERTY_TYPE(Caption, (""), group, App::Prop_None, "Short text about the view");
@@ -429,6 +429,23 @@ bool DrawView::keepUpdated(void)
return result;
}
int DrawView::prefScaleType(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
int result = hGrp->GetInt("DefaultScaleType", 0);
return result;
}
double DrawView::prefScale(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double result = hGrp->GetInt("DefaultViewScale", 1.0);
return result;
}
void DrawView::requestPaint(void)
{
// Base::Console().Message("DV::requestPaint() - %s\n", getNameInDocument());

View File

@@ -103,6 +103,11 @@ protected:
bool autoPos;
bool mouseMove;
int prefScaleType(void);
double prefScale(void);
private:
static const char* ScaleTypeEnums[];
static App::PropertyFloatConstraint::Constraints scaleRange;

View File

@@ -115,10 +115,10 @@ DrawViewBalloon::DrawViewBalloon(void)
ADD_PROPERTY_TYPE(OriginIsSet, (false), "",(App::PropertyType)(App::Prop_None),"Balloon origin is set");
EndType.setEnums(endTypeEnums);
ADD_PROPERTY(EndType,((long)0));
ADD_PROPERTY(EndType,(prefEnd()));
Symbol.setEnums(balloonTypeEnums);
ADD_PROPERTY(Symbol,((long)0));
ADD_PROPERTY(Symbol,(prefShape()));
ADD_PROPERTY_TYPE(SymbolScale,(1),"",(App::PropertyType)(App::Prop_None),"Balloon symbol scale");
@@ -270,6 +270,23 @@ double DrawViewBalloon::prefKinkLength(void) const
return length;
}
int DrawViewBalloon::prefShape(void) const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
int result = hGrp->GetInt("BalloonShape", 0);
return result;
}
int DrawViewBalloon::prefEnd(void) const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Decorations");
int length = hGrp->GetFloat("BalloonArrow", 5.0);
return length;
}
/*
PyObject *DrawViewBalloon::getPyObject(void)
{

View File

@@ -81,7 +81,8 @@ public:
void handleXYLock(void) override;
double prefKinkLength(void) const;
int prefShape(void) const;
int prefEnd(void) const;
protected:
void onChanged(const App::Property* prop) override;

View File

@@ -151,14 +151,14 @@ DrawViewPart::DrawViewPart(void) :
bool coarseView = hGrp->GetBool("CoarseView", false);
ADD_PROPERTY_TYPE(CoarseView, (coarseView), sgroup, App::Prop_None, "Coarse View on/off");
//add property for visible outline?
ADD_PROPERTY_TYPE(SmoothVisible ,(false),sgroup,App::Prop_None,"Visible Smooth lines on/off");
ADD_PROPERTY_TYPE(SeamVisible ,(false),sgroup,App::Prop_None,"Visible Seam lines on/off");
ADD_PROPERTY_TYPE(IsoVisible ,(false),sgroup,App::Prop_None,"Visible Iso u,v lines on/off");
ADD_PROPERTY_TYPE(HardHidden ,(false),sgroup,App::Prop_None,"Hidden Hard lines on/off");
ADD_PROPERTY_TYPE(SmoothHidden ,(false),sgroup,App::Prop_None,"Hidden Smooth lines on/off");
ADD_PROPERTY_TYPE(SeamHidden ,(false),sgroup,App::Prop_None,"Hidden Seam lines on/off");
ADD_PROPERTY_TYPE(IsoHidden ,(false),sgroup,App::Prop_None,"Hidden Iso u,v lines on/off");
ADD_PROPERTY_TYPE(IsoCount ,(0),sgroup,App::Prop_None,"Number of isoparameters");
ADD_PROPERTY_TYPE(SmoothVisible ,(prefSmoothViz()),sgroup,App::Prop_None,"Show Visible Smooth lines");
ADD_PROPERTY_TYPE(SeamVisible ,(prefSeamViz()),sgroup,App::Prop_None,"Show Visible Seam lines");
ADD_PROPERTY_TYPE(IsoVisible ,(prefIsoViz()),sgroup,App::Prop_None,"Show Visible Iso u,v lines");
ADD_PROPERTY_TYPE(HardHidden ,(prefHardHid()),sgroup,App::Prop_None,"Show Hidden Hard lines");
ADD_PROPERTY_TYPE(SmoothHidden ,(prefSmoothHid()),sgroup,App::Prop_None,"Show Hidden Smooth lines");
ADD_PROPERTY_TYPE(SeamHidden ,(prefSeamHid()),sgroup,App::Prop_None,"Show Hidden Seam lines");
ADD_PROPERTY_TYPE(IsoHidden ,(prefIsoHid()),sgroup,App::Prop_None,"Show Hidden Iso u,v lines");
ADD_PROPERTY_TYPE(IsoCount ,(prefIsoCount()),sgroup,App::Prop_None,"Number of iso parameters lines");
// ADD_PROPERTY_TYPE(CosmeticVertexes ,(0),sgroup,App::Prop_Output,"CosmeticVertex Save/Restore");
// ADD_PROPERTY_TYPE(CosmeticEdges ,(0),sgroup,App::Prop_Output,"CosmeticEdge Save/Restore");
@@ -1220,7 +1220,77 @@ void DrawViewPart::handleChangedPropertyName(Base::XMLReader &reader, const char
DrawView::handleChangedPropertyName(reader, TypeName, PropName);
}
bool DrawViewPart::prefHardViz(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("HardViz", true);
return result;
}
bool DrawViewPart::prefSeamViz(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("SeamViz", true);
return result;
}
bool DrawViewPart::prefSmoothViz(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("SmoothViz", true);
return result;
}
bool DrawViewPart::prefIsoViz(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("IsoViz", true);
return result;
}
bool DrawViewPart::prefHardHid(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("HardHid", true);
return result;
}
bool DrawViewPart::prefSeamHid(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("SeamHid", true);
return result;
}
bool DrawViewPart::prefSmoothHid(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("SmoothHid", true);
return result;
}
bool DrawViewPart::prefIsoHid(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
bool result = hGrp->GetBool("IsoHid", true);
return result;
}
int DrawViewPart::prefIsoCount(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR");
int result = hGrp->GetBool("IsoCount", 0);
return result;
}
// Python Drawing feature ---------------------------------------------------------

View File

@@ -215,6 +215,16 @@ protected:
void handleChangedPropertyName(Base::XMLReader &reader, const char* TypeName, const char* PropName) override;
bool prefHardViz(void);
bool prefSeamViz(void);
bool prefSmoothViz(void);
bool prefIsoViz(void);
bool prefHardHid(void);
bool prefSeamHid(void);
bool prefSmoothHid(void);
bool prefIsoHid(void);
int prefIsoCount(void);
private:
bool nowUnsetting;

View File

@@ -39,8 +39,11 @@
#include "Workbench.h"
#include "MDIViewPage.h"
#include "DlgPrefsTechDrawImp.h"
#include "DlgPrefsTechDraw1Imp.h"
#include "DlgPrefsTechDraw2Imp.h"
#include "DlgPrefsTechDraw3Imp.h"
#include "DlgPrefsTechDraw4Imp.h"
#include "DlgPrefsTechDraw5Imp.h"
#include "ViewProviderPage.h"
#include "ViewProviderDrawingView.h"
#include "ViewProviderDimension.h"
@@ -146,8 +149,11 @@ PyMOD_INIT_FUNC(TechDrawGui)
TechDrawGui::ViewProviderCosmeticExtension::init();
// register preferences pages
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawImp> ("TechDraw");
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw2Imp> ("TechDraw");
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::DlgPrefsTechDraw5Imp> ("TechDraw"); //HLR
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw4Imp> ("TechDraw"); //Advanced
// add resources and reloads the translators
loadTechDrawResource();

View File

@@ -44,8 +44,11 @@ set(TechDrawGui_MOC_HDRS
QGIViewDimension.h
QGIViewBalloon.h
TaskProjGroup.h
DlgPrefsTechDrawImp.h
DlgPrefsTechDraw1Imp.h
DlgPrefsTechDraw2Imp.h
DlgPrefsTechDraw3Imp.h
DlgPrefsTechDraw4Imp.h
DlgPrefsTechDraw5Imp.h
TaskLinkDim.h
DlgTemplateField.h
TaskSectionView.h
@@ -79,8 +82,11 @@ else()
endif()
set(TechDrawGui_UIC_SRCS
DlgPrefsTechDraw.ui
DlgPrefsTechDraw1.ui
DlgPrefsTechDraw2.ui
DlgPrefsTechDraw3.ui
DlgPrefsTechDraw4.ui
DlgPrefsTechDraw5.ui
TaskProjGroup.ui
TaskLinkDim.ui
DlgTemplateField.ui
@@ -137,12 +143,21 @@ SET(TechDrawGui_SRCS
TaskProjGroup.ui
TaskProjGroup.cpp
TaskProjGroup.h
DlgPrefsTechDraw.ui
DlgPrefsTechDrawImp.cpp
DlgPrefsTechDrawImp.h
DlgPrefsTechDraw1.ui
DlgPrefsTechDraw1Imp.cpp
DlgPrefsTechDraw1Imp.h
DlgPrefsTechDraw2.ui
DlgPrefsTechDraw2Imp.cpp
DlgPrefsTechDraw2Imp.h
DlgPrefsTechDraw3.ui
DlgPrefsTechDraw3Imp.cpp
DlgPrefsTechDraw3Imp.h
DlgPrefsTechDraw4.ui
DlgPrefsTechDraw4Imp.cpp
DlgPrefsTechDraw4Imp.h
DlgPrefsTechDraw5.ui
DlgPrefsTechDraw5Imp.cpp
DlgPrefsTechDraw5Imp.h
TaskLinkDim.ui
TaskLinkDim.cpp
TaskLinkDim.h

View File

@@ -25,98 +25,95 @@
#include "PreCompiled.h"
#include "DlgPrefsTechDrawImp.h"
#include "DlgPrefsTechDraw1Imp.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDrawImp::DlgPrefsTechDrawImp( QWidget* parent )
DlgPrefsTechDraw1Imp::DlgPrefsTechDraw1Imp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
plsb_LabelSize->setUnit(Base::Unit::Length);
plsb_TemplateDot->setUnit(Base::Unit::Length);
}
DlgPrefsTechDrawImp::~DlgPrefsTechDrawImp()
DlgPrefsTechDraw1Imp::~DlgPrefsTechDraw1Imp()
{
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDrawImp::saveSettings()
void DlgPrefsTechDraw1Imp::saveSettings()
{
cb_HidLine->onSave();
cb_Angle->onSave();
cb_Faces->onSave();
cb_SectionEdges->onSave();
cb_PageUpdate->onSave();
cb_Global->onSave();
cb_Override->onSave();
cb_AutoDist->onSave();
pcb_Normal->onSave();
pcb_Select->onSave();
pcb_PreSelect->onSave();
pcb_Hidden->onSave();
pcb_Surface->onSave();
pcb_Background->onSave();
pcb_Hatch->onSave();
pcb_Face->onSave();
pcb_PaintFaces->onSave(); //check box!
pfb_LabelFont->onSave();
plsb_LabelSize->onSave();
plsb_TemplateDot->onSave();
pfc_DefTemp->onSave();
pfc_DefDir->onSave();
pfc_HatchFile->onSave();
pfc_FilePattern->onSave();
pfc_LineGroup->onSave();
pfc_Welding->onSave();
pfc_FilePattern->onSave();
le_NamePattern->onSave();
pfb_LabelFont->onSave();
plsb_LabelSize->onSave();
cb_Global->onSave();
cb_Override->onSave();
cb_PageUpdate->onSave();
cb_AutoDist->onSave();
pcbDimColor->onSave();
pcb_Hatch->onSave();
pcb_Background->onSave();
pcb_PreSelect->onSave();
pcb_Hidden->onSave();
pcb_Select->onSave();
pcb_Normal->onSave();
pcb_Surface->onSave();
pcb_GeomHatch->onSave();
pcb_Face->onSave();
pcb_PaintFaces->onSave();
pcbSectionLine->onSave();
pcbCenterColor->onSave();
pcbVertexColor->onSave();
}
void DlgPrefsTechDrawImp::loadSettings()
void DlgPrefsTechDraw1Imp::loadSettings()
{
cb_HidLine->onRestore();
cb_Angle->onRestore();
cb_Faces->onRestore();
cb_SectionEdges->onRestore();
cb_PageUpdate->onRestore();
cb_Global->onRestore();
cb_Override->onRestore();
cb_AutoDist->onRestore();
pcb_Normal->onRestore();
pcb_Select->onRestore();
pcb_PreSelect->onRestore();
pcb_Hidden->onRestore();
pcb_Surface->onRestore();
pcb_Background->onRestore();
pcb_Hatch->onRestore();
pcb_Face->onRestore();
pcb_PaintFaces->onRestore(); //check box!
pfb_LabelFont->onRestore();
plsb_LabelSize->onRestore();
plsb_TemplateDot->onRestore();
pfc_DefTemp->onRestore();
pfc_DefDir->onRestore();
pfc_HatchFile->onRestore();
pfc_FilePattern->onRestore();
pfc_LineGroup->onRestore();
pfc_Welding->onRestore();
pfc_FilePattern->onRestore();
le_NamePattern->onRestore();
pfb_LabelFont->onRestore();
plsb_LabelSize->onRestore();
cb_Global->onRestore();
cb_Override->onRestore();
cb_PageUpdate->onRestore();
cb_AutoDist->onRestore();
pcbDimColor->onRestore();
pcb_Hatch->onRestore();
pcb_Background->onRestore();
pcb_PreSelect->onRestore();
pcb_Hidden->onRestore();
pcb_Select->onRestore();
pcb_Normal->onRestore();
pcb_Surface->onRestore();
pcb_GeomHatch->onRestore();
pcb_Face->onRestore();
pcb_PaintFaces->onRestore();
pcbSectionLine->onRestore();
pcbCenterColor->onRestore();
pcbVertexColor->onRestore();
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgPrefsTechDrawImp::changeEvent(QEvent *e)
void DlgPrefsTechDraw1Imp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
@@ -128,4 +125,4 @@ void DlgPrefsTechDrawImp::changeEvent(QEvent *e)
}
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawImp.cpp>
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDraw1Imp.cpp>

View File

@@ -0,0 +1,50 @@
/**************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* Based on src/Mod/FEM/Gui/DlgPrefsTechDraw1Imp.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 *
* *
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw1.h>
#include <Gui/PropertyPage.h>
namespace TechDrawGui {
class DlgPrefsTechDraw1Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw1Imp
{
Q_OBJECT
public:
DlgPrefsTechDraw1Imp( QWidget* parent = 0 );
~DlgPrefsTechDraw1Imp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
};
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H

File diff suppressed because it is too large Load Diff

View File

@@ -34,8 +34,8 @@ DlgPrefsTechDraw2Imp::DlgPrefsTechDraw2Imp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
plsb_FontSize->setUnit(Base::Unit::Length);
plsb_ArrowSize->setUnit(Base::Unit::Length);
// pdsbTemplateMark->setUnit(Base::Unit::Length);
}
DlgPrefsTechDraw2Imp::~DlgPrefsTechDraw2Imp()
@@ -45,48 +45,38 @@ DlgPrefsTechDraw2Imp::~DlgPrefsTechDraw2Imp()
void DlgPrefsTechDraw2Imp::saveSettings()
{
cbShowUnits->onSave();
plsb_FontSize->onSave();
pdsb_TolFactor->onSave();
colDimColor->onSave();
leDiameter->onSave();
pcbMatting->onSave();
pcbCenterStyle->onSave();
colCenterLine->onSave();
pcbSectionStyle->onSave();
colSectionLine->onSave();
pcbArrow->onSave();
cbGlobalDecimals->onSave();
sbAltDecimals->onSave();
leformatSpec->onSave();
plsb_ArrowSize->onSave();
leLineGroup->onSave();
pdsb_VertexScale->onSave();
pcb_VertexColor->onSave();
pcbStandardAndStyle->onSave();
pdsbToleranceScale->onSave();
pdsbTemplateMark->onSave();
pdsbVertexScale->onSave();
pdsbCenterScale->onSave();
pdsbPageScale->onSave();
cbViewScaleType->onSave();
pdsbViewScale->onSave();
pdsbEdgeFuzz->onSave();
pdsbMarkFuzz->onSave();
pdsbOverlapRadius->onSave();
pdsbTemplateMark->onSave();
}
void DlgPrefsTechDraw2Imp::loadSettings()
{
cbShowUnits->onRestore();
plsb_FontSize->onRestore();
pdsb_TolFactor->onRestore();
colDimColor->onRestore();
leDiameter->onRestore();
pcbMatting->onRestore();
pcbCenterStyle->onRestore();
colCenterLine->onRestore();
pcbSectionStyle->onRestore();
colSectionLine->onRestore();
pcbArrow->onRestore();
cbGlobalDecimals->onRestore();
sbAltDecimals->onRestore();
leformatSpec->onRestore();
plsb_ArrowSize->onRestore();
leLineGroup->onRestore();
pdsb_VertexScale->onRestore();
pcb_VertexColor->onRestore();
pcbStandardAndStyle->onRestore();
pdsbToleranceScale->onRestore();
pdsbTemplateMark->onRestore();
pdsbVertexScale->onRestore();
pdsbCenterScale->onRestore();
pdsbPageScale->onRestore();
cbViewScaleType->onRestore();
pdsbViewScale->onRestore();
pdsbEdgeFuzz->onRestore();
pdsbMarkFuzz->onRestore();
pdsbOverlapRadius->onRestore();
pdsbTemplateMark->onRestore();
}
/**

View File

@@ -23,8 +23,8 @@
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAW2IMP_H
#define DRAWINGGUI_DLGPREFSTECHDRAW2IMP_H
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP2_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP2_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw2.h>
#include <Gui/PropertyPage.h>
@@ -47,4 +47,4 @@ protected:
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAW2IMP_H
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP2_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
/***************************************************************************
* 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 "DlgPrefsTechDraw3Imp.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDraw3Imp::DlgPrefsTechDraw3Imp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
plsb_FontSize->setUnit(Base::Unit::Length);
plsb_ArrowSize->setUnit(Base::Unit::Length);
}
DlgPrefsTechDraw3Imp::~DlgPrefsTechDraw3Imp()
{
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDraw3Imp::saveSettings()
{
pcbMatting->onSave();
pcbBalloonShape->onSave();
cbSectionLineStd->onSave();
cbPyramidOrtho->onSave();
pcbCenterStyle->onSave();
pcbSectionStyle->onSave();
leLineGroup->onSave();
pcbBalloonArrow->onSave();
cbAutoHoriz->onSave();
leDiameter->onSave();
pcbArrow->onSave();
sbAltDecimals->onSave();
plsb_FontSize->onSave();
plsb_ArrowSize->onSave();
leformatSpec->onSave();
cbGlobalDecimals->onSave();
cbShowUnits->onSave();
pcbStandardAndStyle->onSave();
cbProjAngle->onSave();
cbHiddenLineStyle->onSave();
pdsbBalloonKink->onSave();
}
void DlgPrefsTechDraw3Imp::loadSettings()
{
pcbMatting->onRestore();
pcbBalloonShape->onRestore();
cbSectionLineStd->onRestore();
cbPyramidOrtho->onRestore();
pcbCenterStyle->onRestore();
pcbSectionStyle->onRestore();
leLineGroup->onRestore();
pcbBalloonArrow->onRestore();
cbAutoHoriz->onRestore();
leDiameter->onRestore();
pcbArrow->onRestore();
sbAltDecimals->onRestore();
plsb_FontSize->onRestore();
plsb_ArrowSize->onRestore();
leformatSpec->onRestore();
cbGlobalDecimals->onRestore();
cbShowUnits->onRestore();
pcbStandardAndStyle->onRestore();
cbProjAngle->onRestore();
cbHiddenLineStyle->onRestore();
pdsbBalloonKink->onRestore();
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgPrefsTechDraw3Imp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
loadSettings();
}
else {
QWidget::changeEvent(e);
}
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDraw3Imp.cpp>

View File

@@ -1,7 +1,7 @@
/**************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* Based on src/Mod/FEM/Gui/DlgPrefsTechDrawImp.cpp *
* Based on src/Mod/FEM/Gui/DlgPrefsTechDraw3Imp.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -23,21 +23,21 @@
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP_H
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw.h>
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw3.h>
#include <Gui/PropertyPage.h>
namespace TechDrawGui {
class DlgPrefsTechDrawImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawImp
class DlgPrefsTechDraw3Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw3Imp
{
Q_OBJECT
public:
DlgPrefsTechDrawImp( QWidget* parent = 0 );
~DlgPrefsTechDrawImp();
DlgPrefsTechDraw3Imp( QWidget* parent = 0 );
~DlgPrefsTechDraw3Imp();
protected:
void saveSettings();
@@ -47,4 +47,4 @@ protected:
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP_H
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H

View File

@@ -0,0 +1,293 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::DlgPrefsTechDraw4Imp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDraw4Imp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>521</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>TechDraw Advanced</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QGroupBox" name="gbDim">
<property name="minimumSize">
<size>
<width>0</width>
<height>150</height>
</size>
</property>
<property name="title">
<string>Advanced</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,1">
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbDebugDetail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Dump intermediate results during Detail processing</string>
</property>
<property name="text">
<string>Debug Detail</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugDetail</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debugDetail</cstring>
</property>
</widget>
</item>
<item row="2" 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="2" column="2">
<widget class="Gui::PrefCheckBox" name="cbFuseBeforeSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Perform a fuse operation on the input shape(s) before Section processing</string>
</property>
<property name="text">
<string>Fuse Before Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionFuseFirst</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="Gui::PrefComboBox" name="cbEndCap">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>false</italic>
</font>
</property>
<property name="toolTip">
<string>Change the shape of ends of edges. Used for 1:1 scale stencil making.</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>EdgeCapStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
<item>
<property name="text">
<string>Round</string>
</property>
</item>
<item>
<property name="text">
<string>Square</string>
</property>
</item>
<item>
<property name="text">
<string>Flat</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="cbCrazyEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include edges with unexpected geometry (zero length etc) to be included in results.</string>
</property>
<property name="text">
<string>Allow Crazy Edges</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>allowCrazyEdge</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="cbDetectFaces">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>If checked, TechDraw will attempt to build faces using the
line segments returned by the hidden line removal algorithm.
Faces must be detected in order to use hatching, but there
can be a performance penalty in complex models.</string>
</property>
<property name="text">
<string>Detect Faces</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="3" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Edge End Cap</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowSectionEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Highlights the border of the section cut in section views</string>
</property>
<property name="text">
<string>Show Section Edges</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="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbDebugSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Dump intermediate results during Section processing</string>
</property>
<property name="text">
<string>Debug Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugSection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<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>
</layout>
</widget>
<customwidgets>
<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>
</customwidgets>
<resources>
<include location="Resources/TechDraw.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,81 @@
/***************************************************************************
* 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 "DlgPrefsTechDraw4Imp.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDraw4Imp::DlgPrefsTechDraw4Imp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
}
DlgPrefsTechDraw4Imp::~DlgPrefsTechDraw4Imp()
{
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDraw4Imp::saveSettings()
{
cbEndCap->onSave();
cbCrazyEdges->onSave();
cbDebugSection->onSave();
cbDetectFaces->onSave();
cbDebugDetail->onSave();
cbShowSectionEdges->onSave();
cbFuseBeforeSection->onSave();
}
void DlgPrefsTechDraw4Imp::loadSettings()
{
cbEndCap->onRestore();
cbCrazyEdges->onRestore();
cbDebugSection->onRestore();
cbDetectFaces->onRestore();
cbDebugDetail->onRestore();
cbShowSectionEdges->onRestore();
cbFuseBeforeSection->onRestore();
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgPrefsTechDraw4Imp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
loadSettings();
}
else {
QWidget::changeEvent(e);
}
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDraw4Imp.cpp>

View File

@@ -0,0 +1,50 @@
/**************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* Based on src/Mod/FEM/Gui/DlgPrefsTechDraw4Imp.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 *
* *
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP4_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP4_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw4.h>
#include <Gui/PropertyPage.h>
namespace TechDrawGui {
class DlgPrefsTechDraw4Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw4Imp
{
Q_OBJECT
public:
DlgPrefsTechDraw4Imp( QWidget* parent = 0 );
~DlgPrefsTechDraw4Imp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
};
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP4_H

View File

@@ -0,0 +1,429 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::DlgPrefsTechDraw5Imp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDraw5Imp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>558</width>
<height>500</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>400</height>
</size>
</property>
<property name="windowTitle">
<string>TechDraw HLR Parameters</string>
</property>
<property name="toolTip">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="0">
<widget class="QLabel" name="label_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<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 row="0" column="0">
<widget class="QGroupBox" name="gbMisc">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>150</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Hidden Line Removal</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_6">
<item row="4" column="0">
<widget class="Gui::PrefCheckBox" name="pcbSeamViz">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Show Seam Lines</string>
</property>
<property name="text">
<string>Show Seam Lines</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SeamViz</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="Gui::PrefCheckBox" name="pcbSmoothViz">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Show Smooth Lines</string>
</property>
<property name="text">
<string>Show Smooth Lines</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SmoothViz</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="pcbHardViz">
<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="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Show Hard and Outline Edges (alway shown)</string>
</property>
<property name="text">
<string>Show Hard Lines</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>HardViz</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="pcbPolygon">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Use an approximation to find hidden lines. Fast, but results is a collection of short straight lines.</string>
</property>
<property name="text">
<string>Use Polygon Approximation</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>UsePolygon</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="Gui::PrefCheckBox" name="pcbIsoViz">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Make lines of equal parameterization</string>
</property>
<property name="text">
<string>Show UV Iso Lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>IsoViz</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefCheckBox" name="pcbSmoothHid">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Show hidden smooth edges</string>
</property>
<property name="text">
<string>Show Smooth Lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SmoothHid</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefCheckBox" name="pcbSeamHid">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Show hidden Seam lines</string>
</property>
<property name="text">
<string>Show Seam Lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SeamHid</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefCheckBox" name="pcbIsoHid">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Show hidden equal parameterization lines</string>
</property>
<property name="text">
<string>Show UV Iso Lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>IsoHid</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Visible</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Hidden</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefCheckBox" name="pcbHardHid">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Show hidden Hard and Outline edges</string>
</property>
<property name="text">
<string>Show Hard Lines</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HardHid</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_19">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Iso Count</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Gui::PrefSpinBox" name="psbIsoCount">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Number of Iso lines per Face edge</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>IsoCount</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/HLR</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<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>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,87 @@
/***************************************************************************
* 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 "DlgPrefsTechDraw5Imp.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDraw5Imp::DlgPrefsTechDraw5Imp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
}
DlgPrefsTechDraw5Imp::~DlgPrefsTechDraw5Imp()
{
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDraw5Imp::saveSettings()
{
pcbSeamViz->onSave();
pcbSmoothViz->onSave();
pcbHardViz->onSave();
pcbPolygon->onSave();
pcbIsoViz->onSave();
pcbSmoothHid->onSave();
pcbSeamHid->onSave();
pcbIsoHid->onSave();
psbIsoCount->onSave();
pcbHardHid->onSave();
}
void DlgPrefsTechDraw5Imp::loadSettings()
{
pcbSeamViz->onRestore();
pcbSmoothViz->onRestore();
pcbHardViz->onRestore();
pcbPolygon->onRestore();
pcbIsoViz->onRestore();
pcbSmoothHid->onRestore();
pcbSeamHid->onRestore();
pcbIsoHid->onRestore();
psbIsoCount->onRestore();
pcbHardHid->onRestore();
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgPrefsTechDraw5Imp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
loadSettings();
}
else {
QWidget::changeEvent(e);
}
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDraw5Imp.cpp>

View File

@@ -0,0 +1,50 @@
/**************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* Based on src/Mod/FEM/Gui/DlgPrefsTechDraw5Imp.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 *
* *
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP5_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP5_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw5.h>
#include <Gui/PropertyPage.h>
namespace TechDrawGui {
class DlgPrefsTechDraw5Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw5Imp
{
Q_OBJECT
public:
DlgPrefsTechDraw5Imp( QWidget* parent = 0 );
~DlgPrefsTechDraw5Imp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
};
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP5_H

View File

@@ -256,13 +256,32 @@ Base::Reference<ParameterGrp> QGIPrimPath::getParmGroup()
return hGrp;
}
//EdgeCapStyle param changed from UInt (Qt::PenCapStyle) to Int (QComboBox index)
Qt::PenCapStyle QGIPrimPath::prefCapStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
Qt::PenCapStyle result;
unsigned int cap = hGrp->GetUnsigned("EdgeCapStyle", 0x20); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap
result = (Qt::PenCapStyle) cap;
//old parameter format UINT
unsigned int oldStyle = hGrp->GetUnsigned("EdgeCapStyle", 0xFF); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap
result = (Qt::PenCapStyle) oldStyle;
int newStyle;
if (oldStyle == 0xFF) { //no old style parm found
newStyle = hGrp->GetUnsigned("EdgeCapStyle", 2); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap
switch (newStyle) {
case 0:
result = (Qt::PenCapStyle) 0x20; //round;
break;
case 1:
result = (Qt::PenCapStyle) 0x10; //square;
break;
case 2:
result = (Qt::PenCapStyle) 0x00; //flat
break;
default:
result = (Qt::PenCapStyle) 0x20;
}
}
return result;
}

View File

@@ -837,7 +837,7 @@ bool QGIViewBalloon::prefOrthoPyramid() const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
bool ortho = hGrp->GetBool("OrthoPyramid", true);
bool ortho = hGrp->GetBool("PyramidOrtho", true);
return ortho;
}