From 4f95d19ab74de278be559677dc0dc582e95a69a4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 10 Oct 2017 19:28:03 +0300 Subject: [PATCH] Qt4: Prevent selecting all in pick-one menus --- win/Qt4/qt4menu.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/win/Qt4/qt4menu.cpp b/win/Qt4/qt4menu.cpp index fe004e87c..5bfefd3b5 100644 --- a/win/Qt4/qt4menu.cpp +++ b/win/Qt4/qt4menu.cpp @@ -502,6 +502,9 @@ void NetHackQtMenuWindow::keyPressEvent(QKeyEvent* event) void NetHackQtMenuWindow::All() { + if (how != PICK_ANY) + return; + for (int i=0; iitem(i, 0); if (count != NULL) count->setText(""); @@ -512,6 +515,9 @@ void NetHackQtMenuWindow::All() } void NetHackQtMenuWindow::ChooseNone() { + if (how != PICK_ANY) + return; + for (int i=0; iitem(i, 0); if (count != NULL) count->setText(""); @@ -522,6 +528,9 @@ void NetHackQtMenuWindow::ChooseNone() } void NetHackQtMenuWindow::Invert() { + if (how != PICK_ANY) + return; + for (int i=0; iitem(i, 0); if (count != NULL) count->setText(""); @@ -532,6 +541,9 @@ void NetHackQtMenuWindow::Invert() } void NetHackQtMenuWindow::Search() { + if (how != PICK_NONE) + return; + NetHackQtStringRequestor requestor(this, "Search for:"); char line[256]; if (requestor.Get(line)) {