Commit 4215e911 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to configure external script

parent 7967748c
Pipeline #58867 passed with stage
in 52 minutes and 31 seconds
......@@ -21,7 +21,8 @@ ViewerPluginExternalscript::ViewerPluginExternalscript(QObject *parent, const QL
ViewerPluginInterface *ViewerPluginExternalscript::createView(QWidget *parent, KActionCollection *ac)
{
MessageViewer::ViewerPluginInterface *view = new MessageViewer::ViewerPluginExternalscriptInterface(ac, parent);
MessageViewer::ViewerPluginExternalscriptInterface *view = new MessageViewer::ViewerPluginExternalscriptInterface(ac, parent);
connect(view, &MessageViewer::ViewerPluginExternalscriptInterface::configChanged, this, &ViewerPluginExternalscript::configChanged);
return view;
}
......@@ -30,7 +31,7 @@ QString ViewerPluginExternalscript::viewerPluginName() const
return QStringLiteral("external script");
}
void MessageViewer::ViewerPluginExternalscript::showConfigureDialog(QWidget *parent)
void ViewerPluginExternalscript::showConfigureDialog(QWidget *parent)
{
QPointer<ViewerPluginExternalConfigureDialog> dlg = new ViewerPluginExternalConfigureDialog(parent);
if (dlg->exec()) {
......@@ -39,7 +40,7 @@ void MessageViewer::ViewerPluginExternalscript::showConfigureDialog(QWidget *par
delete dlg;
}
bool MessageViewer::ViewerPluginExternalscript::hasConfigureDialog() const
bool ViewerPluginExternalscript::hasConfigureDialog() const
{
return true;
}
......
......@@ -10,6 +10,7 @@
#include <QAction>
#include <QIcon>
#include <QPointer>
#include <QProcess>
#include <QStandardPaths>
......@@ -18,6 +19,8 @@
#include <KMessageBox>
#include <QMenu>
#include <configuredialog/viewerpluginexternalconfiguredialog.h>
using namespace MessageViewer;
ViewerPluginExternalscriptInterface::ViewerPluginExternalscriptInterface(KActionCollection *ac, QWidget *parent)
......@@ -136,6 +139,11 @@ void ViewerPluginExternalscriptInterface::createAction(KActionCollection *ac)
void ViewerPluginExternalscriptInterface::slotConfigure()
{
QPointer<ViewerPluginExternalConfigureDialog> dlg = new ViewerPluginExternalConfigureDialog;
if (dlg->exec()) {
Q_EMIT configChanged();
}
delete dlg;
}
void ViewerPluginExternalscriptInterface::slotScriptActivated(QAction *act)
......
......@@ -29,6 +29,9 @@ public:
private Q_SLOTS:
void slotScriptActivated(QAction *act);
Q_SIGNALS:
void configChanged();
private:
void createAction(KActionCollection *ac);
void clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment