| 107 | } |
| 108 | |
| 109 | void InstanceSettingsPage::applySettings() |
| 110 | { |
| 111 | SettingsObject::Lock lock(m_settings); |
| 112 | |
| 113 | // Miscellaneous |
| 114 | bool miscellaneous = ui->miscellaneousSettingsBox->isChecked(); |
| 115 | m_settings->set("OverrideMiscellaneous", miscellaneous); |
| 116 | if (miscellaneous) |
| 117 | { |
| 118 | m_settings->set("CloseAfterLaunch", ui->closeAfterLaunchCheck->isChecked()); |
| 119 | m_settings->set("QuitAfterGameStop", ui->quitAfterGameStopCheck->isChecked()); |
| 120 | } |
| 121 | else |
| 122 | { |
| 123 | m_settings->reset("CloseAfterLaunch"); |
| 124 | m_settings->reset("QuitAfterGameStop"); |
| 125 | } |
| 126 | |
| 127 | // Console |
| 128 | bool console = ui->consoleSettingsBox->isChecked(); |
| 129 | m_settings->set("OverrideConsole", console); |
| 130 | if (console) |
| 131 | { |
| 132 | m_settings->set("ShowConsole", ui->showConsoleCheck->isChecked()); |
| 133 | m_settings->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked()); |
| 134 | m_settings->set("ShowConsoleOnError", ui->showConsoleErrorCheck->isChecked()); |
| 135 | } |
| 136 | else |
| 137 | { |
| 138 | m_settings->reset("ShowConsole"); |
| 139 | m_settings->reset("AutoCloseConsole"); |
| 140 | m_settings->reset("ShowConsoleOnError"); |
| 141 | } |
| 142 | |
| 143 | // Window Size |
| 144 | bool window = ui->windowSizeGroupBox->isChecked(); |
| 145 | m_settings->set("OverrideWindow", window); |
| 146 | if (window) |
| 147 | { |
| 148 | m_settings->set("LaunchMaximized", ui->maximizedCheckBox->isChecked()); |
| 149 | m_settings->set("MinecraftWinWidth", ui->windowWidthSpinBox->value()); |
| 150 | m_settings->set("MinecraftWinHeight", ui->windowHeightSpinBox->value()); |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | m_settings->reset("LaunchMaximized"); |
| 155 | m_settings->reset("MinecraftWinWidth"); |
| 156 | m_settings->reset("MinecraftWinHeight"); |
| 157 | } |
| 158 | |
| 159 | // Memory |
| 160 | bool memory = ui->memoryGroupBox->isChecked(); |
| 161 | m_settings->set("OverrideMemory", memory); |
| 162 | if (memory) |
| 163 | { |
| 164 | int min = ui->minMemSpinBox->value(); |
| 165 | int max = ui->maxMemSpinBox->value(); |
| 166 | if(min < max) |
nothing calls this directly
no test coverage detected