| 225 | void frmConvert::subDelayToggled() { checkFPSNeeded(); } |
| 226 | |
| 227 | void frmConvert::convertClicked() { |
| 228 | double fpsRatio = 1.0, delayOffset = 0.0; |
| 229 | |
| 230 | if (ui.cbChangeFPS->isChecked()) { |
| 231 | double fpsFrom = ui.cbFPSFrom->currentText().replace(',', '.').toDouble(); |
| 232 | double fpsTo = ui.cbFPSTo->currentText().replace(',', '.').toDouble(); |
| 233 | fpsRatio = fpsTo / fpsFrom; |
| 234 | } |
| 235 | |
| 236 | if (ui.cbDelaySubtitles->isChecked()) { |
| 237 | delayOffset = ui.sbDelayOffset->value(); |
| 238 | } |
| 239 | |
| 240 | if (subConverter.convertSubtitles( |
| 241 | ui.leSrcSubFile->text(), targetFormat, ui.leTargetFileName->text(), |
| 242 | ui.cbMovieFPS->currentText().replace(',', '.').toDouble(), fpsRatio, |
| 243 | delayOffset)) { |
| 244 | QMessageBox::information(this, tr("Subtitles converted"), |
| 245 | tr("Changed subtitles format from '%1' to '%2'") |
| 246 | .arg(srcFormat, targetFormat)); |
| 247 | } else { |
| 248 | QMessageBox::warning(this, tr("Could not change subtitle format!"), |
| 249 | tr("An error occured while converting subtitles!")); |
| 250 | } |
| 251 | } |
nothing calls this directly
no test coverage detected