[qet] [1910] Now ask whether to save the project when the diagrams order is changed.

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


Revision: 1910
Author:   xavier
Date:     2012-07-13 19:34:34 +0200 (Fri, 13 Jul 2012)
Log Message:
-----------
Now ask whether to save the project when the diagrams order is changed.

Modified Paths:
--------------
    trunk/sources/projectview.cpp
    trunk/sources/qetproject.cpp

Modified: trunk/sources/projectview.cpp
===================================================================
--- trunk/sources/projectview.cpp	2012-07-13 17:34:31 UTC (rev 1909)
+++ trunk/sources/projectview.cpp	2012-07-13 17:34:34 UTC (rev 1910)
@@ -233,8 +233,10 @@
 int ProjectView::tryClosingDiagrams() {
 	if (!project_) return(QDialogButtonBox::DestructiveRole);
 	
+	bool project_modified = project_ -> projectOptionsWereModified();
 	QList<Diagram *> modified_diagrams = getDiagrams(AllDiagrams | ModifiedDiagramsOnly);
-	if (!modified_diagrams.count() && !project_ -> filePath().isEmpty()) {
+	bool has_filepath = !project_ -> filePath().isEmpty();
+	if (!project_modified && !modified_diagrams.count() && has_filepath) {
 		// nothing was modified, and we have a filepath, i.e. everything was already
 		// saved, i.e we can close the project right now
 		return(QDialogButtonBox::DestructiveRole);

Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp	2012-07-13 17:34:31 UTC (rev 1909)
+++ trunk/sources/qetproject.cpp	2012-07-13 17:34:34 UTC (rev 1910)
@@ -843,6 +843,7 @@
 	
 	diagrams_.move(old_index, new_index);
 	updateDiagramsFolioData();
+	setModified(true);
 	emit(projectDiagramsOrderChanged(this, old_index, new_index));
 }
 
@@ -1146,7 +1147,7 @@
 
 /**
 	@return true if project options (title, project-wide properties, settings
-	for new diagrams, ...) were modified, false otherwise.
+	for new diagrams, diagrams order...) were modified, false otherwise.
 */
 bool QETProject::projectOptionsWereModified() {
 	// unlike similar methods, this method does not compare the content against


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