From: Pasi Kallinen Date: Tue, 10 Oct 2017 16:28:03 +0000 (+0300) Subject: Qt4: Prevent selecting all in pick-one menus X-Git-Tag: NetHack-3.6.1_RC01~287 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f95d19ab74de278be559677dc0dc582e95a69a4;p=nethack Qt4: Prevent selecting all in pick-one menus --- 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)) {