MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / askForChangingInstanceName

Function askForChangingInstanceName

launcher/InstanceTask.cpp:5–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

createInstanceMethod · 0.85
createInstanceMethod · 0.85

Calls 2

selectableFunction · 0.85
execMethod · 0.45

Tested by

no test coverage detected