Respond to a click on the [Reset] button
| 413 | |
| 414 | // Respond to a click on the [Reset] button |
| 415 | void NetHackQtExtCmdRequestor::Reset() |
| 416 | { |
| 417 | // clear any typed text first (in case future changes are made to |
| 418 | // remember it across accept (retry); that would be intended for the |
| 419 | // [Layout] case rather than for [Reset]) |
| 420 | bool clearprompt = (prompt->text() != "#"); |
| 421 | if (clearprompt) |
| 422 | prompt->setText("#"); |
| 423 | |
| 424 | int teardown = 0; |
| 425 | if (set != (WizardMode ? all_cmds : normal_cmds)) |
| 426 | set = all_cmds, ++teardown; |
| 427 | if (byRow) |
| 428 | byRow = false, ++teardown; |
| 429 | if (teardown) { |
| 430 | Retry(); |
| 431 | /*NOTREACHED*/ |
| 432 | } |
| 433 | |
| 434 | if (clearprompt) { // was a subset, now need to show full set |
| 435 | DefaultActionIsCancel(true); // in case keyPressEvent cleared it |
| 436 | enableButtons(); // redraws the grid after discarding typed text above |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | // Return to ExtCmdRequestor::get()'s caller in order to be called back |
| 441 | void NetHackQtExtCmdRequestor::Retry() |
nothing calls this directly
no outgoing calls
no test coverage detected