[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:04:45 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=fe6b42a

The following commit has been merged in the master branch:
commit fe6b42a5d6002447f3126f5f886c5d42db5daa85
Author: Anant Kamath <kamathanant at gmail.com>
Date:   Fri Aug 30 03:08:29 2013 +0530

    Plugin for pintxo (SMS CM)
---
 cmake/modules/FindModemManager.cmake               | 42 ++++++++++
 data/profiles/sms.profile                          |  8 ++
 plugins/CMakeLists.txt                             |  1 +
 plugins/pintxo/CMakeLists.txt                      | 57 ++++++++++++++
 plugins/pintxo/FindModemManager.cmake              | 42 ++++++++++
 plugins/{rakia => pintxo}/Messages.sh              |  2 +-
 .../ktpaccountskcm_plugin_pintxo.desktop.cmake     | 16 ++++
 plugins/pintxo/main-options-widget.cpp             | 76 ++++++++++++++++++
 plugins/{idle => pintxo}/main-options-widget.h     | 15 ++--
 plugins/pintxo/main-options-widget.ui              | 90 ++++++++++++++++++++++
 plugins/pintxo/modem-combobox.cpp                  | 49 ++++++++++++
 .../modem-combobox.h}                              | 26 +++----
 .../pintxo-account-ui-plugin.cpp}                  | 29 +++----
 .../pintxo-account-ui-plugin.h}                    | 14 ++--
 .../pintxo-account-ui.cpp}                         | 16 ++--
 .../pintxo-account-ui.h}                           | 16 ++--
 16 files changed, 444 insertions(+), 55 deletions(-)

diff --git a/cmake/modules/FindModemManager.cmake b/cmake/modules/FindModemManager.cmake
new file mode 100644
index 0000000..7f13087
--- /dev/null
+++ b/cmake/modules/FindModemManager.cmake
@@ -0,0 +1,42 @@
+# - Try to find ModemManager
+# Once done this will define
+#
+#  MODEMMANAGER_FOUND - system has ModemManager
+#  MODEMMANAGER_INCLUDE_DIRS - the ModemManager include directories
+#  MODEMMANAGER_LIBRARIES - the libraries needed to use ModemManager
+#  MODEMMANAGER_CFLAGS - Compiler switches required for using ModemManager
+#  MODEMMANAGER_VERSION - version number of ModemManager
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
+# Copyright (c) 2007, Will Stephenson, <wstephenson at kde.org>
+# Copyright (c) 2013, Lukas Tinkl, <ltinkl at redhat.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (MODEMMANAGER_INCLUDE_DIRS)
+   # in cache already
+   SET(NetworkManager_FIND_QUIETLY TRUE)
+ENDIF (MODEMMANAGER_INCLUDE_DIRS)
+
+IF (NOT WIN32)
+   # use pkg-config to get the directories and then use these values
+   # in the FIND_PATH() and FIND_LIBRARY() calls
+   find_package(PkgConfig)
+   PKG_SEARCH_MODULE( MODEMMANAGER ModemManager )
+ENDIF (NOT WIN32)
+
+IF (MODEMMANAGER_FOUND)
+   IF (ModemManager_FIND_VERSION AND ("${MODEMMANAGER_VERSION}" VERSION_LESS "${ModemManager_FIND_VERSION}"))
+      MESSAGE(FATAL_ERROR "ModemManager ${MODEMMANAGER_VERSION} is too old, need at least ${ModemManager_FIND_VERSION}")
+   ELSEIF (NOT ModemManager_FIND_QUIETLY)
+      MESSAGE(STATUS "Found ModemManager ${MODEMMANAGER_VERSION}: ${MODEMMANAGER_INCLUDE_DIRS}")
+   ENDIF()
+ELSE (MODEMMANAGER_FOUND)
+   IF (ModemManager_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could NOT find ModemManager, check FindPkgConfig output above!")
+   ENDIF (ModemManager_FIND_REQUIRED)
+ENDIF (MODEMMANAGER_FOUND)
+
+MARK_AS_ADVANCED(MODEMMANAGER_INCLUDE_DIRS)
diff --git a/data/profiles/sms.profile b/data/profiles/sms.profile
new file mode 100644
index 0000000..7b95f35
--- /dev/null
+++ b/data/profiles/sms.profile
@@ -0,0 +1,8 @@
+<service xmlns="http://telepathy.freedesktop.org/wiki/service-profile-v1"
+         id="sms"
+         type="IM"
+         manager="pintxo"
+         protocol="sms"
+         icon="phone">
+  <name>SMS Messaging</name>
+</service>
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index b2af316..e270078 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -5,3 +5,4 @@ add_subdirectory (haze)
 add_subdirectory (rakia)
 add_subdirectory (salut)
 add_subdirectory (sunshine)
+add_subdirectory (pintxo)
diff --git a/plugins/pintxo/CMakeLists.txt b/plugins/pintxo/CMakeLists.txt
new file mode 100644
index 0000000..753c504
--- /dev/null
+++ b/plugins/pintxo/CMakeLists.txt
@@ -0,0 +1,57 @@
+project (ktpaccountskcm-plugin-pintxo)
+
+#find_package(ModemManager REQUIRED)
+
+pkg_check_modules(LIBMODEMMANAGERQT REQUIRED ModemManagerQt)
+    if (NOT LIBMODEMMANAGERQT_FOUND)
+    message(FATAL_ERROR "ERROR: libModemManagerQt not found")
+endif (NOT LIBMODEMMANAGERQT_FOUND)
+
+
+INCLUDE(FindPkgConfig)
+
+include_directories (${CMAKE_CURRENT_BINARY_DIR}
+                     ${CMAKE_CURRENT_SOURCE_DIR}
+                     ${QT_INCLUDES}
+                     ${LIBMODEMMANAGERQT_INCLUDE_DIRS}
+                     ${CMAKE_INCLUDE_PATH}
+)
+
+link_directories(${LIBMODEMMANAGERQT_LIBRARY_DIRS})
+
+set (ktpaccountskcm_plugin_pintxo_SRCS
+     pintxo-account-ui-plugin.cpp
+     pintxo-account-ui.cpp
+     main-options-widget.cpp
+     modem-combobox.cpp
+)
+
+kde4_add_ui_files (ktpaccountskcm_plugin_pintxo_SRCS
+                   main-options-widget.ui
+)
+
+kde4_add_plugin (ktpaccountskcm_plugin_pintxo
+                 ${ktpaccountskcm_plugin_pintxo_SRCS}
+)
+
+
+target_link_libraries (ktpaccountskcm_plugin_pintxo
+                       ktpaccountskcminternal
+                       ModemManagerQt
+                       ${QT_LIBRARIES}
+                       ${KDE4_KDEUI_LIBS}
+                       ${TELEPATHY_QT4_LIBRARIES}
+)
+
+# Install:
+install (TARGETS ktpaccountskcm_plugin_pintxo
+         DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ktpaccountskcm_plugin_pintxo.desktop.cmake
+               ${CMAKE_CURRENT_BINARY_DIR}/ktpaccountskcm_plugin_pintxo.desktop
+               @ONLY)
+
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ktpaccountskcm_plugin_pintxo.desktop
+         DESTINATION ${SERVICES_INSTALL_DIR}
+)
diff --git a/plugins/pintxo/FindModemManager.cmake b/plugins/pintxo/FindModemManager.cmake
new file mode 100644
index 0000000..7f13087
--- /dev/null
+++ b/plugins/pintxo/FindModemManager.cmake
@@ -0,0 +1,42 @@
+# - Try to find ModemManager
+# Once done this will define
+#
+#  MODEMMANAGER_FOUND - system has ModemManager
+#  MODEMMANAGER_INCLUDE_DIRS - the ModemManager include directories
+#  MODEMMANAGER_LIBRARIES - the libraries needed to use ModemManager
+#  MODEMMANAGER_CFLAGS - Compiler switches required for using ModemManager
+#  MODEMMANAGER_VERSION - version number of ModemManager
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
+# Copyright (c) 2007, Will Stephenson, <wstephenson at kde.org>
+# Copyright (c) 2013, Lukas Tinkl, <ltinkl at redhat.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (MODEMMANAGER_INCLUDE_DIRS)
+   # in cache already
+   SET(NetworkManager_FIND_QUIETLY TRUE)
+ENDIF (MODEMMANAGER_INCLUDE_DIRS)
+
+IF (NOT WIN32)
+   # use pkg-config to get the directories and then use these values
+   # in the FIND_PATH() and FIND_LIBRARY() calls
+   find_package(PkgConfig)
+   PKG_SEARCH_MODULE( MODEMMANAGER ModemManager )
+ENDIF (NOT WIN32)
+
+IF (MODEMMANAGER_FOUND)
+   IF (ModemManager_FIND_VERSION AND ("${MODEMMANAGER_VERSION}" VERSION_LESS "${ModemManager_FIND_VERSION}"))
+      MESSAGE(FATAL_ERROR "ModemManager ${MODEMMANAGER_VERSION} is too old, need at least ${ModemManager_FIND_VERSION}")
+   ELSEIF (NOT ModemManager_FIND_QUIETLY)
+      MESSAGE(STATUS "Found ModemManager ${MODEMMANAGER_VERSION}: ${MODEMMANAGER_INCLUDE_DIRS}")
+   ENDIF()
+ELSE (MODEMMANAGER_FOUND)
+   IF (ModemManager_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could NOT find ModemManager, check FindPkgConfig output above!")
+   ENDIF (ModemManager_FIND_REQUIRED)
+ENDIF (MODEMMANAGER_FOUND)
+
+MARK_AS_ADVANCED(MODEMMANAGER_INCLUDE_DIRS)
diff --git a/plugins/rakia/Messages.sh b/plugins/pintxo/Messages.sh
old mode 100644
new mode 100755
similarity index 89%
copy from plugins/rakia/Messages.sh
copy to plugins/pintxo/Messages.sh
index a2aad44..43edeb9
--- a/plugins/rakia/Messages.sh
+++ b/plugins/pintxo/Messages.sh
@@ -1,4 +1,4 @@
 #! /usr/bin/env bash
 $EXTRACTRC `find . -name "*.ui"` >> rc.cpp || exit 11
-$XGETTEXT `find . -name "*.cpp"` -o $podir/kcmtelepathyaccounts_plugin_rakia.pot
+$XGETTEXT `find . -name "*.cpp"` -o $podir/kcmtelepathyaccounts_plugin_pintxo.pot
 rm -f rc.cpp
diff --git a/plugins/pintxo/ktpaccountskcm_plugin_pintxo.desktop.cmake b/plugins/pintxo/ktpaccountskcm_plugin_pintxo.desktop.cmake
new file mode 100644
index 0000000..1557c63
--- /dev/null
+++ b/plugins/pintxo/ktpaccountskcm_plugin_pintxo.desktop.cmake
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Encoding=UTF-8
+Comment=Custom account configuration user interface for accounts using the Pintxo connection manager.
+Icon=phone
+Name=Pintxo Account Configuration User Interface
+Type=Service
+ServiceTypes=KTpAccountsKCM/AccountUiPlugin
+
+X-KDE-Library=ktpaccountskcm_plugin_pintxo
+X-KDE-PluginInfo-Author=Anant Kamath
+X-KDE-PluginInfo-Email=kamathanant at gmail.com
+X-KDE-PluginInfo-Name=pintxo
+X-KDE-PluginInfo-Version=@KTP_ACCOUNTS_KCM_VERSION@
+X-KDE-PluginInfo-Website=http://techbase.kde.org/Projects/Telepathy
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
diff --git a/plugins/pintxo/main-options-widget.cpp b/plugins/pintxo/main-options-widget.cpp
new file mode 100644
index 0000000..8fad686
--- /dev/null
+++ b/plugins/pintxo/main-options-widget.cpp
@@ -0,0 +1,76 @@
+/*
+ * This file is part of telepathy-accounts-kcm
+ *
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <QtGui/QDataWidgetMapper>
+
+#include <ModemManagerQt/manager.h>
+#include <ModemManagerQt/modemgsmcardinterface.h>
+
+#include <KCMTelepathyAccounts/ParameterEditModel>
+
+#include "modem-combobox.h"
+#include "main-options-widget.h"
+
+MainOptionsWidget::MainOptionsWidget(ParameterEditModel *model,
+                                     QWidget *parent)
+ : AbstractAccountParametersWidget(model, parent)
+{
+    m_ui = new Ui::MainOptionsWidget;
+    m_ui->setupUi(this);
+    
+    mapper = new QDataWidgetMapper(this);
+    mapper->setModel(parameterModel());
+    mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
+    mapper->setOrientation(Qt::Vertical);
+    mapper->addMapping(m_ui->numberLineEdit, parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("number"))).row(), "text");
+    mapper->addMapping(m_ui->comboBox, parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("simIdentifier"))).row(), "selectedSimIdentifier");
+    mapper->toFirst();
+    
+    QTimer::singleShot(0, m_ui->numberLineEdit, SLOT(setFocus()));
+}
+
+MainOptionsWidget::~MainOptionsWidget()
+{
+    delete m_ui;
+}
+
+void MainOptionsWidget::submit()
+{
+    mapper->submit();
+    parameterModel()->setData(parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("number"))), QValidator::Acceptable, ParameterEditModel::ValidityRole);
+    parameterModel()->setData(parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("simIdentifier"))), QValidator::Acceptable, ParameterEditModel::ValidityRole);
+}
+
+bool MainOptionsWidget::validateParameterValues()
+{
+    QString parameterNumber = parameterModel()->data(parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("number"))), ParameterEditModel::ValueRole).toString();
+    QString parameterSimIdentifier = parameterModel()->data(parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("simIdentifier"))), ParameterEditModel::ValueRole).toString();
+    if(parameterNumber.isEmpty() || parameterSimIdentifier.isEmpty()) {
+        return 0;
+    }
+    return 1;
+}
+
+QString MainOptionsWidget::defaultDisplayName() const
+{
+    return parameterModel()->data(parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("number")))).toString();
+}
+
+#include "main-options-widget.moc"
diff --git a/plugins/idle/main-options-widget.h b/plugins/pintxo/main-options-widget.h
similarity index 78%
copy from plugins/idle/main-options-widget.h
copy to plugins/pintxo/main-options-widget.h
index 64b9347..21a2cb8 100644
--- a/plugins/idle/main-options-widget.h
+++ b/plugins/pintxo/main-options-widget.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2011 Lasse Liehu <lliehu at kolumbus.fi>
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,13 +18,15 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_MAIN_PARAMETERS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_MAIN_PARAMETERS_WIDGET_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_MAIN_OPTIONS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_MAIN_OPTIONS_WIDGET_H
 
-#include "ui_main-options-widget.h"
+#include <QtGui/QDataWidgetMapper>
 
 #include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
 
+#include "ui_main-options-widget.h"
+
 class MainOptionsWidget : public AbstractAccountParametersWidget
 {
     Q_OBJECT
@@ -33,11 +35,14 @@ public:
     explicit MainOptionsWidget(ParameterEditModel *model,
                                QWidget *parent = 0);
     virtual ~MainOptionsWidget();
-
     virtual QString defaultDisplayName() const;
+    virtual void submit();
+    virtual bool validateParameterValues();
 private:
     Q_DISABLE_COPY(MainOptionsWidget);
     Ui::MainOptionsWidget *m_ui;
+    QString simIdent;
+    QDataWidgetMapper* mapper;
 };
 
 
diff --git a/plugins/pintxo/main-options-widget.ui b/plugins/pintxo/main-options-widget.ui
new file mode 100644
index 0000000..6fefff9
--- /dev/null
+++ b/plugins/pintxo/main-options-widget.ui
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainOptionsWidget</class>
+ <widget class="QWidget" name="MainOptionsWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>293</width>
+    <height>254</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Account Preferences</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="numberLabel">
+       <property name="text">
+        <string>Account name:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="KLineEdit" name="numberLineEdit">
+       <property name="showClearButton" stdset="0">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLabel" name="modemLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Modem:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="ModemComboBox" name="comboBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>ModemComboBox</class>
+   <extends>QComboBox</extends>
+   <header>modem-combobox.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>numberLineEdit</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/plugins/pintxo/modem-combobox.cpp b/plugins/pintxo/modem-combobox.cpp
new file mode 100644
index 0000000..5d997b8
--- /dev/null
+++ b/plugins/pintxo/modem-combobox.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is part of telepathy-accounts-kcm
+ *
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <QDebug>
+
+#include <ModemManagerQt/manager.h>
+#include <ModemManagerQt/modemgsmcardinterface.h>
+
+#include "modem-combobox.h"
+
+ModemComboBox::ModemComboBox(QWidget* parent) : QComboBox(parent)
+{
+    modems = ModemManager::modemInterfaces();
+    Q_FOREACH(ModemManager::ModemInterface::Ptr modem, modems) {
+        ModemManager::ModemGsmCardInterface::Ptr simCard = ModemManager::findModemInterface(modem->udi(), ModemManager::ModemInterface::GsmCard).objectCast<ModemManager::ModemGsmCardInterface>();
+        QString simIdent = simCard->getSimIdentifier();
+        QString spn = simCard->getSpn();
+        addItem(spn.isEmpty() ? QLatin1String("Unknown modem") : spn);
+    }
+}
+
+ModemComboBox::~ModemComboBox()
+{
+}
+
+QString ModemComboBox::selectedSimIdentifier()
+{
+    ModemManager::ModemGsmCardInterface::Ptr simCard = ModemManager::findModemInterface(modems.at(currentIndex())->udi(), ModemManager::ModemInterface::GsmCard).objectCast<ModemManager::ModemGsmCardInterface>();
+    return simCard->getSimIdentifier();
+}
+
+#include "modem-combobox.moc"
diff --git a/plugins/haze/haze-steam-account.h b/plugins/pintxo/modem-combobox.h
similarity index 60%
copy from plugins/haze/haze-steam-account.h
copy to plugins/pintxo/modem-combobox.h
index d02c6a4..c66a3d4 100644
--- a/plugins/haze/haze-steam-account.h
+++ b/plugins/pintxo/modem-combobox.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2013 Daniel Cohen <analoguecolour at gmail.com>
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,25 +18,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_STEAM_ACCOUNT_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_STEAM_ACCOUNT_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_MODEM_COMBO_BOX_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_MODEM_COMBO_BOX_H
 
-#include <KCMTelepathyAccounts/AbstractAccountUi>
+#include <QComboBox>
 
-class HazeSteamAccountUi : public AbstractAccountUi
+#include <ModemManagerQt/manager.h>
+#include <ModemManagerQt/modemgsmcardinterface.h>
+
+class ModemComboBox : public QComboBox
 {
     Q_OBJECT
 
 public:
-    explicit HazeSteamAccountUi(QObject *parent = 0);
-    virtual ~HazeSteamAccountUi();
-
-    virtual AbstractAccountParametersWidget
-              *mainOptionsWidget(ParameterEditModel *model,
-                                 QWidget *parent = 0) const;
-
+    explicit ModemComboBox(QWidget *parent = 0);
+    virtual ~ModemComboBox();
+    QString selectedSimIdentifier();
+    Q_PROPERTY(QString selectedSimIdentifier READ selectedSimIdentifier)
 private:
-    Q_DISABLE_COPY(HazeSteamAccountUi);
+    ModemManager::ModemInterface::List modems;
 };
 
 #endif // header guard
diff --git a/plugins/gabble/gabble-account-ui-plugin.cpp b/plugins/pintxo/pintxo-account-ui-plugin.cpp
similarity index 58%
copy from plugins/gabble/gabble-account-ui-plugin.cpp
copy to plugins/pintxo/pintxo-account-ui-plugin.cpp
index aa810de..a7dd5a4 100644
--- a/plugins/gabble/gabble-account-ui-plugin.cpp
+++ b/plugins/pintxo/pintxo-account-ui-plugin.cpp
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2009 Collabora Ltd. <info at collabora.com>
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,35 +18,38 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "gabble-account-ui-plugin.h"
-#include "gabble-account-ui.h"
+#include "pintxo-account-ui-plugin.h"
+
+#include "pintxo-account-ui.h"
 
 #include <KPluginFactory>
 
 #include <QtCore/QVariantList>
 
-GabbleAccountUiPlugin::GabbleAccountUiPlugin(QObject *parent, const QVariantList &)
+PintxoAccountUiPlugin::PintxoAccountUiPlugin(QObject *parent, const QVariantList &)
  : AbstractAccountUiPlugin(parent)
 {
     // Register supported cm/protocol combinations
-    registerProvidedProtocol(QLatin1String("gabble"), QLatin1String("jabber"));
+    registerProvidedProtocol(QLatin1String("pintxo"), QLatin1String("sms"));
 }
 
-GabbleAccountUiPlugin::~GabbleAccountUiPlugin()
+PintxoAccountUiPlugin::~PintxoAccountUiPlugin()
 {
 }
 
-AbstractAccountUi* GabbleAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName)
+AbstractAccountUi* PintxoAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName)
 {
-    // We only support gabble/jabber combination.
-    if ((connectionManager == QLatin1String("gabble")) && (protocol == QLatin1String("jabber"))) {
-        return new GabbleAccountUi(serviceName, this);
+    Q_UNUSED(serviceName);
+
+    // We only support pintxo/sms combination.
+    if ((connectionManager == QLatin1String("pintxo")) && (protocol == QLatin1String("sms"))) {
+        return new PintxoAccountUi;
     }
 
     return 0;
 }
 
-K_PLUGIN_FACTORY(factory, registerPlugin<GabbleAccountUiPlugin>();)
-K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_gabble"))
+K_PLUGIN_FACTORY(factory, registerPlugin<PintxoAccountUiPlugin>();)
+K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_pintxo"))
 
-#include "gabble-account-ui-plugin.moc"
+#include "pintxo-account-ui-plugin.moc"
diff --git a/plugins/gabble/gabble-account-ui-plugin.h b/plugins/pintxo/pintxo-account-ui-plugin.h
similarity index 73%
copy from plugins/gabble/gabble-account-ui-plugin.h
copy to plugins/pintxo/pintxo-account-ui-plugin.h
index 954a9ed..dd8f02f 100644
--- a/plugins/gabble/gabble-account-ui-plugin.h
+++ b/plugins/pintxo/pintxo-account-ui-plugin.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2009 Collabora Ltd. <info at collabora.com>
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,25 +18,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ACCOUNT_UI_PLUGIN_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ACCOUNT_UI_PLUGIN_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_ACCOUNT_UI_PLUGIN_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_ACCOUNT_UI_PLUGIN_H
 
 #include <KCMTelepathyAccounts/AbstractAccountUiPlugin>
 
 #include <QtCore/QVariantList>
 
-class GabbleAccountUiPlugin : public AbstractAccountUiPlugin
+class PintxoAccountUiPlugin : public AbstractAccountUiPlugin
 {
     Q_OBJECT
 
 public:
-    GabbleAccountUiPlugin(QObject *parent, const QVariantList &);
-    virtual ~GabbleAccountUiPlugin();
+    PintxoAccountUiPlugin(QObject *parent, const QVariantList &);
+    virtual ~PintxoAccountUiPlugin();
 
     virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName);
 
 private:
-    Q_DISABLE_COPY(GabbleAccountUiPlugin);
+    Q_DISABLE_COPY(PintxoAccountUiPlugin);
 };
 
 
diff --git a/plugins/butterfly/butterfly-account-ui.cpp b/plugins/pintxo/pintxo-account-ui.cpp
similarity index 70%
copy from plugins/butterfly/butterfly-account-ui.cpp
copy to plugins/pintxo/pintxo-account-ui.cpp
index bacc148..3ee8d68 100644
--- a/plugins/butterfly/butterfly-account-ui.cpp
+++ b/plugins/pintxo/pintxo-account-ui.cpp
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2009 Collabora Ltd. <info at collabora.com>
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,28 +18,28 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "butterfly-account-ui.h"
+#include "pintxo-account-ui.h"
 #include "main-options-widget.h"
 
 #include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
 
-ButterflyAccountUi::ButterflyAccountUi(QObject *parent)
+PintxoAccountUi::PintxoAccountUi(QObject *parent)
  : AbstractAccountUi(parent)
 {
     // Register supported parameters
-    registerSupportedParameter(QLatin1String("account"), QVariant::String);
-    registerSupportedParameter(QLatin1String("password"), QVariant::String);
+    registerSupportedParameter(QLatin1String("number"), QVariant::String);
+    registerSupportedParameter(QLatin1String("simIdentifier"), QVariant::String);
 }
 
-ButterflyAccountUi::~ButterflyAccountUi()
+PintxoAccountUi::~PintxoAccountUi()
 {
 }
 
-AbstractAccountParametersWidget *ButterflyAccountUi::mainOptionsWidget(
+AbstractAccountParametersWidget *PintxoAccountUi::mainOptionsWidget(
         ParameterEditModel *model,
         QWidget *parent) const
 {
     return new MainOptionsWidget(model, parent);
 }
 
-#include "butterfly-account-ui.moc"
+#include "pintxo-account-ui.moc"
diff --git a/plugins/haze/haze-steam-account.h b/plugins/pintxo/pintxo-account-ui.h
similarity index 75%
copy from plugins/haze/haze-steam-account.h
copy to plugins/pintxo/pintxo-account-ui.h
index d02c6a4..1312fa2 100644
--- a/plugins/haze/haze-steam-account.h
+++ b/plugins/pintxo/pintxo-account-ui.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2013 Daniel Cohen <analoguecolour at gmail.com>
+ * Copyright (C) 2013 Anant Kamath <kamathanant at gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,25 +18,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_STEAM_ACCOUNT_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_STEAM_ACCOUNT_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_ACCOUNT_UI_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_PINTXO_ACCOUNT_UI_H
 
 #include <KCMTelepathyAccounts/AbstractAccountUi>
 
-class HazeSteamAccountUi : public AbstractAccountUi
+class PintxoAccountUi : public AbstractAccountUi
 {
     Q_OBJECT
 
 public:
-    explicit HazeSteamAccountUi(QObject *parent = 0);
-    virtual ~HazeSteamAccountUi();
+    explicit PintxoAccountUi(QObject *parent = 0);
+    virtual ~PintxoAccountUi();
 
     virtual AbstractAccountParametersWidget
               *mainOptionsWidget(ParameterEditModel *model,
                                  QWidget *parent = 0) const;
-
 private:
-    Q_DISABLE_COPY(HazeSteamAccountUi);
+    Q_DISABLE_COPY(PintxoAccountUi);
 };
 
+
 #endif // header guard

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list