diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2023-10-27 21:19:30 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-27 21:19:30 -0500 |
| commit | 3c0cd1c88843856ef562a3c88e3df4199fc5b2b6 (patch) | |
| tree | 889635f7ca5a055aa31ac5c1b1dc9f44218b48ff /src | |
| parent | d57d8bdd5a4462c644ad300dc19bf2e02d0ab534 (diff) | |
| parent | f8954806c3d8b3ff046730ec593638be4f1ce063 (diff) | |
Merge pull request #1907 from ModOrganizer2/plugin_updates
Plugins updates
Diffstat (limited to 'src')
| -rw-r--r-- | src/pluginlist.cpp | 45 | ||||
| -rw-r--r-- | src/pluginlist.h | 2 | ||||
| -rw-r--r-- | src/pluginlistproxy.cpp | 5 | ||||
| -rw-r--r-- | src/pluginlistproxy.h | 1 |
4 files changed, 43 insertions, 10 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 07580c48..a2371866 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -1016,6 +1016,16 @@ bool PluginList::isOverlayFlagged(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].hasNoRecords; + } +} + boost::signals2::connection PluginList::onPluginStateChanged( const std::function<void(const std::map<QString, PluginStates>&)>& func) { @@ -1093,9 +1103,12 @@ 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; + // 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; } else { m_ESPs[i].index = QString("%1").arg(l - numESLs - numSkipped, 2, 16, QChar('0')).toUpper(); @@ -1233,10 +1246,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].hasNoRecords) + result.setStrikeOut(true); + return result; } @@ -1329,11 +1343,20 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const .arg(type); } - if (esp.isOverlayFlagged) { - toolTip += - "<br><br>" + 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."); + // This logic may still be used if overlay plugins are fixed to longer consume a load + // order slot + // + // if (esp.isOverlayFlagged) { + // toolTip += + // "<br><br>" + 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.hasNoRecords) { + toolTip += "<br><br>" + 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 +1810,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn isOverlayFlagged = overlaySupported && file.isOverlay(); isLightFlagged = lightSupported && !isOverlayFlagged && file.isLight(overlaySupported); + hasNoRecords = file.isDummy(); author = QString::fromLatin1(file.author().c_str()); description = QString::fromLatin1(file.description().c_str()); @@ -1801,6 +1825,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn isMasterFlagged = false; isOverlayFlagged = false; isLightFlagged = false; + hasNoRecords = false; } } diff --git a/src/pluginlist.h b/src/pluginlist.h index 10bb3997..3f4542fc 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -242,6 +242,7 @@ public: bool isMasterFlagged(const QString& name) const; bool isLightFlagged(const QString& name) const; bool isOverlayFlagged(const QString& name) const; + bool hasNoRecords(const QString& name) const; boost::signals2::connection onRefreshed(const std::function<void()>& callback); boost::signals2::connection @@ -334,6 +335,7 @@ private: bool isMasterFlagged; bool isLightFlagged; bool isOverlayFlagged; + bool hasNoRecords; bool modSelected; QString author; QString description; diff --git a/src/pluginlistproxy.cpp b/src/pluginlistproxy.cpp index a056a38d..fa3960a8 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::hasNoRecords(const QString& name) const +{ + return m_Proxied->hasNoRecords(name); +} diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h index 98e62475..397d786d 100644 --- a/src/pluginlistproxy.h +++ b/src/pluginlistproxy.h @@ -34,6 +34,7 @@ public: bool isMasterFlagged(const QString& name) const override; bool isLightFlagged(const QString& name) const override; bool isOverlayFlagged(const QString& name) const override; + bool hasNoRecords(const QString& name) const override; private: friend class OrganizerProxy; |
