used by doMenuItem() and for the toolbar buttons */
| 1005 | |
| 1006 | /* used by doMenuItem() and for the toolbar buttons */ |
| 1007 | bool NetHackQtMainWindow::ok_for_command() |
| 1008 | { |
| 1009 | /* |
| 1010 | * If the core expects text to be entered (perhaps typing in a wish, |
| 1011 | * assigning a name to something, or answering a y/n prompt), or a |
| 1012 | * map position or a direction is being picked, don't accept commands |
| 1013 | * from the toolbar. |
| 1014 | * |
| 1015 | * FIXME: it would be much better to gray-out inapplicable entries |
| 1016 | * when popping up a command menu instead of needing this. |
| 1017 | */ |
| 1018 | if (::program_state.input_state != commandInp) { |
| 1019 | NetHackQtBind::qt_nhbell(); |
| 1020 | // possibly call doKeys("\033"); here? |
| 1021 | return false; |
| 1022 | } |
| 1023 | return true; |
| 1024 | } |
| 1025 | |
| 1026 | void NetHackQtMainWindow::doMenuItem(QAction *action) |
| 1027 | { |
nothing calls this directly
no outgoing calls
no test coverage detected