summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-12-06 23:12:18 -0600
committerSilarn <jrim@rimpo.org>2019-12-06 23:12:18 -0600
commitb3331ef2c0b50ab2cea4c328e78f6ab58bca099d (patch)
treee0be0d00f40733baa4692120d0266ae797ab3785 /src/mainwindow.cpp
parentd42bca5bc0043337f8de72ea72544ebabc505f8b (diff)
Separate conflict flags and render them in separate columns
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index cb242b88..68627c90 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -61,6 +61,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "filedialogmemory.h"
#include "tutorialmanager.h"
#include "modflagicondelegate.h"
+#include "modconflicticondelegate.h"
#include "genericicondelegate.h"
#include "selectiondialog.h"
#include "csvbuilder.h"
@@ -552,7 +553,16 @@ void MainWindow::setupModList()
flagDelegate, SLOT(columnResized(int,int,int)));
+ ModConflictIconDelegate* conflictFlagDelegate = new ModConflictIconDelegate(
+ ui->modList, ModList::COL_CONFLICTFLAGS, 120);
+
+ connect(
+ ui->modList->header(), SIGNAL(sectionResized(int, int, int)),
+ conflictFlagDelegate, SLOT(columnResized(int, int, int)));
+
+
ui->modList->setItemDelegateForColumn(ModList::COL_FLAGS, flagDelegate);
+ ui->modList->setItemDelegateForColumn(ModList::COL_CONFLICTFLAGS, conflictFlagDelegate);
ui->modList->setItemDelegateForColumn(ModList::COL_CONTENT, contentDelegate);
ui->modList->header()->installEventFilter(m_OrganizerCore.modList());
@@ -2317,6 +2327,15 @@ void MainWindow::processUpdates(Settings& settings) {
ui->downloadView->header()->hideSection(i);
}
}
+
+ if (lastVersion < QVersionNumber(2, 2, 2)) {
+ bool lastHidden = true;
+ for (int i = ModList::COL_CONFLICTFLAGS; i < ui->modList->model()->columnCount(); ++i) {
+ bool hidden = ui->modList->header()->isSectionHidden(i);
+ ui->modList->header()->setSectionHidden(i, lastHidden);
+ lastHidden = hidden;
+ }
+ }
}
if (currentVersion < lastVersion) {
@@ -3877,7 +3896,8 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index)
case ModList::COL_MODID: tab = ModInfoTabIDs::Nexus; break;
case ModList::COL_GAME: tab = ModInfoTabIDs::Nexus; break;
case ModList::COL_CATEGORY: tab = ModInfoTabIDs::Categories; break;
- case ModList::COL_FLAGS: tab = ModInfoTabIDs::Conflicts; break;
+ case ModList::COL_CONFLICTFLAGS: tab = ModInfoTabIDs::Conflicts; break;
+ case ModList::COL_FLAGS: tab = ModInfoTabIDs::Flags; break;
}
displayModInformation(sourceIdx.row(), tab);