diff --git a/csgui/messageBox.py b/csgui/messageBox.py index 8bd65a0..a3a3992 100644 --- a/csgui/messageBox.py +++ b/csgui/messageBox.py @@ -8,7 +8,7 @@ class UnsavedMessageBox(QMessageBox): def __init__(self, fileName): super().__init__() - self.setIcon(QMessageBox.Question) + self.setIcon(QMessageBox.Information) self.setWindowTitle("Unsaved changes") self.setText(f"The document \"{fileName}\" has been modified.") self.setInformativeText("Do you want to save your changes?") diff --git a/gui.py b/gui.py index 92972e8..66fbcf0 100755 --- a/gui.py +++ b/gui.py @@ -1059,7 +1059,12 @@ class DocumentWindow(QMdiSubWindow): if self.lastHash == self.doc.getHash(): return True else: - wantToSave = UnsavedMessageBox(os.path.basename(self.currentFilePath)).exec() + if self.currentFilePath: + fileName = os.path.basename(self.currentFilePath) + else: + fileName = "Unsaved" + + wantToSave = UnsavedMessageBox(fileName).exec() if wantToSave == QMessageBox.Save: if not self.currentFilePath: