-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.272 $ $NHDT-Date: 1596651973 2020/08/05 18:26:13 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.273 $ $NHDT-Date: 1596652492 2020/08/05 18:34:52 $
General Fixes and Modified Features
-----------------------------------
menus; ESC works to dismiss those and [cancel] should be the same
Qt: bring status conditions up to 3.6 levels but new ones lack pictures
Qt: fix control key on OSX
+Qt: clicking on the window's Close button brought up a dialog offering
+ choices of "Save" and "Cancel"; picking Cancel sent nethack into an
+ infinite loop with complaints about Qt's event loop already being
+ active; change dialog: offer "Save and exit" or "Quit without saving"
+ with no opportunity to try to back out of the Close operation
tiles: add indicator of thonged portion to aklys tile
tty: role and race selection menus weren't filtering out potential choices
which got excluded by OPTIONS=align:!lawful or !neutral or !chaotic
void NetHackQtMainWindow::closeEvent(QCloseEvent* e)
{
if ( g.program_state.something_worth_saving ) {
- switch ( QMessageBox::information( this, "NetHack",
- "This will end your NetHack session",
- "&Save", "&Cancel", 0, 1 ) )
- {
- case 0:
- // See dosave() function
- if (dosave0()) {
- u.uhp = -1;
- NetHackQtBind::qt_exit_nhwindows(0);
- nh_terminate(EXIT_SUCCESS);
- }
- break;
- case 1:
- break; // ignore the event
+ int ok = 0;
+ /* this used to offer "Save" and "Cancel"
+ but cancel (ignoring the close attempt) won't work
+ if user has clicked on the window's Close button */
+ int act = QMessageBox::information(this, "NetHack",
+ "This will end your NetHack session",
+ "&Save and exit", "&Quit without saving", 0, 1);
+ switch (act) {
+ case 0:
+ // See dosave() function
+ ok = dosave0();
+ break;
+ case 1:
+ // quit -- bypass the prompting preformed by done2()
+ ok = 1;
+ g.program_state.stopprint++;
+ done(QUIT);
+ /*NOTREACHED*/
+ break;
+ case 2:
+ // cancel -- no longer an alternative
+ break; // ignore the event
}
+ /* if !ok, we should try to continue, but we don't... */
+ u.uhp = -1;
+ NetHackQtBind::qt_exit_nhwindows(0);
+ nh_terminate(EXIT_SUCCESS);
} else {
e->accept();
}