MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / changeStepProgress

Method changeStepProgress

launcher/ui/dialogs/ProgressDialog.cpp:232–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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