| 214 | } |
| 215 | |
| 216 | void frmOptions::pbEngineConfClicked() { |
| 217 | QString engineName = ui.twEngines->selectedItems().at(0)->text(); |
| 218 | |
| 219 | const QNapiConfig config = LibQNapi::loadConfig(); |
| 220 | auto enginesConfig = config.enginesConfig(); |
| 221 | |
| 222 | EngineConfig engineCfg = enginesConfig[engineName]; |
| 223 | |
| 224 | if (engineName == NapiProjektDownloadEngine::metadata.name()) { |
| 225 | frmNapiProjektConfig configDialog(engineCfg, this); |
| 226 | if (configDialog.exec() == QDialog::Accepted) { |
| 227 | engineCfg = configDialog.getConfig(); |
| 228 | } |
| 229 | } else if (engineName == OpenSubtitlesDownloadEngine::metadata.name()) { |
| 230 | frmOpenSubtitlesConfig configDialog(engineCfg, this); |
| 231 | if (configDialog.exec() == QDialog::Accepted) { |
| 232 | engineCfg = configDialog.getConfig(); |
| 233 | } |
| 234 | } else if (engineName == Napisy24DownloadEngine::metadata.name()) { |
| 235 | frmNapisy24Config configDialog(engineCfg, this); |
| 236 | if (configDialog.exec() == QDialog::Accepted) { |
| 237 | engineCfg = configDialog.getConfig(); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | enginesConfig[engineName] = engineCfg; |
| 242 | |
| 243 | LibQNapi::writeConfig(config.setEnginesConfig(enginesConfig)); |
| 244 | } |
| 245 | |
| 246 | void frmOptions::pbEngineInfoClicked() { |
| 247 | QString engineName = ui.twEngines->selectedItems().at(0)->text(); |
nothing calls this directly
no test coverage detected