| 131 | } |
| 132 | |
| 133 | void frmProgress::updateProgress(int current, int all, float stageProgress) { |
| 134 | static int lastCurrent, lastAll; |
| 135 | static float lastStageProgress; |
| 136 | |
| 137 | static QMutex m; |
| 138 | m.lock(); |
| 139 | |
| 140 | if (current >= 0) lastCurrent = current; |
| 141 | if (all >= 0) lastAll = all; |
| 142 | if (stageProgress >= 0) lastStageProgress = stageProgress; |
| 143 | |
| 144 | QString windowTitle = |
| 145 | (lastAll > 1) ? QString(tr("QNapi - downloading subtitles (%1/%2)")) |
| 146 | .arg(lastCurrent + 1) |
| 147 | .arg(lastAll) |
| 148 | : QString(tr("QNapi - downloading subtitles...")); |
| 149 | setWindowTitle(windowTitle); |
| 150 | |
| 151 | ui.pbProgress->setMaximum(lastAll * 100); |
| 152 | ui.pbProgress->setValue(lastCurrent * 100 + (int)(lastStageProgress * 100)); |
| 153 | |
| 154 | m.unlock(); |
| 155 | } |
| 156 | |
| 157 | void frmProgress::selectSubtitles(QString fileName, |
| 158 | SubtitleInfoList subtitles) { |
nothing calls this directly
no outgoing calls
no test coverage detected