QElectroTech  0.8-dev
integrationmovetemplateshandler.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 TITLEBLOCK_SLASH_INTEGRATION_MOVE_TEMPLATES_HANDLER_H
19 #define TITLEBLOCK_SLASH_INTEGRATION_MOVE_TEMPLATES_HANDLER_H
20 #include "movetemplateshandler.h"
21 #include <QtWidgets>
28  Q_OBJECT
29 
30  // constructors, destructor
31  public:
32  IntegrationMoveTitleBlockTemplatesHandler(QWidget * = nullptr);
34  private:
36 
37  // methods
38  public:
40  QET::Action errorWithATemplate(const TitleBlockTemplateLocation &, const QString &) override;
41  QString nameForRenamingOperation() override;
42 
43  private:
44  QString dateString() const;
47  void initDialog();
48  void radioButtonleftMargin(QRadioButton *);
49 
50  private slots:
51  void correctRadioButtons();
52 
53  // attributes
54  private:
55  QWidget *parent_widget_;
56  QString rename_;
57  QDialog *integ_dialog_;
58  QLabel *dialog_label_;
59  QVBoxLayout *dialog_vlayout_;
60  QGridLayout *dialog_glayout;
61  QDialogButtonBox *buttons_;
62  QRadioButton *use_existing_template_;
63  QRadioButton *integrate_new_template_;
64  QRadioButton *erase_template_;
65  /*
66  Radio button the user may click for the integrated template to be
67  automatically renamed in order to be stored along with the existing one.
68  */
69  QRadioButton *integrate_both_;
70  QButtonGroup *button_group1_;
71  QButtonGroup *button_group2_;
72 };
73 #endif
IntegrationMoveTitleBlockTemplatesHandler::nameForRenamingOperation
QString nameForRenamingOperation() override
Definition: integrationmovetemplateshandler.cpp:98
IntegrationMoveTitleBlockTemplatesHandler::initDialog
void initDialog()
Definition: integrationmovetemplateshandler.cpp:145
QET::Ignore
@ Ignore
Skip the current item.
Definition: qet.h:129
IntegrationMoveTitleBlockTemplatesHandler
Definition: integrationmovetemplateshandler.h:27
TitleBlockTemplateLocation::getTemplateXmlDescription
QDomElement getTemplateXmlDescription() const
Definition: templatelocation.cpp:138
IntegrationMoveTitleBlockTemplatesHandler::~IntegrationMoveTitleBlockTemplatesHandler
~IntegrationMoveTitleBlockTemplatesHandler() override
Definition: integrationmovetemplateshandler.cpp:36
IntegrationMoveTitleBlockTemplatesHandler::integ_dialog_
QDialog * integ_dialog_
Dialog in case of conflict when integrating a title block template.
Definition: integrationmovetemplateshandler.h:57
IntegrationMoveTitleBlockTemplatesHandler::errorWithATemplate
QET::Action errorWithATemplate(const TitleBlockTemplateLocation &, const QString &) override
Definition: integrationmovetemplateshandler.cpp:82
IntegrationMoveTitleBlockTemplatesHandler::buttons_
QDialogButtonBox * buttons_
Definition: integrationmovetemplateshandler.h:61
qetmessagebox.h
IntegrationMoveTitleBlockTemplatesHandler::use_existing_template_
QRadioButton * use_existing_template_
Radio button the user may click to use the existing template and stop the integration.
Definition: integrationmovetemplateshandler.h:62
IntegrationMoveTitleBlockTemplatesHandler::erase_template_
QRadioButton * erase_template_
Radio button the user may click for the integrated template to erase the existing one.
Definition: integrationmovetemplateshandler.h:64
QET::Managed
@ Managed
the current item was handled by the Strategy object: do not treat it and continue
Definition: qet.h:132
IntegrationMoveTitleBlockTemplatesHandler::button_group2_
QButtonGroup * button_group2_
Definition: integrationmovetemplateshandler.h:71
IntegrationMoveTitleBlockTemplatesHandler::IntegrationMoveTitleBlockTemplatesHandler
IntegrationMoveTitleBlockTemplatesHandler(QWidget *=nullptr)
Definition: integrationmovetemplateshandler.cpp:26
IntegrationMoveTitleBlockTemplatesHandler::correctRadioButtons
void correctRadioButtons()
Definition: integrationmovetemplateshandler.cpp:241
IntegrationMoveTitleBlockTemplatesHandler::integrate_new_template_
QRadioButton * integrate_new_template_
Radio button the user may click to integrate the template.
Definition: integrationmovetemplateshandler.h:63
IntegrationMoveTitleBlockTemplatesHandler::IntegrationMoveTitleBlockTemplatesHandler
IntegrationMoveTitleBlockTemplatesHandler(const IntegrationMoveTitleBlockTemplatesHandler &)
IntegrationMoveTitleBlockTemplatesHandler::integrate_both_
QRadioButton * integrate_both_
Definition: integrationmovetemplateshandler.h:69
MoveTitleBlockTemplatesHandler
Definition: movetemplateshandler.h:30
IntegrationMoveTitleBlockTemplatesHandler::dateString
QString dateString() const
Definition: integrationmovetemplateshandler.cpp:105
QET::Rename
@ Rename
the target has to be renamed
Definition: qet.h:133
TitleBlockTemplateLocation
Definition: templatelocation.h:29
TitleBlockTemplateLocation::toString
QString toString() const
Definition: templatelocation.cpp:108
templatescollection.h
IntegrationMoveTitleBlockTemplatesHandler::newNameForTemplate
QString newNameForTemplate(const TitleBlockTemplateLocation &)
Definition: integrationmovetemplateshandler.cpp:114
QET::Abort
@ Abort
abort the whole operation, ignoring the curent item
Definition: qet.h:131
IntegrationMoveTitleBlockTemplatesHandler::dialog_label_
QLabel * dialog_label_
Definition: integrationmovetemplateshandler.h:58
IntegrationMoveTitleBlockTemplatesHandler::askUser
QET::Action askUser(const TitleBlockTemplateLocation &, const TitleBlockTemplateLocation &)
Definition: integrationmovetemplateshandler.cpp:124
IntegrationMoveTitleBlockTemplatesHandler::parent_widget_
QWidget * parent_widget_
Widget used as parent to display dialogs.
Definition: integrationmovetemplateshandler.h:55
IntegrationMoveTitleBlockTemplatesHandler::radioButtonleftMargin
void radioButtonleftMargin(QRadioButton *)
Definition: integrationmovetemplateshandler.cpp:234
QET::Action
Action
Definition: qet.h:127
IntegrationMoveTitleBlockTemplatesHandler::button_group1_
QButtonGroup * button_group1_
Definition: integrationmovetemplateshandler.h:70
TitleBlockTemplateLocation::parentCollection
TitleBlockTemplatesCollection * parentCollection() const
Definition: templatelocation.cpp:57
QET::Erase
@ Erase
Erase the target content.
Definition: qet.h:130
integrationmovetemplateshandler.h
IntegrationMoveTitleBlockTemplatesHandler::dialog_vlayout_
QVBoxLayout * dialog_vlayout_
Definition: integrationmovetemplateshandler.h:59
IntegrationMoveTitleBlockTemplatesHandler::templateAlreadyExists
QET::Action templateAlreadyExists(const TitleBlockTemplateLocation &src, const TitleBlockTemplateLocation &dst) override
Definition: integrationmovetemplateshandler.cpp:44
TitleBlockTemplatesCollection
Definition: templatescollection.h:34
IntegrationMoveTitleBlockTemplatesHandler::rename_
QString rename_
Name to be used when renaming a title block template.
Definition: integrationmovetemplateshandler.h:56
QET::QetMessageBox::critical
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:23
movetemplateshandler.h
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QET::Icons::Cancel
QIcon Cancel
Definition: qeticons.cpp:34
IntegrationMoveTitleBlockTemplatesHandler::dialog_glayout
QGridLayout * dialog_glayout
Definition: integrationmovetemplateshandler.h:60
TitleBlockTemplateLocation::name
QString name() const
Definition: templatelocation.cpp:73