[qet] [1414] Double clicking on a title block template now opens a dedicated editor.

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


Revision: 1414
Author:   xavier
Date:     2011-12-27 03:17:07 +0100 (Tue, 27 Dec 2011)
Log Message:
-----------
Double clicking on a title block template now opens a dedicated editor.

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

Modified: branches/0.3/sources/elementspanel.cpp
===================================================================
--- branches/0.3/sources/elementspanel.cpp	2011-12-27 01:40:32 UTC (rev 1413)
+++ branches/0.3/sources/elementspanel.cpp	2011-12-27 02:17:07 UTC (rev 1414)
@@ -842,6 +842,10 @@
 		emit(requestForDiagram(diagram));
 	} else if (ElementsCollectionItem *item = collectionItemForItem(qtwi)) {
 		emit(requestForCollectionItem(item));
+	} else if (itemIsATitleBlockTemplate(qtwi)) {
+		if (QETProject *project = projectForTitleBlockTemplate(qtwi)) {
+			emit(requestForTitleBlockTemplate(project, nameOfTitleBlockTemplate(qtwi)));
+		}
 	}
 }
 

Modified: branches/0.3/sources/elementspanel.h
===================================================================
--- branches/0.3/sources/elementspanel.h	2011-12-27 01:40:32 UTC (rev 1413)
+++ branches/0.3/sources/elementspanel.h	2011-12-27 02:17:07 UTC (rev 1414)
@@ -91,6 +91,7 @@
 	void requestForDiagram(Diagram *);
 	void requestForCollectionItem(ElementsCollectionItem *);
 	void requestForMoveElements(ElementsCollectionItem *, ElementsCollectionItem *, QPoint);
+	void requestForTitleBlockTemplate(QETProject *, const QString &);
 	void readingAboutToBegin();
 	void readingFinished();
 	void loadingProgressed(int, int);

Modified: branches/0.3/sources/elementspanelwidget.cpp
===================================================================
--- branches/0.3/sources/elementspanelwidget.cpp	2011-12-27 01:40:32 UTC (rev 1413)
+++ branches/0.3/sources/elementspanelwidget.cpp	2011-12-27 02:17:07 UTC (rev 1414)
@@ -128,6 +128,12 @@
 		SLOT(handleMoveElementsRequest(ElementsCollectionItem *, ElementsCollectionItem *, const QPoint &)),
 		Qt::QueuedConnection
 	);
+	connect(
+		elements_panel,
+		SIGNAL(requestForTitleBlockTemplate(QETProject *, const QString &)),
+		QETApp::instance(),
+		SLOT(openTitleBlockTemplate(QETProject *, const QString &))
+	);
 	connect(elements_panel, SIGNAL(loadingProgressed(int, int)),  this, SLOT(updateProgressBar(int, int)));
 	connect(elements_panel, SIGNAL(readingAboutToBegin()),        this, SLOT(collectionsRead()));
 	connect(elements_panel, SIGNAL(readingFinished()),            this, SLOT(collectionsReadFinished()));
@@ -377,7 +383,6 @@
 		setElementsActionEnabled(false);
 	} else if (elements_panel -> selectedItemIsATitleBlockTemplate()) {
 		bool is_writable = !(elements_panel -> projectForTitleBlockTemplate(elements_panel -> currentItem()) -> isReadOnly());
-		tbt_add -> setEnabled(is_writable);
 		tbt_edit -> setEnabled(is_writable);
 		tbt_remove -> setEnabled(is_writable);
 		setElementsActionEnabled(false);
@@ -469,7 +474,6 @@
 		} else if (elements_panel -> itemIsATitleBlockTemplatesDirectory(item)) {
 			context_menu -> addAction(tbt_add);
 		} else if (elements_panel -> itemIsATitleBlockTemplate(item)) {
-			context_menu -> addAction(tbt_add);
 			context_menu -> addAction(tbt_edit);
 			context_menu -> addAction(tbt_remove);
 		}


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