mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
GH-988 add ability to toggle mods with keyboard
This commit is contained in:
parent
d31184f9a4
commit
4ed67413ac
4 changed files with 32 additions and 7 deletions
|
|
@ -312,15 +312,29 @@ bool ModFolderModel::enableMods(const QModelIndexList& indexes, bool enable)
|
|||
if(indexes.isEmpty())
|
||||
return true;
|
||||
|
||||
for (auto i: indexes)
|
||||
for (auto index: indexes)
|
||||
{
|
||||
Mod &m = mods[i.row()];
|
||||
Mod &m = mods[index.row()];
|
||||
m.enable(enable);
|
||||
emit dataChanged(i, i);
|
||||
emit dataChanged(index, index);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ModFolderModel::toggleEnabled(const QModelIndex& index)
|
||||
{
|
||||
if(interaction_disabled) {
|
||||
return;
|
||||
}
|
||||
if(!index.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Mod &m = mods[index.row()];
|
||||
m.enable(!m.enabled());
|
||||
emit dataChanged(index, index);
|
||||
}
|
||||
|
||||
bool ModFolderModel::deleteMods(const QModelIndexList& indexes)
|
||||
{
|
||||
if(interaction_disabled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue