summaryrefslogtreecommitdiffstats
path: root/logic/ModList.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-26 05:14:32 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-26 05:14:32 +0100
commitacf25d8a33ef67b79d8e8a8859f5559e011373a5 (patch)
tree513fee2d62fb97b9d68c44f2a2a58f733f01a43c /logic/ModList.h
parent449f55c3e668c0e01eee0868226473f12d0b109f (diff)
downloadMultiMC-acf25d8a33ef67b79d8e8a8859f5559e011373a5.tar
MultiMC-acf25d8a33ef67b79d8e8a8859f5559e011373a5.tar.gz
MultiMC-acf25d8a33ef67b79d8e8a8859f5559e011373a5.tar.lz
MultiMC-acf25d8a33ef67b79d8e8a8859f5559e011373a5.tar.xz
MultiMC-acf25d8a33ef67b79d8e8a8859f5559e011373a5.zip
Disable/enable mods with checkboxes. Needs testing.
A lot of testing!
Diffstat (limited to 'logic/ModList.h')
-rw-r--r--logic/ModList.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/logic/ModList.h b/logic/ModList.h
index 803a5429..0d6507fb 100644
--- a/logic/ModList.h
+++ b/logic/ModList.h
@@ -34,9 +34,18 @@ class ModList : public QAbstractListModel
{
Q_OBJECT
public:
+ enum Columns
+ {
+ ActiveColumn = 0,
+ NameColumn,
+ VersionColumn
+ };
ModList(const QString &dir, const QString &list_file = QString());
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ virtual bool setData(const QModelIndex &index, const QVariant &value,
+ int role = Qt::EditRole);
+
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const
{
return size();
@@ -59,7 +68,6 @@ public:
{
return mods[index];
}
- ;
/// Reloads the mod list and returns true if the list changed.
virtual bool update();
@@ -119,7 +127,13 @@ public:
}
private:
- QStringList readListFile();
+ struct OrderItem
+ {
+ QString id;
+ bool enabled = false;
+ };
+ typedef QList<OrderItem> OrderList;
+ OrderList readListFile();
bool saveListFile();
private
slots: