summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-07-21 19:14:24 +0200
committerTannin <devnull@localhost>2014-07-21 19:14:24 +0200
commit0050cb07409d775efe14e728c1cef4a2c33aa1db (patch)
treeed3eb9363aa35617f0dd92c4746bf14e032d010f /src/mainwindow.cpp
parentf6ef5477e718b14af99bd22436f66dee0b9d22cd (diff)
- download-list will no longer show a file as having incomplete data if there is no file version
- added a new mod column with icons displaying the content of the mod - MO now differentiates between mods using an internal name that disambiguates between foreign and regular mods
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c3182321..a3887a23 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -209,14 +209,22 @@ MainWindow::MainWindow(const QString &exeName, QSettings &initSettings, QWidget
ui->modList->setModel(m_ModListSortProxy);
+ GenericIconDelegate *contentDelegate = new GenericIconDelegate(ui->modList, Qt::UserRole + 3, ModList::COL_CONTENT, 150);
+ connect(ui->modList->header(), SIGNAL(sectionResized(int,int,int)), contentDelegate, SLOT(columnResized(int,int,int)));
ui->modList->sortByColumn(ModList::COL_PRIORITY, Qt::AscendingOrder);
ui->modList->setItemDelegateForColumn(ModList::COL_FLAGS, new ModFlagIconDelegate(ui->modList));
+ ui->modList->setItemDelegateForColumn(ModList::COL_CONTENT, contentDelegate);
//ui->modList->setAcceptDrops(true);
ui->modList->header()->installEventFilter(&m_ModList);
if (initSettings.contains("mod_list_state")) {
ui->modList->header()->restoreState(initSettings.value("mod_list_state").toByteArray());
+
+ // hack: force the resize-signal to be triggered because restoreState doesn't seem to do that
+ ui->modList->header()->resizeSection(ModList::COL_CONTENT, ui->modList->header()->sectionSize(ModList::COL_CONTENT) + 1);
+ ui->modList->header()->resizeSection(ModList::COL_CONTENT, ui->modList->header()->sectionSize(ModList::COL_CONTENT) - 1);
} else {
// hide these columns by default
+ ui->modList->header()->setSectionHidden(ModList::COL_CONTENT, true);
ui->modList->header()->setSectionHidden(ModList::COL_MODID, true);
ui->modList->header()->setSectionHidden(ModList::COL_INSTALLTIME, true);
}
@@ -230,7 +238,7 @@ MainWindow::MainWindow(const QString &exeName, QSettings &initSettings, QWidget
ui->espList->setModel(m_PluginListSortProxy);
ui->espList->sortByColumn(PluginList::COL_PRIORITY, Qt::AscendingOrder);
- ui->espList->setItemDelegateForColumn(PluginList::COL_FLAGS, new PluginFlagIconDelegate(ui->espList));
+ ui->espList->setItemDelegateForColumn(PluginList::COL_FLAGS, new GenericIconDelegate(ui->espList));
if (initSettings.contains("plugin_list_state")) {
ui->espList->header()->restoreState(initSettings.value("plugin_list_state").toByteArray());
}
@@ -2758,7 +2766,7 @@ void MainWindow::modorder_changed()
if (m_CurrentProfile->modEnabled(i)) {
ModInfo::Ptr modInfo = ModInfo::getByIndex(i);
// priorities in the directory structure are one higher because data is 0
- m_DirectoryStructure->getOriginByName(ToWString(modInfo->name())).setPriority(priority + 1);
+ m_DirectoryStructure->getOriginByName(ToWString(modInfo->internalName())).setPriority(priority + 1);
}
}
refreshBSAList();