Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 33f285ac authored by Laurent Montel's avatar Laurent Montel 😁

Add dialog box

parent a7a70785
......@@ -9,6 +9,7 @@ set(kmail_markdownplugin_SRCS
markdowndocument.cpp
markdownpreviewpage.cpp
markdownconfigurewidget.cpp
markdownconfiguredialog.cpp
)
qt5_add_resources(kmail_markdownplugin_SRCS data/markdown.qrc)
......
......@@ -13,3 +13,4 @@ add_kmail_converttext_unittest(markdownpreviewwidgettest.cpp "../markdownpreview
add_kmail_converttext_unittest(markdownplugintest.cpp "../markdownplugin.cpp;../markdowninterface.cpp;../markdowndocument.cpp;../markdownpreviewpage.cpp")
add_kmail_converttext_unittest(markdowndocumenttest.cpp "../markdowndocument.cpp")
add_kmail_converttext_unittest(markdownconfigurewidgettest.cpp "../markdownconfigurewidget.cpp")
add_kmail_converttext_unittest(markdownconfiguredialogtest.cpp "../markdownconfiguredialog.cpp;../markdownconfigurewidget.cpp")
/*
Copyright (C) 2018 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 "markdownconfiguredialogtest.h"
#include "../markdownconfiguredialog.h"
#include <QTest>
QTEST_MAIN(MarkdownConfigureDialogTest)
MarkdownConfigureDialogTest::MarkdownConfigureDialogTest(QObject *parent)
: QObject(parent)
{
}
/*
Copyright (C) 2018 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 MARKDOWNCONFIGUREDIALOGTEST_H
#define MARKDOWNCONFIGUREDIALOGTEST_H
#include <QObject>
class MarkdownConfigureDialogTest : public QObject
{
Q_OBJECT
public:
explicit MarkdownConfigureDialogTest(QObject *parent = nullptr);
~MarkdownConfigureDialogTest() = default;
};
#endif // MARKDOWNCONFIGUREDIALOGTEST_H
/*
Copyright (C) 2018 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 "markdownconfiguredialog.h"
#include "markdownconfigurewidget.h"
#include <KLocalizedString>
MarkdownConfigureDialog::MarkdownConfigureDialog(QWidget *parent)
: PimCommon::ConfigurePluginDialog(parent)
{
setWindowTitle(i18n("Configure Markdown Plugin"));
initLayout();
}
MarkdownConfigureDialog::~MarkdownConfigureDialog()
{
}
QWidget *MarkdownConfigureDialog::createLayout()
{
mConfigureWidget = new MarkdownConfigureWidget(this);
mConfigureWidget->setObjectName(QStringLiteral("configurewidget"));
return mConfigureWidget;
}
void MarkdownConfigureDialog::save()
{
mConfigureWidget->saveSettings();
}
void MarkdownConfigureDialog::load()
{
mConfigureWidget->loadSettings();
}
void MarkdownConfigureDialog::reset()
{
mConfigureWidget->resetSettings();
}
void MarkdownConfigureDialog::help()
{
showHelp(QStringLiteral("kmail2"), QString());
}
/*
Copyright (C) 2018 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 MARKDOWNCONFIGUREDIALOG_H
#define MARKDOWNCONFIGUREDIALOG_H
#include <PimCommon/ConfigurePluginDialog>
class MarkdownConfigureWidget;
class MarkdownConfigureDialog : public PimCommon::ConfigurePluginDialog
{
Q_OBJECT
public:
explicit MarkdownConfigureDialog(QWidget *parent = nullptr);
~MarkdownConfigureDialog() override;
protected:
QWidget *createLayout() override;
void save() override;
void load() override;
void reset() override;
void help() override;
private:
MarkdownConfigureWidget *mConfigureWidget = nullptr;
};
#endif // MARKDOWNCONFIGUREDIALOG_H
......@@ -28,7 +28,7 @@ class ExternalComposerConfigureDialog : public PimCommon::ConfigurePluginDialog
Q_OBJECT
public:
explicit ExternalComposerConfigureDialog(QWidget *parent = nullptr);
~ExternalComposerConfigureDialog();
~ExternalComposerConfigureDialog() override;
protected:
QWidget *createLayout() override;
......
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