[qet] [1738] Moved some ElementsPanel-specific modifications to reimplemented GenericPanel virtual methods .

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


Revision: 1738
Author:   xavier
Date:     2012-05-03 07:28:28 +0200 (Thu, 03 May 2012)
Log Message:
-----------
Moved some ElementsPanel-specific modifications to reimplemented GenericPanel virtual methods.

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

Modified: branches/0.3/sources/elementspanel.cpp
===================================================================
--- branches/0.3/sources/elementspanel.cpp	2012-05-02 13:37:21 UTC (rev 1737)
+++ branches/0.3/sources/elementspanel.cpp	2012-05-03 05:28:28 UTC (rev 1738)
@@ -430,17 +430,13 @@
 	
 	if (TitleBlockTemplatesCollection *tbt_collection = project -> embeddedTitleBlockTemplatesCollection()) {
 		if (QTreeWidgetItem *tbt_collection_qtwi = itemForTemplatesCollection(tbt_collection)) {
-			tbt_collection_qtwi -> setText(0, tr("Cartouches embarqu\xE9s"));
-			tbt_collection_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection de cartouches embarqu\351e", "Status tip"));
-			
 			if (first_add) tbt_collection_qtwi -> setExpanded(true);
 		}
 	}
 	
 	if (ElementsCollection *elmt_collection = project -> embeddedCollection()) {
 		if (QTreeWidgetItem *elmt_collection_qtwi = itemForElementsCollection(elmt_collection)) {
-			elmt_collection_qtwi -> setText(0, tr("Collection embarqu\xE9e"));
-			elmt_collection_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection d'\351l\351ments embarqu\351e", "Status tip"));
+
 			if (first_add) elmt_collection_qtwi -> setExpanded(true);
 		}
 	}
@@ -465,6 +461,15 @@
 	return(addElementsCollection(collection, invisibleRootItem(), options));
 }
 
+QTreeWidgetItem *ElementsPanel::updateTemplatesCollectionItem(QTreeWidgetItem *tbt_collection_qtwi, TitleBlockTemplatesCollection *tbt_collection, PanelOptions options, bool freshly_created) {
+	QTreeWidgetItem *tbtc_qtwi = GenericPanel::updateTemplatesCollectionItem(tbt_collection_qtwi, tbt_collection, options, freshly_created);
+	if (tbt_collection && tbt_collection -> parentProject()) {
+		tbtc_qtwi -> setText(0, tr("Cartouches embarqu\xE9s"));
+		tbtc_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection de cartouches embarqu\351e", "Status tip"));
+	}
+	return(tbtc_qtwi);
+}
+
 QTreeWidgetItem *ElementsPanel::updateTemplateItem(QTreeWidgetItem *tb_template_qtwi, const TitleBlockTemplateLocation &tb_template, PanelOptions options, bool freshly_created) {
 	QTreeWidgetItem *item = GenericPanel::updateTemplateItem(tb_template_qtwi, tb_template, options, freshly_created);
 	item -> setStatusTip(
@@ -490,6 +495,15 @@
 	return(item);
 }
 
+QTreeWidgetItem *ElementsPanel::updateElementsCollectionItem(QTreeWidgetItem *collection_qtwi, ElementsCollection *collection, PanelOptions options, bool freshly_created) {
+	QTreeWidgetItem *c_qtwi = GenericPanel::updateElementsCollectionItem(collection_qtwi, collection, options, freshly_created);
+	if (collection && collection -> project()) {
+		c_qtwi -> setText(0, tr("Collection embarqu\xE9e"));
+		c_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection d'\351l\351ments embarqu\351e", "Status tip"));
+	}
+	return(c_qtwi);
+}
+
 QTreeWidgetItem *ElementsPanel::updateElementItem(QTreeWidgetItem *element_qtwi, ElementDefinition *element, PanelOptions options, bool freshly_created) {
 	QTreeWidgetItem *item = GenericPanel::updateElementItem(element_qtwi, element, options, freshly_created);
 	

Modified: branches/0.3/sources/elementspanel.h
===================================================================
--- branches/0.3/sources/elementspanel.h	2012-05-02 13:37:21 UTC (rev 1737)
+++ branches/0.3/sources/elementspanel.h	2012-05-03 05:28:28 UTC (rev 1738)
@@ -99,11 +99,13 @@
 	virtual QList<ElementsLocation> elementIntegrated(QETProject *, const ElementsLocation &);
 	
 	private:
-	QTreeWidgetItem *addProject   (QETProject *);
-	QTreeWidgetItem *addCollection(ElementsCollection *);
-	QTreeWidgetItem *updateTemplateItem        (QTreeWidgetItem *, const TitleBlockTemplateLocation &,  PanelOptions, bool = false);
-	QTreeWidgetItem *updateElementsCategoryItem(QTreeWidgetItem *, ElementsCategory *,  PanelOptions, bool = false);
-	QTreeWidgetItem *updateElementItem         (QTreeWidgetItem *, ElementDefinition *, PanelOptions, bool = false);
+	virtual QTreeWidgetItem *addProject   (QETProject *);
+	virtual QTreeWidgetItem *addCollection(ElementsCollection *);
+	virtual QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false);
+	virtual QTreeWidgetItem *updateTemplateItem        (QTreeWidgetItem *, const TitleBlockTemplateLocation &,  PanelOptions, bool = false);
+	virtual QTreeWidgetItem *updateElementsCategoryItem(QTreeWidgetItem *, ElementsCategory *,  PanelOptions, bool = false);
+	virtual QTreeWidgetItem *updateElementsCollectionItem(QTreeWidgetItem *, ElementsCollection *,  PanelOptions, bool = false);
+	virtual QTreeWidgetItem *updateElementItem         (QTreeWidgetItem *, ElementDefinition *, PanelOptions, bool = false);
 	
 	// attributes
 	private:


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