| 141 | } |
| 142 | |
| 143 | void QuitMenu::execute() { |
| 144 | HUDuiElement* _focus = getNav().get(); |
| 145 | std::vector<HUDuiElement*>& listHUD = getElements(); |
| 146 | if (_focus == listHUD[0]) { // yes |
| 147 | const bool permanentSave = BZDB.isTrue("saveSettings"); |
| 148 | const bool tempSave = (((HUDuiList*)listHUD[2])->getIndex() != 0); |
| 149 | if (tempSave && !permanentSave) { |
| 150 | // save this time, but not usually |
| 151 | dumpResources(); |
| 152 | if (alternateConfig == "") { |
| 153 | CFGMGR.write(getCurrentConfigFileName()); |
| 154 | } |
| 155 | else { |
| 156 | CFGMGR.write(alternateConfig); |
| 157 | } |
| 158 | } |
| 159 | else if (permanentSave && !tempSave) { |
| 160 | // save usually, but not this time |
| 161 | BZDB.setBool("saveSettings", false); |
| 162 | } |
| 163 | CommandsStandard::quit(); |
| 164 | } |
| 165 | else if (_focus == listHUD[1]) { //no |
| 166 | HUDDialogStack::get()->pop(); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | |
| 171 | // Local Variables: *** |
nothing calls this directly
no test coverage detected