-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.290 $ $NHDT-Date: 1598570054 2020/08/27 23:14:14 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.291 $ $NHDT-Date: 1598661087 2020/08/29 00:31:27 $
General Fixes and Modified Features
-----------------------------------
Qt: tombstone showed newly constructed date instead of the value set up at
time of death; it only shows year but that could be wrong if player
stared at or ignored prior --More-- for long enough on 31 December
+Qt: menu choices All, None, Invert were setting, unsetting, or toggling menu
+ entry checkboxes internally but didn't redraw the menu to show that
Qt+QSX: fix control key
Qt+OSX: rename menu entry "nethack->Preferences..." for invoking nethack's
'O' command to "Game->Run-time options" and entry "Game->Qt settings"
how=h;
- ok->setEnabled(how!=PICK_ONE);ok->setDefault(how!=PICK_ONE);
+ ok->setEnabled(how!=PICK_ONE); ok->setDefault(how!=PICK_ONE);
cancel->setEnabled(true);
all->setEnabled(how==PICK_ANY);
none->setEnabled(how==PICK_ANY);
InputCount(key);
else {
for (int i=0; i<itemcount; i++) {
- if ((unsigned int) itemlist[i].ch == key || (unsigned int) itemlist[i].gch == key)
+ if ((unsigned int) itemlist[i].ch == key
+ || (unsigned int) itemlist[i].gch == key)
ToggleSelect(i);
}
}
if (how != PICK_ANY)
return;
+ bool didcheck = false;
for (int i=0; i<itemcount; i++) {
QTableWidgetItem *count = table->item(i, 0);
if (count != NULL) count->setText("");
QCheckBox *cb = dynamic_cast<QCheckBox *>(table->cellWidget(i, 1));
- if (cb != NULL) cb->setChecked(true);
+ if (cb != NULL) {
+ cb->setChecked(true);
+ didcheck = true;
+ }
}
+ if (didcheck)
+ table->repaint();
}
void NetHackQtMenuWindow::ChooseNone()
{
if (how != PICK_ANY)
return;
+ bool diduncheck = false;
for (int i=0; i<itemcount; i++) {
QTableWidgetItem *count = table->item(i, 0);
if (count != NULL) count->setText("");
QCheckBox *cb = dynamic_cast<QCheckBox *>(table->cellWidget(i, 1));
- if (cb != NULL) cb->setChecked(false);
+ if (cb != NULL) {
+ cb->setChecked(false);
+ diduncheck = true;
+ }
}
+ if (diduncheck)
+ table->repaint();
}
void NetHackQtMenuWindow::Invert()
{
if (how != PICK_ANY)
return;
+ boolean didtoggle = false;
for (int i=0; i<itemcount; i++) {
if (!menuitem_invert_test(0, itemlist[i].itemflags,
itemlist[i].selected))
if (count != NULL) count->setText("");
QCheckBox *cb = dynamic_cast<QCheckBox *>(table->cellWidget(i, 1));
- if (cb != NULL) cb->setChecked(cb->checkState() == Qt::Unchecked);
+ if (cb != NULL) {
+ cb->setChecked(cb->checkState() == Qt::Unchecked);
+ didtoggle = true;
+ }
}
+ if (didtoggle)
+ table->repaint();
}
void NetHackQtMenuWindow::Search()
{
NetHackQtStringRequestor requestor(this, "Search for:");
char line[256];
+ line[0] = '\0'; /* for EDIT_GETLIN */
if (requestor.Get(line)) {
for (int i=0; i<itemcount; i++) {
if (itemlist[i].str.contains(line))
QCheckBox *cb = dynamic_cast<QCheckBox *>(table->cellWidget(i, 1));
if (cb == NULL) return;
- cb->setChecked((counting && !countstr.isEmpty())
- || cb->checkState() == Qt::Unchecked);
+ cb->setChecked((counting && !countstr.isEmpty())
+ || cb->checkState() == Qt::Unchecked);
QTableWidgetItem *count = table->item(i, 0);
if (count != NULL) count->setText(countstr);
if (how==PICK_ONE) {
accept();
- }
+ } else {
+ table->repaint();
+ }
}
}