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

Function askIfShouldUpdate

launcher/InstanceTask.cpp:25–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name)
26{
27 if (APPLICATION->settings()->get("SkipModpackUpdatePrompt").toBool())
28 return ShouldUpdate::SkipUpdating;
29
30 auto info = CustomMessageBox::selectable(
31 parent, QObject::tr("Similar modpack was found!"),
32 QObject::tr(
33 "One or more of your instances are from this same modpack%1. Do you want to create a "
34 "separate instance, or update the existing one?\n\nNOTE: Make sure you made a backup of your important instance data before "
35 "updating, as worlds can be corrupted and some configuration may be lost (due to pack overrides).")
36 .arg(original_version_name),
37 QMessageBox::Information, QMessageBox::Cancel);
38 QAbstractButton* update = info->addButton(QObject::tr("Update existing instance"), QMessageBox::AcceptRole);
39 QAbstractButton* skip = info->addButton(QObject::tr("Create new instance"), QMessageBox::ResetRole);
40
41 info->exec();
42
43 if (info->clickedButton() == update)
44 return ShouldUpdate::Update;
45 if (info->clickedButton() == skip)
46 return ShouldUpdate::SkipUpdating;
47 return ShouldUpdate::Cancel;
48}
49
50QString InstanceName::name() const
51{

Callers 2

updateInstanceMethod · 0.85
updateInstanceMethod · 0.85

Calls 4

selectableFunction · 0.85
getMethod · 0.45
settingsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected