mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-04-16 05:43:01 +00:00
GH-336 Only allow non running instance renaming
This commit is contained in:
parent
14c4df8427
commit
f711425bcf
@ -232,15 +232,21 @@ QString BaseInstance::iconKey() const
|
||||
|
||||
void BaseInstance::setName(QString val, bool requestDirChange)
|
||||
{
|
||||
if(m_settings->get("name") == val) {
|
||||
if(m_settings->get("name") == val)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings->set("name", val);
|
||||
emit propertiesChanged(this);
|
||||
if(requestDirChange) {
|
||||
if(requestDirChange && !isRunning())
|
||||
{
|
||||
emit instanceDirChangeRequest(this);
|
||||
}
|
||||
else if(requestDirChange && isRunning())
|
||||
{
|
||||
qWarning() << "Tried to rename running instance with folder";
|
||||
}
|
||||
}
|
||||
|
||||
QString BaseInstance::name() const
|
||||
|
@ -1831,6 +1831,7 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex &
|
||||
ui->actionLaunchInstanceOffline->setEnabled(m_selectedInstance->canLaunch());
|
||||
ui->actionExportInstance->setEnabled(m_selectedInstance->canExport());
|
||||
ui->renameButton->setText(m_selectedInstance->name());
|
||||
ui->actionRenameInstance->setDisabled(m_selectedInstance->isRunning());
|
||||
m_statusLeft->setText(m_selectedInstance->getStatusbarDescription());
|
||||
updateInstanceToolIcon(m_selectedInstance->iconKey());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user