Commit 326c4099 authored by Àlex Fiestas's avatar Àlex Fiestas
Browse files

Add the service page

parent 4516e788
/*************************************************************************************
* 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 *
*************************************************************************************/
#include "oservices.h"
#include "owncloud.h"
#include "google/serviceoption.h"
OServices::OServices(OwnCloudWizard* wizard)
: QWizardPage()
, m_wizard(wizard)
{
setupUi(this);
}
OServices::~OServices()
{
}
void OServices::initializePage()
{
addOption("File", i18n("Chat"));
addOption("Calendar", i18n("Calendar"));
addOption("Contact", i18n("Contacts"));
}
void OServices::addOption(const QString& text, const QString& displayText)
{
ServiceOption *option = new ServiceOption(text, displayText, this);
connect(option, SIGNAL(toggled(QString, bool)), this, SLOT(optionToggled(QString, bool)));
m_wizard->activateOption(text, true);
d_layout->addWidget(option);
}
void OServices::optionToggled(const QString& name, bool checked)
{
m_wizard->activateOption(name, checked);
}
/*************************************************************************************
* 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
......@@ -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)));
......
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