Commit 9f7226bd authored by Laurent Montel's avatar Laurent Montel 😁

continue to implement it

parent d6cfa73e
......@@ -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();
}
......
......@@ -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
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