| 4036 | } |
| 4037 | |
| 4038 | void NetHackQtMainWindow::closeEvent(QCloseEvent* e) |
| 4039 | { |
| 4040 | if ( program_state.something_worth_saving ) { |
| 4041 | switch ( QMessageBox::information( this, "NetHack", |
| 4042 | "This will end your NetHack session", |
| 4043 | "&Save", "&Cancel", 0, 1 ) ) |
| 4044 | { |
| 4045 | case 0: |
| 4046 | // See dosave() function |
| 4047 | if (dosave0()) { |
| 4048 | u.uhp = -1; |
| 4049 | NetHackQtBind::qt_exit_nhwindows(0); |
| 4050 | nh_terminate(EXIT_SUCCESS); |
| 4051 | } |
| 4052 | break; |
| 4053 | case 1: |
| 4054 | break; // ignore the event |
| 4055 | } |
| 4056 | } else { |
| 4057 | e->accept(); |
| 4058 | } |
| 4059 | } |
| 4060 | |
| 4061 | void NetHackQtMainWindow::ShowIfReady() |
| 4062 | { |
nothing calls this directly
no test coverage detected