From b0e8037feb5b9d48defe6b8263d068f87bdb141c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 15 Dec 2013 20:42:17 +0100 Subject: Make updates prevented by missing accounts verbose --- gui/MainWindow.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'gui') diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index c4b0ceab..d91fc862 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -529,21 +529,21 @@ void MainWindow::on_actionAddInstance_triggered() { errorMsg += "An instance with the given directory name already exists."; CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - break; + return; } case InstanceFactory::CantCreateDir: { errorMsg += "Failed to create the instance directory."; CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - break; + return; } default: { errorMsg += QString("Unknown instance loader error %1").arg(error); CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - break; + return; } } @@ -559,6 +559,14 @@ void MainWindow::on_actionAddInstance_triggered() }); loadDialog.exec(update.get()); } + else + { + CustomMessageBox::selectable( + this, tr("Error"), + tr("MultiMC cannot download Minecraft or update instances unless you have at least " + "one account added.\nPlease add your Mojang or Minecraft account."), + QMessageBox::Warning)->show(); + } } void MainWindow::on_actionCopyInstance_triggered() @@ -634,7 +642,7 @@ void MainWindow::on_actionChangeInstGroup_triggered() bool ok = false; QString name(m_selectedInstance->group()); auto groups = MMC->instances()->getGroups(); - groups.insert(0,""); + groups.insert(0, ""); groups.sort(Qt::CaseInsensitive); int foo = groups.indexOf(name); @@ -1011,7 +1019,14 @@ void MainWindow::on_actionChangeInstMCVersion_triggered() m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); } if (!MMC->accounts()->anyAccountIsValid()) + { + CustomMessageBox::selectable( + this, tr("Error"), + tr("MultiMC cannot download Minecraft or update instances unless you have at least " + "one account added.\nPlease add your Mojang or Minecraft account."), + QMessageBox::Warning)->show(); return; + } auto updateTask = m_selectedInstance->doUpdate(false /*only_prepare*/); if (!updateTask) { -- cgit v1.2.3