diff --git a/gui/textEditor.py b/gui/textEditor.py index 2d07763..4109e86 100644 --- a/gui/textEditor.py +++ b/gui/textEditor.py @@ -60,16 +60,16 @@ def closeEvent(self, event): if self.prevName == None or self.ui.mainEditor.toPlainText() != loadFile(self.prevName): reply = QMessageBox.question(self, 'Fechar Janela', 'Tem certeza que vai fechar a janela? Existem modificações não salvas.', QMessageBox.Yes | QMessageBox.No, QMessageBox.No) + if reply == QMessageBox.Yes: + event.accept() + self.wClosed.emit(event.isAccepted) + #https://doc.qt.io/qtforpython/tutorials/basictutorial/signals_and_slots.html + else: + event.ignore() else: event.accept() self.wClosed.emit(event.isAccepted) - if reply == QMessageBox.Yes: - event.accept() - self.wClosed.emit(event.isAccepted) - #https://doc.qt.io/qtforpython/tutorials/basictutorial/signals_and_slots.html - else: - event.ignore() \ No newline at end of file diff --git a/text/dwadawd.txt b/text/dwadawd.txt deleted file mode 100644 index e0b7ce8..0000000 --- a/text/dwadawd.txt +++ /dev/null @@ -1 +0,0 @@ -Teste \ No newline at end of file