From 0b56b5efafffca77d6deee966097c55e78fb0aef Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Mon, 17 Feb 2014 20:31:50 +0100 Subject: Instance flags. Currently used for marking instances as broken. Can later be used for badges. --- logic/OneSixInstance.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'logic/OneSixInstance.cpp') diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 048e635c..b85a593c 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -325,11 +325,12 @@ bool OneSixInstance::reloadVersion(QWidget *widgetParent) } if (ret) { + setFlags(flags() & ~VersionBrokenFlag); emit versionReloaded(); } else { - nuke(); + setFlags(flags() | VersionBrokenFlag); } return ret; } @@ -366,8 +367,14 @@ QString OneSixInstance::defaultCustomBaseJar() const bool OneSixInstance::menuActionEnabled(QString action_name) const { + if (flags() & VersionBrokenFlag) + { + return false; + } if (action_name == "actionChangeInstLWJGLVersion") + { return false; + } return true; } @@ -376,7 +383,11 @@ QString OneSixInstance::getStatusbarDescription() QString descr = "OneSix : " + intendedVersionId(); if (versionIsCustom()) { - descr + " (custom)"; + descr += " (custom)"; + } + if (flags() & VersionBrokenFlag) + { + descr += " (broken)"; } return descr; } -- cgit v1.2.3