summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-05-12 13:38:10 +0200
committerMontel Laurent <[email protected]>2015-05-12 13:38:41 +0200
commit44c643682de28a3490bbd9e02dc5f51f0f0dec12 (patch)
treea2163d6dbd60c0d3094da6d72e37bf37cc79e5fc
parent70c9120e520bede0dcec386c98aeab44e4b62a3e (diff)
Add dialog box to get gravatar pixmap
-rw-r--r--pimcommon/CMakeLists.txt1
-rw-r--r--pimcommon/gravatar/autotests/CMakeLists.txt5
-rw-r--r--pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.cpp42
-rw-r--r--pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.h24
-rw-r--r--pimcommon/gravatar/widgets/gravatarconfigwidget.cpp7
-rw-r--r--pimcommon/gravatar/widgets/gravatarconfigwidget.h17
-rw-r--r--pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.cpp44
-rw-r--r--pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.h33
-rw-r--r--pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.cpp2
-rw-r--r--pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.h2
10 files changed, 166 insertions, 11 deletions
diff --git a/pimcommon/CMakeLists.txt b/pimcommon/CMakeLists.txt
index 449904b..43b6759 100644
--- a/pimcommon/CMakeLists.txt
+++ b/pimcommon/CMakeLists.txt
@@ -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
diff --git a/pimcommon/gravatar/autotests/CMakeLists.txt b/pimcommon/gravatar/autotests/CMakeLists.txt
index 48d9baa..6148dd7 100644
--- a/pimcommon/gravatar/autotests/CMakeLists.txt
+++ b/pimcommon/gravatar/autotests/CMakeLists.txt
@@ -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)
+
+
diff --git a/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.cpp b/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.cpp
index 3c63f12..49017f1 100644
--- a/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.cpp
+++ b/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.cpp
@@ -1,7 +1,47 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ 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)
diff --git a/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.h b/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.h
index 1e9f0e6..9071039 100644
--- a/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.h
+++ b/pimcommon/gravatar/autotests/gravatardownloadpixmapdialogtest.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ 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
diff --git a/pimcommon/gravatar/widgets/gravatarconfigwidget.cpp b/pimcommon/gravatar/widgets/gravatarconfigwidget.cpp
new file mode 100644
index 0000000..45b1088
--- /dev/null
+++ b/pimcommon/gravatar/widgets/gravatarconfigwidget.cpp
@@ -0,0 +1,7 @@
+#include "gravatarconfigwidget.h"
+
+GravatarConfigWidget::GravatarConfigWidget(QWidget *parent) : QWidget(parent)
+{
+
+}
+
diff --git a/pimcommon/gravatar/widgets/gravatarconfigwidget.h b/pimcommon/gravatar/widgets/gravatarconfigwidget.h
new file mode 100644
index 0000000..9426b95
--- /dev/null
+++ b/pimcommon/gravatar/widgets/gravatarconfigwidget.h
@@ -0,0 +1,17 @@
+#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
diff --git a/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.cpp b/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.cpp
index 091b0cb..80ebdf7 100644
--- a/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.cpp
+++ b/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.cpp
@@ -1,7 +1,49 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ 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()
+{
+
+}
diff --git a/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.h b/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.h
index 09624bf..c123b47 100644
--- a/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.h
+++ b/pimcommon/gravatar/widgets/gravatardownloadpixmapdialog.h
@@ -1,11 +1,40 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ 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
diff --git a/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.cpp b/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.cpp
index a622c13c..b851655 100644
--- a/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.cpp
+++ b/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.cpp
@@ -1,8 +1,6 @@
/*
Copyright (c) 2015 Montel Laurent <[email protected]>
- based on code from Sune Vuorela <[email protected]> (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.
diff --git a/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.h b/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.h
index 34421ea..b57adb2 100644
--- a/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.h
+++ b/pimcommon/gravatar/widgets/gravatardownloadpixmapwidget.h
@@ -1,8 +1,6 @@
/*
Copyright (c) 2015 Montel Laurent <[email protected]>
- based on code from Sune Vuorela <[email protected]> (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.