From ebfeb2fbf95df4a2246ff2ef1cd6b48f373b70f3 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 14 Dec 2014 18:25:26 +0100 Subject: - mod-list can now be re-ordered with drag&drop while grouping is active - drag&drop is not disabled when ordering by other columns than priority. MO will notify using messagedialog that it's impossible instead. --- src/modlistsortproxy.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 887ef758..0f6ce33a 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -21,10 +21,12 @@ along with Mod Organizer. If not, see . #include "modinfo.h" #include "profile.h" #include "modlist.h" +#include "messagedialog.h" #include #include #include -#include +#include +#include ModListSortProxy::ModListSortProxy(Profile* profile, QObject *parent) @@ -65,9 +67,9 @@ void ModListSortProxy::setCategoryFilter(const std::vector &categories) Qt::ItemFlags ModListSortProxy::flags(const QModelIndex &modelIndex) const { Qt::ItemFlags flags = sourceModel()->flags(mapToSource(modelIndex)); - if (sortColumn() != ModList::COL_PRIORITY) { +/* if (sortColumn() != ModList::COL_PRIORITY) { flags &= ~Qt::ItemIsDragEnabled; - } + }*/ return flags; } @@ -321,6 +323,10 @@ bool ModListSortProxy::filterAcceptsRow(int row, const QModelIndex &parent) cons bool ModListSortProxy::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { + if (sortColumn() != ModList::COL_PRIORITY) { + MessageDialog::showMessage(tr("Drag&Drop is only supported when sorting by priority"), qApp->activeWindow()); + return false; + } if ((row == -1) && (column == -1)) { return this->sourceModel()->dropMimeData(data, action, -1, -1, mapToSource(parent)); } -- cgit v1.3.1