MCPcopy Create free account
hub / github.com/NetHack/NetHack / All

Method All

win/Qt/qt_menu.cpp:708–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708void NetHackQtMenuWindow::All()
709{
710 if (how != PICK_ANY && (how != PICK_ONE || itemcount != 1))
711 return;
712
713 if (counting)
714 ClearCount(); // discard any pending count
715 for (int row = 0; row < itemcount; ++row) {
716 itemlist[row].preselected = false; // stale for all rows
717 // skip if not selectable or already selected or fails invert_test()
718 if (!itemlist[row].Selectable()
719 || itemlist[row].selected
720 || !menuitem_invert_test(1, itemlist[row].itemflags, FALSE))
721 continue;
722 itemlist[row].selected = true;
723
724 QTableWidgetItem *count = table->item(row, 0);
725 if (count != NULL) {
726 count->setText("");
727 }
728 QCheckBox *cb = dynamic_cast<QCheckBox *> (table->cellWidget(row, 1));
729 if (cb != NULL) {
730 cb->setChecked(true);
731 }
732 }
733 if (biggestcount > 0L) { // had one or more counts
734 UpdateCountColumn(-1L); // all counts are now gone
735 } else {
736 table->repaint();
737 }
738}
739
740void NetHackQtMenuWindow::ChooseNone()
741{

Callers

nothing calls this directly

Calls 3

menuitem_invert_testFunction · 0.85
repaintMethod · 0.60
SelectableMethod · 0.45

Tested by

no test coverage detected