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

Function askForChangingInstanceName

launcher/InstanceTask.cpp:10–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <QPushButton>
9
10InstanceNameChange askForChangingInstanceName(QWidget* parent, const QString& old_name, const QString& new_name)
11{
12 auto dialog =
13 CustomMessageBox::selectable(parent, QObject::tr("Change instance name"),
14 QObject::tr("The instance's name seems to include the old version. Would you like to update it?\n\n"
15 "Old name: %1\n"
16 "New name: %2")
17 .arg(old_name, new_name),
18 QMessageBox::Question, QMessageBox::No | QMessageBox::Yes);
19 auto result = dialog->exec();
20
21 if (result == QMessageBox::Yes)
22 return InstanceNameChange::ShouldChange;
23 return InstanceNameChange::ShouldKeep;
24}
25
26ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name)
27{

Callers 1

createInstanceMethod · 0.85

Calls 2

selectableFunction · 0.85
execMethod · 0.45

Tested by

no test coverage detected