Skip to content

Commit

Permalink
Add author and description methods to IPluginList
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanFeenstra committed Sep 8, 2024
1 parent 9c130cb commit 69cb9b1
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 33 deletions.
65 changes: 32 additions & 33 deletions src/organizer_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6322,112 +6322,112 @@ Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1281"/>
<location filename="pluginlist.cpp" line="1301"/>
<source>Origin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1285"/>
<location filename="pluginlist.cpp" line="1305"/>
<source>This plugin can&apos;t be disabled or moved (enforced by the game).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1291"/>
<location filename="pluginlist.cpp" line="1311"/>
<source>This plugin can&apos;t be disabled (enforced by the game).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1295"/>
<location filename="pluginlist.cpp" line="1315"/>
<source>Author</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1300"/>
<location filename="pluginlist.cpp" line="1320"/>
<source>Description</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1305"/>
<location filename="pluginlist.cpp" line="1325"/>
<source>Missing Masters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1317"/>
<location filename="pluginlist.cpp" line="1337"/>
<source>Enabled Masters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1328"/>
<location filename="pluginlist.cpp" line="1348"/>
<source>Loads Archives</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1329"/>
<location filename="pluginlist.cpp" line="1349"/>
<source>There are Archives connected to this plugin. Their assets will be added to your game, overwriting in case of conflicts following the plugin order. Loose files will always overwrite assets from Archives. (This flag only checks for Archives from the same mod as the plugin)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1337"/>
<location filename="pluginlist.cpp" line="1357"/>
<source>Loads INI settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1340"/>
<location filename="pluginlist.cpp" line="1360"/>
<source>There is an ini file connected to this plugin. Its settings will be added to your game settings, overwriting in case of conflicts.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1348"/>
<location filename="pluginlist.cpp" line="1368"/>
<source>This %1 is flagged as a light plugin (ESL). It will adhere to the %1 load order but the records will be loaded in ESL space (FE/FF). You can have up to 4096 light plugins in addition to other plugin types.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1354"/>
<location filename="pluginlist.cpp" line="1374"/>
<source>This ESM is flagged as a medium plugin (ESH). It adheres to the ESM load order but loads records in ESH space (FD). You can have 256 medium plugins in addition to other plugin types.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1362"/>
<location filename="pluginlist.cpp" line="1382"/>
<source>WARNING: This plugin is both light and medium flagged. This could indicate that the file was saved improperly and may have mismatched record references. Use it at your own risk.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1368"/>
<location filename="pluginlist.cpp" line="1388"/>
<source>This is a dummy plugin. It contains no records and is typically used to load a paired archive file.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1375"/>
<location filename="pluginlist.cpp" line="1395"/>
<source>Light plugins (ESL) are not supported by this game.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1377"/>
<location filename="pluginlist.cpp" line="1397"/>
<source>This game does not currently permit custom plugin loading. There may be manual workarounds.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1409"/>
<location filename="pluginlist.cpp" line="1429"/>
<source>Incompatible with %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1415"/>
<location filename="pluginlist.cpp" line="1435"/>
<source>Depends on missing %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1423"/>
<location filename="pluginlist.cpp" line="1443"/>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1427"/>
<location filename="pluginlist.cpp" line="1447"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="pluginlist.cpp" line="1713"/>
<location filename="pluginlist.cpp" line="1733"/>
<source>failed to restore load order for %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -6534,7 +6534,6 @@ Continue?</source>
<message>
<location filename="pluginlistview.cpp" line="100"/>
<source>&lt;table cellspacing=&quot;6&quot;&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Active &lt;/th&gt;&lt;th&gt;Total&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;All plugins:&lt;/td&gt;&lt;td align=right&gt;%1 &lt;/td&gt;&lt;td align=right&gt;%2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESMs:&lt;/td&gt;&lt;td align=right&gt;%3 &lt;/td&gt;&lt;td align=right&gt;%4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESPs:&lt;/td&gt;&lt;td align=right&gt;%7 &lt;/td&gt;&lt;td align=right&gt;%8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESMs+ESPs:&lt;/td&gt;&lt;td align=right&gt;%9 &lt;/td&gt;&lt;td align=right&gt;%10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESHs:&lt;/td&gt;&lt;td align=right&gt;%11 &lt;/td&gt;&lt;td align=right&gt;%12&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESLs:&lt;/td&gt;&lt;td align=right&gt;%5 &lt;/td&gt;&lt;td align=right&gt;%6&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</source>
<oldsource>&lt;table cellspacing=&quot;6&quot;&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Active &lt;/th&gt;&lt;th&gt;Total&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;All plugins:&lt;/td&gt;&lt;td align=right&gt;%1 &lt;/td&gt;&lt;td align=right&gt;%2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESMs:&lt;/td&gt;&lt;td align=right&gt;%3 &lt;/td&gt;&lt;td align=right&gt;%4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESPs:&lt;/td&gt;&lt;td align=right&gt;%7 &lt;/td&gt;&lt;td align=right&gt;%8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESMs+ESPs:&lt;/td&gt;&lt;td align=right&gt;%9 &lt;/td&gt;&lt;td align=right&gt;%10&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ESLs:&lt;/td&gt;&lt;td align=right&gt;%5 &lt;/td&gt;&lt;td align=right&gt;%6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Overlay:&lt;/td&gt;&lt;td align=right&gt;%11 &lt;/td&gt;&lt;td align=right&gt;%12&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down Expand Up @@ -8455,6 +8454,11 @@ You can restart Mod Organizer as administrator and try launching the program aga
<source>Remember my choice for %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../uibase/src/safewritefile.cpp" line="42"/>
<source>Failed to save &apos;%1&apos;, could not create a temporary file: %2 (error %3)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../uibase/src/utility.cpp" line="62"/>
<source>removal of &quot;%1&quot; failed: %2</source>
Expand Down Expand Up @@ -8543,11 +8547,6 @@ You can restart Mod Organizer as administrator and try launching the program aga
<source>%1 TB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../uibase/src/safewritefile.cpp" line="42"/>
<source>Failed to save &apos;%1&apos;, could not create a temporary file: %2 (error %3)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QueryOverwriteDialog</name>
Expand Down Expand Up @@ -9519,6 +9518,11 @@ p, li { white-space: pre-wrap; }
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.ui" line="2034"/>
<source>Back-date BSAs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.ui" line="2076"/>
<source>Add executables to the blacklist to prevent them from
Expand All @@ -9538,11 +9542,6 @@ programs you are intentionally running.</source>
<source>Executables Blacklist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.ui" line="2034"/>
<source>Back-date BSAs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="settingsdialog.ui" line="2096"/>
<location filename="settingsdialog.ui" line="2099"/>
Expand Down
20 changes: 20 additions & 0 deletions src/pluginlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,26 @@ bool PluginList::hasNoRecords(const QString& name) const
}
}

QString PluginList::author(const QString& name) const
{
auto iter = m_ESPsByName.find(name);
if (iter == m_ESPsByName.end()) {
return QString();
} else {
return m_ESPs[iter->second].author;
}
}

QString PluginList::description(const QString& name) const
{
auto iter = m_ESPsByName.find(name);
if (iter == m_ESPsByName.end()) {
return QString();
} else {
return m_ESPs[iter->second].description;
}
}

boost::signals2::connection PluginList::onPluginStateChanged(
const std::function<void(const std::map<QString, PluginStates>&)>& func)
{
Expand Down
3 changes: 3 additions & 0 deletions src/pluginlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ class PluginList : public QAbstractItemModel
bool isLightFlagged(const QString& name) const;
bool hasNoRecords(const QString& name) const;

QString author(const QString& name) const;
QString description(const QString& name) const;

boost::signals2::connection onRefreshed(const std::function<void()>& callback);
boost::signals2::connection
onPluginMoved(const std::function<void(const QString&, int, int)>& func);
Expand Down
10 changes: 10 additions & 0 deletions src/pluginlistproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,13 @@ bool PluginListProxy::hasNoRecords(const QString& name) const
{
return m_Proxied->hasNoRecords(name);
}

QString PluginListProxy::author(const QString& name) const
{
return m_Proxied->author(name);
}

QString PluginListProxy::description(const QString& name) const
{
return m_Proxied->description(name);
}
3 changes: 3 additions & 0 deletions src/pluginlistproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class PluginListProxy : public MOBase::IPluginList
bool isLightFlagged(const QString& name) const override;
bool hasNoRecords(const QString& name) const override;

QString author(const QString& name) const override;
QString description(const QString& name) const override;

private:
friend class OrganizerProxy;

Expand Down

0 comments on commit 69cb9b1

Please sign in to comment.