[qet] [1714] The scroll-and-highlight animation when integrating an element into a project is now optional .

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1714
Author:   xavier
Date:     2012-04-29 22:29:40 +0200 (Sun, 29 Apr 2012)
Log Message:
-----------
The scroll-and-highlight animation when integrating an element into a project is now optional.

Modified Paths:
--------------
    branches/0.3/sources/configpages.cpp
    branches/0.3/sources/configpages.h
    branches/0.3/sources/elementspanel.cpp
    branches/0.3/sources/elementspanel.h

Modified: branches/0.3/sources/configpages.cpp
===================================================================
--- branches/0.3/sources/configpages.cpp	2012-04-29 20:29:37 UTC (rev 1713)
+++ branches/0.3/sources/configpages.cpp	2012-04-29 20:29:40 UTC (rev 1714)
@@ -105,6 +105,7 @@
 	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 @@
 	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 @@
 	}
 	
 	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 @@
 	
 	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 @@
 	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());
 }
 

Modified: branches/0.3/sources/configpages.h
===================================================================
--- branches/0.3/sources/configpages.h	2012-04-29 20:29:37 UTC (rev 1713)
+++ branches/0.3/sources/configpages.h	2012-04-29 20:29:40 UTC (rev 1714)
@@ -99,6 +99,7 @@
 	QLabel *warning_view_mode_;
 	QGroupBox *elements_management_;
 	QCheckBox *integrate_elements_;
+	QCheckBox *highlight_integrated_elements_;
 	QLabel    *default_element_infos_label_;
 	QTextEdit *default_element_infos_textfield_;
 };

Modified: branches/0.3/sources/elementspanel.cpp
===================================================================
--- branches/0.3/sources/elementspanel.cpp	2012-04-29 20:29:37 UTC (rev 1713)
+++ branches/0.3/sources/elementspanel.cpp	2012-04-29 20:29:40 UTC (rev 1714)
@@ -388,7 +388,9 @@
 QList<ElementsLocation> ElementsPanel::elementIntegrated(QETProject *project, const ElementsLocation &location) {
 	// the base implementation simply refreshes the adequate category and returns the list of added locations
 	QList<ElementsLocation> 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)) {
@@ -551,6 +553,13 @@
 }
 
 /**
+	@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...)
 */

Modified: branches/0.3/sources/elementspanel.h
===================================================================
--- branches/0.3/sources/elementspanel.h	2012-04-29 20:29:37 UTC (rev 1713)
+++ branches/0.3/sources/elementspanel.h	2012-04-29 20:29:40 UTC (rev 1714)
@@ -60,6 +60,7 @@
 	
 	void reloadCollections();
 	int elementsCollectionItemsCount();
+	bool mustHighlightIntegratedElements() const;
 	
 	signals:
 	void requestForProject(QETProject *);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/