Skip to content
Permalink
Browse files

NOISSUE disable component install buttons in impossible cases

  • Loading branch information...
peterix committed Jul 10, 2019
1 parent 725ec35 commit 791a8227b6aae6b506d5f6aac2213b73b1ba0c70
Showing with 9 additions and 5 deletions.
  1. +9 −5 application/pages/instance/VersionPage.cpp
@@ -41,6 +41,7 @@
#include "minecraft/Mod.h"
#include "icons/IconList.h"
#include "Exception.h"
#include "Version.h"

#include "MultiMC.h"

@@ -126,8 +127,7 @@ VersionPage::VersionPage(MinecraftInstance *inst, QWidget *parent)
{
disableVersionControls();
}
connect(m_inst, &MinecraftInstance::versionReloaded, this,
&VersionPage::updateVersionControls);
connect(m_inst, &MinecraftInstance::versionReloaded, this, &VersionPage::updateVersionControls);
}

VersionPage::~VersionPage()
@@ -180,9 +180,13 @@ void VersionPage::packageCurrent(const QModelIndex &current, const QModelIndex &

void VersionPage::updateVersionControls()
{
ui->fabricBtn->setEnabled(true);
ui->forgeBtn->setEnabled(true);
ui->liteloaderBtn->setEnabled(true);
// FIXME: this is a dirty hack
auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));
bool newCraft = minecraftVersion >= Version("1.14");
bool oldCraft = minecraftVersion <= Version("1.12.2");
ui->fabricBtn->setEnabled(newCraft);
ui->forgeBtn->setEnabled(oldCraft);
ui->liteloaderBtn->setEnabled(oldCraft);
updateButtons();
}

0 comments on commit 791a822

Please sign in to comment.
You can’t perform that action at this time.