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

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 23:58:35 UTC 2016


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

The following commit has been merged in the master branch:
commit 9d74c85177fcbdb642e9f9b5e1f8da200dcac8ab
Author: Lasse Liehu <lliehu at kolumbus.fi>
Date:   Sun Jan 9 01:54:53 2011 +0200

    Initial Idle/IRC configuration plugin
---
 CMakeLists.txt                                     |   2 +-
 idle/CMakeLists.txt                                |  37 +++++
 {gabble => idle}/Messages.sh                       |   2 +-
 idle/advanced-options-widget.cpp                   | 168 +++++++++++++++++++++
 {gabble => idle}/advanced-options-widget.h         |  11 +-
 .../advanced-options-widget.ui                     |  81 +++++++---
 .../idle-account-ui-plugin.cpp                     |  26 ++--
 .../idle-account-ui-plugin.h                       |  12 +-
 .../idle-account-ui.cpp                            |  41 ++---
 .../gabble-account-ui.h => idle/idle-account-ui.h  |  16 +-
 .../kcmtelepathyaccounts_plugin_idle.desktop       |  16 +-
 {butterfly => idle}/main-options-widget.cpp        |  73 ++++++---
 {butterfly => idle}/main-options-widget.h          |   4 +-
 idle/main-options-widget.ui                        | 103 +++++++++++++
 14 files changed, 483 insertions(+), 109 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a102d9..06b4322 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,4 +22,4 @@ include_directories (${KDE4_INCLUDES}
 
 add_subdirectory (gabble)
 add_subdirectory (butterfly)
-
+add_subdirectory (idle)
diff --git a/idle/CMakeLists.txt b/idle/CMakeLists.txt
new file mode 100644
index 0000000..0dae885
--- /dev/null
+++ b/idle/CMakeLists.txt
@@ -0,0 +1,37 @@
+project (kcmtelepathyaccounts-plugin-idle)
+
+include_directories (${CMAKE_CURRENT_BINARY_DIR}
+                     ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set (kcmtelepathyaccounts_plugin_idle_SRCS
+     idle-account-ui-plugin.cpp
+     idle-account-ui.cpp
+     main-options-widget.cpp
+     advanced-options-widget.cpp
+)
+
+kde4_add_ui_files (kcmtelepathyaccounts_plugin_idle_SRCS
+                   main-options-widget.ui
+                   advanced-options-widget.ui
+)
+
+kde4_add_plugin (kcmtelepathyaccounts_plugin_idle
+                 ${kcmtelepathyaccounts_plugin_idle_SRCS}
+)
+
+target_link_libraries (kcmtelepathyaccounts_plugin_idle
+                       ${KCMTELEPATHYACCOUNTS_LIBRARIES}
+                       ${QT_LIBRARIES}
+                       ${KDE4_KDEUI_LIBS}
+                       ${TELEPATHY_QT4_LIBRARIES}
+)
+
+# Install:
+install (TARGETS kcmtelepathyaccounts_plugin_idle
+         DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+install (FILES kcmtelepathyaccounts_plugin_idle.desktop
+         DESTINATION ${SERVICES_INSTALL_DIR}
+)
diff --git a/gabble/Messages.sh b/idle/Messages.sh
similarity index 89%
copy from gabble/Messages.sh
copy to idle/Messages.sh
index c8d9bbc..e25d8b5 100755
--- a/gabble/Messages.sh
+++ b/idle/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_gabble.pot
+$XGETTEXT `find . -name "*.cpp"` -o $podir/kcmtelepathyaccounts_plugin_idle.pot
 rm -f rc.cpp
diff --git a/idle/advanced-options-widget.cpp b/idle/advanced-options-widget.cpp
new file mode 100644
index 0000000..69f1de2
--- /dev/null
+++ b/idle/advanced-options-widget.cpp
@@ -0,0 +1,168 @@
+/*
+ * This file is part of telepathy-accounts-kcm
+ *
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * 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 "advanced-options-widget.h"
+
+#include "ui_advanced-options-widget.h"
+
+#include <KDebug>
+#include <KMessageBox>
+#include <KCMTelepathyAccounts/ProtocolParameterValue>
+
+class AdvancedOptionsWidget::Private
+{
+public:
+    Private()
+            : ui(0)
+    {
+        kDebug();
+    }
+
+    Tp::ProtocolParameter charsetParameter;
+    Tp::ProtocolParameter portParameter;
+    Tp::ProtocolParameter passwordParameter;
+    Tp::ProtocolParameter useSslParameter;
+
+    Ui::AdvancedOptionsWidget *ui;
+};
+
+AdvancedOptionsWidget::AdvancedOptionsWidget(
+        Tp::ProtocolParameterList parameters, const QVariantMap &values,
+        QWidget *parent)
+         : AbstractAccountParametersWidget(parameters, values, parent),
+           d(new Private)
+{
+    kDebug();
+
+    // Store the parameters this widget supports
+    foreach (const Tp::ProtocolParameter &parameter, parameters) {
+        if ((parameter.name() == "charset") && (parameter.type() == QVariant::String)) {
+           d->charsetParameter = parameter;
+        } else if ((parameter.name() == "port") && (parameter.type() == QVariant::UInt)) {
+           d->portParameter = parameter;
+        } else if ((parameter.name() == "password") && (parameter.type() == QVariant::String)) {
+           d->passwordParameter = parameter;
+        } else if ((parameter.name() == "use-ssl") && (parameter.type() == QVariant::Bool)) {
+           d->useSslParameter = parameter;
+        }
+    }
+
+    // Set up the UI.
+    d->ui = new Ui::AdvancedOptionsWidget;
+    d->ui->setupUi(this);
+
+   // Prefill UI elements if appropriate.
+   if (d->charsetParameter.isValid()) {
+       if (values.contains(d->charsetParameter.name())) {
+           d->ui->charsetLineEdit->setText(values.value(d->charsetParameter.name()).toString());
+       } else {
+           d->ui->charsetLineEdit->setText(d->charsetParameter.defaultValue().toString());
+       }
+   }
+
+   if (d->portParameter.isValid()) {
+       if (values.contains(d->portParameter.name())) {
+           d->ui->portSpinBox->setValue(values.value(d->portParameter.name()).toUInt());
+       } else {
+           d->ui->portSpinBox->setValue(d->portParameter.defaultValue().toUInt());
+       }
+   }
+
+   if (d->useSslParameter.isValid()) {
+       if (values.contains(d->useSslParameter.name())) {
+           d->ui->useSslCheckBox->setChecked(values.value(d->useSslParameter.name()).toBool());
+       } else {
+           d->ui->useSslCheckBox->setChecked(d->useSslParameter.defaultValue().toBool());
+       }
+   }
+
+   if (d->passwordParameter.isValid()) {
+       if (values.contains(d->passwordParameter.name())) {
+           d->ui->passwordLineEdit->setText(values.value(d->passwordParameter.name()).toString());
+       } else {
+           d->ui->passwordLineEdit->setText(d->passwordParameter.defaultValue().toString());
+       }
+   }
+
+   // Hide any elements we don't have the parameters passed to show.
+  if (!d->charsetParameter.isValid()) {
+       d->ui->charsetLabel->hide();
+       d->ui->charsetLineEdit->hide();
+   }
+
+  if (!d->portParameter.isValid()) {
+       d->ui->portLabel->hide();
+       d->ui->portSpinBox->hide();
+   }
+
+  if (!d->useSslParameter.isValid()) {
+       d->ui->useSslLabel->hide();
+       d->ui->useSslCheckBox->hide();
+   }
+
+   if (!d->passwordParameter.isValid()) {
+       d->ui->passwordLabel->hide();
+       d->ui->passwordLineEdit->hide();
+   }
+}
+
+AdvancedOptionsWidget::~AdvancedOptionsWidget()
+{
+    kDebug();
+
+    delete d;
+}
+
+QList<ProtocolParameterValue> AdvancedOptionsWidget::parameterValues() const
+{
+    kDebug();
+
+    QList<ProtocolParameterValue> parameters;
+
+    // Populate the map of parameters and their values with all the parameters this widget contains.
+    if (d->charsetParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->charsetParameter, d->ui->charsetLineEdit->text()));
+    }
+
+    if (d->portParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->portParameter, d->ui->portSpinBox->value()));
+    }
+
+    if (d->useSslParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->useSslParameter, d->ui->useSslCheckBox->isChecked()));
+    }
+
+    if (d->passwordParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->passwordParameter, d->ui->passwordLineEdit->text()));
+    }
+
+    return parameters;
+}
+
+bool AdvancedOptionsWidget::validateParameterValues()
+{
+    kDebug();
+
+
+    return true;
+}
+
+#include "advanced-options-widget.moc"
+
diff --git a/gabble/advanced-options-widget.h b/idle/advanced-options-widget.h
similarity index 78%
copy from gabble/advanced-options-widget.h
copy to idle/advanced-options-widget.h
index e38f844..d6a31e2 100644
--- a/gabble/advanced-options-widget.h
+++ b/idle/advanced-options-widget.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ADVANCED_PARAMETERS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ADVANCED_PARAMETERS_WIDGET_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_ADVANCED_PARAMETERS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_ADVANCED_PARAMETERS_WIDGET_H
 
 #include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
 
@@ -29,8 +29,8 @@ class AdvancedOptionsWidget : public AbstractAccountParametersWidget
 
 public:
     explicit AdvancedOptionsWidget(Tp::ProtocolParameterList parameters,
-                                   const QVariantMap &values = QVariantMap(),
-                                   QWidget *parent = 0);
+                               const QVariantMap &values = QVariantMap(),
+                               QWidget *parent = 0);
     virtual ~AdvancedOptionsWidget();
 
     virtual QList<ProtocolParameterValue> parameterValues() const;
@@ -43,5 +43,6 @@ private:
     Private * const d;
 };
 
+
 #endif // header guard
 
diff --git a/butterfly/main-options-widget.ui b/idle/advanced-options-widget.ui
similarity index 50%
copy from butterfly/main-options-widget.ui
copy to idle/advanced-options-widget.ui
index 672d561..8ded8e5 100644
--- a/butterfly/main-options-widget.ui
+++ b/idle/advanced-options-widget.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>MainOptionsWidget</class>
- <widget class="QWidget" name="MainOptionsWidget">
+ <class>AdvancedOptionsWidget</class>
+ <widget class="QWidget" name="AdvancedOptionsWidget">
   <property name="geometry">
    <rect>
     <x>0</x>
@@ -18,23 +18,6 @@
     <enum>QFormLayout::ExpandingFieldsGrow</enum>
    </property>
    <item row="0" column="0">
-    <widget class="QLabel" name="accountLabel">
-     <property name="text">
-      <string>Email Address</string>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="KLineEdit" name="accountLineEdit">
-     <property name="showClearButton" stdset="0">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0">
     <widget class="QLabel" name="passwordLabel">
      <property name="text">
       <string>Password:</string>
@@ -42,9 +25,12 @@
      <property name="alignment">
       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
      </property>
+     <property name="buddy">
+      <cstring>passwordLineEdit</cstring>
+     </property>
     </widget>
    </item>
-   <item row="2" column="1">
+   <item row="0" column="1">
     <widget class="KLineEdit" name="passwordLineEdit">
      <property name="echoMode">
       <enum>QLineEdit::Password</enum>
@@ -58,9 +44,49 @@
     </widget>
    </item>
    <item row="1" column="1">
-    <widget class="QLabel" name="label">
+    <widget class="QCheckBox" name="useSslCheckBox">
      <property name="text">
-      <string>Example: user at hotmail.com</string>
+      <string/>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QLabel" name="useSslLabel">
+     <property name="text">
+      <string>Use SSL?</string>
+     </property>
+     <property name="buddy">
+      <cstring>useSslCheckBox</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="KLineEdit" name="charsetLineEdit"/>
+   </item>
+   <item row="3" column="0">
+    <widget class="QLabel" name="charsetLabel">
+     <property name="text">
+      <string>Character Set:</string>
+     </property>
+     <property name="buddy">
+      <cstring>charsetLineEdit</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="portLabel">
+     <property name="text">
+      <string>Server Port:</string>
+     </property>
+     <property name="buddy">
+      <cstring>portSpinBox</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="KIntSpinBox" name="portSpinBox">
+     <property name="maximum">
+      <number>65535</number>
      </property>
     </widget>
    </item>
@@ -68,11 +94,22 @@
  </widget>
  <customwidgets>
   <customwidget>
+   <class>KIntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+  <customwidget>
    <class>KLineEdit</class>
    <extends>QLineEdit</extends>
    <header>klineedit.h</header>
   </customwidget>
  </customwidgets>
+ <tabstops>
+  <tabstop>passwordLineEdit</tabstop>
+  <tabstop>useSslCheckBox</tabstop>
+  <tabstop>charsetLineEdit</tabstop>
+  <tabstop>portSpinBox</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/butterfly/butterfly-account-ui-plugin.cpp b/idle/idle-account-ui-plugin.cpp
similarity index 62%
copy from butterfly/butterfly-account-ui-plugin.cpp
copy to idle/idle-account-ui-plugin.cpp
index 83c665d..03569ca 100644
--- a/butterfly/butterfly-account-ui-plugin.cpp
+++ b/idle/idle-account-ui-plugin.cpp
@@ -18,9 +18,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "butterfly-account-ui-plugin.h"
+#include "idle-account-ui-plugin.h"
 
-#include "butterfly-account-ui.h"
+#include "idle-account-ui.h"
 
 #include <KCMTelepathyAccounts/PluginMacros>
 
@@ -31,7 +31,7 @@
 
 #include <KCMTelepathyAccounts/ProtocolParameterValue>
 
-class ButterflyAccountUiPlugin::Private
+class IdleAccountUiPlugin::Private
 {
 public:
     Private()
@@ -40,38 +40,38 @@ public:
     }
 };
 
-ButterflyAccountUiPlugin::ButterflyAccountUiPlugin(QObject *parent, const QVariantList &)
+IdleAccountUiPlugin::IdleAccountUiPlugin(QObject *parent, const QVariantList &)
  : AbstractAccountUiPlugin(parent),
    d(new Private)
 {
     kDebug();
 
     // Register supported cm/protocol combinations
-    registerProvidedProtocol("butterfly", "msn");
+    registerProvidedProtocol("idle", "irc");
 }
 
-ButterflyAccountUiPlugin::~ButterflyAccountUiPlugin()
+IdleAccountUiPlugin::~IdleAccountUiPlugin()
 {
     kDebug();
 }
 
-AbstractAccountUi* ButterflyAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol)
+AbstractAccountUi* IdleAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol)
 {
     kDebug();
     
     // We only support butterfly/xmpp combination.
-    if ((connectionManager == "butterfly") && (protocol == "msn")) {
-        return new ButterflyAccountUi;
+    if ((connectionManager == "idle") && (protocol == "irc")) {
+        return new IdleAccountUi;
     }
 
     return 0;
 }
 
 
-//KCMTELEPATHYACCOUNTS_PLUGIN_EXPORT("butterfly", "ButterflyAccountUiPlugin")
-  K_PLUGIN_FACTORY(factory, registerPlugin<ButterflyAccountUiPlugin>();) \
-  K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_butterfly"))
+//KCMTELEPATHYACCOUNTS_PLUGIN_EXPORT("idle", "IdleAccountUiPlugin")
+  K_PLUGIN_FACTORY(factory, registerPlugin<IdleAccountUiPlugin>();) \
+  K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_idle"))
 
 
-#include "butterfly-account-ui-plugin.moc"
+#include "idle-account-ui-plugin.moc"
 
diff --git a/gabble/gabble-account-ui-plugin.h b/idle/idle-account-ui-plugin.h
similarity index 77%
copy from gabble/gabble-account-ui-plugin.h
copy to idle/idle-account-ui-plugin.h
index 9b343ac..f38caab 100644
--- a/gabble/gabble-account-ui-plugin.h
+++ b/idle/idle-account-ui-plugin.h
@@ -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_IDLE_ACCOUNT_UI_PLUGIN_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_UI_PLUGIN_H
 
 #include <KCMTelepathyAccounts/AbstractAccountUiPlugin>
 
 #include <QVariantList>
 
-class GabbleAccountUiPlugin : public AbstractAccountUiPlugin
+class IdleAccountUiPlugin : public AbstractAccountUiPlugin
 {
     Q_OBJECT
 
 public:
-    GabbleAccountUiPlugin(QObject *parent, const QVariantList &);
-    virtual ~GabbleAccountUiPlugin();
+    IdleAccountUiPlugin(QObject *parent, const QVariantList &);
+    virtual ~IdleAccountUiPlugin();
 
     virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol);
 
 private:
-    Q_DISABLE_COPY(GabbleAccountUiPlugin);
+    Q_DISABLE_COPY(IdleAccountUiPlugin);
 
     class Private;
     Private * const d;
diff --git a/gabble/gabble-account-ui.cpp b/idle/idle-account-ui.cpp
similarity index 59%
copy from gabble/gabble-account-ui.cpp
copy to idle/idle-account-ui.cpp
index 8212e4f..227e266 100644
--- a/gabble/gabble-account-ui.cpp
+++ b/idle/idle-account-ui.cpp
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "gabble-account-ui.h"
+#include "idle-account-ui.h"
 
 #include "main-options-widget.h"
 #include "advanced-options-widget.h"
@@ -27,7 +27,7 @@
 
 #include <KDebug>
 
-class GabbleAccountUi::Private
+class IdleAccountUi::Private
 {
 public:
     Private()
@@ -36,7 +36,7 @@ public:
     }
 };
 
-GabbleAccountUi::GabbleAccountUi(QObject *parent)
+IdleAccountUi::IdleAccountUi(QObject *parent)
  : AbstractAccountUi(parent),
    d(new Private)
 {
@@ -44,34 +44,24 @@ GabbleAccountUi::GabbleAccountUi(QObject *parent)
 
     // Register supported parameters
     registerSupportedParameter("account", QVariant::String);
-    registerSupportedParameter("password", QVariant::String);
-
-    registerSupportedParameter("port", QVariant::UInt);
     registerSupportedParameter("server", QVariant::String);
-    registerSupportedParameter("require-encryption", QVariant::Bool);
-    registerSupportedParameter("old-ssl", QVariant::Bool);
-    registerSupportedParameter("low-bandwidth", QVariant::Bool);
-    registerSupportedParameter("ignore-ssl-errors", QVariant::Bool);
-    registerSupportedParameter("keepalive-interval", QVariant::UInt);
-
-    registerSupportedParameter("stun-server", QVariant::String);
-    registerSupportedParameter("stun-port", QVariant::UInt);
-    registerSupportedParameter("fallback-stun-server", QVariant::String);
-    registerSupportedParameter("fallback-stun-port", QVariant::UInt);
-    registerSupportedParameter("https-proxy-server", QVariant::String);
-    registerSupportedParameter("https-proxy-port", QVariant::UInt);
-    registerSupportedParameter("fallback-socks5-proxies", QVariant::StringList);
-    registerSupportedParameter("fallback-conference-server", QVariant::String);
+    registerSupportedParameter("port", QVariant::UInt);
+    registerSupportedParameter("username", QVariant::String);
+    registerSupportedParameter("password", QVariant::String);
+    registerSupportedParameter("fullname", QVariant::String);
+    registerSupportedParameter("use-ssl", QVariant::Bool);
+    registerSupportedParameter("charset", QVariant::String);
+//     registerSupportedParameter("quit-message", QVariant::String);
 }
 
-GabbleAccountUi::~GabbleAccountUi()
+IdleAccountUi::~IdleAccountUi()
 {
     kDebug();
 
     delete d;
 }
 
-AbstractAccountParametersWidget *GabbleAccountUi::mainOptionsWidget(
+AbstractAccountParametersWidget *IdleAccountUi::mainOptionsWidget(
         Tp::ProtocolParameterList parameters,
         const QVariantMap &values,
         QWidget *parent) const
@@ -81,12 +71,12 @@ AbstractAccountParametersWidget *GabbleAccountUi::mainOptionsWidget(
     return new MainOptionsWidget(parameters, values, parent);
 }
 
-bool GabbleAccountUi::hasAdvancedOptionsWidget() const
+bool IdleAccountUi::hasAdvancedOptionsWidget() const
 {
     return true;
 }
 
-AbstractAccountParametersWidget *GabbleAccountUi::advancedOptionsWidget(
+AbstractAccountParametersWidget *IdleAccountUi::advancedOptionsWidget(
         Tp::ProtocolParameterList parameters,
         const QVariantMap &values,
         QWidget *parent) const
@@ -96,6 +86,5 @@ AbstractAccountParametersWidget *GabbleAccountUi::advancedOptionsWidget(
     return new AdvancedOptionsWidget(parameters, values, parent);
 }
 
-
-#include "gabble-account-ui.moc"
+#include "idle-account-ui.moc"
 
diff --git a/gabble/gabble-account-ui.h b/idle/idle-account-ui.h
similarity index 83%
copy from gabble/gabble-account-ui.h
copy to idle/idle-account-ui.h
index 73bdbdc..8fee94a 100644
--- a/gabble/gabble-account-ui.h
+++ b/idle/idle-account-ui.h
@@ -18,18 +18,18 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ACCOUNT_UI_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ACCOUNT_UI_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_UI_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_UI_H
 
 #include <KCMTelepathyAccounts/AbstractAccountUi>
 
-class GabbleAccountUi : public AbstractAccountUi
+class IdleAccountUi : public AbstractAccountUi
 {
     Q_OBJECT
 
 public:
-    explicit GabbleAccountUi(QObject *parent = 0);
-    virtual ~GabbleAccountUi();
+    explicit IdleAccountUi(QObject *parent = 0);
+    virtual ~IdleAccountUi();
 
     virtual AbstractAccountParametersWidget
               *mainOptionsWidget(Tp::ProtocolParameterList parameters,
@@ -39,14 +39,14 @@ public:
     virtual AbstractAccountParametersWidget
               *advancedOptionsWidget(Tp::ProtocolParameterList parameters,
                                      const QVariantMap &values = QVariantMap(),
-                                     QWidget *parent = 0) const;
-
+                                     QWidget *parent = 0) const;                                 
 private:
-    Q_DISABLE_COPY(GabbleAccountUi);
+    Q_DISABLE_COPY(IdleAccountUi);
 
     class Private;
     Private * const d;
 };
 
+
 #endif // header guard
 
diff --git a/butterfly/kcmtelepathyaccounts_plugin_butterfly.desktop b/idle/kcmtelepathyaccounts_plugin_idle.desktop
similarity index 70%
copy from butterfly/kcmtelepathyaccounts_plugin_butterfly.desktop
copy to idle/kcmtelepathyaccounts_plugin_idle.desktop
index e6330a0..e69f640 100644
--- a/butterfly/kcmtelepathyaccounts_plugin_butterfly.desktop
+++ b/idle/kcmtelepathyaccounts_plugin_idle.desktop
@@ -1,18 +1,18 @@
 [Desktop Entry]
 Encoding=UTF-8
-Comment=Custom account configuration user interface for accounts using the Butterfly connection manager.
-Comment[pt]=Interface de configuração de contas personalizadas, usando o gestor de ligações Butterfly.
-Comment[pt_BR]=Interface de configuração de contas personalizadas, usando o gerenciador de conexão Butterfly.
-Comment[sv]=Användargränssnitt för anpassad kontoinställning av konton som använder anslutningshanteraren Butterfly.
-Comment[uk]=Інтерфейс користувача для нетипового налаштування облікового запису за допомогою керування з’єднаннями Butterfly.
-Comment[x-test]=xxCustom account configuration user interface for accounts using the Butterfly connection manager.xx
+Comment=Custom account configuration user interface for accounts using the Idle connection manager.
+Comment[pt]=Interface de configuração de contas personalizadas, usando o gestor de ligações Idle.
+Comment[pt_BR]=Interface de configuração de contas personalizadas, usando o gerenciador de conexão Idle.
+Comment[sv]=Användargränssnitt för anpassad kontoinställning av konton som använder anslutningshanteraren Idle.
+Comment[uk]=Інтерфейс користувача для нетипового налаштування облікового запису за допомогою керування з’єднаннями Idle.
+Comment[x-test]=xxCustom account configuration user interface for accounts using the Idle connection manager.xx
 Type=Service
 ServiceTypes=KCMTelepathyAccounts/AccountUiPlugin
 
-X-KDE-Library=kcmtelepathyaccounts_plugin_butterfly
+X-KDE-Library=kcmtelepathyaccounts_plugin_idle
 X-KDE-PluginInfo-Author=David Edmundson
 X-KDE-PluginInfo-Email=kde at davidedmundson.co.uk
-X-KDE-PluginInfo-Name=butterfly
+X-KDE-PluginInfo-Name=idle
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-Website=http://techbase.kde.org/Projects/Telepathy
 X-KDE-PluginInfo-License=GPL
diff --git a/butterfly/main-options-widget.cpp b/idle/main-options-widget.cpp
similarity index 55%
copy from butterfly/main-options-widget.cpp
copy to idle/main-options-widget.cpp
index 9f38a02..ee605bb 100644
--- a/butterfly/main-options-widget.cpp
+++ b/idle/main-options-widget.cpp
@@ -36,16 +36,18 @@ public:
     }
 
     Tp::ProtocolParameter accountParameter;
-    Tp::ProtocolParameter passwordParameter;
+    Tp::ProtocolParameter fullnameParameter;
+    Tp::ProtocolParameter usernameParameter;
+    Tp::ProtocolParameter serverParameter;
 
     Ui::MainOptionsWidget *ui;
 };
 
 MainOptionsWidget::MainOptionsWidget(Tp::ProtocolParameterList parameters,
-                                                     const QVariantMap &values,
-                                                     QWidget *parent)
- : AbstractAccountParametersWidget(parameters, values, parent),
-   d(new Private)
+        const QVariantMap &values,
+        QWidget *parent)
+         : AbstractAccountParametersWidget(parameters, values, parent),
+           d(new Private)
 {
     kDebug();
 
@@ -53,8 +55,12 @@ MainOptionsWidget::MainOptionsWidget(Tp::ProtocolParameterList parameters,
     foreach (const Tp::ProtocolParameter &parameter, parameters) {
         if ((parameter.name() == "account") && (parameter.type() == QVariant::String)) {
            d->accountParameter = parameter;
-        } else if ((parameter.name() == "password") && (parameter.type() == QVariant::String)) {
-           d->passwordParameter = parameter;
+        } else if ((parameter.name() == "fullname") && (parameter.type() == QVariant::String)) {
+          d->fullnameParameter = parameter;
+        } else if ((parameter.name() == "username") && (parameter.type() == QVariant::String)) {
+          d->usernameParameter = parameter;
+        } else if ((parameter.name() == "server") && (parameter.type() == QVariant::String)) {
+          d->serverParameter = parameter;
         }
     }
 
@@ -71,11 +77,27 @@ MainOptionsWidget::MainOptionsWidget(Tp::ProtocolParameterList parameters,
        }
    }
 
-   if (d->passwordParameter.isValid()) {
-       if (values.contains(d->passwordParameter.name())) {
-           d->ui->passwordLineEdit->setText(values.value(d->passwordParameter.name()).toString());
+   if (d->fullnameParameter.isValid()) {
+       if (values.contains(d->fullnameParameter.name())) {
+           d->ui->fullnameLineEdit->setText(values.value(d->fullnameParameter.name()).toString());
        } else {
-           d->ui->passwordLineEdit->setText(d->passwordParameter.defaultValue().toString());
+           d->ui->fullnameLineEdit->setText(d->fullnameParameter.defaultValue().toString());
+       }
+   }
+
+   if (d->serverParameter.isValid()) {
+       if (values.contains(d->serverParameter.name())) {
+           d->ui->serverLineEdit->setText(values.value(d->serverParameter.name()).toString());
+       } else {
+           d->ui->serverLineEdit->setText(d->serverParameter.defaultValue().toString());
+       }
+   }
+
+   if (d->usernameParameter.isValid()) {
+       if (values.contains(d->usernameParameter.name())) {
+           d->ui->usernameLineEdit->setText(values.value(d->usernameParameter.name()).toString());
+       } else {
+           d->ui->usernameLineEdit->setText(d->usernameParameter.defaultValue().toString());
        }
    }
 
@@ -85,9 +107,19 @@ MainOptionsWidget::MainOptionsWidget(Tp::ProtocolParameterList parameters,
        d->ui->accountLineEdit->hide();
    }
 
-   if (!d->passwordParameter.isValid()) {
-       d->ui->passwordLabel->hide();
-       d->ui->passwordLineEdit->hide();
+   if (!d->fullnameParameter.isValid()) {
+       d->ui->fullnameLabel->hide();
+       d->ui->fullnameLineEdit->hide();
+   }
+
+   if (!d->usernameParameter.isValid()) {
+       d->ui->usernameLabel->hide();
+       d->ui->usernameLineEdit->hide();
+   }
+
+   if (!d->serverParameter.isValid()) {
+       d->ui->serverLabel->hide();
+       d->ui->serverLineEdit->hide();
    }
 }
 
@@ -109,8 +141,16 @@ QList<ProtocolParameterValue> MainOptionsWidget::parameterValues() const
         parameters.append(ProtocolParameterValue(d->accountParameter, d->ui->accountLineEdit->text()));
     }
 
-    if (d->passwordParameter.isValid()) {
-        parameters.append(ProtocolParameterValue(d->passwordParameter, d->ui->passwordLineEdit->text()));
+    if (d->fullnameParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->fullnameParameter, d->ui->fullnameLineEdit->text()));
+    }
+
+    if (d->usernameParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->usernameParameter, d->ui->usernameLineEdit->text()));
+    }
+
+    if (d->serverParameter.isValid()) {
+        parameters.append(ProtocolParameterValue(d->serverParameter, d->ui->serverLineEdit->text()));
     }
 
     return parameters;
@@ -125,4 +165,3 @@ bool MainOptionsWidget::validateParameterValues()
 }
 
 #include "main-options-widget.moc"
-
diff --git a/butterfly/main-options-widget.h b/idle/main-options-widget.h
similarity index 92%
copy from butterfly/main-options-widget.h
copy to idle/main-options-widget.h
index 7678fad..481c45a 100644
--- a/butterfly/main-options-widget.h
+++ b/idle/main-options-widget.h
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_BUTTERFLY_ACCOUNT_PARAMETERS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_BUTTERFLY_ACCOUNT_PARAMETERS_WIDGET_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_MAIN_PARAMETERS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_IDLE_ACCOUNT_MAIN_PARAMETERS_WIDGET_H
 
 #include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
 
diff --git a/idle/main-options-widget.ui b/idle/main-options-widget.ui
new file mode 100644
index 0000000..9a75db4
--- /dev/null
+++ b/idle/main-options-widget.ui
@@ -0,0 +1,103 @@
+<?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>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Account Preferences</string>
+  </property>
+  <layout class="QFormLayout" name="formLayout">
+   <property name="fieldGrowthPolicy">
+    <enum>QFormLayout::ExpandingFieldsGrow</enum>
+   </property>
+   <item row="0" column="0">
+    <widget class="QLabel" name="serverLabel">
+     <property name="text">
+      <string>Server address:</string>
+     </property>
+     <property name="buddy">
+      <cstring>serverLineEdit</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="KLineEdit" name="serverLineEdit"/>
+   </item>
+   <item row="1" column="1">
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>Example: chat.freenode.net</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QLabel" name="accountLabel">
+     <property name="text">
+      <string>Account (nick?):</string>
+     </property>
+     <property name="buddy">
+      <cstring>accountLineEdit</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="KLineEdit" name="accountLineEdit"/>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="usernameLabel">
+     <property name="text">
+      <string>Username:</string>
+     </property>
+     <property name="buddy">
+      <cstring>usernameLineEdit</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="KLineEdit" name="usernameLineEdit"/>
+   </item>
+   <item row="6" column="0">
+    <widget class="QLabel" name="fullnameLabel">
+     <property name="text">
+      <string>Real name:</string>
+     </property>
+     <property name="buddy">
+      <cstring>fullnameLineEdit</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1">
+    <widget class="KLineEdit" name="fullnameLineEdit"/>
+   </item>
+   <item row="7" column="1">
+    <widget class="QLabel" name="label_2">
+     <property name="text">
+      <string>Real name can be left empty.</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>serverLineEdit</tabstop>
+  <tabstop>accountLineEdit</tabstop>
+  <tabstop>usernameLineEdit</tabstop>
+  <tabstop>fullnameLineEdit</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list