diff --git a/sources/configpages.cpp b/sources/configpages.cpp index 8e208036e..9b477e58e 100644 --- a/sources/configpages.cpp +++ b/sources/configpages.cpp @@ -105,6 +105,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage bool use_system_colors = settings.value("usesystemcolors", "true").toBool(); bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed"; bool integrate_elements = settings.value("diagrameditor/integrate-elements", true).toBool(); + bool highlight_integrated_elements = settings.value("diagrameditor/highlight-integrated-elements", true).toBool(); QString default_element_informations = settings.value("elementeditor/default-informations", "").toString(); appearance_ = new QGroupBox(tr("Apparence"), this); @@ -116,7 +117,8 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage warning_view_mode_ = new QLabel(tr("Ces param\350tres s'appliqueront d\350s la prochaine ouverture d'un \351diteur de sch\351mas.")); elements_management_ = new QGroupBox(tr("Gestion des \351l\351ments"), this); - integrate_elements_ = new QCheckBox(tr("Int\351grer automatiquement les \351l\351ments dans les projets (recommand\351)"), elements_management_); + integrate_elements_ = new QCheckBox(tr("Int\351grer automatiquement les \351l\351ments dans les projets (recommand\351)")); + highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les \351l\351ments fraichement int\351gr\351s", "configuration option")); default_element_infos_label_ = new QLabel( tr( "Chaque \351l\351ment embarque des informations sur ses auteurs, sa licence, ou tout autre renseignement que vous jugerez utile dans un champ libre. " @@ -136,6 +138,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage } integrate_elements_ -> setChecked(integrate_elements); + highlight_integrated_elements_ -> setChecked(highlight_integrated_elements); default_element_infos_textfield_ -> setPlainText(default_element_informations); QVBoxLayout *appearance_layout = new QVBoxLayout(); @@ -150,6 +153,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage QVBoxLayout *elements_management_layout = new QVBoxLayout(); elements_management_layout -> addWidget(integrate_elements_); + elements_management_layout -> addWidget(highlight_integrated_elements_); elements_management_layout -> addWidget(default_element_infos_label_); elements_management_layout -> addWidget(default_element_infos_textfield_); elements_management_ -> setLayout(elements_management_layout); @@ -192,6 +196,7 @@ void GeneralConfigurationPage::applyConf() { settings.setValue("diagrameditor/viewmode", view_mode) ; settings.setValue("diagrameditor/integrate-elements", integrate_elements_ -> isChecked()); + settings.setValue("diagrameditor/highlight-integrated-elements", highlight_integrated_elements_ -> isChecked()); settings.setValue("elementeditor/default-informations", default_element_infos_textfield_ -> toPlainText()); } diff --git a/sources/configpages.h b/sources/configpages.h index a4fc34ce0..3cd6e3744 100644 --- a/sources/configpages.h +++ b/sources/configpages.h @@ -99,6 +99,7 @@ class GeneralConfigurationPage : public ConfigPage { QLabel *warning_view_mode_; QGroupBox *elements_management_; QCheckBox *integrate_elements_; + QCheckBox *highlight_integrated_elements_; QLabel *default_element_infos_label_; QTextEdit *default_element_infos_textfield_; }; diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 8d8e15b85..f268b155f 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -388,7 +388,9 @@ void ElementsPanel::panelContentChange() { QList ElementsPanel::elementIntegrated(QETProject *project, const ElementsLocation &location) { // the base implementation simply refreshes the adequate category and returns the list of added locations QList added_locations = GenericPanel::elementIntegrated(project, location); - if (!added_locations.count()) return(added_locations); + if (!added_locations.count() || !mustHighlightIntegratedElements()) { + return(added_locations); + } // the additional job of this method consists in displaying the integrated elements... if (QTreeWidgetItem *integrated_element_qtwi = itemForElementsLocation(location)) { @@ -550,6 +552,13 @@ int ElementsPanel::elementsCollectionItemsCount() { return(items_count); } +/** + @return true if freshly integrated elements should be highlighted, false otherwise. +*/ +bool ElementsPanel::mustHighlightIntegratedElements() const { + return(QETApp::settings().value("diagrameditor/highlight-integrated-elements", true).toBool()); +} + /** Recharge l'arbre des elements @param reload_collections true pour relire les collections depuis leurs sources (fichiers, projets...) diff --git a/sources/elementspanel.h b/sources/elementspanel.h index 1b45f1ff6..60b3cdb0e 100644 --- a/sources/elementspanel.h +++ b/sources/elementspanel.h @@ -60,6 +60,7 @@ class ElementsPanel : public GenericPanel { void reloadCollections(); int elementsCollectionItemsCount(); + bool mustHighlightIntegratedElements() const; signals: void requestForProject(QETProject *);