2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2012-01-01 22:51:51 +00:00
|
|
|
Copyright 2006-2012 Xavier Guerrin
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2007-12-01 10:47:15 +00:00
|
|
|
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.
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2007-12-01 10:47:15 +00:00
|
|
|
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.
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2007-12-01 10:47:15 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2010-12-20 02:45:36 +00:00
|
|
|
#ifndef TITLEBLOCK_PROPERTIES_WIDGET_H
|
|
|
|
#define TITLEBLOCK_PROPERTIES_WIDGET_H
|
2007-12-01 10:29:03 +00:00
|
|
|
#include <QtGui>
|
2010-12-20 02:45:36 +00:00
|
|
|
#include "titleblockproperties.h"
|
2012-07-01 21:54:00 +00:00
|
|
|
class DiagramContextWidget;
|
2012-01-25 18:02:17 +00:00
|
|
|
class TitleBlockTemplatesCollection;
|
2007-12-01 10:29:03 +00:00
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
This widget enable users to edit the properties of a title block.
|
2007-12-01 10:29:03 +00:00
|
|
|
*/
|
2010-12-20 02:45:36 +00:00
|
|
|
class TitleBlockPropertiesWidget : public QWidget {
|
2007-12-01 10:29:03 +00:00
|
|
|
Q_OBJECT
|
2012-11-09 21:09:24 +00:00
|
|
|
// constructors, destructor
|
2007-12-01 10:29:03 +00:00
|
|
|
public:
|
2010-12-20 02:45:36 +00:00
|
|
|
TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock = TitleBlockProperties(), bool = false, QWidget * = 0);
|
|
|
|
virtual ~TitleBlockPropertiesWidget();
|
2007-12-01 10:29:03 +00:00
|
|
|
private:
|
2010-12-20 02:45:36 +00:00
|
|
|
TitleBlockPropertiesWidget(const TitleBlockPropertiesWidget &);
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// methods
|
2007-12-01 10:29:03 +00:00
|
|
|
public:
|
2010-12-20 02:45:36 +00:00
|
|
|
TitleBlockProperties titleBlockProperties() const;
|
|
|
|
void setTitleBlockProperties(const TitleBlockProperties &);
|
2012-06-29 05:21:43 +00:00
|
|
|
void clearDiagramContext();
|
|
|
|
void setDiagramContext(const DiagramContext &);
|
2007-12-01 10:29:03 +00:00
|
|
|
bool displayCurrentDate() const;
|
2010-02-28 16:13:45 +00:00
|
|
|
bool isReadOnly() const;
|
|
|
|
void setReadOnly(bool);
|
2010-12-24 23:35:40 +00:00
|
|
|
void setTitleBlockTemplatesList(const QList<QString> &);
|
2012-01-25 18:02:17 +00:00
|
|
|
void setTitleBlockTemplatesCollection(TitleBlockTemplatesCollection *);
|
2010-12-24 23:35:40 +00:00
|
|
|
void setTitleBlockTemplatesVisible(bool);
|
2012-01-25 07:29:50 +00:00
|
|
|
QString currentTitleBlockTemplateName() const;
|
2012-01-25 18:02:17 +00:00
|
|
|
void setCurrentTitleBlockTemplateName(const QString &);
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2011-01-09 15:16:51 +00:00
|
|
|
private slots:
|
2012-01-25 18:02:17 +00:00
|
|
|
void updateTemplateList();
|
2012-01-25 07:29:50 +00:00
|
|
|
void editCurrentTitleBlockTemplate();
|
|
|
|
void duplicateCurrentTitleBlockTemplate();
|
2012-11-10 16:04:51 +00:00
|
|
|
void setDate_now();
|
|
|
|
|
2011-01-09 15:16:51 +00:00
|
|
|
private:
|
|
|
|
void initWidgets(const TitleBlockProperties &);
|
|
|
|
void initLayouts();
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2012-01-25 07:29:50 +00:00
|
|
|
signals:
|
|
|
|
void editTitleBlockTemplate(const QString &, bool);
|
2012-11-10 16:04:51 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// attributes
|
2007-12-01 10:29:03 +00:00
|
|
|
private:
|
2011-01-09 15:16:51 +00:00
|
|
|
QStackedLayout *stack_layout;
|
|
|
|
QLabel *titleblock_template_label;
|
|
|
|
QComboBox *titleblock_template_name;
|
2012-01-25 07:29:50 +00:00
|
|
|
QPushButton *titleblock_template_button_;
|
|
|
|
QMenu *titleblock_template_menu_;
|
|
|
|
QAction *titleblock_template_edit_;
|
|
|
|
QAction *titleblock_template_duplicate_;
|
2010-12-20 02:45:36 +00:00
|
|
|
QLineEdit *titleblock_title;
|
|
|
|
QLineEdit *titleblock_author;
|
|
|
|
QDateEdit *titleblock_date;
|
2012-11-10 16:04:51 +00:00
|
|
|
QPushButton *titleblock_date_now;
|
2010-12-20 02:45:36 +00:00
|
|
|
QLineEdit *titleblock_filename;
|
|
|
|
QLineEdit *titleblock_folio;
|
2011-01-09 15:16:51 +00:00
|
|
|
QLabel *folio_tip;
|
2010-12-20 02:45:36 +00:00
|
|
|
QRadioButton *titleblock_no_date;
|
|
|
|
QRadioButton *titleblock_current_date;
|
|
|
|
QRadioButton *titleblock_fixed_date;
|
2007-12-01 10:29:03 +00:00
|
|
|
bool display_current_date;
|
2011-01-09 15:16:51 +00:00
|
|
|
QLabel *additional_fields_label;
|
2012-07-01 21:54:00 +00:00
|
|
|
DiagramContextWidget *additional_fields_;
|
2011-01-09 15:16:51 +00:00
|
|
|
QTabBar *tabbar;
|
2012-01-25 18:02:17 +00:00
|
|
|
TitleBlockTemplatesCollection *tbt_collection_;
|
2007-12-01 10:29:03 +00:00
|
|
|
};
|
|
|
|
#endif
|