diff options
-rw-r--r-- | MultiMC.cpp | 1 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | gui/mainwindow.cpp | 41 | ||||
-rw-r--r-- | logic/OneSixUpdate.cpp | 2 |
4 files changed, 37 insertions, 10 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp index 50ae3d3d..25c53185 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -265,6 +265,7 @@ void MultiMC::initGlobalSettings() // Java Settings m_settings->registerSetting(new Setting("JavaPath", "")); + m_settings->registerSetting(new Setting("LastHostname", "")); m_settings->registerSetting(new Setting("JvmArgs", "")); // Custom Commands @@ -8,6 +8,9 @@ MultiMC is a custom launcher for Minecraft that allows you to easily manage mult ## Building Check [BUILD.md](BUILD.md) for build instructions. +## Contributing +The repository is currently managed by @peterix and @drayshak - we're the ones likely to review pull requests. If you'd like to contribute to the project please talk to us on IRC (Esper/#MultiMC) first! This helps us organise ideas and keep in contact with you, and we're unlikely to accept anything blindly. + ## License Copyright © 2013 MultiMC Contributors diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index f5503754..ab718f98 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -74,7 +74,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { - MultiMCPlatform::fixWM_CLASS(this); + MultiMCPlatform::fixWM_CLASS(this); ui->setupUi(this); setWindowTitle(QString("MultiMC %1").arg(MMC->version().toString())); @@ -656,8 +656,9 @@ void MainWindow::on_actionChangeInstMCVersion_triggered() auto result = QMessageBox::warning( this, tr("Are you sure?"), tr("This will remove any library/version customization you did previously. " - "This includes things like Forge install and similar."), QMessageBox::Ok, QMessageBox::Abort); - if(result != QMessageBox::Ok) + "This includes things like Forge install and similar."), + QMessageBox::Ok, QMessageBox::Abort); + if (result != QMessageBox::Ok) return; } m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); @@ -749,22 +750,42 @@ void MainWindow::instanceEnded() void MainWindow::checkSetDefaultJava() { - QString currentJavaPath = MMC->settings()->get("JavaPath").toString(); - if(currentJavaPath.isEmpty()) + bool askForJava = false; { - QLOG_DEBUG() << "Java path not set, showing Java selection dialog..."; + QString currentHostName = QHostInfo::localHostName(); + QString oldHostName = MMC->settings()->get("LastHostname").toString(); + if (currentHostName != oldHostName) + { + MMC->settings()->set("LastHostname", currentHostName); + askForJava = true; + } + } + + { + QString currentJavaPath = MMC->settings()->get("JavaPath").toString(); + if (currentJavaPath.isEmpty()) + { + askForJava = true; + } + } + + if (askForJava) + { + QLOG_DEBUG() << "Java path needs resetting, showing Java selection dialog..."; JavaVersionPtr java; - VersionSelectDialog vselect(MMC->javalist().get(), tr("First run: select a Java version"), this, false); + VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, + false); vselect.setResizeOn(2); vselect.exec(); if (!vselect.selectedVersion()) { - QMessageBox::warning( - this, tr("Invalid version selected"), tr("You didn't select a valid Java version, so MultiMC will select the default. " - "You can change this in the settings dialog.")); + QMessageBox::warning(this, tr("Invalid version selected"), + tr("You didn't select a valid Java version, so MultiMC will " + "select the default. " + "You can change this in the settings dialog.")); JavaUtils ju; java = ju.GetDefaultJava(); diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp index 008995ae..b5f1d78b 100644 --- a/logic/OneSixUpdate.cpp +++ b/logic/OneSixUpdate.cpp @@ -164,6 +164,8 @@ void OneSixUpdate::jarlibStart() auto metacache = MMC->metacache(); for (auto lib : libs) { + if (lib->hint() == "local") + continue; QString download_path = lib->downloadUrl(); auto entry = metacache->resolveEntry("libraries", lib->storagePath()); if (entry->stale) |