From cd0f67d9008c87048844446e94a45bbf8cbfb9b5 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 8 Aug 2020 15:57:45 +0200 Subject: [PATCH] Prevent the enter key from closing the stats dialog --- nw/gui/writingstats.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nw/gui/writingstats.py b/nw/gui/writingstats.py index 8268a714..76c45a58 100644 --- a/nw/gui/writingstats.py +++ b/nw/gui/writingstats.py @@ -220,10 +220,15 @@ class GuiWritingStats(QDialog): self.optsBox.addWidget(self.histMax, 0) # Buttons - self.buttonBox = QDialogButtonBox(QDialogButtonBox.Close) + self.buttonBox = QDialogButtonBox() self.buttonBox.rejected.connect(self._doClose) + self.btnClose = self.buttonBox.addButton(QDialogButtonBox.Close) + self.btnClose.setAutoDefault(False) + self.btnSave = self.buttonBox.addButton("Save As", QDialogButtonBox.ActionRole) + self.btnSave.setAutoDefault(False) + self.saveMenu = QMenu(self) self.btnSave.setMenu(self.saveMenu)