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

Method closeEvent

outdated/win/Qt3/qt3_win.cpp:4038–4059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4036}
4037
4038void 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
4061void NetHackQtMainWindow::ShowIfReady()
4062{

Callers

nothing calls this directly

Calls 2

dosave0Function · 0.85
nh_terminateFunction · 0.50

Tested by

no test coverage detected