summaryrefslogtreecommitdiff
path: root/src/modlistviewactions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistviewactions.cpp')
-rw-r--r--src/modlistviewactions.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp
index e7e74b16..9d4be554 100644
--- a/src/modlistviewactions.cpp
+++ b/src/modlistviewactions.cpp
@@ -207,10 +207,16 @@ void ModListViewActions::createSeparator(const QModelIndex& index) const
void ModListViewActions::setAllMatchingModsEnabled(bool enabled) const
{
+ // number of mods to enable / disable
+ const auto counters = m_view->counters();
+ const auto count = enabled ?
+ counters.visible.regular - counters.visible.active : counters.visible.active;
+
+ // retrieve visible mods from the model view
const auto allIndex = m_view->indexViewToModel(flatIndex(m_view->model()));
const QString message = enabled ?
tr("Really enable %1 mod(s)?") : tr("Really disable %1 mod(s)?");
- if (QMessageBox::question(m_parent, tr("Confirm"), message.arg(allIndex.size()),
+ if (QMessageBox::question(m_parent, tr("Confirm"), message.arg(count),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
m_core.modList()->setActive(allIndex, enabled);
}
@@ -539,12 +545,12 @@ void ModListViewActions::displayModInformation(ModInfo::Ptr modInfo, unsigned in
void ModListViewActions::sendModsToTop(const QModelIndexList& indexes) const
{
- m_core.modList()->changeModsPriority(indexes, 0);
+ m_core.modList()->changeModsPriority(indexes, Profile::MinimumPriority);
}
void ModListViewActions::sendModsToBottom(const QModelIndexList& indexes) const
{
- m_core.modList()->changeModsPriority(indexes, std::numeric_limits<int>::max());
+ m_core.modList()->changeModsPriority(indexes, Profile::MaximumPriority);
}
void ModListViewActions::sendModsToPriority(const QModelIndexList& indexes) const
@@ -580,7 +586,7 @@ void ModListViewActions::sendModsToSeparator(const QModelIndexList& indexes) con
if (!result.isEmpty()) {
result += "_separator";
- int newPriority = std::numeric_limits<int>::max();
+ int newPriority = Profile::MaximumPriority;
bool foundSection = false;
for (auto mod : m_core.modList()->allModsByProfilePriority()) {
unsigned int modIndex = ModInfo::getIndex(mod);