From 2f5cca5c60bf9ea62ccdddb45243ee163f6b227d Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 17 Oct 2023 00:38:17 -0500 Subject: [PATCH 1/3] Plugins updates - Temporarily remove some overlay info - Add isDummy and dummy info - Display refinements for plugin info --- src/pluginlist.cpp | 39 +++++++++++++++++++++++++++++---------- src/pluginlist.h | 2 ++ src/pluginlistproxy.cpp | 5 +++++ src/pluginlistproxy.h | 1 + 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 07580c488..b944caf71 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -1016,6 +1016,16 @@ bool PluginList::isOverlayFlagged(const QString& name) const } } +bool PluginList::isDummy(const QString& name) const +{ + auto iter = m_ESPsByName.find(name); + if (iter == m_ESPsByName.end()) { + return false; + } else { + return m_ESPs[iter->second].isDummy; + } +} + boost::signals2::connection PluginList::onPluginStateChanged( const std::function&)>& func) { @@ -1093,9 +1103,9 @@ void PluginList::generatePluginIndexes() .arg((numESLs) % 4096, 3, 16, QChar('0')) .toUpper(); ++numESLs; - } else if (overridePluginsSupported && m_ESPs[i].isOverlayFlagged) { - m_ESPs[i].index = QString("XX"); - ++numSkipped; + //} else if (overridePluginsSupported && m_ESPs[i].isOverlayFlagged) { + // m_ESPs[i].index = QString("XX"); + // ++numSkipped; } else { m_ESPs[i].index = QString("%1").arg(l - numESLs - numSkipped, 2, 16, QChar('0')).toUpper(); @@ -1233,10 +1243,11 @@ QVariant PluginList::fontData(const QModelIndex& modelIndex) const result.setWeight(QFont::Bold); } else if (m_ESPs[index].isLightFlagged) { result.setItalic(true); - } else if (m_ESPs[index].isOverlayFlagged) { - result.setUnderline(true); } + if (m_ESPs[index].isDummy) + result.setStrikeOut(true); + return result; } @@ -1329,11 +1340,17 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const .arg(type); } - if (esp.isOverlayFlagged) { - toolTip += - "

" + tr("This plugin is flagged as an overlay plugin. It contains only " - "modified records and will overlay those changes onto the " - "existing records in memory. It takes no memory space."); + // if (esp.isOverlayFlagged) { + // toolTip += + // "

" + tr("This plugin is flagged as an overlay plugin. It contains + // only " + // "modified records and will overlay those changes onto the " + // "existing records in memory. It takes no memory space."); + // } + + if (esp.isDummy) { + toolTip += "

" + tr("This is a dummy plugin. It contains no records and is " + "typically used to load a paired archive file."); } if (esp.forceDisabled) { @@ -1787,6 +1804,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn isOverlayFlagged = overlaySupported && file.isOverlay(); isLightFlagged = lightSupported && !isOverlayFlagged && file.isLight(overlaySupported); + isDummy = file.isDummy(); author = QString::fromLatin1(file.author().c_str()); description = QString::fromLatin1(file.description().c_str()); @@ -1801,6 +1819,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn isMasterFlagged = false; isOverlayFlagged = false; isLightFlagged = false; + isDummy = false; } } diff --git a/src/pluginlist.h b/src/pluginlist.h index 10bb3997a..c2cfab6e7 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -242,6 +242,7 @@ class PluginList : public QAbstractItemModel bool isMasterFlagged(const QString& name) const; bool isLightFlagged(const QString& name) const; bool isOverlayFlagged(const QString& name) const; + bool isDummy(const QString& name) const; boost::signals2::connection onRefreshed(const std::function& callback); boost::signals2::connection @@ -334,6 +335,7 @@ public slots: bool isMasterFlagged; bool isLightFlagged; bool isOverlayFlagged; + bool isDummy; bool modSelected; QString author; QString description; diff --git a/src/pluginlistproxy.cpp b/src/pluginlistproxy.cpp index a056a38dc..bb115b4ad 100644 --- a/src/pluginlistproxy.cpp +++ b/src/pluginlistproxy.cpp @@ -123,3 +123,8 @@ bool PluginListProxy::isOverlayFlagged(const QString& name) const { return m_Proxied->isOverlayFlagged(name); } + +bool PluginListProxy::isDummy(const QString& name) const +{ + return m_Proxied->isDummy(name); +} diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h index 98e62475f..ae66cb60d 100644 --- a/src/pluginlistproxy.h +++ b/src/pluginlistproxy.h @@ -34,6 +34,7 @@ class PluginListProxy : public MOBase::IPluginList bool isMasterFlagged(const QString& name) const override; bool isLightFlagged(const QString& name) const override; bool isOverlayFlagged(const QString& name) const override; + bool isDummy(const QString& name) const override; private: friend class OrganizerProxy; From 8f6ba13fbc57d9f4793383a1402afd32923a9f04 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Wed, 18 Oct 2023 23:02:16 -0500 Subject: [PATCH 2/3] Use hasNoRecords --- src/pluginlist.cpp | 12 ++++++------ src/pluginlist.h | 4 ++-- src/pluginlistproxy.cpp | 4 ++-- src/pluginlistproxy.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index b944caf71..83ecd70bc 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -1016,13 +1016,13 @@ bool PluginList::isOverlayFlagged(const QString& name) const } } -bool PluginList::isDummy(const QString& name) const +bool PluginList::hasNoRecords(const QString& name) const { auto iter = m_ESPsByName.find(name); if (iter == m_ESPsByName.end()) { return false; } else { - return m_ESPs[iter->second].isDummy; + return m_ESPs[iter->second].hasNoRecords; } } @@ -1245,7 +1245,7 @@ QVariant PluginList::fontData(const QModelIndex& modelIndex) const result.setItalic(true); } - if (m_ESPs[index].isDummy) + if (m_ESPs[index].hasNoRecords) result.setStrikeOut(true); return result; @@ -1348,7 +1348,7 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const // "existing records in memory. It takes no memory space."); // } - if (esp.isDummy) { + if (esp.hasNoRecords) { toolTip += "

" + tr("This is a dummy plugin. It contains no records and is " "typically used to load a paired archive file."); } @@ -1804,7 +1804,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn isOverlayFlagged = overlaySupported && file.isOverlay(); isLightFlagged = lightSupported && !isOverlayFlagged && file.isLight(overlaySupported); - isDummy = file.isDummy(); + hasNoRecords = file.isDummy(); author = QString::fromLatin1(file.author().c_str()); description = QString::fromLatin1(file.description().c_str()); @@ -1819,7 +1819,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn isMasterFlagged = false; isOverlayFlagged = false; isLightFlagged = false; - isDummy = false; + hasNoRecords = false; } } diff --git a/src/pluginlist.h b/src/pluginlist.h index c2cfab6e7..3f4542fc6 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -242,7 +242,7 @@ class PluginList : public QAbstractItemModel bool isMasterFlagged(const QString& name) const; bool isLightFlagged(const QString& name) const; bool isOverlayFlagged(const QString& name) const; - bool isDummy(const QString& name) const; + bool hasNoRecords(const QString& name) const; boost::signals2::connection onRefreshed(const std::function& callback); boost::signals2::connection @@ -335,7 +335,7 @@ public slots: bool isMasterFlagged; bool isLightFlagged; bool isOverlayFlagged; - bool isDummy; + bool hasNoRecords; bool modSelected; QString author; QString description; diff --git a/src/pluginlistproxy.cpp b/src/pluginlistproxy.cpp index bb115b4ad..fa3960a84 100644 --- a/src/pluginlistproxy.cpp +++ b/src/pluginlistproxy.cpp @@ -124,7 +124,7 @@ bool PluginListProxy::isOverlayFlagged(const QString& name) const return m_Proxied->isOverlayFlagged(name); } -bool PluginListProxy::isDummy(const QString& name) const +bool PluginListProxy::hasNoRecords(const QString& name) const { - return m_Proxied->isDummy(name); + return m_Proxied->hasNoRecords(name); } diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h index ae66cb60d..397d786d6 100644 --- a/src/pluginlistproxy.h +++ b/src/pluginlistproxy.h @@ -34,7 +34,7 @@ class PluginListProxy : public MOBase::IPluginList bool isMasterFlagged(const QString& name) const override; bool isLightFlagged(const QString& name) const override; bool isOverlayFlagged(const QString& name) const override; - bool isDummy(const QString& name) const override; + bool hasNoRecords(const QString& name) const override; private: friend class OrganizerProxy; From f8954806c3d8b3ff046730ec593638be4f1ce063 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 27 Oct 2023 20:53:53 -0500 Subject: [PATCH 3/3] Explain overlay comments --- src/pluginlist.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 83ecd70bc..a23718667 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -1103,6 +1103,9 @@ void PluginList::generatePluginIndexes() .arg((numESLs) % 4096, 3, 16, QChar('0')) .toUpper(); ++numESLs; + // This logic may still be used if overlay plugins are fixed to longer consume a + // load order slot + // //} else if (overridePluginsSupported && m_ESPs[i].isOverlayFlagged) { // m_ESPs[i].index = QString("XX"); // ++numSkipped; @@ -1340,6 +1343,9 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const .arg(type); } + // This logic may still be used if overlay plugins are fixed to longer consume a load + // order slot + // // if (esp.isOverlayFlagged) { // toolTip += // "

" + tr("This plugin is flagged as an overlay plugin. It contains