summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-28 05:19:38 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-28 05:19:38 (GMT)
commit35cbd837655096f63f60a60db002e0960a71c8d7 (patch)
tree350f5fbb2e48abf5174b83e60decb0d7d1d2efcf
parente1f296ccc08fad51434c83146b37d274ae375d30 (diff)
improve dialog box
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt1
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.cpp35
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.h33
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.cpp10
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.h2
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp5
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.h1
7 files changed, 86 insertions, 1 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt b/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt
index f7e397d..4d14372 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/CMakeLists.txt
@@ -21,3 +21,4 @@ add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalscri
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalconfigurewidgettest.cpp "../configuredialog/viewerpluginexternaleditwidget.cpp;../configuredialog/viewerpluginexternaleditdialog.cpp;../configuredialog/viewerpluginexternalconfigurewidget.cpp;../viewerpluginexternalscriptsloadjob.cpp;../viewerpluginexternalscriptinfo.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternalconfiguredialogtest.cpp "../configuredialog/viewerpluginexternaleditwidget.cpp;../configuredialog/viewerpluginexternaleditdialog.cpp;../configuredialog/viewerpluginexternalconfiguredialog.cpp;../configuredialog/viewerpluginexternalconfigurewidget.cpp;../viewerpluginexternalscriptsloadjob.cpp;../viewerpluginexternalscriptinfo.cpp" "")
add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternaleditwidgettest.cpp "../configuredialog/viewerpluginexternaleditwidget.cpp" "")
+add_messageviewer_viewerplugin_external_plugin_unittest(viewerpluginexternaleditdialogtest.cpp "../configuredialog/viewerpluginexternaleditdialog.cpp;../configuredialog/viewerpluginexternaleditwidget.cpp" "")
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.cpp
new file mode 100644
index 0000000..1a08271
--- /dev/null
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.cpp
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "viewerpluginexternaleditdialogtest.h"
+
+#include <QTest>
+
+ViewerPluginExternalEditDialogTest::ViewerPluginExternalEditDialogTest(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+ViewerPluginExternalEditDialogTest::~ViewerPluginExternalEditDialogTest()
+{
+
+}
+
+QTEST_MAIN(ViewerPluginExternalEditDialogTest)
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.h b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.h
new file mode 100644
index 0000000..9b3837b
--- /dev/null
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditdialogtest.h
@@ -0,0 +1,33 @@
+/*
+ Copyright (C) 2016 Montel Laurent <montel@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef VIEWERPLUGINEXTERNALEDITDIALOGTEST_H
+#define VIEWERPLUGINEXTERNALEDITDIALOGTEST_H
+
+#include <QObject>
+
+class ViewerPluginExternalEditDialogTest : public QObject
+{
+ Q_OBJECT
+public:
+ explicit ViewerPluginExternalEditDialogTest(QObject *parent = Q_NULLPTR);
+ ~ViewerPluginExternalEditDialogTest();
+};
+
+#endif // VIEWERPLUGINEXTERNALEDITDIALOGTEST_H
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.cpp
index 2f17ec4..5418531 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.cpp
@@ -33,7 +33,10 @@ ViewerPluginExternalEditDialog::ViewerPluginExternalEditDialog(QWidget *parent)
mEditWidget->setObjectName(QStringLiteral("editwidget"));
mainLayout->addWidget(mEditWidget);
-
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
+ buttonBox->setObjectName(QStringLiteral("buttonbox"));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &ViewerPluginExternalEditDialog::slotAccepted);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &ViewerPluginExternalEditDialog::reject);
}
ViewerPluginExternalEditDialog::~ViewerPluginExternalEditDialog()
@@ -41,6 +44,11 @@ ViewerPluginExternalEditDialog::~ViewerPluginExternalEditDialog()
}
+void ViewerPluginExternalEditDialog::slotAccepted()
+{
+ mEditWidget->save();
+}
+
void ViewerPluginExternalEditDialog::setScriptInfo(const ViewerPluginExternalScriptInfo &info)
{
mEditWidget->setScriptInfo(info);
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.h b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.h
index d402299..d5d59e1 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditdialog.h
@@ -34,7 +34,9 @@ public:
~ViewerPluginExternalEditDialog();
void setScriptInfo(const ViewerPluginExternalScriptInfo &info);
+
private:
+ void slotAccepted();
ViewerPluginExternalEditWidget *mEditWidget;
};
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp
index f19186e..d8af815 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp
@@ -40,3 +40,8 @@ void ViewerPluginExternalEditWidget::setScriptInfo(const ViewerPluginExternalScr
{
//TODO
}
+
+void ViewerPluginExternalEditWidget::save()
+{
+ //TODO
+}
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.h b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.h
index 86370e3..073640c 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.h
@@ -31,6 +31,7 @@ public:
explicit ViewerPluginExternalEditWidget(QWidget *parent = Q_NULLPTR);
~ViewerPluginExternalEditWidget();
void setScriptInfo(const ViewerPluginExternalScriptInfo &info);
+ void save();
};
#endif // VIEWERPLUGINEXTERNALEDITWIDGET_H