summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-26 19:13:51 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-26 19:13:51 (GMT)
commit2af05597fb0524ef1d1237ab82ef7f9ce32a163e (patch)
treea63f493a71fcd094813444d3ee5ef619ece3ab79
parent0f121b9c446db641e3cee4f271d669066343c991 (diff)
Continue to implement configure dialog
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt6
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.cpp6
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.h2
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp6
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.h2
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.cpp12
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.h4
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp28
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h3
9 files changed, 62 insertions, 7 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt b/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt
index 486999d..e86546e 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt
@@ -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" "")
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.cpp
index a4797ca..d928efb 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.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)
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.h b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.h
index 33b9349..9d535d7 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfiguredialogtest.h
@@ -28,6 +28,8 @@ class ViewerPluginExternalConfigureDialogTest : public QObject
public:
explicit ViewerPluginExternalConfigureDialogTest(QObject *parent = Q_NULLPTR);
~ViewerPluginExternalConfigureDialogTest();
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREDIALOGTEST_H
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp
index 79a8837..ddbcb9b 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp
@@ -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)
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.h b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.h
index e75b9e6..67754ab 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.h
@@ -28,6 +28,8 @@ class ViewerPluginExternalConfigureWidgetTest : public QObject
public:
explicit ViewerPluginExternalConfigureWidgetTest(QObject *parent = Q_NULLPTR);
~ViewerPluginExternalConfigureWidgetTest();
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREWIDGETTEST_H
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.cpp
index 1c609cd..50602ba 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.cpp
@@ -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
}
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.h b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.h
index 0b36f22..738e7f5 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfiguredialog.h
@@ -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
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
index 9eb66f7..3ca963f 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
@@ -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()
+{
+
+}
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h
index 8813348..e5d303c 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h
@@ -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