[qet] [2276] qetelementeditor: added warnings when close editor if primitives seem to be out of the element bordenow and change method

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


Revision: 2276
Author:   scorpio810
Date:     2013-06-16 07:36:57 +0200 (Sun, 16 Jun 2013)
Log Message:
-----------
qetelementeditor: added warnings when close editor if primitives seem to be out of the element bordenow and change method 

Modified Paths:
--------------
    trunk/sources/editor/qetelementeditor.cpp

Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp	2013-06-15 18:55:47 UTC (rev 2275)
+++ trunk/sources/editor/qetelementeditor.cpp	2013-06-16 05:36:57 UTC (rev 2276)
@@ -1053,6 +1053,10 @@
 */
 bool QETElementEditor::canClose() {
 	if (ce_scene -> undoStack().isClean()) return(true);
+	//verification avant d'enregistrer le fichier
+	if (!ce_scene -> borderContainsEveryParts()) checkElement();
+	// si le symbole deborde, echec de la fermeture
+	if (!ce_scene -> borderContainsEveryParts()) return(false);
 	// demande d'abord a l'utilisateur s'il veut enregistrer l'element en cours
 	QMessageBox::StandardButton answer = QET::MessageBox::question(
 		this,
@@ -1116,8 +1120,6 @@
 	@param qce Le QCloseEvent correspondant a l'evenement de fermeture
 */
 void QETElementEditor::closeEvent(QCloseEvent *qce) {
-	// verification avant d'enregistrer le fichier
-	if (!ce_scene -> borderContainsEveryParts()) return;
 	if (canClose()) {
 		writeSettings();
 		setAttribute(Qt::WA_DeleteOnClose);


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