]> granicus.if.org Git - nethack/commitdiff
Qt4: Prevent selecting all in pick-one menus
authorPasi Kallinen <paxed@alt.org>
Tue, 10 Oct 2017 16:28:03 +0000 (19:28 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 10 Oct 2017 16:28:03 +0000 (19:28 +0300)
win/Qt4/qt4menu.cpp

index fe004e87ce1bfb539d8d7210f5462bfd310d07cc..5bfefd3b5a7d85dc3a3f8a575478b08dba2fcba4 100644 (file)
@@ -502,6 +502,9 @@ void NetHackQtMenuWindow::keyPressEvent(QKeyEvent* event)
 
 void NetHackQtMenuWindow::All()
 {
+    if (how != PICK_ANY)
+        return;
+
     for (int i=0; i<itemcount; i++) {
        QTableWidgetItem *count = table->item(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; i<itemcount; i++) {
        QTableWidgetItem *count = table->item(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; i<itemcount; i++) {
        QTableWidgetItem *count = table->item(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)) {