mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +01:00
qetelementeditor: added warnings when close editor if primitives seem to be out of the element bordenow and change method
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2276 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1053,6 +1053,10 @@ bool QETElementEditor::slot_saveAsFile() {
|
||||
*/
|
||||
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 @@ void QETElementEditor::copyAndPasteXml(const QDomDocument &xml_document) {
|
||||
@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);
|
||||
|
||||
Reference in New Issue
Block a user