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 44c64368 authored by Laurent Montel's avatar Laurent Montel 😁

Add dialog box to get gravatar pixmap

parent 70c9120e
......@@ -198,6 +198,7 @@ set(libpimcommon_temporary_SRCS
set(libpimcommon_gravatar_SRCS
gravatar/gravatarresolvurljob.cpp
gravatar/widgets/gravatardownloadpixmapwidget.cpp
gravatar/widgets/gravatardownloadpixmapdialog.cpp
)
set(libpimcommon_SRCS
......
......@@ -13,3 +13,8 @@ kde4_add_unit_test( pimcommon_gravatardownloadpixmapwidget ${pimcommon_gravatard
target_link_libraries( pimcommon_gravatardownloadpixmapwidget ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} pimcommon)
set( pimcommon_gravatardownloadpixmapdialog_SRCS gravatardownloadpixmapdialogtest.cpp ../widgets/gravatardownloadpixmapdialog.cpp)
kde4_add_unit_test( pimcommon_gravatardownloadpixmapdialog ${pimcommon_gravatardownloadpixmapdialog_SRCS})
target_link_libraries( pimcommon_gravatardownloadpixmapdialog ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBS} pimcommon)
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "gravatardownloadpixmapdialogtest.h"
#include "../widgets/gravatardownloadpixmapdialog.h"
#include <QDialogButtonBox>
#include <qtest_kde.h>
#include "gravatar/widgets/gravatardownloadpixmapwidget.h"
GravatarDownloadPixmapDialogTest::GravatarDownloadPixmapDialogTest(QObject *parent)
: QObject(parent)
{
}
GravatarDownloadPixmapDialogTest::~GravatarDownloadPixmapDialogTest()
{
}
GravatarDownloadPixmapDialogTest::GravatarDownloadPixmapDialogTest(QObject *parent) : QObject(parent)
void GravatarDownloadPixmapDialogTest::shouldHaveDefaultValue()
{
PimCommon::GravatarDownloadPixmapDialog dlg;
PimCommon::GravatarDownloadPixmapWidget *widget = qFindChild<PimCommon::GravatarDownloadPixmapWidget *>(&dlg, QLatin1String("gravatarwidget"));
QVERIFY(widget);
QDialogButtonBox *buttonBox = qFindChild<QDialogButtonBox *>(&dlg, QLatin1String("buttonbox"));
QVERIFY(buttonBox);
}
QTEST_KDEMAIN(GravatarDownloadPixmapDialogTest, GUI)
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GRAVATARDOWNLOADPIXMAPDIALOGTEST_H
#define GRAVATARDOWNLOADPIXMAPDIALOGTEST_H
......@@ -8,10 +26,10 @@ class GravatarDownloadPixmapDialogTest : public QObject
Q_OBJECT
public:
explicit GravatarDownloadPixmapDialogTest(QObject *parent = 0);
~GravatarDownloadPixmapDialogTest();
signals:
public slots:
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // GRAVATARDOWNLOADPIXMAPDIALOGTEST_H
#include "gravatarconfigwidget.h"
GravatarConfigWidget::GravatarConfigWidget(QWidget *parent) : QWidget(parent)
{
}
#ifndef GRAVATARCONFIGWIDGET_H
#define GRAVATARCONFIGWIDGET_H
#include <QWidget>
class GravatarConfigWidget : public QWidget
{
Q_OBJECT
public:
explicit GravatarConfigWidget(QWidget *parent = 0);
signals:
public slots:
};
#endif // GRAVATARCONFIGWIDGET_H
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "gravatardownloadpixmapdialog.h"
#include "gravatardownloadpixmapwidget.h"
#include <QHBoxLayout>
#include <QDialogButtonBox>
#include <KLocalizedString>
using namespace PimCommon;
GravatarDownloadPixmapDialog::GravatarDownloadPixmapDialog()
GravatarDownloadPixmapDialog::GravatarDownloadPixmapDialog(QWidget *parent)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mGravatarDownloadPixmapWidget = new PimCommon::GravatarDownloadPixmapWidget(this);
mGravatarDownloadPixmapWidget->setObjectName(QLatin1String("gravatarwidget"));
mainLayout->addWidget(mGravatarDownloadPixmapWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
buttonBox->setObjectName(QLatin1String("buttonbox"));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotAccepted()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
mainLayout->addWidget(buttonBox);
}
GravatarDownloadPixmapDialog::~GravatarDownloadPixmapDialog()
{
}
void GravatarDownloadPixmapDialog::slotAccepted()
{
}
/*
Copyright (c) 2015 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, version 2, as
published by the Free Software Foundation.
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; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GRAVATARDOWNLOADPIXMAPDIALOG_H
#define GRAVATARDOWNLOADPIXMAPDIALOG_H
#include <QDialog>
class GravatarDownloadPixmapDialog
namespace PimCommon {
class GravatarDownloadPixmapWidget;
class GravatarDownloadPixmapDialog : public QDialog
{
Q_OBJECT
public:
GravatarDownloadPixmapDialog();
explicit GravatarDownloadPixmapDialog(QWidget *parent = 0);
~GravatarDownloadPixmapDialog();
private slots:
void slotAccepted();
private:
PimCommon::GravatarDownloadPixmapWidget *mGravatarDownloadPixmapWidget;
};
}
#endif // GRAVATARDOWNLOADPIXMAPDIALOG_H
/*
Copyright (c) 2015 Montel Laurent <montel@kde.org>
based on code from Sune Vuorela <sune@vuorela.dk> (Rawatar source code)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
......
/*
Copyright (c) 2015 Montel Laurent <montel@kde.org>
based on code from Sune Vuorela <sune@vuorela.dk> (Rawatar source code)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
......
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