Commit 35cbd837 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

improve dialog box

parent e1f296cc
......@@ -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" "")
/*
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)
/*
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
......@@ -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);
......
......@@ -34,7 +34,9 @@ public:
~ViewerPluginExternalEditDialog();
void setScriptInfo(const ViewerPluginExternalScriptInfo &info);
private:
void slotAccepted();
ViewerPluginExternalEditWidget *mEditWidget;
};
......
......@@ -40,3 +40,8 @@ void ViewerPluginExternalEditWidget::setScriptInfo(const ViewerPluginExternalScr
{
//TODO
}
void ViewerPluginExternalEditWidget::save()
{
//TODO
}
......@@ -31,6 +31,7 @@ public:
explicit ViewerPluginExternalEditWidget(QWidget *parent = Q_NULLPTR);
~ViewerPluginExternalEditWidget();
void setScriptInfo(const ViewerPluginExternalScriptInfo &info);
void save();
};
#endif // VIEWERPLUGINEXTERNALEDITWIDGET_H
Supports Markdown
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