diff options
| author | Al <26797547+Al12rs@users.noreply.github.com> | 2021-01-16 23:02:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-16 23:02:42 +0100 |
| commit | c48791a8a105d89cdbb8f4ac39557ed9cfd81800 (patch) | |
| tree | fb9aeb6aa05474dcad1a5fc9b21eb1af04f23778 /src/modlistviewactions.cpp | |
| parent | 8ee1f94b0f695be46abce2f76ee96035e1d79df7 (diff) | |
| parent | 9f8ba0ea5196bccf73f2f26a3dc8a55907faa02f (diff) | |
Merge pull request #1361 from Holt59/ui-fixes-and-others
UI fixes and others.
Diffstat (limited to 'src/modlistviewactions.cpp')
| -rw-r--r-- | src/modlistviewactions.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp index ed26faa8..857afbdc 100644 --- a/src/modlistviewactions.cpp +++ b/src/modlistviewactions.cpp @@ -17,6 +17,7 @@ #include "modinfodialog.h" #include "modlist.h" #include "modlistview.h" +#include "modelutils.h" #include "messagedialog.h" #include "nexusinterface.h" #include "nxmaccessmanager.h" @@ -172,6 +173,11 @@ void ModListViewActions::createSeparator(const QModelIndex& index) const int newPriority = -1; if (index.isValid() && m_view->sortColumn() == ModList::COL_PRIORITY) { newPriority = m_core.currentProfile()->getModPriority(index.data(ModList::IndexRole).toInt()); + + // descending order, we need to fix the priority + if (m_view->sortOrder() == Qt::DescendingOrder) { + newPriority++; + } } if (m_core.createMod(name) == nullptr) { @@ -192,6 +198,17 @@ void ModListViewActions::createSeparator(const QModelIndex& index) const m_view->scrollToAndSelect(m_view->indexModelToView(m_core.modList()->index(mIndex, 0))); } +void ModListViewActions::setAllMatchingModsEnabled(bool enabled) const +{ + 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()), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + m_core.modList()->setActive(allIndex, enabled); + } +} + void ModListViewActions::checkModsForUpdates() const { bool checkingModsForUpdate = false; |
