GH-589 GH-842 GH-901 GH-1117 allow mass-enabling/disabling of mods
This commit is contained in:
@ -175,6 +175,21 @@ bool ModList::installMod(const QString &filename)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ModList::enableMods(const QModelIndexList& indexes, bool enable)
|
||||
{
|
||||
if(indexes.isEmpty())
|
||||
return true;
|
||||
|
||||
for (auto i: indexes)
|
||||
{
|
||||
Mod &m = mods[i.row()];
|
||||
m.enable(enable);
|
||||
emit dataChanged(i, i);
|
||||
}
|
||||
emit changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ModList::deleteMods(const QModelIndexList& indexes)
|
||||
{
|
||||
if(indexes.isEmpty())
|
||||
|
@ -86,6 +86,9 @@ public:
|
||||
/// Deletes all the selected mods
|
||||
virtual bool deleteMods(const QModelIndexList &indexes);
|
||||
|
||||
/// Enable or disable listed mods
|
||||
virtual bool enableMods(const QModelIndexList &indexes, bool enable = true);
|
||||
|
||||
void startWatching();
|
||||
void stopWatching();
|
||||
|
||||
|
Reference in New Issue
Block a user