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

Method runUpdateTask

launcher/ui/pages/instance/ManagedPackPage.cpp:189–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189bool ManagedPackPage::runUpdateTask(InstanceTask* task)
190{
191 Q_ASSERT(task);
192
193 unique_qobject_ptr<Task> wrapped_task(APPLICATION->instances()->wrapInstanceTask(task));
194
195 connect(task, &Task::failed,
196 [this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); });
197 connect(task, &Task::succeeded, [this, task]() {
198 QStringList warnings = task->warnings();
199 if (warnings.count())
200 CustomMessageBox::selectable(this, tr("Warnings"), warnings.join('\n'), QMessageBox::Warning)->show();
201 });
202 connect(task, &Task::aborted, [this] {
203 CustomMessageBox::selectable(this, tr("Task aborted"), tr("The task has been aborted by the user."), QMessageBox::Information)
204 ->show();
205 });
206
207 ProgressDialog loadDialog(this);
208 loadDialog.setSkipButton(true, tr("Abort"));
209 loadDialog.execWithTask(task);
210
211 return task->wasSuccessful();
212}
213
214void ManagedPackPage::suggestVersion()
215{

Callers

nothing calls this directly

Calls 9

selectableFunction · 0.85
wrapInstanceTaskMethod · 0.80
instancesMethod · 0.80
showMethod · 0.80
setSkipButtonMethod · 0.80
execWithTaskMethod · 0.80
wasSuccessfulMethod · 0.80
warningsMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected