2014-07-31 10:02:33 +00:00
|
|
|
|
|
|
|
|
2014-01-29 19:31:34 +00:00
|
|
|
/*
|
2015-02-20 14:56:22 +00:00
|
|
|
Copyright 2006-2015 The QElectroTech Team
|
2014-01-29 19:31:34 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech 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 General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2012-06-29 05:21:41 +00:00
|
|
|
#ifndef PROJECTCONFIGPAGES_H
|
|
|
|
#define PROJECTCONFIGPAGES_H
|
|
|
|
#include "configpage.h"
|
2016-05-13 13:10:32 +00:00
|
|
|
#include <QtWidgets>
|
|
|
|
|
2012-06-29 05:21:41 +00:00
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
|
|
|
class QETProject;
|
|
|
|
class BorderPropertiesWidget;
|
|
|
|
class TitleBlockPropertiesWidget;
|
|
|
|
class ConductorPropertiesWidget;
|
2012-07-01 21:54:07 +00:00
|
|
|
class DiagramContextWidget;
|
2014-01-18 19:04:39 +00:00
|
|
|
class ReportPropertieWidget;
|
2014-04-11 09:51:21 +00:00
|
|
|
class XRefPropertiesWidget;
|
2014-07-31 10:02:33 +00:00
|
|
|
class SelectAutonumW;
|
|
|
|
class QComboBox;
|
2014-08-12 09:41:33 +00:00
|
|
|
class QPushButton;
|
2016-05-13 13:10:32 +00:00
|
|
|
class FolioAutonumberingW;
|
2012-06-29 05:21:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This class, derived from ConfigPage, aims at providing the basic skeleton
|
|
|
|
for a project configuration page.
|
|
|
|
*/
|
|
|
|
class ProjectConfigPage : public ConfigPage {
|
|
|
|
Q_OBJECT
|
|
|
|
// Constructor, destructor
|
|
|
|
public:
|
|
|
|
ProjectConfigPage(QETProject *, QWidget * = 0);
|
|
|
|
virtual ~ProjectConfigPage();
|
|
|
|
private:
|
|
|
|
ProjectConfigPage(const ProjectConfigPage &);
|
|
|
|
|
|
|
|
// methods
|
|
|
|
public:
|
|
|
|
virtual QETProject *project() const;
|
|
|
|
virtual QETProject *setProject(QETProject *project, bool = true);
|
|
|
|
virtual void applyConf();
|
|
|
|
/**
|
|
|
|
Apply configuration to the project after user input. This method is
|
|
|
|
automatically called when the ConfigDialog is validated, and only if the
|
|
|
|
project is both non-zero and not read-only.
|
|
|
|
*/
|
|
|
|
virtual void applyProjectConf() = 0;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void init();
|
|
|
|
/**
|
|
|
|
Use this pure virtual method to initialize your page widgets.
|
|
|
|
*/
|
|
|
|
virtual void initWidgets() = 0;
|
|
|
|
/**
|
|
|
|
Use this pure virtual method to initialize your page layout. This method is
|
|
|
|
always called after initWidgets().
|
|
|
|
*/
|
|
|
|
virtual void initLayout() = 0;
|
|
|
|
/**
|
|
|
|
Use this pure virtual method to fill widgets with project values.
|
|
|
|
*/
|
|
|
|
virtual void readValuesFromProject() = 0;
|
|
|
|
/**
|
|
|
|
Use this pure virtual method to adjust the "read only" state of your page
|
|
|
|
widgets according to the currently edited project.
|
|
|
|
*/
|
|
|
|
virtual void adjustReadOnly() = 0;
|
|
|
|
|
|
|
|
// attributes
|
|
|
|
protected:
|
|
|
|
QETProject *project_; ///< Currently edited project
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
This page enables users to configure the main properties of a project.
|
|
|
|
*/
|
|
|
|
class ProjectMainConfigPage : public ProjectConfigPage {
|
|
|
|
Q_OBJECT
|
|
|
|
// Constructor, destructor
|
|
|
|
public:
|
|
|
|
ProjectMainConfigPage(QETProject *, QWidget * = 0);
|
|
|
|
virtual ~ProjectMainConfigPage();
|
|
|
|
private:
|
|
|
|
ProjectMainConfigPage(const ProjectMainConfigPage &);
|
|
|
|
|
|
|
|
// methods
|
|
|
|
public:
|
|
|
|
QString title() const;
|
|
|
|
QIcon icon() const;
|
|
|
|
void applyProjectConf();
|
|
|
|
QString projectTitle() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void initWidgets();
|
|
|
|
void initLayout();
|
|
|
|
void readValuesFromProject();
|
|
|
|
void adjustReadOnly();
|
|
|
|
|
|
|
|
// attributes
|
|
|
|
protected:
|
|
|
|
QLabel *title_label_;
|
|
|
|
QLineEdit *title_value_;
|
2012-07-02 06:34:40 +00:00
|
|
|
QLabel *title_information_;
|
2012-07-01 21:54:07 +00:00
|
|
|
QLabel *project_variables_label_;
|
|
|
|
DiagramContextWidget *project_variables_;
|
2012-06-29 05:21:41 +00:00
|
|
|
};
|
|
|
|
|
2014-07-31 10:02:33 +00:00
|
|
|
class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
//Methods
|
|
|
|
public:
|
|
|
|
ProjectAutoNumConfigPage (QETProject *project, QWidget *parent = 0);
|
|
|
|
|
|
|
|
virtual QString title() const;
|
|
|
|
virtual QIcon icon() const;
|
|
|
|
virtual void applyProjectConf();
|
2016-05-13 13:10:32 +00:00
|
|
|
virtual void changeToTab(int);
|
2014-07-31 10:02:33 +00:00
|
|
|
protected:
|
|
|
|
virtual void initWidgets();
|
|
|
|
virtual void initLayout();
|
|
|
|
virtual void readValuesFromProject();
|
|
|
|
virtual void adjustReadOnly();
|
|
|
|
private:
|
|
|
|
void buildConnections();
|
|
|
|
private slots:
|
|
|
|
void updateContext(QString);
|
|
|
|
void saveContext();
|
2014-08-12 09:41:33 +00:00
|
|
|
void removeContext();
|
2016-05-13 13:10:32 +00:00
|
|
|
void updateContext_2(QString);
|
|
|
|
void saveContext_2();
|
|
|
|
void removeContext_2();
|
|
|
|
|
|
|
|
// void applyAutoNum(); - Needs Further Testing
|
|
|
|
|
|
|
|
void tabChanged(int);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void setAutoNum(QString);
|
|
|
|
void setAutoNum(int,int);
|
|
|
|
void saveCurrentTbp();
|
|
|
|
void loadSavedTbp();
|
2014-07-31 10:02:33 +00:00
|
|
|
|
|
|
|
//Attributes
|
|
|
|
private:
|
2016-05-13 13:10:32 +00:00
|
|
|
QTabWidget *tab_widget;
|
|
|
|
QWidget *element_widget;
|
|
|
|
QWidget *conductor_tab_widget;
|
|
|
|
QWidget *folio_tab_widget;
|
|
|
|
QWidget *autoNumbering_tab_widget;
|
|
|
|
QScrollArea *scrollArea;
|
|
|
|
QLabel *m_label;
|
|
|
|
QLabel *m_label_2;
|
|
|
|
QComboBox *m_context_cb;
|
|
|
|
QComboBox *m_context_cb_2;
|
|
|
|
QPushButton *m_remove_pb;
|
|
|
|
QPushButton *m_remove_pb_2;
|
|
|
|
SelectAutonumW *m_saw;
|
|
|
|
SelectAutonumW *m_saw_2;
|
|
|
|
FolioAutonumberingW *m_faw;
|
2014-07-31 10:02:33 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2012-06-29 05:21:41 +00:00
|
|
|
#endif
|