GH-1082 allow disabling components

Currently only ones that are removable and aren't dep-only
This commit is contained in:
Petr Mrázek
2017-12-03 15:48:25 +01:00
parent 0a56b56286
commit 6a462d0778
4 changed files with 107 additions and 9 deletions

View File

@ -31,6 +31,10 @@ public:
virtual ~Component(){};
void applyTo(LaunchProfile *profile);
bool isEnabled();
bool setEnabled (bool state);
bool canBeDisabled();
bool isMoveable();
bool isCustomizable();
bool isRevertible();
@ -55,6 +59,7 @@ public:
void setImportant (bool state);
const QList<PatchProblem> getProblems() const override;
ProblemSeverity getProblemSeverity() const override;
@ -79,6 +84,8 @@ public: /* data */
bool m_dependencyOnly = false;
/// if true, the component is either the main component of the instance, or otherwise important and cannot be removed.
bool m_important = false;
/// if true, the component is disabled
bool m_disabled = false;
/// cached name for display purposes, taken from the version file (meta or local override)
QString m_cachedName;