mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Add a listing of plugin commands
This commit is contained in:
parent
dc5141dfc7
commit
50e71195b2
2 changed files with 22 additions and 0 deletions
|
@ -79,6 +79,16 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::set<QString> listRegisteredCommands()
|
||||||
|
{
|
||||||
|
std::set<QString> out;
|
||||||
|
for (const auto &[name, _] : this->ownedCommands)
|
||||||
|
{
|
||||||
|
out.insert(name);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDir loadDirectory_;
|
QDir loadDirectory_;
|
||||||
lua_State *state_;
|
lua_State *state_;
|
||||||
|
|
|
@ -83,6 +83,18 @@ void PluginsPage::rebuildContent()
|
||||||
}
|
}
|
||||||
pl->addRow("Used libraries", libs);
|
pl->addRow("Used libraries", libs);
|
||||||
|
|
||||||
|
QString cmds;
|
||||||
|
for (const auto &cmdName : plugin->listRegisteredCommands())
|
||||||
|
{
|
||||||
|
if (!cmds.isEmpty())
|
||||||
|
{
|
||||||
|
cmds += ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
cmds += cmdName;
|
||||||
|
}
|
||||||
|
pl->addRow("Commands", new QLabel(cmds));
|
||||||
|
|
||||||
auto *reload = new QPushButton("Reload");
|
auto *reload = new QPushButton("Reload");
|
||||||
QObject::connect(reload, &QPushButton::pressed,
|
QObject::connect(reload, &QPushButton::pressed,
|
||||||
[name = codename, this]() {
|
[name = codename, this]() {
|
||||||
|
|
Loading…
Reference in a new issue