diff --git a/kcm/CMakeLists.txt b/kcm/CMakeLists.txt index 1afe7e2f9..9ed031175 100644 --- a/kcm/CMakeLists.txt +++ b/kcm/CMakeLists.txt @@ -6,10 +6,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} set(kcm_SRCS devicessortproxymodel.cpp kcm.cpp - #wizard.cpp ) -kde4_add_ui_files(kcm_SRCS kcm.ui wizard.ui) +kde4_add_ui_files(kcm_SRCS kcm.ui) kde4_add_plugin(kcm_kdeconnect ${kcm_SRCS}) diff --git a/kcm/kcm.h b/kcm/kcm.h index 6dcbc550c..32aac2063 100644 --- a/kcm/kcm.h +++ b/kcm/kcm.h @@ -27,7 +27,6 @@ #include #include -#include "wizard.h" #include "libkdeconnect/devicesmodel.h" class QModelIndex; @@ -67,11 +66,10 @@ private: Ui::KdeConnectKcmUi* kcmUi; DevicesModel* devicesModel; DevicesSortProxyModel* sortProxyModel; - AddDeviceWizard* addDeviceWizard; DeviceDbusInterface* currentDevice; QModelIndex currentIndex; - //KSharedConfigPtr config; -public slots: + +public Q_SLOTS: void unpair(); }; diff --git a/kcm/wizard.cpp b/kcm/wizard.cpp deleted file mode 100644 index a275b3ddb..000000000 --- a/kcm/wizard.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2013 Albert Vaca - * - * 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) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * 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, see . - */ - -#include "wizard.h" -#include "devicesmodel.h" - -#include -#include - -#include - -#include "ui_wizard.h" - -AddDeviceWizard::AddDeviceWizard(QWidget* parent) - : QWizard(parent) - , wizardUi(new Ui::Wizard()) - , dbusInterface(new DaemonDbusInterface(this)) - , discoveredDevicesList(new DevicesModel(this)) -{ - - wizardUi->setupUi(this); - - connect(wizardUi->listView,SIGNAL(activated(QModelIndex)),this,SLOT(deviceSelected(QModelIndex))); - - wizardUi->listView->setModel(discoveredDevicesList); - - connect(this,SIGNAL(currentIdChanged(int)),this,SLOT(pageChanged(int))); - - connect(this,SIGNAL(accepted()),this,SLOT(wizardFinished())); - - connect(dbusInterface, SIGNAL(deviceDiscovered(QString, QString)), this, SLOT(deviceDiscovered(QString,QString))); - //connect(dbusInterface, SIGNAL(deviceLost(QString)), this, SLOT(deviceLost(QString))); - -} - -void AddDeviceWizard::wizardFinished() -{ - if (selectedIndex.isValid() && selectedIndex.row() >= 0 && selectedIndex.row() < discoveredDevicesList->rowCount()) { - QString name = discoveredDevicesList->data(selectedIndex,DevicesModel::NameModelRole).toString(); - QString id = discoveredDevicesList->data(selectedIndex,DevicesModel::IdModelRole).toString(); - emit deviceAdded(id,name); - } -} - - -void AddDeviceWizard::pageChanged(int id) -{ - qDebug() << id; - if (id == 2) { - //TODO: Do the actual pairing in this page - } -} - -void AddDeviceWizard::deviceDiscovered(QString id, QString name) -{ - qDebug() << "Discovered"<addDevice(id,name,DevicesModel::Visible); -} -/* -void AddDeviceWizard::deviceLost(QString id) -{ - //discoveredDevicesList->removeRow(); -} -*/ - -void AddDeviceWizard::restart() -{ - selectedIndex = QModelIndex(); - QWizard::restart(); -} - - -void AddDeviceWizard::show() -{ - restart(); - QWizard::show(); -} - -void AddDeviceWizard::deviceSelected(const QModelIndex& index) -{ - qDebug() << "Selected:" << index.row(); - selectedIndex = index; - next(); -} - -AddDeviceWizard::~AddDeviceWizard() -{ - delete wizardUi; - delete dbusInterface; - delete discoveredDevicesList; -} diff --git a/kcm/wizard.h b/kcm/wizard.h deleted file mode 100644 index 41db776e7..000000000 --- a/kcm/wizard.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2013 Albert Vaca - * - * 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) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * 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, see . - */ - -#ifndef WIZARD_H -#define WIZARD_H - -#include -#include - -#include "../libkdeconnect/dbusinterfaces.h" -#include "../libkdeconnect/devicesmodel.h" - -namespace Ui { - class Wizard; -} - -class QStandardItemModel; - -class AddDeviceWizard : public QWizard -{ - Q_OBJECT - -public: - AddDeviceWizard(QWidget* parent); - ~AddDeviceWizard(); - void show(); - void restart(); - -private Q_SLOTS: - void pageChanged(int id); - - void deviceDiscovered(QString id, QString name); - //void deviceLost(QString id); - - void deviceSelected(const QModelIndex& index); - - void wizardFinished(); - -Q_SIGNALS: - void deviceAdded(QString id, QString name); - -private: - Ui::Wizard* wizardUi; - DaemonDbusInterface* dbusInterface; - DevicesModel* discoveredDevicesList; - QModelIndex selectedIndex; -}; - -#endif // WIZARD_H diff --git a/kcm/wizard.ui b/kcm/wizard.ui deleted file mode 100644 index b3173b8da..000000000 --- a/kcm/wizard.ui +++ /dev/null @@ -1,54 +0,0 @@ - - - Wizard - - - - 0 - 0 - 361 - 293 - - - - Wizard - - - - - - - <html><head/><body><p>Bla bla bla blo blo blo<br/><br/><br/><br/><a href="https://accounts.google.com/ServiceLogin?service=googleplay&amp;passive=86400&amp;continue=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.melloware.zeroconf%26hl%3Den%26rdid%3Dcom.melloware.zeroconf%26rdot%"><span style=" text-decoration: underline; color:#0057ae;">Click Here!</span></a></p></body></html> - - - Qt::RichText - - - true - - - Qt::TextBrowserInteraction - - - - - - - - - - - Select your device - - - - - - - - - - - - -