MCPcopy Create free account
hub / github.com/QNapi/qnapi / updateProgress

Method updateProgress

gui/src/forms/frmprogress.cpp:133–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void 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
157void frmProgress::selectSubtitles(QString fileName,
158 SubtitleInfoList subtitles) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected