| 85 | } |
| 86 | |
| 87 | void frmConvert::srcSubFileLoaded(const QString &srcSubFileName) { |
| 88 | bool fileExists = QFileInfo(srcSubFileName).exists(); |
| 89 | |
| 90 | ui.lbDetectedFormat->setEnabled(fileExists); |
| 91 | ui.lbDetectedFormatValue->setVisible(fileExists); |
| 92 | |
| 93 | if (fileExists) { |
| 94 | QString detectedFormat = subConverter.detectFormat(srcSubFileName); |
| 95 | if (detectedFormat.isEmpty()) { |
| 96 | ui.lbDetectedFormatValue->setText(tr("incorrect")); |
| 97 | ui.lbDetectedFormatValue->setStyleSheet("QLabel { color: red }"); |
| 98 | } else { |
| 99 | ui.lbDetectedFormatValue->setText(detectedFormat); |
| 100 | ui.lbDetectedFormatValue->setStyleSheet("QLabel { color: black }"); |
| 101 | } |
| 102 | srcFormat = detectedFormat; |
| 103 | } else { |
| 104 | srcFormat = ""; |
| 105 | } |
| 106 | |
| 107 | ui.lbTargetFormat->setEnabled(!srcFormat.isEmpty()); |
| 108 | ui.cbTargetFormat->setEnabled(!srcFormat.isEmpty()); |
| 109 | ui.lbTargetExtension->setEnabled(!srcFormat.isEmpty()); |
| 110 | ui.cbTargetExtension->setEnabled(!srcFormat.isEmpty()); |
| 111 | ui.cbChangeFPS->setEnabled(!srcFormat.isEmpty()); |
| 112 | ui.cbDelaySubtitles->setEnabled(!srcFormat.isEmpty()); |
| 113 | ui.pbMovieFPSSelect->setEnabled(!srcFormat.isEmpty()); |
| 114 | ui.lbTargetFileName->setEnabled(!srcFormat.isEmpty()); |
| 115 | ui.leTargetFileName->setEnabled(!srcFormat.isEmpty()); |
| 116 | ui.pbConvert->setEnabled(!srcFormat.isEmpty()); |
| 117 | |
| 118 | checkFPSNeeded(); |
| 119 | generateTargetFileName(); |
| 120 | } |
| 121 | |
| 122 | void frmConvert::targetFormatChanged(int targetFormatIdx) { |
| 123 | targetFormat = subtitleFormatsRegistry->listFormatNames().at(targetFormatIdx); |
nothing calls this directly
no test coverage detected