diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 7cb5274d..8c731c5b 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -157,7 +157,7 @@ class GuiMainMenu(QMenuBar): menuItem = QAction(QIcon.fromTheme("document-revert"), "Close Project", self) menuItem.setStatusTip("Close Project") menuItem.setShortcut("Ctrl+Shift+W") - menuItem.triggered.connect(lambda : self.theParent.closeProject(False)) + menuItem.triggered.connect(self.theParent.closeProject) self.projMenu.addAction(menuItem) # Project > Recent Projects diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 90e81481..2203bf89 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -214,12 +214,12 @@ class GuiMain(QMainWindow): return True - def closeProject(self, isYes=False): + def closeProject(self): if not self.hasProject: return True - if not isYes: + if self.mainConf.showGUI: msgBox = QMessageBox() msgRes = msgBox.question( self, "Close Project", diff --git a/tests/test_gui.py b/tests/test_gui.py index 261f8ebf..7f141b47 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -27,7 +27,7 @@ def testMainWindows(qtbot, nwTempGUI, nwRef): nwGUI.theProject.handleSeed = 42 assert nwGUI.newProject(nwTempGUI, True) assert nwGUI.saveProject() - assert nwGUI.closeProject(True) + assert nwGUI.closeProject() assert len(nwGUI.theProject.projTree) == 0 assert len(nwGUI.theProject.treeOrder) == 0