28 parent_widget_(parent),
29 integ_dialog_(nullptr)
45 QString no_parent_collection_error_message(
tr(
"Impossible d'accéder à la catégorie parente",
"error message"));
46 QString cant_get_xml_description_error_message(
tr(
"Impossible d'obtenir la description XML de ce modèle",
"error message"));
50 if (!src_tbt_parent_collection)
return(
errorWithATemplate(src, no_parent_collection_error_message));
53 if (!dst_tbt_parent_collection)
return(
errorWithATemplate(dst, no_parent_collection_error_message));
58 if (src_xml_elmt.isNull())
return(
errorWithATemplate(src, cant_get_xml_description_error_message));
60 if (dst_xml_elmt.isNull())
return(
errorWithATemplate(dst, cant_get_xml_description_error_message));
62 QDomDocument src_tbt_document;
63 src_tbt_document.appendChild(src_tbt_document.importNode(src_xml_elmt,
true));
64 QDomDocument dst_tbt_document;
65 dst_tbt_document.appendChild(dst_tbt_document.importNode(dst_xml_elmt,
true));
68 if (src_tbt_document.toString(0) == dst_tbt_document.toString(0)) {
70 qDebug() << Q_FUNC_INFO <<
"Not integrating" << src.
parentCollection() <<
"/" << src.
name()<<
"because it is already present in the project";
83 QString error_message = QString(
"Une erreur s'est produite avec le modèle %1 : %2").arg(tbt.
toString()).arg(message);
86 tr(
"Erreur",
"message box title"),
106 return(QDateTime::currentDateTime().toString(
"yyyyMMddhhmmss"));
128 if (result == QDialog::Accepted) {
148 integ_dialog_ -> setWindowTitle(
tr(
"Intégration d'un modèle de cartouche"));
153 "Le modèle a déjà été " 154 "intégré dans le projet. Toutefois, la version que vous " 155 "tentez d'appliquer semble différente. Que souhaitez-vous " 157 "dialog content - %1 is a title block template name" 165 "Utiliser le modèle déjà intégré",
174 "Intégrer le modèle déposé",
184 "Écraser le modèle déjà intégré",
194 "Faire cohabiter les deux modèles",
236 button -> getContentsMargins(&a, &b, &c, &d);
237 button -> setContentsMargins(a + 15, b, c, d);
abort the whole operation, ignoring the curent item
QRadioButton * use_existing_template_
Radio button the user may click to use the existing template and stop the integration.
QDialogButtonBox * buttons_
QET::Action askUser(const TitleBlockTemplateLocation &, const TitleBlockTemplateLocation &)
QVBoxLayout * dialog_vlayout_
QString nameForRenamingOperation() override
void radioButtonleftMargin(QRadioButton *)
QRadioButton * integrate_new_template_
Radio button the user may click to integrate the template.
QDomElement getTemplateXmlDescription() const
~IntegrationMoveTitleBlockTemplatesHandler() override
QString newNameForTemplate(const TitleBlockTemplateLocation &)
QRadioButton * integrate_both_
the target has to be renamed
Erase the target content.
QET::Action errorWithATemplate(const TitleBlockTemplateLocation &, const QString &) override
QRadioButton * erase_template_
Radio button the user may click for the integrated template to erase the existing one...
QDialog * integ_dialog_
Dialog in case of conflict when integrating a title block template.
QString rename_
Name to be used when renaming a title block template.
void correctRadioButtons()
QString dateString() const
QET::Action templateAlreadyExists(const TitleBlockTemplateLocation &src, const TitleBlockTemplateLocation &dst) override
QButtonGroup * button_group1_
QGridLayout * dialog_glayout
IntegrationMoveTitleBlockTemplatesHandler(QWidget *=nullptr)
TitleBlockTemplatesCollection * parentCollection() const
the current item was handled by the Strategy object: do not treat it and continue ...
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
QButtonGroup * button_group2_
QWidget * parent_widget_
Widget used as parent to display dialogs.