QElectroTech  0.8-dev
projectconfigpages.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef PROJECTCONFIGPAGES_H
19 #define PROJECTCONFIGPAGES_H
20 #include "configpage.h"
21 
22 class QLabel;
23 class QLineEdit;
24 class QETProject;
30 class SelectAutonumW;
34 
40 class ProjectConfigPage : public ConfigPage {
41  Q_OBJECT
42  // Constructor, destructor
43  public:
44  ProjectConfigPage(QETProject *, QWidget * = nullptr);
45  ~ProjectConfigPage() override;
46  private:
48 
49  // methods
50  public:
51  virtual QETProject *project() const;
52  virtual QETProject *setProject(QETProject *project, bool = true);
53  void applyConf() override;
59  virtual void applyProjectConf() = 0;
60 
61  protected:
62  virtual void init();
66  virtual void initWidgets() = 0;
71  virtual void initLayout() = 0;
75  virtual void readValuesFromProject() = 0;
80  virtual void adjustReadOnly() = 0;
81 
82  // attributes
83  protected:
85 };
86 
91  Q_OBJECT
92  // Constructor, destructor
93  public:
94  ProjectMainConfigPage(QETProject *, QWidget * = nullptr);
95  ~ProjectMainConfigPage() override;
96  private:
98 
99  // methods
100  public:
101  QString title() const override;
102  QIcon icon() const override;
103  void applyProjectConf() override;
104  QString projectTitle() const;
105 
106  protected:
107  void initWidgets() override;
108  void initLayout() override;
109  void readValuesFromProject() override;
110  void adjustReadOnly() override;
111 
112  // attributes
113  protected:
114  QLabel *title_label_;
115  QLineEdit *title_value_;
119 };
120 
122  Q_OBJECT
123 
124  //Methods
125  public:
127  QWidget *parent = nullptr);
128 
129  QString title() const override;
130  QIcon icon() const override;
131  void applyProjectConf() override;
132  virtual void changeToTab(int);
133  protected:
134  void initWidgets() override;
135  void initLayout() override {}
136  void readValuesFromProject() override;
137  void adjustReadOnly() override;
138  private:
139  void buildConnections();
140  private slots:
141  void updateContextConductor(const QString&);//conductor
142  void saveContextConductor();
143  void removeContextConductor();
144  void updateContextFolio(const QString&);//folio
145  void saveContextFolio();
146  void removeContextFolio();
147  void updateContextElement(const QString&);//element
148  void saveContextElement();
149  void removeContextElement();
150 
151  void applyAutoNum();
152  void applyManagement();
153 
154  signals:
155  void setAutoNum(QString);
156  void setAutoNum(int,int);
158  void loadSavedTbp();
159 
160  //Attributes
161  private:
167 
168 };
169 
170 #endif
ProjectMainConfigPage::initLayout
void initLayout() override
Definition: projectconfigpages.cpp:186
selectautonumw.h
ProjectAutoNumConfigPage::adjustReadOnly
void adjustReadOnly() override
ProjectAutoNumConfigPage::adjustReadOnly set this config page disable if project is read only.
Definition: projectconfigpages.cpp:317
ProjectAutoNumConfigPage::applyAutoNum
void applyAutoNum()
ProjectAutoNumConfigPage::applyAutoNum Apply auto folio numbering, New Folios or Selected Folios.
Definition: projectconfigpages.cpp:486
ProjectMainConfigPage::applyProjectConf
void applyProjectConf() override
Definition: projectconfigpages.cpp:139
QETProject::conductorAutoNumAdded
void conductorAutoNumAdded()
QETProject::autoFolioNumberingNewFolios
void autoFolioNumberingNewFolios()
QETProject::autoFolioNumberingNewFolios emit Signal to add new Diagram with autonum properties.
Definition: qetproject.cpp:788
QETProject::addElementAutoNum
void addElementAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addElementAutoNum Add a new element numerotation context. If key already exist,...
Definition: qetproject.cpp:598
ConductorPropertiesWidget
Definition: conductorpropertieswidget.h:32
ProjectAutoNumConfigPage::m_saw_conductor
SelectAutonumW * m_saw_conductor
Definition: projectconfigpages.h:162
ProjectAutoNumConfigPage::title
QString title() const override
ProjectAutoNumConfigPage::title Title of this config page.
Definition: projectconfigpages.cpp:240
ProjectAutoNumConfigPage
Definition: projectconfigpages.h:121
ProjectMainConfigPage::title_label_
QLabel * title_label_
Definition: projectconfigpages.h:114
borderpropertieswidget.h
ProjectConfigPage::applyConf
void applyConf() override
Definition: projectconfigpages.cpp:84
QET::Icons::AutoNum
QIcon AutoNum
Definition: qeticons.cpp:209
ProjectMainConfigPage::project_variables_label_
QLabel * project_variables_label_
Definition: projectconfigpages.h:117
QETProject::autoFolioNumberingSelectedFolios
void autoFolioNumberingSelectedFolios(int, int, const QString &)
QETProject::autoFolioNumberingNewFolios.
Definition: qetproject.cpp:799
QETProject::removeElementAutoNum
void removeElementAutoNum(const QString &key)
QETProject::removeElementAutonum Remove Element Numerotation Context stored with key.
Definition: qetproject.cpp:629
ProjectMainConfigPage::initWidgets
void initWidgets() override
Definition: projectconfigpages.cpp:168
AutoNumberingManagementW
Definition: autonumberingmanagementw.h:32
QETProject::addConductorAutoNum
void addConductorAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addConductorAutoNum Add a new conductor numerotation context. If key already exist,...
Definition: qetproject.cpp:587
ProjectAutoNumConfigPage::setAutoNum
void setAutoNum(QString)
FolioAutonumberingW::newFolios
bool newFolios
Definition: folioautonumbering.h:45
QETProject::setFreezeNewConductors
void setFreezeNewConductors(bool)
QETProject::setfreezeNewConductors Set Project Wide freeze new conductors.
Definition: qetproject.cpp:715
QETProject::freezeNewConductorLabel
void freezeNewConductorLabel(bool freeze, int from, int to)
QETProject::freezeNewConductorLabel Freeze New Conductors in the selected folios.
Definition: qetproject.cpp:697
ProjectConfigPage::applyProjectConf
virtual void applyProjectConf()=0
ProjectConfigPage::initLayout
virtual void initLayout()=0
ProjectAutoNumConfigPage::updateContextConductor
void updateContextConductor(const QString &)
ProjectAutoNumConfigPage::updateContext_conductor Display the current selected context for conductor.
Definition: projectconfigpages.cpp:353
ReportPropertieWidget
Definition: reportpropertiewidget.h:30
ProjectAutoNumConfigPage::ProjectAutoNumConfigPage
ProjectAutoNumConfigPage(QETProject *project, QWidget *parent=nullptr)
ProjectAutoNumConfigPage::ProjectAutoNumConfigPage Default constructor.
Definition: projectconfigpages.cpp:226
SelectAutonumW::setContext
void setContext(const NumerotationContext &context)
SelectAutonumW::setContext build the context of current diagram selected in the diagram_chooser Qcomb...
Definition: selectautonumw.cpp:88
ProjectConfigPage::setProject
virtual QETProject * setProject(QETProject *project, bool=true)
ProjectConfigPage::setProject Set new_project as the project being edited by this page.
Definition: projectconfigpages.cpp:68
QETProject::setCurrentConductorAutoNum
void setCurrentConductorAutoNum(QString autoNum)
QETProject::setCurrentConductorAutoNum.
Definition: qetproject.cpp:568
ProjectConfigPage::init
virtual void init()
Definition: projectconfigpages.cpp:94
autonumberingmanagementw.h
ProjectConfigPage::project
virtual QETProject * project() const
Definition: projectconfigpages.cpp:55
NumerotationContext
Definition: numerotationcontext.h:31
FolioAutonumberingW::setContext
void setContext(QList< QString > autonums)
FolioAutonumberingW::setContext construct autonums in the comboBox selected in the autonum_chooser Qc...
Definition: folioautonumbering.cpp:53
reportpropertiewidget.h
titleblockpropertieswidget.h
ProjectAutoNumConfigPage::changeToTab
virtual void changeToTab(int)
ProjectAutoNumConfigPage::changeToTab.
Definition: projectconfigpages.cpp:629
SelectAutonumW
Definition: selectautonumw.h:35
ProjectAutoNumConfigPage::icon
QIcon icon() const override
ProjectAutoNumConfigPage::icon Icon of this config pafe.
Definition: projectconfigpages.cpp:249
FolioAutonumberingW
Definition: folioautonumbering.h:33
ProjectMainConfigPage::projectTitle
QString projectTitle() const
Definition: projectconfigpages.cpp:161
ProjectAutoNumConfigPage::removeContextElement
void removeContextElement()
ProjectAutoNumConfigPage::removeContextElement Remove from project the current element numerotation c...
Definition: projectconfigpages.cpp:420
folioautonumbering.h
ProjectAutoNumConfigPage::saveContextConductor
void saveContextConductor()
ProjectAutoNumConfigPage::saveContext_conductor Save the current displayed conductor context in proje...
Definition: projectconfigpages.cpp:433
ProjectAutoNumConfigPage::saveContextFolio
void saveContextFolio()
ProjectAutoNumConfigPage::saveContext_folio Save the current displayed folio context in project.
Definition: projectconfigpages.cpp:463
ProjectMainConfigPage::icon
QIcon icon() const override
Definition: projectconfigpages.cpp:132
ProjectConfigPage::~ProjectConfigPage
~ProjectConfigPage() override
Definition: projectconfigpages.cpp:49
ProjectAutoNumConfigPage::m_faw
FolioAutonumberingW * m_faw
Definition: projectconfigpages.h:165
configpage.h
ProjectMainConfigPage::project_variables_
DiagramContextWidget * project_variables_
Definition: projectconfigpages.h:118
QETProject::conductorAutoNumRemoved
void conductorAutoNumRemoved()
qeticons.h
projectconfigpages.h
QETProject::diagrams
QList< Diagram * > diagrams() const
Definition: qetproject.cpp:217
ProjectConfigPage::adjustReadOnly
virtual void adjustReadOnly()=0
DiagramContextWidget
Definition: diagramcontextwidget.h:29
ProjectAutoNumConfigPage::applyProjectConf
void applyProjectConf() override
ProjectAutoNumConfigPage::applyProjectConf.
Definition: projectconfigpages.cpp:256
AutoNumberingManagementW::ui
Ui::AutoNumberingManagementW * ui
Definition: autonumberingmanagementw.h:39
ProjectMainConfigPage::readValuesFromProject
void readValuesFromProject() override
Definition: projectconfigpages.cpp:204
ProjectConfigPage::initWidgets
virtual void initWidgets()=0
ProjectMainConfigPage::title_value_
QLineEdit * title_value_
Definition: projectconfigpages.h:115
XRefPropertiesWidget
The XRefPropertiesWidget class This class provide a widget to edit the XRefProperties.
Definition: xrefpropertieswidget.h:33
FolioAutonumberingW::toFolio
int toFolio()
FolioAutonumberingW::toFolio returns the current "To Folio" index.
Definition: folioautonumbering.cpp:77
SelectAutonumW::contextComboBox
QComboBox * contextComboBox() const
Definition: selectautonumw.cpp:169
QETProject::folioAutoNumAdded
void folioAutoNumAdded()
ProjectAutoNumConfigPage::saveCurrentTbp
void saveCurrentTbp()
ProjectAutoNumConfigPage::initWidgets
void initWidgets() override
ProjectAutoNumConfigPage::initWidgets Init some widget of this page.
Definition: projectconfigpages.cpp:262
ProjectMainConfigPage::title_information_
QLabel * title_information_
Definition: projectconfigpages.h:116
QETProject::setCurrrentElementAutonum
void setCurrrentElementAutonum(QString autoNum)
QETProject::setCurrrentElementAutonum.
Definition: qetproject.cpp:539
FormulaAutonumberingW
Definition: formulaautonumberingw.h:36
QETProject::setFreezeNewElements
void setFreezeNewElements(bool)
QETProject::setfreezeNewElements Set Project Wide freeze new elements.
Definition: qetproject.cpp:757
ProjectConfigPage::ProjectConfigPage
ProjectConfigPage(const ProjectConfigPage &)
numerotationcontext.h
ProjectConfigPage::ProjectConfigPage
ProjectConfigPage(QETProject *, QWidget *=nullptr)
Definition: projectconfigpages.cpp:40
ProjectAutoNumConfigPage::loadSavedTbp
void loadSavedTbp()
ProjectAutoNumConfigPage::removeContextFolio
void removeContextFolio()
ProjectAutoNumConfigPage::removeContext_folio Remove from project the current folio numerotation cont...
Definition: projectconfigpages.cpp:616
ProjectAutoNumConfigPage::readValuesFromProject
void readValuesFromProject() override
ProjectAutoNumConfigPage::readValuesFromProject Read value stored on project, and update display.
Definition: projectconfigpages.cpp:295
SelectAutonumW::toNumContext
NumerotationContext toNumContext() const
SelectAutonumW::toNumContext.
Definition: selectautonumw.cpp:117
ConfigPage
Definition: configpage.h:27
QETProject::conductorAutoNum
QHash< QString, NumerotationContext > conductorAutoNum() const
QETProject::conductorAutoNum.
Definition: qetproject.cpp:493
SelectAutonumW::removeClicked
void removeClicked()
ProjectMainConfigPage
Definition: projectconfigpages.h:90
ProjectAutoNumConfigPage::m_amw
AutoNumberingManagementW * m_amw
Definition: projectconfigpages.h:166
ProjectMainConfigPage::title
QString title() const override
Definition: projectconfigpages.cpp:125
qetproject.h
SelectAutonumW::applyPressed
void applyPressed()
QETProject::freezeExistentElementLabel
void freezeExistentElementLabel(bool freeze, int from, int to)
QETProject::freezeExistentElementLabel Freeze Existent Elements in the selected folios.
Definition: qetproject.cpp:726
ProjectAutoNumConfigPage::initLayout
void initLayout() override
Definition: projectconfigpages.h:135
QETProject::addFolioAutoNum
void addFolioAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addFolioAutoNum Add a new folio numerotation context. If key already exist,...
Definition: qetproject.cpp:611
ProjectConfigPage::m_project
QETProject * m_project
Currently edited project.
Definition: projectconfigpages.h:84
FolioAutonumberingW::newFoliosNumber
int newFoliosNumber()
FolioAutonumberingW::newFoliosNumber returns the number of folios to create.
Definition: folioautonumbering.cpp:85
QETProject
Definition: qetproject.h:51
ProjectAutoNumConfigPage::updateContextFolio
void updateContextFolio(const QString &)
ProjectAutoNumConfigPage::updateContext_folio Display the current selected context for folio.
Definition: projectconfigpages.cpp:363
QETProject::freezeNewElementLabel
void freezeNewElementLabel(bool freeze, int from, int to)
QETProject::freezeNewElementLabel Freeze New Elements in the selected folios.
Definition: qetproject.cpp:739
ProjectAutoNumConfigPage::removeContextConductor
void removeContextConductor()
ProjectAutoNumConfigPage::removeContext Remove from project the current conductor numerotation contex...
Definition: projectconfigpages.cpp:604
ProjectMainConfigPage::ProjectMainConfigPage
ProjectMainConfigPage(const ProjectMainConfigPage &)
diagramcontextwidget.h
QET::Icons::Settings
QIcon Settings
Definition: qeticons.cpp:159
formulaautonumberingw.h
ProjectConfigPage::readValuesFromProject
virtual void readValuesFromProject()=0
QETProject::freezeExistentConductorLabel
void freezeExistentConductorLabel(bool freeze, int from, int to)
QETProject::freezeExistentConductorLabel Freeze Existent Conductors in the selected folios.
Definition: qetproject.cpp:684
QETProject::folioAutoNum
QHash< QString, NumerotationContext > folioAutoNum() const
QETProject::folioAutoNum.
Definition: qetproject.cpp:576
xrefpropertieswidget.h
FolioAutonumberingW::fromFolio
int fromFolio()
FolioAutonumberingW::fromFolio returns the current "From Folio" index.
Definition: folioautonumbering.cpp:69
ProjectAutoNumConfigPage::setAutoNum
void setAutoNum(int, int)
ProjectAutoNumConfigPage::buildConnections
void buildConnections()
ProjectAutoNumConfigPage::buildConnections setup some connections.
Definition: projectconfigpages.cpp:324
ProjectAutoNumConfigPage::applyManagement
void applyManagement()
ProjectAutoNumConfigPage::applyAutoManagement Apply Management Options in Selected Folios.
Definition: projectconfigpages.cpp:510
ProjectAutoNumConfigPage::updateContextElement
void updateContextElement(const QString &)
ProjectAutoNumConfigPage::updateContextElement Display the current selected context for element.
Definition: projectconfigpages.cpp:373
ProjectAutoNumConfigPage::m_saw_folio
SelectAutonumW * m_saw_folio
Definition: projectconfigpages.h:163
BorderPropertiesWidget
The BorderPropertiesWidget class this widget edit the properties of a border.
Definition: borderpropertieswidget.h:33
QETProject::elementAutoNum
QHash< QString, NumerotationContext > elementAutoNum() const
QETProject::elementAutoNum.
Definition: qetproject.cpp:501
ProjectMainConfigPage::ProjectMainConfigPage
ProjectMainConfigPage(QETProject *, QWidget *=nullptr)
Definition: projectconfigpages.cpp:110
ProjectConfigPage
The ProjectConfigPage class This class, derived from ConfigPage, aims at providing the basic skeleton...
Definition: projectconfigpages.h:40
conductorpropertieswidget.h
QETProject::folioAutoNumRemoved
void folioAutoNumRemoved()
ProjectAutoNumConfigPage::saveContextElement
void saveContextElement()
ProjectAutoNumConfigPage::saveContextElement Save the current displayed Element formula in project.
Definition: projectconfigpages.cpp:389
FolioAutonumberingW::autoNumSelected
QString autoNumSelected()
FolioAutonumberingW::autoNumSelected returns the current autonum selected.
Definition: folioautonumbering.cpp:61
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
ProjectMainConfigPage::~ProjectMainConfigPage
~ProjectMainConfigPage() override
Definition: projectconfigpages.cpp:119
DiagramContext
Definition: diagramcontext.h:56
ProjectAutoNumConfigPage::m_saw_element
SelectAutonumW * m_saw_element
Definition: projectconfigpages.h:164
ProjectMainConfigPage::adjustReadOnly
void adjustReadOnly() override
Definition: projectconfigpages.cpp:213