[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:05:28 UTC 2016


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

The following commit has been merged in the master branch:
commit 846f0f5d64698e8023f0f00ec19031aceac258a2
Author: Maksim Melnikau <maxposedon at gmail.com>
Date:   Mon Jan 6 16:13:11 2014 +0100

    Add sipe/sipe protocol support
    
    Support for telepathy-sipe e.g. pidgin-sipe telepathy's backend support
    
    REVIEW: 114121
---
 plugins/CMakeLists.txt                             |   1 +
 plugins/{idle => sipe}/CMakeLists.txt              |  33 +++--
 plugins/{haze => sipe}/Messages.sh                 |   2 +-
 .../sipe/ktpaccountskcm_plugin_sipe.desktop.cmake  |  16 +++
 .../sipe-account-ui-plugin.cpp}                    |  33 ++---
 .../sipe-account-ui-plugin.h}                      |  16 +--
 .../sipe-account-ui.cpp}                           |  36 ++---
 .../haze-msn-account.h => sipe/sipe-account-ui.h}  |  20 +--
 .../sipe-advanced-options-widget.cpp}              |  24 ++--
 .../sipe-advanced-options-widget.h}                |  16 +--
 plugins/sipe/sipe-advanced-options-widget.ui       | 157 +++++++++++++++++++++
 .../{haze => sipe}/sipe-main-options-widget.cpp    |  25 ++++
 plugins/{haze => sipe}/sipe-main-options-widget.h  |   7 +-
 plugins/{haze => sipe}/sipe-main-options-widget.ui |   4 +-
 14 files changed, 291 insertions(+), 99 deletions(-)

diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index e752ef1..994fab4 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -6,3 +6,4 @@ macro_optional_add_subdirectory (rakia)
 macro_optional_add_subdirectory (salut)
 macro_optional_add_subdirectory (sunshine)
 macro_optional_add_subdirectory (pintxo)
+macro_optional_add_subdirectory (sipe)
diff --git a/plugins/idle/CMakeLists.txt b/plugins/sipe/CMakeLists.txt
similarity index 50%
copy from plugins/idle/CMakeLists.txt
copy to plugins/sipe/CMakeLists.txt
index 77b5db3..e63bb07 100644
--- a/plugins/idle/CMakeLists.txt
+++ b/plugins/sipe/CMakeLists.txt
@@ -1,26 +1,26 @@
-project (ktpaccountskcm-plugin-idle)
+project (ktpaccountskcm-plugin-sipe)
 
 include_directories (${CMAKE_CURRENT_BINARY_DIR}
                      ${CMAKE_CURRENT_SOURCE_DIR}
 )
 
-set (ktpaccountskcm_plugin_idle_SRCS
-     idle-account-ui-plugin.cpp
-     idle-account-ui.cpp
-     main-options-widget.cpp
-     advanced-options-widget.cpp
+set (ktpaccountskcm_plugin_sipe_SRCS
+     sipe-account-ui-plugin.cpp
+     sipe-account-ui.cpp
+     sipe-main-options-widget.cpp
+     sipe-advanced-options-widget.cpp
 )
 
-kde4_add_ui_files (ktpaccountskcm_plugin_idle_SRCS
-                   main-options-widget.ui
-                   advanced-options-widget.ui
+kde4_add_ui_files (ktpaccountskcm_plugin_sipe_SRCS
+                   sipe-main-options-widget.ui
+                   sipe-advanced-options-widget.ui
 )
 
-kde4_add_plugin (ktpaccountskcm_plugin_idle
-                 ${ktpaccountskcm_plugin_idle_SRCS}
+kde4_add_plugin (ktpaccountskcm_plugin_sipe
+                 ${ktpaccountskcm_plugin_sipe_SRCS}
 )
 
-target_link_libraries (ktpaccountskcm_plugin_idle
+target_link_libraries (ktpaccountskcm_plugin_sipe
                        ktpaccountskcminternal
                        ${QT_LIBRARIES}
                        ${KDE4_KDEUI_LIBS}
@@ -28,14 +28,13 @@ target_link_libraries (ktpaccountskcm_plugin_idle
 )
 
 # Install:
-install (TARGETS ktpaccountskcm_plugin_idle
+install (TARGETS ktpaccountskcm_plugin_sipe
          DESTINATION ${PLUGIN_INSTALL_DIR}
 )
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ktpaccountskcm_plugin_idle.desktop.cmake
-               ${CMAKE_CURRENT_BINARY_DIR}/ktpaccountskcm_plugin_idle.desktop
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ktpaccountskcm_plugin_sipe.desktop.cmake
+               ${CMAKE_CURRENT_BINARY_DIR}/ktpaccountskcm_plugin_sipe.desktop
                @ONLY)
 
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ktpaccountskcm_plugin_idle.desktop
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ktpaccountskcm_plugin_sipe.desktop
          DESTINATION ${SERVICES_INSTALL_DIR}
 )
diff --git a/plugins/haze/Messages.sh b/plugins/sipe/Messages.sh
old mode 100755
new mode 100644
similarity index 90%
copy from plugins/haze/Messages.sh
copy to plugins/sipe/Messages.sh
index e6231eb..12a679c
--- a/plugins/haze/Messages.sh
+++ b/plugins/sipe/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_haze.pot
+$XGETTEXT `find . -name "*.cpp"` -o $podir/kcmtelepathyaccounts_plugin_sipe.pot
 rm -f rc.cpp
diff --git a/plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake b/plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake
new file mode 100644
index 0000000..3373a2f
--- /dev/null
+++ b/plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Encoding=UTF-8
+Comment=Custom account configuration user interface for accounts using the sipe connection manager.
+Icon=blockdevice
+Name=Sipe Account Configuration User Interface
+Type=Service
+ServiceTypes=KTpAccountsKCM/AccountUiPlugin
+
+X-KDE-Library=ktpaccountskcm_plugin_sipe
+X-KDE-PluginInfo-Author=Maksim Melnikau
+X-KDE-PluginInfo-Email=maxposedon at gmail.com
+X-KDE-PluginInfo-Name=sipe
+X-KDE-PluginInfo-Version=@KTP_ACCOUNTS_KCM_VERSION@
+X-KDE-PluginInfo-Website=http://techbase.kde.org/Projects/Telepathy
+X-KDE-PluginInfo-License=LGPL
+X-KDE-PluginInfo-EnabledByDefault=true
diff --git a/plugins/idle/idle-account-ui-plugin.cpp b/plugins/sipe/sipe-account-ui-plugin.cpp
similarity index 51%
copy from plugins/idle/idle-account-ui-plugin.cpp
copy to plugins/sipe/sipe-account-ui-plugin.cpp
index 7cbad3c..e30b29a 100644
--- a/plugins/idle/idle-account-ui-plugin.cpp
+++ b/plugins/sipe/sipe-account-ui-plugin.cpp
@@ -1,7 +1,7 @@
 /*
- * This file is part of telepathy-accounts-kcm
+ * This file is part of telepathy-accounts-kcm-plugins
  *
- * Copyright (C) 2011 Lasse Liehu <lliehu at kolumbus.fi>
+ * Copyright (C) 2013 Maksim Melnikau <maxposedon 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,37 +18,38 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "idle-account-ui-plugin.h"
-
-#include "idle-account-ui.h"
+#include "sipe-account-ui-plugin.h"
+#include "sipe-account-ui.h"
 
 #include <KPluginFactory>
 
 #include <QtCore/QVariantList>
 
-IdleAccountUiPlugin::IdleAccountUiPlugin(QObject *parent, const QVariantList &)
+SipeAccountUiPlugin::SipeAccountUiPlugin(QObject *parent, const QVariantList &)
  : AbstractAccountUiPlugin(parent)
 {
-    // Register supported cm/protocol combinations
-    registerProvidedProtocol(QLatin1String("idle"), QLatin1String("irc"));
+    registerProvidedProtocol(QLatin1String("sipe"), QLatin1String("sipe"));
 }
 
-IdleAccountUiPlugin::~IdleAccountUiPlugin()
+SipeAccountUiPlugin::~SipeAccountUiPlugin()
 {
 }
 
-AbstractAccountUi* IdleAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName)
+AbstractAccountUi* SipeAccountUiPlugin::accountUi(
+    const QString &connectionManager,
+    const QString &protocol,
+    const QString &serviceName)
 {
     Q_UNUSED(serviceName);
 
-    if ((connectionManager == QLatin1String("idle")) && (protocol == QLatin1String("irc"))) {
-        return new IdleAccountUi;
+    if (connectionManager == QLatin1String("sipe") && protocol == QLatin1String("sipe")) {
+        AbstractAccountUi *sipeAccountUi = new SipeAccountUi(this);
+        return sipeAccountUi;
     }
-
     return 0;
 }
 
-K_PLUGIN_FACTORY(factory, registerPlugin<IdleAccountUiPlugin>();)
-K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_idle"))
+K_PLUGIN_FACTORY(factory, registerPlugin<SipeAccountUiPlugin>();)
+K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_sipe"))
 
-#include "idle-account-ui-plugin.moc"
+#include "sipe-account-ui-plugin.moc"
diff --git a/plugins/haze/haze-account-ui-plugin.h b/plugins/sipe/sipe-account-ui-plugin.h
similarity index 70%
copy from plugins/haze/haze-account-ui-plugin.h
copy to plugins/sipe/sipe-account-ui-plugin.h
index ac31ca4..8886242 100644
--- a/plugins/haze/haze-account-ui-plugin.h
+++ b/plugins/sipe/sipe-account-ui-plugin.h
@@ -1,7 +1,7 @@
 /*
- * This file is part of telepathy-accounts-kcm
+ * This file is part of telepathy-accounts-kcm-plugins
  *
- * Copyright (C) 2011 Dominik Schmidt <kde at dominik-schmidt.de>
+ * Copyright (C) 2013 Maksim Melnikau <maxposedon 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_ACCOUNT_UI_PLUGIN_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_ACCOUNT_UI_PLUGIN_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_ACCOUNT_UI_PLUGIN_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_ACCOUNT_UI_PLUGIN_H
 
 #include <KCMTelepathyAccounts/AbstractAccountUiPlugin>
 
 #include <QtCore/QVariantList>
 
-class HazeAccountUiPlugin : public AbstractAccountUiPlugin
+class SipeAccountUiPlugin : public AbstractAccountUiPlugin
 {
     Q_OBJECT
 
 public:
-    HazeAccountUiPlugin(QObject *parent, const QVariantList &);
-    virtual ~HazeAccountUiPlugin();
+    SipeAccountUiPlugin(QObject *parent, const QVariantList &);
+    virtual ~SipeAccountUiPlugin();
 
     virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName);
 
 private:
-    Q_DISABLE_COPY(HazeAccountUiPlugin);
+    Q_DISABLE_COPY(SipeAccountUiPlugin);
 };
 
 
diff --git a/plugins/haze/haze-sipe-account.cpp b/plugins/sipe/sipe-account-ui.cpp
similarity index 56%
copy from plugins/haze/haze-sipe-account.cpp
copy to plugins/sipe/sipe-account-ui.cpp
index 1867ae5..8e87418 100644
--- a/plugins/haze/haze-sipe-account.cpp
+++ b/plugins/sipe/sipe-account-ui.cpp
@@ -18,12 +18,12 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "haze-sipe-account.h"
+#include "sipe-account-ui.h"
 
 #include "sipe-main-options-widget.h"
-#include "sipe-advanced-settings-widget.h"
+#include "sipe-advanced-options-widget.h"
 
-HazeSipeAccountUi::HazeSipeAccountUi(QObject *parent)
+SipeAccountUi::SipeAccountUi(QObject *parent)
  : AbstractAccountUi(parent)
 {
     // Main Options
@@ -33,39 +33,33 @@ HazeSipeAccountUi::HazeSipeAccountUi(QObject *parent)
     // Advanced Options
     registerSupportedParameter(QLatin1String("login"), QVariant::String);
     registerSupportedParameter(QLatin1String("server"), QVariant::String);
+    registerSupportedParameter(QLatin1String("port"), QVariant::UInt);
     registerSupportedParameter(QLatin1String("transport"), QVariant::String);
     registerSupportedParameter(QLatin1String("useragent"), QVariant::String);
     registerSupportedParameter(QLatin1String("authentication"), QVariant::String);
-    registerSupportedParameter(QLatin1String("dont-publish"), QVariant::Bool);
-    registerSupportedParameter(QLatin1String("email-url"), QVariant::String);
-    registerSupportedParameter(QLatin1String("email"), QVariant::String);
-    registerSupportedParameter(QLatin1String("email-login"), QVariant::String);
-    registerSupportedParameter(QLatin1String("email-password"), QVariant::String);
-    registerSupportedParameter(QLatin1String("groupchat-user"), QVariant::String);
+    registerSupportedParameter(QLatin1String("single-sign-on"), QVariant::Bool);
+    registerSupportedParameter(QLatin1String("don't-publish-calendar"), QVariant::Bool);
 }
 
-HazeSipeAccountUi::~HazeSipeAccountUi()
+SipeAccountUi::~SipeAccountUi()
 {
 }
 
-AbstractAccountParametersWidget *HazeSipeAccountUi::mainOptionsWidget(
-    ParameterEditModel *model,
-    QWidget *parent) const
+AbstractAccountParametersWidget* SipeAccountUi::mainOptionsWidget(ParameterEditModel *model, QWidget *parent) const
 {
-    return new SipeMainOptionsWidget(model, parent);
+    AbstractAccountParametersWidget *sipeMainOptionsWidget = new SipeMainOptionsWidget(model, parent);
+    return sipeMainOptionsWidget;
 }
 
-bool HazeSipeAccountUi::hasAdvancedOptionsWidget() const
+bool SipeAccountUi::hasAdvancedOptionsWidget() const
 {
     return true;
 }
 
-AbstractAccountParametersWidget *HazeSipeAccountUi::advancedOptionsWidget(
-    ParameterEditModel *model,
-    QWidget *parent) const
+AbstractAccountParametersWidget *SipeAccountUi::advancedOptionsWidget(ParameterEditModel *model, QWidget *parent) const
 {
-    AbstractAccountParametersWidget *sipeAdvancedSettingsWidget = new SipeAdvancedSettingsWidget(model, parent);
-    return sipeAdvancedSettingsWidget;
+    AbstractAccountParametersWidget *sipeAdvancedOptionsWidget = new SipeAdvancedOptionsWidget(model, parent);
+    return sipeAdvancedOptionsWidget;
 }
 
-#include "haze-sipe-account.moc"
+#include "sipe-account-ui.moc"
diff --git a/plugins/haze/haze-msn-account.h b/plugins/sipe/sipe-account-ui.h
similarity index 62%
copy from plugins/haze/haze-msn-account.h
copy to plugins/sipe/sipe-account-ui.h
index d58f0fd..19dbf79 100644
--- a/plugins/haze/haze-msn-account.h
+++ b/plugins/sipe/sipe-account-ui.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2011 Francesco Nwokeka <francesco.nwokeka at gmail.com>
+ * Copyright (C) 2013 Maksim Melnikau <maxposedon 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_MSN_ACCOUNT_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_MSN_ACCOUNT_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_ACCOUNT_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_ACCOUNT_H
 
 #include <KCMTelepathyAccounts/AbstractAccountUi>
 
-class HazeMsnAccountUi: public AbstractAccountUi
+class SipeAccountUi : public AbstractAccountUi
 {
     Q_OBJECT
 
 public:
-    explicit HazeMsnAccountUi(QObject *parent = 0);
-    virtual ~HazeMsnAccountUi();
+    explicit SipeAccountUi(QObject *parent = 0);
+    virtual ~SipeAccountUi();
 
-//     virtual AbstractAccountParametersWidget *advancedOptionsWidget(ParameterEditModel *model, QWidget *parent = 0) const;
-    virtual AbstractAccountParametersWidget *mainOptionsWidget(ParameterEditModel *model, QWidget *parent = 0) const;
+    virtual AbstractAccountParametersWidget* mainOptionsWidget(ParameterEditModel *model, QWidget *parent = 0) const;
     virtual bool hasAdvancedOptionsWidget() const;
+    virtual AbstractAccountParametersWidget* advancedOptionsWidget(ParameterEditModel *model, QWidget *parent = 0) const;
 
 private:
-    Q_DISABLE_COPY(HazeMsnAccountUi);
+    Q_DISABLE_COPY(SipeAccountUi);
 };
 
-#endif // KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_MSN_ACCOUNT_H
+#endif // header guard
diff --git a/plugins/haze/sipe-advanced-settings-widget.cpp b/plugins/sipe/sipe-advanced-options-widget.cpp
similarity index 55%
copy from plugins/haze/sipe-advanced-settings-widget.cpp
copy to plugins/sipe/sipe-advanced-options-widget.cpp
index cff730e..d23455e 100644
--- a/plugins/haze/sipe-advanced-settings-widget.cpp
+++ b/plugins/sipe/sipe-advanced-options-widget.cpp
@@ -18,33 +18,29 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "sipe-advanced-settings-widget.h"
+#include "sipe-advanced-options-widget.h"
 
-SipeAdvancedSettingsWidget::SipeAdvancedSettingsWidget(ParameterEditModel *model,
-                                                                 QWidget *parent)
+SipeAdvancedOptionsWidget::SipeAdvancedOptionsWidget(ParameterEditModel *model, QWidget *parent)
  : AbstractAccountParametersWidget(model, parent)
 {
     // Set up the UI.
-    m_ui = new Ui::SipeAdvancedSettingsWidget;
+    m_ui = new Ui::SipeAdvancedOptionsWidget;
     m_ui->setupUi(this);
 
     //server
     handleParameter(QLatin1String("login"), QVariant::String, m_ui->loginLineEdit, m_ui->loginLabel);
     handleParameter(QLatin1String("server"), QVariant::String, m_ui->serverLineEdit, m_ui->serverLabel);
-    handleParameter(QLatin1String("transport"), QVariant::String, m_ui->transportLineEdit, m_ui->transportLabel);
+    handleParameter(QLatin1String("port"),   QVariant::UInt, m_ui->portSpinBox, m_ui->portLabel);
+    handleParameter(QLatin1String("transport"), QVariant::String, m_ui->transportComboBox, m_ui->transportLabel);
     handleParameter(QLatin1String("useragent"), QVariant::String, m_ui->useragentLineEdit, m_ui->useragentLabel);
-    handleParameter(QLatin1String("authentication"), QVariant::String, m_ui->authenticationLineEdit, m_ui->authenticationLabel);
-    handleParameter(QLatin1String("dont-publish"), QVariant::Bool, m_ui->dontpublishCheckBox, 0);
-    handleParameter(QLatin1String("email-url"), QVariant::String, m_ui->emailurlLineEdit, m_ui->emailurlLabel);
-    handleParameter(QLatin1String("email"), QVariant::String, m_ui->emailLineEdit, m_ui->emailLabel);
-    handleParameter(QLatin1String("email-login"), QVariant::String, m_ui->emailloginLineEdit, m_ui->emailloginLabel);
-    handleParameter(QLatin1String("email-password"), QVariant::String, m_ui->emailpasswordLineEdit, m_ui->emailpasswordLabel);
-    handleParameter(QLatin1String("groupchat-user"), QVariant::String, m_ui->groupchatuserLineEdit, m_ui->groupchatuserLabel);
+    handleParameter(QLatin1String("authentication"), QVariant::String, m_ui->authenticationComboBox, m_ui->authenticationLabel);
+    handleParameter(QLatin1String("single-sign-on"), QVariant::Bool, m_ui->singlesignonCheckBox, 0);
+    handleParameter(QLatin1String("don't-publish-calendar"), QVariant::Bool, m_ui->dontpublishcalendarCheckBox, 0);
 }
 
-SipeAdvancedSettingsWidget::~SipeAdvancedSettingsWidget()
+SipeAdvancedOptionsWidget::~SipeAdvancedOptionsWidget()
 {
     delete m_ui;
 }
 
-#include "sipe-advanced-settings-widget.moc"
+#include "sipe-advanced-options-widget.moc"
diff --git a/plugins/haze/sipe-advanced-settings-widget.h b/plugins/sipe/sipe-advanced-options-widget.h
similarity index 67%
copy from plugins/haze/sipe-advanced-settings-widget.h
copy to plugins/sipe/sipe-advanced-options-widget.h
index f1f049c..1e4abdb 100644
--- a/plugins/haze/sipe-advanced-settings-widget.h
+++ b/plugins/sipe/sipe-advanced-options-widget.h
@@ -18,24 +18,24 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_SIPE_SERVER_SETTINGS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_SIPE_SERVER_SETTINGS_WIDGET_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_ADVANCED_OPTIONS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_ADVANCED_OPTIONS_WIDGET_H
 
-#include "ui_sipe-advanced-settings-widget.h"
+#include "ui_sipe-advanced-options-widget.h"
 
 #include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
 
-class SipeAdvancedSettingsWidget : public AbstractAccountParametersWidget
+class SipeAdvancedOptionsWidget : public AbstractAccountParametersWidget
 {
     Q_OBJECT
 
 public:
-    explicit SipeAdvancedSettingsWidget(ParameterEditModel *model, QWidget *parent = 0);
-    virtual ~SipeAdvancedSettingsWidget();
+    explicit SipeAdvancedOptionsWidget(ParameterEditModel *model, QWidget *parent = 0);
+    virtual ~SipeAdvancedOptionsWidget();
 
 private:
-    Q_DISABLE_COPY(SipeAdvancedSettingsWidget);
-    Ui::SipeAdvancedSettingsWidget *m_ui;
+    Q_DISABLE_COPY(SipeAdvancedOptionsWidget);
+    Ui::SipeAdvancedOptionsWidget *m_ui;
 };
 
 
diff --git a/plugins/sipe/sipe-advanced-options-widget.ui b/plugins/sipe/sipe-advanced-options-widget.ui
new file mode 100644
index 0000000..67a7277
--- /dev/null
+++ b/plugins/sipe/sipe-advanced-options-widget.ui
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SipeAdvancedOptionsWidget</class>
+ <widget class="QWidget" name="SipeAdvancedOptionsWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>497</width>
+    <height>288</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Advanced Options</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="margin">
+    <number>4</number>
+   </property>
+   <item>
+    <layout class="QFormLayout" name="formLayout">
+     <property name="sizeConstraint">
+      <enum>QLayout::SetMinimumSize</enum>
+     </property>
+     <property name="fieldGrowthPolicy">
+      <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+     </property>
+     <item row="0" column="0">
+      <widget class="QLabel" name="loginLabel">
+       <property name="text">
+        <string>Login:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="KLineEdit" name="loginLineEdit"/>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="serverLabel">
+       <property name="text">
+        <string>Server:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="KLineEdit" name="serverLineEdit"/>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="portLabel">
+       <property name="text">
+        <string>Port:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="KIntSpinBox" name="portSpinBox"/>
+     </item>
+     <item row="3" column="0">
+      <widget class="QLabel" name="transportLabel">
+       <property name="text">
+        <string>Connection type:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <widget class="KComboBox" name="transportComboBox">
+       <item>
+        <property name="text">
+         <string>auto</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>ssl</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>tcp</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+     <item row="4" column="0">
+      <widget class="QLabel" name="useragentLabel">
+       <property name="text">
+        <string>User Agent:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1">
+      <widget class="KLineEdit" name="useragentLineEdit"/>
+     </item>
+     <item row="5" column="0">
+      <widget class="QLabel" name="authenticationLabel">
+       <property name="text">
+        <string>Authentication scheme:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="1">
+      <widget class="KComboBox" name="authenticationComboBox">
+       <item>
+        <property name="text">
+         <string>ntlm</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>krb5</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>tls-dsk</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="singlesignonCheckBox">
+     <property name="text">
+      <string>Single Sign On</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="dontpublishcalendarCheckBox">
+     <property name="text">
+      <string>Do not publish my calendar information</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KIntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/plugins/haze/sipe-main-options-widget.cpp b/plugins/sipe/sipe-main-options-widget.cpp
similarity index 54%
copy from plugins/haze/sipe-main-options-widget.cpp
copy to plugins/sipe/sipe-main-options-widget.cpp
index b04bc2e..f16369a 100644
--- a/plugins/haze/sipe-main-options-widget.cpp
+++ b/plugins/sipe/sipe-main-options-widget.cpp
@@ -31,6 +31,18 @@ SipeMainOptionsWidget::SipeMainOptionsWidget(ParameterEditModel *model, QWidget
 
     handleParameter(QLatin1String("account"),  QVariant::String, m_ui->accountLineEdit,  m_ui->accountLabel);
     handleParameter(QLatin1String("password"), QVariant::String, m_ui->passwordLineEdit, m_ui->passwordLabel);
+
+    // telepathy-sipe require login, but it just equals account in many cases, so
+    // let login will be optional (empty) in kcm when it equals to account
+    Tp::ProtocolParameter loginParameter = parameterModel()->parameter(QLatin1String("login"));
+    Tp::ProtocolParameter accountParameter = parameterModel()->parameter(QLatin1String("account"));
+    QString login = parameterModel()->indexForParameter(loginParameter).data().toString();
+    QString account = parameterModel()->indexForParameter(accountParameter).data().toString();
+    if (account==login) {
+        QModelIndex index = parameterModel()->indexForParameter(loginParameter);
+        QString empty(QLatin1String(""));
+        parameterModel()->setData(index, empty, Qt::EditRole);
+    }
 }
 
 SipeMainOptionsWidget::~SipeMainOptionsWidget()
@@ -43,4 +55,17 @@ QString SipeMainOptionsWidget::defaultDisplayName() const
     return m_ui->accountLineEdit->text();
 }
 
+void SipeMainOptionsWidget::submit()
+{
+    AbstractAccountParametersWidget::submit();
+
+    // if login is empty, copy account value to login
+    Tp::ProtocolParameter loginParameter = parameterModel()->parameter(QLatin1String("login"));
+    if (parameterModel()->indexForParameter(loginParameter).data().toString().isEmpty()) {
+        QString account = parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("account"))).data().toString();
+        QModelIndex index = parameterModel()->indexForParameter(loginParameter);
+        parameterModel()->setData(index, account, Qt::EditRole);
+    }
+}
+
 #include "sipe-main-options-widget.moc"
diff --git a/plugins/haze/sipe-main-options-widget.h b/plugins/sipe/sipe-main-options-widget.h
similarity index 89%
copy from plugins/haze/sipe-main-options-widget.h
copy to plugins/sipe/sipe-main-options-widget.h
index 92e063b..8af2ea4 100644
--- a/plugins/haze/sipe-main-options-widget.h
+++ b/plugins/sipe/sipe-main-options-widget.h
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_SIPE_ACCOUNT_PARAMETERS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_SIPE_ACCOUNT_PARAMETERS_WIDGET_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_MAIN_OPTIONS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_SIPE_MAIN_OPTIONS_WIDGET_H
 
 #include "ui_sipe-main-options-widget.h"
 
@@ -28,11 +28,14 @@
 class SipeMainOptionsWidget : public AbstractAccountParametersWidget
 {
     Q_OBJECT
+
 public:
     explicit SipeMainOptionsWidget(ParameterEditModel *model, QWidget *parent = 0);
     virtual ~SipeMainOptionsWidget();
 
     virtual QString defaultDisplayName() const;
+    virtual void submit();
+
 private:
     Q_DISABLE_COPY(SipeMainOptionsWidget);
     Ui::SipeMainOptionsWidget *m_ui;
diff --git a/plugins/haze/sipe-main-options-widget.ui b/plugins/sipe/sipe-main-options-widget.ui
similarity index 97%
copy from plugins/haze/sipe-main-options-widget.ui
copy to plugins/sipe/sipe-main-options-widget.ui
index 5025cec..00aa09e 100644
--- a/plugins/haze/sipe-main-options-widget.ui
+++ b/plugins/sipe/sipe-main-options-widget.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>58</height>
+    <width>360</width>
+    <height>80</height>
    </rect>
   </property>
   <property name="sizePolicy">

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list