summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-27 05:12:33 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-27 05:12:33 (GMT)
commit431143971ea60a4ada12c5094485a8ed7ca3e56b (patch)
tree8f8021475a1a3217bf071bd044c5703d36f2d5c7
parent2af05597fb0524ef1d1237ab82ef7f9ce32a163e (diff)
improve configure dialog
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp9
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp5
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h4
3 files changed, 15 insertions, 3 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp
index ddbcb9b..b9b81c7 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalconfigurewidgettest.cpp
@@ -21,6 +21,8 @@
#include "viewerpluginexternalconfigurewidgettest.h"
#include "../configuredialog/viewerpluginexternalconfigurewidget.h"
#include <QTest>
+#include <QLabel>
+#include <QVBoxLayout>
ViewerPluginExternalConfigureWidgetTest::ViewerPluginExternalConfigureWidgetTest(QObject *parent)
: QObject(parent)
@@ -35,7 +37,12 @@ ViewerPluginExternalConfigureWidgetTest::~ViewerPluginExternalConfigureWidgetTes
void ViewerPluginExternalConfigureWidgetTest::shouldHaveDefaultValue()
{
-
+ ViewerPluginExternalConfigureWidget w;
+ QLabel *label = w.findChild<QLabel *>(QStringLiteral("lab"));
+ QVERIFY(label);
+ QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("layout"));
+ QVERIFY(mainLayout);
+ QCOMPARE(mainLayout->margin(), 0);
}
QTEST_MAIN(ViewerPluginExternalConfigureWidgetTest)
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
index 3ca963f..85413a5 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
@@ -22,6 +22,7 @@
#include <QStandardPaths>
#include <KLocalizedString>
#include "../viewerpluginexternalscriptsloadjob.h"
+#include <QLabel>
ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget *parent)
: QWidget(parent)
@@ -29,7 +30,9 @@ ViewerPluginExternalConfigureWidget::ViewerPluginExternalConfigureWidget(QWidget
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("layout"));
mainLayout->setMargin(0);
-
+ QLabel *lab = new QLabel(i18n("External Script:"), this);
+ lab->setObjectName(QStringLiteral("lab"));
+ mainLayout->addWidget(lab);
}
ViewerPluginExternalConfigureWidget::~ViewerPluginExternalConfigureWidget()
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h
index e5d303c..d7a7ce7 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.h
@@ -21,7 +21,7 @@
#define VIEWERPLUGINEXTERNALCONFIGUREWIDGET_H
#include <QWidget>
-
+class QListWidget;
class ViewerPluginExternalConfigureWidget : public QWidget
{
Q_OBJECT
@@ -31,6 +31,8 @@ public:
void load();
void save();
void reset();
+private:
+ QListWidget *mListExternal;
};
#endif // VIEWERPLUGINEXTERNALCONFIGUREWIDGET_H