summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-05-18 12:32:38 +0200
committerMontel Laurent <[email protected]>2015-05-18 12:32:38 +0200
commit57c89f5e8d3b7f369babd38cc69ebc4e9df25b40 (patch)
tree4c3d52c83b218d27193aa36e814a3e2e89652945
parent52a1bb22e6af1d71370c1c391fb9e6c7c3d3ba3b (diff)
Add new widget for update gravatar
-rw-r--r--kaddressbook/CMakeLists.txt2
-rw-r--r--kaddressbook/gravatar/autotests/gravatarcreatedialogtest.cpp5
-rw-r--r--kaddressbook/gravatar/widgets/gravatarcreatedialog.cpp8
-rw-r--r--kaddressbook/gravatar/widgets/gravatarupdatedialog.cpp34
-rw-r--r--kaddressbook/gravatar/widgets/gravatarupdatedialog.h31
-rw-r--r--kaddressbook/gravatar/widgets/gravatarupdatewidget.cpp34
-rw-r--r--kaddressbook/gravatar/widgets/gravatarupdatewidget.h35
7 files changed, 148 insertions, 1 deletions
diff --git a/kaddressbook/CMakeLists.txt b/kaddressbook/CMakeLists.txt
index 8c61733..cfba8dd 100644
--- a/kaddressbook/CMakeLists.txt
+++ b/kaddressbook/CMakeLists.txt
@@ -112,6 +112,8 @@ set(kaddressbook_gravatar_SRCS
gravatar/job/gravatarupdatejob.cpp
gravatar/widgets/gravatarcreatedialog.cpp
gravatar/widgets/gravatarcreatewidget.cpp
+ gravatar/widgets/gravatarupdatedialog.cpp
+ gravatar/widgets/gravatarcreatewidget.cpp
)
set(kaddressbook_LIB_SRCS
diff --git a/kaddressbook/gravatar/autotests/gravatarcreatedialogtest.cpp b/kaddressbook/gravatar/autotests/gravatarcreatedialogtest.cpp
index bfbe7c3..a34ffb0 100644
--- a/kaddressbook/gravatar/autotests/gravatarcreatedialogtest.cpp
+++ b/kaddressbook/gravatar/autotests/gravatarcreatedialogtest.cpp
@@ -18,6 +18,7 @@
#include "gravatarcreatedialogtest.h"
#include "../widgets/gravatarcreatedialog.h"
#include "../widgets/gravatarcreatewidget.h"
+#include <QDialogButtonBox>
#include <qtest_kde.h>
GravatarCreateDialogTest::GravatarCreateDialogTest(QObject *parent)
@@ -36,6 +37,10 @@ void GravatarCreateDialogTest::shouldHaveDefaultValue()
KABGravatar::GravatarCreateDialog dlg;
KABGravatar::GravatarCreateWidget *w = dlg.findChild<KABGravatar::GravatarCreateWidget *>(QLatin1String("gravatarcreatewidget"));
QVERIFY(w);
+
+ QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QLatin1String("buttonbox"));
+ QVERIFY(buttonBox);
+
}
QTEST_KDEMAIN(GravatarCreateDialogTest, GUI)
diff --git a/kaddressbook/gravatar/widgets/gravatarcreatedialog.cpp b/kaddressbook/gravatar/widgets/gravatarcreatedialog.cpp
index 70e51f8..0ff6670 100644
--- a/kaddressbook/gravatar/widgets/gravatarcreatedialog.cpp
+++ b/kaddressbook/gravatar/widgets/gravatarcreatedialog.cpp
@@ -19,7 +19,8 @@
#include "gravatarcreatewidget.h"
#include <QVBoxLayout>
#include <KLocalizedString>
-
+#include <QDialogButtonBox>
+#include <QPushButton>
using namespace KABGravatar;
GravatarCreateDialog::GravatarCreateDialog(QWidget *parent)
: QDialog(parent)
@@ -29,6 +30,11 @@ GravatarCreateDialog::GravatarCreateDialog(QWidget *parent)
mCreateWidget = new GravatarCreateWidget(this);
mCreateWidget->setObjectName(QLatin1String("gravatarcreatewidget"));
mainLayout->addWidget(mCreateWidget);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ buttonBox->setObjectName(QLatin1String("buttonbox"));
+ mainLayout->addWidget(buttonBox);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
GravatarCreateDialog::~GravatarCreateDialog()
diff --git a/kaddressbook/gravatar/widgets/gravatarupdatedialog.cpp b/kaddressbook/gravatar/widgets/gravatarupdatedialog.cpp
new file mode 100644
index 0000000..7b724fa
--- /dev/null
+++ b/kaddressbook/gravatar/widgets/gravatarupdatedialog.cpp
@@ -0,0 +1,34 @@
+/*
+ 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 "gravatarupdatedialog.h"
+#include <QVBoxLayout>
+#include <KLocalizedString>
+
+using namespace KABGravatar;
+
+GravatarUpdateDialog::GravatarUpdateDialog(QWidget *parent)
+ : QDialog(parent)
+{
+
+}
+
+GravatarUpdateDialog::~GravatarUpdateDialog()
+{
+
+}
+
diff --git a/kaddressbook/gravatar/widgets/gravatarupdatedialog.h b/kaddressbook/gravatar/widgets/gravatarupdatedialog.h
new file mode 100644
index 0000000..18bcef4
--- /dev/null
+++ b/kaddressbook/gravatar/widgets/gravatarupdatedialog.h
@@ -0,0 +1,31 @@
+/*
+ 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 GRAVATARUPDATEDIALOG_H
+#define GRAVATARUPDATEDIALOG_H
+
+#include <QDialog>
+namespace KABGravatar {
+class GravatarUpdateDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit GravatarUpdateDialog(QWidget *parent=0);
+ ~GravatarUpdateDialog();
+};
+}
+#endif // GRAVATARUPDATEDIALOG_H
diff --git a/kaddressbook/gravatar/widgets/gravatarupdatewidget.cpp b/kaddressbook/gravatar/widgets/gravatarupdatewidget.cpp
new file mode 100644
index 0000000..a4612e3
--- /dev/null
+++ b/kaddressbook/gravatar/widgets/gravatarupdatewidget.cpp
@@ -0,0 +1,34 @@
+/*
+ This file is part of KAddressBook.
+
+ Copyright (c) 2015 Laurent Montel <[email protected]>
+
+ 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; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "gravatarupdatewidget.h"
+using namespace KABGravatar;
+
+GravatarUpdateWidget::GravatarUpdateWidget(QWidget *parent)
+ : QWidget(parent)
+{
+
+}
+
+GravatarUpdateWidget::~GravatarUpdateWidget()
+{
+
+}
+
diff --git a/kaddressbook/gravatar/widgets/gravatarupdatewidget.h b/kaddressbook/gravatar/widgets/gravatarupdatewidget.h
new file mode 100644
index 0000000..59750df
--- /dev/null
+++ b/kaddressbook/gravatar/widgets/gravatarupdatewidget.h
@@ -0,0 +1,35 @@
+/*
+ This file is part of KAddressBook.
+
+ Copyright (c) 2015 Laurent Montel <[email protected]>
+
+ 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; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef GRAVATARUPDATEWIDGET_H
+#define GRAVATARUPDATEWIDGET_H
+
+#include <QWidget>
+namespace KABGravatar {
+class GravatarUpdateWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit GravatarUpdateWidget(QWidget *parent = 0);
+ ~GravatarUpdateWidget();
+};
+}
+
+#endif // GRAVATARUPDATEWIDGET_H