From 6d095aca7f59dff26df0e2b5283d926feff5b477 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 16 May 2018 18:20:25 +0200 Subject: Plugin command-line parameters --- plugins/ProfileEditor/profileeditorplugin.cpp | 10 ++++++++++ plugins/ProfileEditor/profileeditorplugin.h | 1 + plugins/interfaces.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/ProfileEditor/profileeditorplugin.cpp b/plugins/ProfileEditor/profileeditorplugin.cpp index 7a92e51..fc65350 100644 --- a/plugins/ProfileEditor/profileeditorplugin.cpp +++ b/plugins/ProfileEditor/profileeditorplugin.cpp @@ -8,6 +8,16 @@ #include "profileeditorplugin.h" #include "forms/profileview.h" +#include + +QHash> ProfileEditorPlugin::commands() +{ + QHash> hash; + hash.insert("profileEditor:about", []() { + qDebug("ProfileEditor for smolbote"); + }); + return hash; +} QDialog *ProfileEditorPlugin::createWidget(QWebEngineProfile *profile, QWidget *parent) { diff --git a/plugins/ProfileEditor/profileeditorplugin.h b/plugins/ProfileEditor/profileeditorplugin.h index 899c51a..88a0783 100644 --- a/plugins/ProfileEditor/profileeditorplugin.h +++ b/plugins/ProfileEditor/profileeditorplugin.h @@ -21,6 +21,7 @@ class ProfileEditorPlugin : public QObject, public PluginInterface, public Profi public: // PluginInterface + QHash> commands() override; // ProfileInterface QDialog *createWidget(QWebEngineProfile *profile, QWidget *parent) override; diff --git a/plugins/interfaces.h b/plugins/interfaces.h index 46cf24a..ad3df97 100644 --- a/plugins/interfaces.h +++ b/plugins/interfaces.h @@ -11,6 +11,7 @@ #include #include +#include class QString; class QAction; @@ -26,13 +27,13 @@ class PluginInterface { public: virtual ~PluginInterface() = default; + virtual QHash> commands() = 0; }; class ProfileInterface { public: virtual ~ProfileInterface() = default; - virtual QDialog *createWidget(QWebEngineProfile *profile, QWidget *parent) = 0; }; -- cgit v1.2.1