diff --git a/sources/configpages.cpp b/sources/configpages.cpp index 2e6612a43..e5a31da58 100644 --- a/sources/configpages.cpp +++ b/sources/configpages.cpp @@ -237,7 +237,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed"; bool zoom_out_folio = settings.value("diagrameditor/zoom-out-beyond-of-folio", false).toBool(); bool use_trackpad = settings.value("diagramview/gestures", false).toBool(); - bool save_label_paste = settings.value("diagramcommands/save-label", true).toBool(); + bool save_label_paste = settings.value("diagramcommands/erase-label-on-copy", true).toBool(); bool panel_folio = settings.value("genericpanel/folio", true).toBool(); bool highlight_integrated_elements = settings.value("diagrameditor/highlight-integrated-elements", true).toBool(); bool terminal_exportlist = settings.value("nomenclature-exportlist", true).toBool(); @@ -386,7 +386,7 @@ void GeneralConfigurationPage::applyConf() settings.setValue("diagrameditor/highlight-integrated-elements", highlight_integrated_elements_ -> isChecked()); settings.setValue("elementeditor/default-informations", default_element_infos_textfield_ -> toPlainText()); settings.setValue("diagramview/gestures", use_trackpad_ -> isChecked()); - settings.setValue("diagramcommands/save-label", save_label_paste_ -> isChecked()); + settings.setValue("diagramcommands/erase-label-on-copy", save_label_paste_ -> isChecked()); settings.setValue("diagrameditor/zoom-out-beyond-of-folio", m_zoom_out_beyond_folio->isChecked()); settings.setValue("genericpanel/folio",folio_panel_->isChecked()); settings.setValue("nomenclature/terminal-exportlist",terminal_exportlist_->isChecked()); diff --git a/sources/diagramcommands.cpp b/sources/diagramcommands.cpp index 7266b7325..c952a0844 100644 --- a/sources/diagramcommands.cpp +++ b/sources/diagramcommands.cpp @@ -100,7 +100,7 @@ void PasteDiagramCommand::redo() //make new uuid, because old uuid are the uuid of the copied element e -> newUuid(); - if (settings.value("diagramcommands/save-label", true).toBool()) + if (settings.value("diagramcommands/erase-label-on-copy", true).toBool()) { //Reset the information about the label, the comment and location e -> rElementInformations().addValue("formula", ""); diff --git a/sources/ui/multipastedialog.cpp b/sources/ui/multipastedialog.cpp index 1ef19e235..61547329c 100644 --- a/sources/ui/multipastedialog.cpp +++ b/sources/ui/multipastedialog.cpp @@ -4,6 +4,7 @@ #include "diagramcommands.h" #include "element.h" #include "conductorautonumerotation.h" +#include MultiPasteDialog::MultiPasteDialog(Diagram *diagram, QWidget *parent) : QDialog(parent), @@ -75,6 +76,17 @@ void MultiPasteDialog::on_m_button_box_accepted() { if(m_pasted_content.count()) { + QSettings settings; + bool erase_label = settings.value("diagramcommands/erase-label-on-copy", true).toBool(); + //Ensure when 'auto_num' is checked, the settings 'save_label' is to true. + //Because in the class PasteDiagramCommand, if the settings 'save_label' is to false, + //the function redo of PasteDiagramCommand, clear the formula and the label of the pasted element + //and so the auto_num below do nothing (there is not a formula to compare) + if(ui->m_auto_num_cb->isChecked()) + settings.setValue("diagramcommands/erase-label-on-copy", false); + + + m_diagram->clearSelection(); QUndoCommand *undo = new QUndoCommand(tr("Multi-collage")); @@ -132,5 +144,6 @@ void MultiPasteDialog::on_m_button_box_accepted() } m_diagram->adjustSceneRect(); m_accept = true; + settings.setValue("diagramcommands/erase-label-on-copy", erase_label); } } diff --git a/sources/ui/multipastedialog.ui b/sources/ui/multipastedialog.ui index 9e359d67b..03d0ad692 100644 --- a/sources/ui/multipastedialog.ui +++ b/sources/ui/multipastedialog.ui @@ -6,8 +6,8 @@ 0 0 - 261 - 136 + 304 + 162 @@ -90,14 +90,14 @@ - Auto-connection + Auto-connexion - Auto-numérotation des éléments (experimental) + Auto-numérotation des éléments