QElectroTech  0.70
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
IntegrationMoveTitleBlockTemplatesHandler Class Reference

#include <integrationmovetemplateshandler.h>

Public Member Functions

 IntegrationMoveTitleBlockTemplatesHandler (QWidget *=nullptr)
 
 ~IntegrationMoveTitleBlockTemplatesHandler () override
 
QET::Action templateAlreadyExists (const TitleBlockTemplateLocation &src, const TitleBlockTemplateLocation &dst) override
 
QET::Action errorWithATemplate (const TitleBlockTemplateLocation &, const QString &) override
 
QString nameForRenamingOperation () override
 
- Public Member Functions inherited from MoveTitleBlockTemplatesHandler
 MoveTitleBlockTemplatesHandler (QObject *=nullptr)
 
 ~MoveTitleBlockTemplatesHandler () override
 

Private Slots

void correctRadioButtons ()
 

Private Member Functions

 IntegrationMoveTitleBlockTemplatesHandler (const IntegrationMoveTitleBlockTemplatesHandler &)
 
QString dateString () const
 
QString newNameForTemplate (const TitleBlockTemplateLocation &)
 
QET::Action askUser (const TitleBlockTemplateLocation &, const TitleBlockTemplateLocation &)
 
void initDialog ()
 
void radioButtonleftMargin (QRadioButton *)
 

Private Attributes

QWidget * parent_widget_
 Widget used as parent to display dialogs. More...
 
QString rename_
 Name to be used when renaming a title block template. More...
 
QDialog * integ_dialog_
 Dialog in case of conflict when integrating a title block template. More...
 
QLabel * dialog_label_
 
QVBoxLayout * dialog_vlayout_
 
QGridLayout * dialog_glayout
 
QDialogButtonBox * buttons_
 
QRadioButton * use_existing_template_
 Radio button the user may click to use the existing template and stop the integration. More...
 
QRadioButton * integrate_new_template_
 Radio button the user may click to integrate the template. More...
 
QRadioButton * erase_template_
 Radio button the user may click for the integrated template to erase the existing one. More...
 
QRadioButton * integrate_both_
 
QButtonGroup * button_group1_
 
QButtonGroup * button_group2_
 

Detailed Description

This class implements the interface defined by MoveTitleBlockTemplatesHandler to ease the integration of title block templates from files-based collections into projects.

Definition at line 27 of file integrationmovetemplateshandler.h.

Constructor & Destructor Documentation

◆ IntegrationMoveTitleBlockTemplatesHandler() [1/2]

IntegrationMoveTitleBlockTemplatesHandler::IntegrationMoveTitleBlockTemplatesHandler ( QWidget *  parent = nullptr)

Constructor

Parameters
parentQwidget used as parent when showing the user dialog.

Definition at line 26 of file integrationmovetemplateshandler.cpp.

◆ ~IntegrationMoveTitleBlockTemplatesHandler()

IntegrationMoveTitleBlockTemplatesHandler::~IntegrationMoveTitleBlockTemplatesHandler ( )
override

Destructor

Definition at line 36 of file integrationmovetemplateshandler.cpp.

◆ IntegrationMoveTitleBlockTemplatesHandler() [2/2]

IntegrationMoveTitleBlockTemplatesHandler::IntegrationMoveTitleBlockTemplatesHandler ( const IntegrationMoveTitleBlockTemplatesHandler )
private

Member Function Documentation

◆ askUser()

QET::Action IntegrationMoveTitleBlockTemplatesHandler::askUser ( const TitleBlockTemplateLocation src,
const TitleBlockTemplateLocation dst 
)
private

Ask the use whether they wish to erase the already existing template, rename it or cancel the operation.

Parameters
srcSource title block template
dstTarget title block template
Returns
the user answer

Definition at line 124 of file integrationmovetemplateshandler.cpp.

References QET::Abort, QET::Erase, erase_template_, initDialog(), integ_dialog_, QET::Managed, newNameForTemplate(), QET::Rename, rename_, and use_existing_template_.

Referenced by templateAlreadyExists().

◆ correctRadioButtons

void IntegrationMoveTitleBlockTemplatesHandler::correctRadioButtons ( )
privateslot

Ensure the dialog remains consistent.

Definition at line 243 of file integrationmovetemplateshandler.cpp.

References erase_template_, integrate_both_, and integrate_new_template_.

Referenced by initDialog().

◆ dateString()

QString IntegrationMoveTitleBlockTemplatesHandler::dateString ( ) const
private
Returns
the current date with a filename-friendly format

Definition at line 105 of file integrationmovetemplateshandler.cpp.

Referenced by newNameForTemplate().

◆ errorWithATemplate()

QET::Action IntegrationMoveTitleBlockTemplatesHandler::errorWithATemplate ( const TitleBlockTemplateLocation tbt,
const QString &  message 
)
overridevirtual

Display an error message related to a specific title block template.

Parameters
tbtProblematic title block template
messageError message.

Implements MoveTitleBlockTemplatesHandler.

Definition at line 82 of file integrationmovetemplateshandler.cpp.

References QET::QetMessageBox::critical(), QET::Ignore, parent_widget_, TitleBlockTemplateLocation::toString(), and QET::Icons::tr.

Referenced by templateAlreadyExists().

◆ initDialog()

void IntegrationMoveTitleBlockTemplatesHandler::initDialog ( )
private

◆ nameForRenamingOperation()

QString IntegrationMoveTitleBlockTemplatesHandler::nameForRenamingOperation ( )
overridevirtual
Returns
the name to be used when this object returns QET::Rename
See also
QET::Action

Implements MoveTitleBlockTemplatesHandler.

Definition at line 98 of file integrationmovetemplateshandler.cpp.

References rename_.

◆ newNameForTemplate()

QString IntegrationMoveTitleBlockTemplatesHandler::newNameForTemplate ( const TitleBlockTemplateLocation tbt)
private
Parameters
tbtA title block template location
Returns
a name to be used in order to duplicate the title block template. This name is based on the current date.

Definition at line 114 of file integrationmovetemplateshandler.cpp.

References dateString(), and TitleBlockTemplateLocation::name().

Referenced by askUser().

◆ radioButtonleftMargin()

void IntegrationMoveTitleBlockTemplatesHandler::radioButtonleftMargin ( QRadioButton *  button)
private

Increase the left margin of a radiob utton.

Parameters
buttonRadio button

Definition at line 234 of file integrationmovetemplateshandler.cpp.

Referenced by initDialog().

◆ templateAlreadyExists()

QET::Action IntegrationMoveTitleBlockTemplatesHandler::templateAlreadyExists ( const TitleBlockTemplateLocation src,
const TitleBlockTemplateLocation dst 
)
overridevirtual
Parameters
srcSource template
dstTarget template
Returns
the action to be done if the target template already exists

Implements MoveTitleBlockTemplatesHandler.

Definition at line 44 of file integrationmovetemplateshandler.cpp.

References askUser(), errorWithATemplate(), TitleBlockTemplateLocation::getTemplateXmlDescription(), QET::Managed, TitleBlockTemplateLocation::name(), TitleBlockTemplateLocation::parentCollection(), and QET::Icons::tr.

Member Data Documentation

◆ button_group1_

QButtonGroup* IntegrationMoveTitleBlockTemplatesHandler::button_group1_
private

Definition at line 70 of file integrationmovetemplateshandler.h.

Referenced by initDialog().

◆ button_group2_

QButtonGroup* IntegrationMoveTitleBlockTemplatesHandler::button_group2_
private

Definition at line 71 of file integrationmovetemplateshandler.h.

Referenced by initDialog().

◆ buttons_

QDialogButtonBox* IntegrationMoveTitleBlockTemplatesHandler::buttons_
private

Definition at line 61 of file integrationmovetemplateshandler.h.

Referenced by initDialog().

◆ dialog_glayout

QGridLayout* IntegrationMoveTitleBlockTemplatesHandler::dialog_glayout
private

Definition at line 60 of file integrationmovetemplateshandler.h.

Referenced by initDialog().

◆ dialog_label_

QLabel* IntegrationMoveTitleBlockTemplatesHandler::dialog_label_
private

Definition at line 58 of file integrationmovetemplateshandler.h.

Referenced by initDialog().

◆ dialog_vlayout_

QVBoxLayout* IntegrationMoveTitleBlockTemplatesHandler::dialog_vlayout_
private

Definition at line 59 of file integrationmovetemplateshandler.h.

Referenced by initDialog().

◆ erase_template_

QRadioButton* IntegrationMoveTitleBlockTemplatesHandler::erase_template_
private

Radio button the user may click for the integrated template to erase the existing one.

Definition at line 64 of file integrationmovetemplateshandler.h.

Referenced by askUser(), correctRadioButtons(), and initDialog().

◆ integ_dialog_

QDialog* IntegrationMoveTitleBlockTemplatesHandler::integ_dialog_
private

Dialog in case of conflict when integrating a title block template.

Definition at line 57 of file integrationmovetemplateshandler.h.

Referenced by askUser(), and initDialog().

◆ integrate_both_

QRadioButton* IntegrationMoveTitleBlockTemplatesHandler::integrate_both_
private

Definition at line 69 of file integrationmovetemplateshandler.h.

Referenced by correctRadioButtons(), and initDialog().

◆ integrate_new_template_

QRadioButton* IntegrationMoveTitleBlockTemplatesHandler::integrate_new_template_
private

Radio button the user may click to integrate the template.

Definition at line 63 of file integrationmovetemplateshandler.h.

Referenced by correctRadioButtons(), and initDialog().

◆ parent_widget_

QWidget* IntegrationMoveTitleBlockTemplatesHandler::parent_widget_
private

Widget used as parent to display dialogs.

Definition at line 55 of file integrationmovetemplateshandler.h.

Referenced by errorWithATemplate(), and initDialog().

◆ rename_

QString IntegrationMoveTitleBlockTemplatesHandler::rename_
private

Name to be used when renaming a title block template.

Definition at line 56 of file integrationmovetemplateshandler.h.

Referenced by askUser(), and nameForRenamingOperation().

◆ use_existing_template_

QRadioButton* IntegrationMoveTitleBlockTemplatesHandler::use_existing_template_
private

Radio button the user may click to use the existing template and stop the integration.

Definition at line 62 of file integrationmovetemplateshandler.h.

Referenced by askUser(), and initDialog().


The documentation for this class was generated from the following files: