MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / changeStepProgress

Method changeStepProgress

launcher/ui/dialogs/ProgressDialog.cpp:233–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void ProgressDialog::changeStepProgress(TaskStepProgress const& task_progress)
234{
235 m_is_multi_step = true;
236 if (ui->taskProgressScrollArea->isHidden()) {
237 ui->taskProgressScrollArea->setHidden(false);
238 updateSize();
239 }
240
241 if (!taskProgress.contains(task_progress.uid))
242 addTaskProgress(task_progress);
243 auto task_bar = taskProgress.value(task_progress.uid);
244
245 auto const [mapped_current, mapped_total] = map_int_zero_max<qint64>(task_progress.current, task_progress.total, 0);
246 if (task_progress.total <= 0) {
247 task_bar->setRange(0, 0);
248 } else {
249 task_bar->setRange(0, mapped_total);
250 }
251
252 task_bar->setValue(mapped_current);
253 task_bar->setStatus(task_progress.status);
254 task_bar->setDetails(task_progress.details);
255
256 if (task_progress.isDone()) {
257 task_bar->setVisible(false);
258 }
259}
260
261void ProgressDialog::changeProgress(qint64 current, qint64 total)
262{

Callers

nothing calls this directly

Calls 8

valueMethod · 0.80
setRangeMethod · 0.80
setValueMethod · 0.80
isDoneMethod · 0.80
setVisibleMethod · 0.80
containsMethod · 0.45
setStatusMethod · 0.45
setDetailsMethod · 0.45

Tested by

no test coverage detected