[qet] [1628] Fixed a bug preventing the user from dropping an already-integrated titleblock template onto a diagram .

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


Revision: 1628
Author:   xavier
Date:     2012-04-04 18:13:08 +0200 (Wed, 04 Apr 2012)
Log Message:
-----------
Fixed a bug preventing the user from dropping an already-integrated titleblock template onto a diagram.

Modified Paths:
--------------
    branches/0.3/sources/diagramview.cpp
    branches/0.3/sources/qetproject.cpp
    branches/0.3/sources/titleblock/integrationmovetemplateshandler.cpp

Modified: branches/0.3/sources/diagramview.cpp
===================================================================
--- branches/0.3/sources/diagramview.cpp	2012-04-04 15:39:18 UTC (rev 1627)
+++ branches/0.3/sources/diagramview.cpp	2012-04-04 16:13:08 UTC (rev 1628)
@@ -752,7 +752,7 @@
 	can be directly applied
 */
 bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &tbt_loc) const {
-	// unlike elements, the integration of title block templates is mandatory, so we simply check whether the parent project of the 
+	// unlike elements, the integration of title block templates is mandatory, so we simply check whether the parent project of the template is also the parent project of the diagram
 	QETProject *tbt_parent_project = tbt_loc.parentProject();
 	if (!tbt_parent_project) return(true);
 	

Modified: branches/0.3/sources/qetproject.cpp
===================================================================
--- branches/0.3/sources/qetproject.cpp	2012-04-04 15:39:18 UTC (rev 1627)
+++ branches/0.3/sources/qetproject.cpp	2012-04-04 16:13:08 UTC (rev 1628)
@@ -675,7 +675,7 @@
 
 /**
 	Integrate a title block template into this project.
-	@param src_tbt The locaiton of the title block template to be integrated into this project
+	@param src_tbt The location of the title block template to be integrated into this project
 	@param handler 
 	@return the name of the template after integration, or an empty QString if a problem occured.
 */
@@ -690,10 +690,12 @@
 			continue;
 		} else if (action == QET::Erase) {
 			break;
-		} else if (action == QET::Ignore || action == QET::Abort || action == QET::Managed) {
+		} else if (action == QET::Abort || action == QET::Ignore) {
 			return(QString());
 		} else if (action == QET::Rename) {
 			target_name = handler -> nameForRenamingOperation();
+		} else if (action == QET::Managed) {
+			return(target_name);
 		}
 	}
 	

Modified: branches/0.3/sources/titleblock/integrationmovetemplateshandler.cpp
===================================================================
--- branches/0.3/sources/titleblock/integrationmovetemplateshandler.cpp	2012-04-04 15:39:18 UTC (rev 1627)
+++ branches/0.3/sources/titleblock/integrationmovetemplateshandler.cpp	2012-04-04 16:13:08 UTC (rev 1628)
@@ -68,7 +68,7 @@
 	if (src_tbt_document.toString(0) == dst_tbt_document.toString(0)) {
 		// the templates are the same, consider the integration is done
 		qDebug() << Q_FUNC_INFO << "Not integrating" << src.parentCollection() << "/" << src.name()<< "because it is already present in the project";
-		return(QET::Ignore);
+		return(QET::Managed);
 	} else {
 		return(askUser(src, dst));
 	}
@@ -127,7 +127,7 @@
 	int result = integ_dialog_ -> exec();
 	if (result == QDialog::Accepted) {
 		if (use_existing_template_ -> isChecked()) {
-			return(QET::Ignore);
+			return(QET::Managed);
 		} else if (erase_template_ -> isChecked()) {
 			return(QET::Erase);
 		} else {


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