Commit b010a5f2 authored by Laurent Montel's avatar Laurent Montel 😁

Add test apps

parent c48d5345
......@@ -12,3 +12,8 @@ target_link_libraries(transportmgr KF5MailTransport Qt5::Widgets KF5::I18n KF5::
add_executable(servertest servertest.cpp)
ecm_mark_as_test(servertest)
target_link_libraries(servertest KF5MailTransport KF5::I18n KF5::ConfigGui Qt5::Widgets)
add_executable(addtransportdialogng_gui addtransportdialogng_gui.cpp)
ecm_mark_as_test(addtransportdialogng_gui)
target_link_libraries(addtransportdialogng_gui KF5MailTransport KF5::I18n KF5::ConfigGui Qt5::Widgets)
/*
Copyright (c) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "addtransportdialogng_gui.h"
#include "../src/kmailtransport/widgets/addtransportdialogng.h"
#include <QApplication>
#include <QStandardPaths>
#include <QHBoxLayout>
#include <QPushButton>
AddTransportDialogNG_gui::AddTransportDialogNG_gui(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
QPushButton *button = new QPushButton(QStringLiteral("Add transport"));
layout->addWidget(button);
connect(button, &QPushButton::clicked, this, [this] {
MailTransport::AddTransportDialogNG *dlg = new MailTransport::AddTransportDialogNG(this);
dlg->exec();
delete dlg;
});
}
int main(int argc, char **argv)
{
QApplication app(argc, argv);
app.setApplicationName(QStringLiteral("addtransportnewng"));
QStandardPaths::setTestModeEnabled(true);
AddTransportDialogNG_gui *t = new AddTransportDialogNG_gui();
t->show();
app.exec();
delete t;
}
/*
Copyright (c) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef ADDTRANSPORTDIALOGNG_GUI_H
#define ADDTRANSPORTDIALOGNG_GUI_H
#include <QWidget>
class AddTransportDialogNG_gui : public QWidget
{
Q_OBJECT
public:
explicit AddTransportDialogNG_gui(QWidget *parent = nullptr);
};
#endif // ADDTRANSPORTDIALOGNG_GUI_H
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