Commit 32d14c0e authored by Laurent Montel's avatar Laurent Montel 😁

Add configure widget

parent a4c48b58
set(kmail_checkbeforesendeditorplugin_SRCS
checkbeforesendplugin.cpp
checkbeforesendinterface.cpp
checkbeforesendconfigurewidget.cpp
)
ecm_qt_declare_logging_category(kmail_checkbeforesendeditorplugin_SRCS HEADER checkbeforesendplugin_debug.h IDENTIFIER KMAIL_EDITOR_checkbeforesend_PLUGIN_LOG CATEGORY_NAME log_kmail_checkbeforesendplugin)
......
......@@ -12,5 +12,6 @@ macro(add_kmail_checkbeforesend_unittest _source _additional)
endmacro ()
add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp")
add_kmail_checkbeforesend_unittest(checkbeforesendplugintest.cpp "../checkbeforesendplugin.cpp;../checkbeforesendinterface.cpp;../checkbeforesendconfigurewidget.cpp")
add_kmail_checkbeforesend_unittest(checkbeforesendinterfacetest.cpp "../checkbeforesendinterface.cpp")
add_kmail_checkbeforesend_unittest(checkbeforesendconfigurewidgettest.cpp "../checkbeforesendconfigurewidget.cpp")
/*
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 "checkbeforesendconfigurewidgettest.h"
#include <QTest>
CheckBeforeSendConfigureWidgetTest::CheckBeforeSendConfigureWidgetTest(QObject *parent)
: QObject(parent)
{
}
CheckBeforeSendConfigureWidgetTest::~CheckBeforeSendConfigureWidgetTest()
{
}
QTEST_MAIN(CheckBeforeSendConfigureWidgetTest)
/*
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 CHECKBEFORESENDCONFIGUREWIDGETTEST_H
#define CHECKBEFORESENDCONFIGUREWIDGETTEST_H
#include <QObject>
class CheckBeforeSendConfigureWidgetTest : public QObject
{
Q_OBJECT
public:
explicit CheckBeforeSendConfigureWidgetTest(QObject *parent = Q_NULLPTR);
~CheckBeforeSendConfigureWidgetTest();
signals:
public slots:
};
#endif // CHECKBEFORESENDCONFIGUREWIDGETTEST_H
......@@ -36,7 +36,7 @@ void CheckBeforeSendPluginTest::shouldHaveDefaultValue()
{
CheckBeforeSendPlugin plugin;
QVERIFY(plugin.hasConfigureSupport());
//TODO more
QVERIFY(plugin.createConfigureWidget(new QWidget()).configureWidget);
}
......
/*
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 "checkbeforesendconfigurewidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
CheckBeforeSendConfigureWidget::CheckBeforeSendConfigureWidget(QWidget *parent)
: MessageComposer::PluginEditorCheckBeforeSendConfigureWidget(parent)
{
}
CheckBeforeSendConfigureWidget::~CheckBeforeSendConfigureWidget()
{
}
void CheckBeforeSendConfigureWidget::loadSettings()
{
}
void CheckBeforeSendConfigureWidget::saveSettings()
{
}
void CheckBeforeSendConfigureWidget::resetSettings()
{
}
/*
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 CHECKBEFORESENDCONFIGUREWIDGET_H
#define CHECKBEFORESENDCONFIGUREWIDGET_H
#include <QWidget>
#include <MessageComposer/PluginEditorCheckBeforeSendConfigureWidget>
class CheckBeforeSendConfigureWidget : public MessageComposer::PluginEditorCheckBeforeSendConfigureWidget
{
Q_OBJECT
public:
explicit CheckBeforeSendConfigureWidget(QWidget *parent = Q_NULLPTR);
~CheckBeforeSendConfigureWidget();
void loadSettings() Q_DECL_OVERRIDE;
void saveSettings() Q_DECL_OVERRIDE;
void resetSettings() Q_DECL_OVERRIDE;
};
#endif // CHECKBEFORESENDCONFIGUREWIDGET_H
......@@ -19,6 +19,7 @@
#include "checkbeforesendplugin.h"
#include "checkbeforesendinterface.h"
#include "checkbeforesendconfigurewidget.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
......@@ -51,8 +52,9 @@ bool CheckBeforeSendPlugin::hasConfigureSupport() const
MessageComposer::PluginEditorCheckBeforeSendConfigureWidgetSetting CheckBeforeSendPlugin::createConfigureWidget(QWidget *parent) const
{
//TODO
return {};
CheckBeforeSendConfigureWidget *w = new CheckBeforeSendConfigureWidget(parent);
MessageComposer::PluginEditorCheckBeforeSendConfigureWidgetSetting settings(w, i18n("Check Before Send Email"));
return settings;
}
#include "checkbeforesendplugin.moc"
......@@ -36,6 +36,7 @@ void ConfirmAddressPluginTest::shouldHaveDefaultValue()
{
ConfirmAddressPlugin plugin;
QVERIFY(plugin.hasConfigureSupport());
QVERIFY(plugin.createConfigureWidget(new QWidget()).configureWidget);
}
QTEST_MAIN(ConfirmAddressPluginTest)
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