From aeb0b42cde85c8075918d564e8ca9e5652b2c39d Mon Sep 17 00:00:00 2001 From: Silarn Date: Thu, 10 May 2018 11:21:27 -0500 Subject: Refresh the sort proxy when the data is changed --- src/modlist.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 2d58081d..bf57ef6e 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -699,7 +699,9 @@ void ModList::modInfoChanged(ModInfo::Ptr info) int row = ModInfo::getIndex(info->name()); info->testValid(); + emit aboutToChangeData(); emit dataChanged(index(row, 0), index(row, columnCount())); + emit postDataChanged(); } else { qCritical("modInfoChanged not called after modInfoAboutToChange"); } -- cgit v1.3.1 From 5a0b8b431c3ffd5de2f4359492854310da32405e Mon Sep 17 00:00:00 2001 From: Al12rs Date: Tue, 17 Jul 2018 13:06:38 +0200 Subject: Added Contains INI files content filter and checking. --- src/modinfo.cpp | 1 + src/modinfo.h | 5 +++-- src/modinforegular.cpp | 4 ++++ src/modlist.cpp | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 1f2520c9..91f3c1a1 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -102,6 +102,7 @@ QString ModInfo::getContentTypeName(int contentType) case CONTENT_SKSE: return tr("Script Extender"); case CONTENT_SKYPROC: return tr("SkyProc Tools"); case CONTENT_MCM: return tr("MCM Data"); + case CONTENT_INI: return tr("INI files"); default: throw MyException(tr("invalid content type %1").arg(contentType)); } } diff --git a/src/modinfo.h b/src/modinfo.h index 001a78dc..4cdd7bcf 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -84,10 +84,11 @@ public: CONTENT_SCRIPT, CONTENT_SKSE, CONTENT_SKYPROC, - CONTENT_MCM + CONTENT_MCM, + CONTENT_INI }; - static const int NUM_CONTENT_TYPES = CONTENT_MCM + 1; + static const int NUM_CONTENT_TYPES = CONTENT_INI + 1; enum EHighlight { HIGHLIGHT_NONE = 0, diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index c19294f1..5b6ddcda 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -466,6 +466,10 @@ std::vector ModInfoRegular::getContents() const if (dir.entryList(QStringList() << "*.bsa" << "*.ba2").size() > 0) { m_CachedContent.push_back(CONTENT_BSA); } + //use >1 for ini files since there is meta.ini in all mods already. + if (dir.entryList(QStringList() << "*.ini").size() > 1) { + m_CachedContent.push_back(CONTENT_INI); + } ScriptExtender *extender = qApp->property("managed_game") .value() diff --git a/src/modlist.cpp b/src/modlist.cpp index bf57ef6e..aaa4ba79 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -73,6 +73,7 @@ ModList::ModList(PluginContainer *pluginContainer, QObject *parent) m_ContentIcons[ModInfo::CONTENT_SOUND] = std::make_tuple(":/MO/gui/content/sound", tr("Sound or Music")); m_ContentIcons[ModInfo::CONTENT_TEXTURE] = std::make_tuple(":/MO/gui/content/texture", tr("Textures")); m_ContentIcons[ModInfo::CONTENT_MCM] = std::make_tuple(":/MO/gui/content/menu", tr("MCM Configuration")); + m_ContentIcons[ModInfo::CONTENT_INI] = std::make_tuple(":/MO/gui/content/inifile", tr("INI files")); m_LastCheck.start(); } @@ -1109,6 +1110,7 @@ QString ModList::getColumnToolTip(int column) "Script Extender plugins" "SkyProc Patcher" "Mod Configuration Menu" + "INI files" ""); case COL_INSTALLTIME: return tr("Time this mod was installed"); default: return tr("unknown"); -- cgit v1.3.1 From f6ecb93d460b16c10933b35605f7ac1d60eac705 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 18 Jul 2018 16:00:19 +0200 Subject: Set delete Key to recursively clear overwrite with confirmation message. --- src/modlist.cpp | 9 +++++++++ src/modlist.h | 5 +++++ src/organizercore.cpp | 2 ++ 3 files changed, 16 insertions(+) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index aaa4ba79..87cbbfb2 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -999,6 +999,15 @@ bool ModList::removeRows(int row, int count, const QModelIndex &parent) bool success = false; + if (count == 1) { + ModInfo::Ptr modInfo = ModInfo::getByIndex(row); + std::vector flags = modInfo->getFlags(); + if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) { + emit clearOverwrite(); + success = true; + } + } + for (int i = 0; i < count; ++i) { ModInfo::Ptr modInfo = ModInfo::getByIndex(row + i); if (!modInfo->isRegular()) { diff --git a/src/modlist.h b/src/modlist.h index b5f18e98..2db98bd1 100644 --- a/src/modlist.h +++ b/src/modlist.h @@ -244,6 +244,11 @@ signals: */ void fileMoved(const QString &relativePath, const QString &oldOriginName, const QString &newOriginName); + /** + * @brief emitted to have the overwrite folder cleared + */ + void clearOverwrite(); + void aboutToChangeData(); void postDataChanged(); diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 142faabe..74ec752e 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -552,6 +552,8 @@ void OrganizerCore::setUserInterface(IUserInterface *userInterface, SLOT(modRemoved(QString))); connect(&m_ModList, SIGNAL(removeSelectedMods()), widget, SLOT(removeMod_clicked())); + connect(&m_ModList, SIGNAL(clearOverwrite()), widget, + SLOT(clearOverwrite())); connect(&m_ModList, SIGNAL(requestColumnSelect(QPoint)), widget, SLOT(displayColumnSelection(QPoint))); connect(&m_ModList, SIGNAL(fileMoved(QString, QString, QString)), widget, -- cgit v1.3.1 From e80bb3a8370aeea37183d94f62e7bb3a843722b5 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 18 Jul 2018 16:14:16 +0200 Subject: Check if there is actually something in overwrite to delete before asking confirmation. --- src/modlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 87cbbfb2..27bccf63 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -1002,7 +1002,7 @@ bool ModList::removeRows(int row, int count, const QModelIndex &parent) if (count == 1) { ModInfo::Ptr modInfo = ModInfo::getByIndex(row); std::vector flags = modInfo->getFlags(); - if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) { + if ((std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) && (QDir(modInfo->absolutePath()).count() > 2)) { emit clearOverwrite(); success = true; } -- cgit v1.3.1 From edf608ab23e98b4d7dbfd09628cb64770d4bdb1a Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 22 Jul 2018 15:49:40 +0200 Subject: Allow normal QAbstractItemModel event handling for mainwindow. Somehow before it wouldn't work. --- src/modlist.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 27bccf63..e077a5ee 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -1228,6 +1228,7 @@ bool ModList::eventFilter(QObject *obj, QEvent *event) } else if (keyEvent->key() == Qt::Key_Space) { return toggleSelection(itemView); } + return QAbstractItemModel::eventFilter(obj, event); } return QAbstractItemModel::eventFilter(obj, event); } -- cgit v1.3.1 From 7eb4b33214279aeb97541344e1c20da2b8dd79ff Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Tue, 31 Jul 2018 03:52:55 -0500 Subject: Tweak shading of mods and plugins to better support dark themes --- src/modlist.cpp | 7 +++---- src/pluginlist.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index e077a5ee..0d084c22 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -354,7 +354,6 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const int highlight = modInfo->getHighlight(); if (highlight & ModInfo::HIGHLIGHT_IMPORTANT) return QBrush(Qt::darkRed); else if (highlight & ModInfo::HIGHLIGHT_INVALID) return QBrush(Qt::darkGray); - else if (highlight & ModInfo::HIGHLIGHT_PLUGIN) return QBrush(Qt::darkBlue); } else if (column == COL_VERSION) { if (!modInfo->getNewestVersion().isValid()) { return QVariant(); @@ -368,11 +367,11 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const } else if ((role == Qt::BackgroundRole) || (role == ViewMarkingScrollBar::DEFAULT_ROLE)) { if (modInfo->getHighlight() & ModInfo::HIGHLIGHT_PLUGIN) { - return QColor(0, 0, 255, 32); + return QColor(0, 0, 255, 64); } else if (m_Overwrite.find(modIndex) != m_Overwrite.end()) { - return QColor(0, 255, 0, 32); + return QColor(0, 255, 0, 64); } else if (m_Overwritten.find(modIndex) != m_Overwritten.end()) { - return QColor(255, 0, 0, 32); + return QColor(255, 0, 0, 64); } else { return QVariant(); } diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 76de436d..323cd98f 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -861,7 +861,7 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const } else if (role == Qt::BackgroundRole || (role == ViewMarkingScrollBar::DEFAULT_ROLE)) { if (m_ESPs[index].m_ModSelected) { - return QColor(0, 0, 255, 32); + return QColor(0, 0, 255, 64); } else { return QVariant(); } -- cgit v1.3.1