From 0899724d901669512d607434d95630035f1d20b8 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 2 Mar 2016 21:22:26 +0100 Subject: profile- and group-dropdown no longer switch by mouse-wheel. Plus fixed refreshing of right-hand side tabs --- src/mainwindow.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index db7bd682..05000761 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -74,6 +74,7 @@ along with Mod Organizer. If not, see . #include "safewritefile.h" #include "nxmaccessmanager.h" #include "appconfig.h" +#include "eventfilter.h" #include #include #include @@ -290,6 +291,17 @@ MainWindow::MainWindow(QSettings &initSettings ui->savegameList->installEventFilter(this); ui->savegameList->setMouseTracking(true); + // don't allow mouse wheel to switch grouping, too many people accidentally + // turn on grouping and then don't understand what happened + + EventFilter *noWheel + = new EventFilter(this, [](QObject *, QEvent *event) -> bool { + return event->type() == QEvent::Wheel; + }); + + ui->groupCombo->installEventFilter(noWheel); + ui->profileBox->installEventFilter(noWheel); + connect(ui->savegameList, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(saveSelectionChanged(QListWidgetItem*))); connect(ui->modList, SIGNAL(dropModeUpdate(bool)), m_OrganizerCore.modList(), SLOT(dropModeUpdate(bool))); @@ -1064,9 +1076,7 @@ void MainWindow::on_profileBox_currentIndexChanged(int index) void MainWindow::updateTo(QTreeWidgetItem *subTree, const std::wstring &directorySoFar, const DirectoryEntry &directoryEntry, bool conflictsOnly) { { - std::vector files = directoryEntry.getFiles(); - for (auto iter = files.begin(); iter != files.end(); ++iter) { - FileEntry::Ptr current = *iter; + for (const FileEntry::Ptr current : directoryEntry.getFiles()) { if (conflictsOnly && (current->getAlternatives().size() == 0)) { continue; } @@ -1476,12 +1486,10 @@ void MainWindow::on_tabWidget_currentChanged(int index) if (index == 0) { m_OrganizerCore.refreshESPList(); } else if (index == 1) { - m_OrganizerCore.refreshBSAList(); - } else if (index == 2) { refreshDataTree(); - } else if (index == 3) { + } else if (index == 2) { refreshSaveList(); - } else if (index == 4) { + } else if (index == 3) { ui->downloadView->scrollToBottom(); } } -- cgit v1.3.1