summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index d16f8353..6c24be98 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -21,10 +21,13 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "modinfo.h"
#include "profile.h"
#include "modlist.h"
+#include "messagedialog.h"
#include <QMenu>
#include <QCheckBox>
#include <QWidgetAction>
-#include <QMessageBox>
+#include <QApplication>
+#include <QDebug>
+#include <QTreeView>
ModListSortProxy::ModListSortProxy(Profile* profile, QObject *parent)
@@ -72,13 +75,12 @@ void ModListSortProxy::setContentFilter(const std::vector<int> &content)
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;
}
-
void ModListSortProxy::enableAllVisible()
{
if (m_Profile == nullptr) return;
@@ -345,6 +347,11 @@ 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) {
+ QWidget *wid = qApp->activeWindow()->findChild<QTreeView*>("modList");
+ MessageDialog::showMessage(tr("Drag&Drop is only supported when sorting by priority"), wid);
+ return false;
+ }
if ((row == -1) && (column == -1)) {
return this->sourceModel()->dropMimeData(data, action, -1, -1, mapToSource(parent));
}