Commit 2af05597 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement configure dialog

parent 0f121b9c
......@@ -10,7 +10,7 @@ macro(add_messageviewer_viewerplugin_external_plugin_unittest _source _additiona
ecm_add_test(${_test}
TEST_NAME ${_name}
NAME_PREFIX "messageviewerplugins-"
LINK_LIBRARIES KF5::MessageViewer KF5::Libkleo KF5::QGpgme Qt5::Test KF5::KIOCore KF5::Mime KF5::AkonadiCore KF5::AkonadiNotes KF5::CalendarCore KF5::GrantleeTheme KF5::IncidenceEditor
LINK_LIBRARIES KF5::MessageViewer Qt5::Test KF5::KIOCore KF5::Mime KF5::AkonadiCore KF5::I18n
)
endmacro ()
......@@ -18,5 +18,5 @@ endmacro ()
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalscriptinfotest.cpp "../viewerpluginexternalscriptparseargument.cpp;../viewerpluginexternalscriptinfo.cpp;../viewerpluginexternalscriptsloadjob.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalscriptsloadjobtest.cpp "../viewerpluginexternalscriptsloadjob.cpp;../viewerpluginexternalscriptinfo.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalscriptparseargumenttest.cpp "../viewerpluginexternalscriptparseargument.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalconfigurewidgettest.cpp "../configuredialog/viewerpluginexternalconfigurewidget.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalconfiguredialogtest.cpp "../configuredialog/viewerpluginexternalconfiguredialog.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalconfigurewidgettest.cpp "../configuredialog/viewerpluginexternalconfigurewidget.cpp;../viewerpluginexternalscriptsloadjob.cpp;../viewerpluginexternalscriptinfo.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalconfiguredialogtest.cpp "../configuredialog/viewerpluginexternalconfiguredialog.cpp;../configuredialog/viewerpluginexternalconfigurewidget.cpp;../viewerpluginexternalscriptsloadjob.cpp;../viewerpluginexternalscriptinfo.cpp" "")
......@@ -18,6 +18,7 @@
*/
#include "viewerpluginexternalconfiguredialogtest.h"
#include "../configuredialog/viewerpluginexternalconfiguredialog.h"
#include <QTest>
ViewerPluginExternalConfigureDialogTest::ViewerPluginExternalConfigureDialogTest(QObject *parent)
......@@ -31,4 +32,9 @@ ViewerPluginExternalConfigureDialogTest::~ViewerPluginExternalConfigureDialogTes
}
void ViewerPluginExternalConfigureDialogTest::shouldHaveDefaultValue()
{
}
QTEST_MAIN(ViewerPluginExternalConfigureDialogTest)
......@@ -28,6 +28,8 @@ class ViewerPluginExternalConfigureDialogTest : public QObject
public:
explicit ViewerPluginExternalConfigureDialogTest(QObject *parent = Q_NULLPTR);
~ViewerPluginExternalConfigureDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREDIALOGTEST_H
......@@ -19,6 +19,7 @@
#include "viewerpluginexternalconfigurewidgettest.h"
#include "../configuredialog/viewerpluginexternalconfigurewidget.h"
#include <QTest>
ViewerPluginExternalConfigureWidgetTest::ViewerPluginExternalConfigureWidgetTest(QObject *parent)
......@@ -32,4 +33,9 @@ ViewerPluginExternalConfigureWidgetTest::~ViewerPluginExternalConfigureWidgetTes
}
void ViewerPluginExternalConfigureWidgetTest::shouldHaveDefaultValue()
{
}
QTEST_MAIN(ViewerPluginExternalConfigureWidgetTest)
......@@ -28,6 +28,8 @@ class ViewerPluginExternalConfigureWidgetTest : public QObject
public:
explicit ViewerPluginExternalConfigureWidgetTest(QObject *parent = Q_NULLPTR);
~ViewerPluginExternalConfigureWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREWIDGETTEST_H
......@@ -18,11 +18,12 @@
*/
#include "viewerpluginexternalconfiguredialog.h"
#include "viewerpluginexternalconfigurewidget.h"
ViewerPluginExternalConfigureDialog::ViewerPluginExternalConfigureDialog(QWidget *parent)
: PimCommon::ConfigurePluginDialog(parent)
{
initLayout();
}
ViewerPluginExternalConfigureDialog::~ViewerPluginExternalConfigureDialog()
......@@ -33,22 +34,27 @@ ViewerPluginExternalConfigureDialog::~ViewerPluginExternalConfigureDialog()
QWidget *ViewerPluginExternalConfigureDialog::createLayout()
{
//TODO
return {};
mConfigWidget = new ViewerPluginExternalConfigureWidget(this);
mConfigWidget->setObjectName(QStringLiteral("externalconfigwidget"));
return mConfigWidget;
}
void ViewerPluginExternalConfigureDialog::save()
{
mConfigWidget->save();
}
void ViewerPluginExternalConfigureDialog::load()
{
mConfigWidget->load();
}
void ViewerPluginExternalConfigureDialog::reset()
{
mConfigWidget->reset();
}
void ViewerPluginExternalConfigureDialog::help()
{
//TODO
}
......@@ -21,7 +21,7 @@
#define VIEWERPLUGINEXTERNALCONFIGUREDIALOG_H
#include <PimCommon/ConfigurePluginDialog>
class ViewerPluginExternalConfigureWidget;
class ViewerPluginExternalConfigureDialog : public PimCommon::ConfigurePluginDialog
{
Q_OBJECT
......@@ -35,6 +35,8 @@ protected:
void load() Q_DECL_OVERRIDE;
void reset() Q_DECL_OVERRIDE;
void help() Q_DECL_OVERRIDE;
private:
ViewerPluginExternalConfigureWidget *mConfigWidget;
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREDIALOG_H
......@@ -18,10 +18,17 @@
*/
#include "viewerpluginexternalconfigurewidget.h"
#include <QVBoxLayout>
#include <QStandardPaths>
#include <KLocalizedString>
#include "../viewerpluginexternalscriptsloadjob.h"
ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("layout"));
mainLayout->setMargin(0);
}
......@@ -29,3 +36,24 @@ ViewerPluginExternalConfigureWidget::~ViewerPluginExternalConfigureWidget()
{
}
void ViewerPluginExternalConfigureWidget::load()
{
ViewerPluginExternalScriptsLoadJob job;
const QStringList lst = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("messageviewerplugins/"), QStandardPaths::LocateDirectory);
job.setExternalScriptsDirectories(lst);
job.start();
const QVector<ViewerPluginExternalScriptInfo> scriptInfos = job.scriptInfos();
}
void ViewerPluginExternalConfigureWidget::save()
{
}
void ViewerPluginExternalConfigureWidget::reset()
{
}
......@@ -28,6 +28,9 @@ class ViewerPluginExternalConfigureWidget : public QWidget
public:
explicit ViewerPluginExternalConfigureWidget(QWidget *parent = Q_NULLPTR);
~ViewerPluginExternalConfigureWidget();
void load();
void save();
void reset();
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREWIDGET_H
Supports Markdown
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