[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kaccounts-providers] /: Add the service page
From: Alex Fiestas <afiestas () kde ! org>
Date: 2015-10-15 21:01:21
Message-ID: E1ZmpeL-0000yK-0S () scm ! kde ! org
[Download RAW message or body]
Git commit 326c4099a02c6550c98ac8f180f97bbeed9b3c21 by Alex Fiestas.
Committed on 17/04/2012 at 16:27.
Pushed by mklapetek into branch 'master'.
Add the service page
C +18 -40 oservices.cpp [from: owncloud.cpp - 050% similarity]
A +45 -0 oservices.h [License: GPL (v2+)]
M +6 -0 owncloud.cpp
http://commits.kde.org/kaccounts-providers/326c4099a02c6550c98ac8f180f97bbeed9b3c21
diff --git a/owncloud.cpp b/oservices.cpp
similarity index 50%
copy from owncloud.cpp
copy to oservices.cpp
index 022f47e..f3a0915 100644
--- a/owncloud.cpp
+++ b/oservices.cpp
@@ -16,63 +16,41 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
+#include "oservices.h"
#include "owncloud.h"
-#include "basicinfo.h"
-#include "connecting.h"
-#include <klocalizedstring.h>
-#include <kpushbutton.h>
-#include <kstandardguiitem.h>
+#include "google/serviceoption.h"
-OwnCloudWizard::OwnCloudWizard(QWidget* parent, Qt::WindowFlags flags): QWizard(parent, flags)
+OServices::OServices(OwnCloudWizard* wizard)
+ : QWizardPage()
+ , m_wizard(wizard)
{
- BasicInfo *basicInfo = new BasicInfo(this);
- Connecting *connecting = new Connecting(this);
-
- addPage(basicInfo);
- addPage(connecting);
-
- setButton(QWizard::BackButton, new KPushButton(KStandardGuiItem::back(KStandardGuiItem::UseRTL)));
- setButton(QWizard::NextButton, new KPushButton(KStandardGuiItem::forward(KStandardGuiItem::UseRTL)));
- setButton(QWizard::FinishButton, new KPushButton(KStandardGuiItem::apply()));
- setButton(QWizard::CancelButton, new KPushButton(KStandardGuiItem::cancel()));
-
- //We do not want "Forward" as text
- setButtonText(QWizard::NextButton, i18nc("Action to go to the next page on the wizard", "Next"));
- setButtonText(QWizard::FinishButton, i18nc("Action to finish the wizard", "Finish"));
+ setupUi(this);
}
-OwnCloudWizard::~OwnCloudWizard()
+OServices::~OServices()
{
}
-void OwnCloudWizard::setUsername(const QString& username)
+void OServices::initializePage()
{
- m_username = username;
+ addOption("File", i18n("Chat"));
+ addOption("Calendar", i18n("Calendar"));
+ addOption("Contact", i18n("Contacts"));
}
-void OwnCloudWizard::setPassword(const QString& password)
+void OServices::addOption(const QString& text, const QString& displayText)
{
- m_password = password;
-}
+ ServiceOption *option = new ServiceOption(text, displayText, this);
+ connect(option, SIGNAL(toggled(QString, bool)), this, SLOT(optionToggled(QString, bool)));
-void OwnCloudWizard::setServer(const KUrl& server)
-{
- m_server = server;
-}
+ m_wizard->activateOption(text, true);
-const QString OwnCloudWizard::username() const
-{
- return m_username;
+ d_layout->addWidget(option);
}
-const QString OwnCloudWizard::password() const
+void OServices::optionToggled(const QString& name, bool checked)
{
- return m_password;
+ m_wizard->activateOption(name, checked);
}
-
-const KUrl OwnCloudWizard::server() const
-{
- return m_server;
-}
\ No newline at end of file
diff --git a/oservices.h b/oservices.h
new file mode 100644
index 0000000..ba405de
--- /dev/null
+++ b/oservices.h
@@ -0,0 +1,45 @@
+/*************************************************************************************
+ * Copyright (C) 2012 by Alejandro Fiestas Olivares <afiestas@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; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
+ *************************************************************************************/
+
+#ifndef OSERVICES_H
+#define OSERVICES_H
+
+#include "ui_services.h"
+#include <QWizardPage>
+
+class OwnCloudWizard;
+class OServices : public QWizardPage, Ui::Services
+{
+ Q_OBJECT
+ public:
+ explicit OServices(OwnCloudWizard *wizard);
+ virtual ~OServices();
+
+ virtual void initializePage();
+
+ private Q_SLOTS:
+ void optionToggled(const QString &name, bool checked);
+
+ private:
+ void addOption(const QString& text, const QString& displayText);
+
+ private:
+ OwnCloudWizard *m_wizard;
+};
+
+#endif //OSERVICES_H
\ No newline at end of file
diff --git a/owncloud.cpp b/owncloud.cpp
index 022f47e..152d0ea 100644
--- a/owncloud.cpp
+++ b/owncloud.cpp
@@ -19,18 +19,24 @@
#include "owncloud.h"
#include "basicinfo.h"
#include "connecting.h"
+#include "oservices.h"
#include <klocalizedstring.h>
#include <kpushbutton.h>
#include <kstandardguiitem.h>
+#include <KWallet/Wallet>
+
+using namespace KWallet;
OwnCloudWizard::OwnCloudWizard(QWidget* parent, Qt::WindowFlags flags): QWizard(parent, flags)
{
BasicInfo *basicInfo = new BasicInfo(this);
Connecting *connecting = new Connecting(this);
+ OServices *services = new OServices(this);
addPage(basicInfo);
addPage(connecting);
+ addPage(services);
setButton(QWizard::BackButton, new KPushButton(KStandardGuiItem::back(KStandardGuiItem::UseRTL)));
setButton(QWizard::NextButton, new KPushButton(KStandardGuiItem::forward(KStandardGuiItem::UseRTL)));
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic