summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-04-02 23:25:19 +0200
committerMontel Laurent <[email protected]>2016-04-02 23:25:19 +0200
commit9f7226bdb1ecaf064010cce73125957713234ce5 (patch)
tree535367a388873922ca32616371aac3149014724d
parentd6cfa73ecd6a6f46fa05142215cf70c3c9ff5b13 (diff)
continue to implement it
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp17
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.h6
2 files changed, 13 insertions, 10 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
index 57985b5..299aa6c 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
@@ -21,6 +21,7 @@
#include <QHBoxLayout>
#include <QIcon>
#include <QAction>
+#include <QDebug>
#include <KActionCollection>
#include <KLocalizedString>
@@ -61,7 +62,11 @@ void ViewerPluginExternalscriptInterface::setText(const QString &text)
void ViewerPluginExternalscriptInterface::execute()
{
- //TODO
+ if (mCurrentInfo.count() == 2) {
+ //TODO
+ } else {
+ qDebug() << "Problem with arguments";
+ }
}
void ViewerPluginExternalscriptInterface::createAction(KActionCollection *ac)
@@ -79,10 +84,12 @@ void ViewerPluginExternalscriptInterface::createAction(KActionCollection *ac)
addHelpTextAction(act, description);
}
ac->addAction(QStringLiteral("externalscript_%1").arg(info.name()), act);
- ViewerPluginExternalscriptActionInfo actionInfo;
- actionInfo.arguments = info.commandLine();
- actionInfo.executable = info.executable();
+ QStringList actionInfo;
+ //TODO adapt command line
+ actionInfo.append(info.commandLine());
+ actionInfo.append(info.executable());
+ act->setData(actionInfo);
//TODO add info.
mAction.append(act);
grp->addAction(act);
@@ -93,7 +100,7 @@ void ViewerPluginExternalscriptInterface::createAction(KActionCollection *ac)
void ViewerPluginExternalscriptInterface::slotScriptActivated(QAction *act)
{
- //TODO
+ mCurrentInfo = act->data().toStringList();
slotActivatePlugin();
}
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.h b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.h
index 6e6db24..82c6b4e 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.h
@@ -22,11 +22,6 @@
class KActionCollection;
namespace MessageViewer
{
-struct ViewerPluginExternalscriptActionInfo
-{
- QString executable;
- QString arguments;
-};
class ViewerPluginExternalscriptInterface : public ViewerPluginInterface
{
@@ -48,6 +43,7 @@ private:
void createAction(KActionCollection *ac);
QList<QAction *> mAction;
QString adaptArguments(const QString &scriptArguments);
+ QStringList mCurrentInfo;
};
}
#endif // VIEWERPLUGINEXTERNALSCRIPTINTERFACE_H