[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:59:10 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=f40d260
The following commit has been merged in the master branch:
commit f40d26005ac5873b1cd392db3c6b43925354bafc
Author: Florian Reinhard <florian.reinhard at googlemail.com>
Date: Wed Feb 16 12:33:22 2011 +0100
Add telepathy-rakia/sofiasip configuration plugin.
Reviewed-by: David Edmundson <kde at davidedmundson.co.uk>
Reviewed-by: George Kiagiadakis <kiagiadakis.george at gmail.com>
---
CMakeLists.txt | 1 +
rakia/CMakeLists.txt | 38 +++
{haze => rakia}/Messages.sh | 2 +-
rakia/kcmtelepathyaccounts_plugin_rakia.desktop | 16 ++
rakia/rakia-account-ui-plugin.cpp | 71 +++++
.../rakia-account-ui-plugin.h | 24 +-
rakia/rakia-account-ui.cpp | 131 +++++++++
.../rakia-account-ui.h | 23 +-
rakia/rakia-advanced-options-widget.cpp | 129 +++++++++
.../rakia-advanced-options-widget.h | 31 ++-
rakia/rakia-advanced-options-widget.ui | 307 +++++++++++++++++++++
rakia/rakia-main-options-widget.cpp | 52 ++++
.../rakia-main-options-widget.h | 25 +-
.../rakia-main-options-widget.ui | 36 ++-
14 files changed, 824 insertions(+), 62 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9aec0ec..f7fa03d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,4 +24,5 @@ add_subdirectory (gabble)
add_subdirectory (butterfly)
add_subdirectory (idle)
add_subdirectory (haze)
+add_subdirectory (rakia)
diff --git a/rakia/CMakeLists.txt b/rakia/CMakeLists.txt
new file mode 100644
index 0000000..1075b20
--- /dev/null
+++ b/rakia/CMakeLists.txt
@@ -0,0 +1,38 @@
+project (kcmtelepathyaccounts-plugin-rakia)
+
+include_directories (${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set (kcmtelepathyaccounts_plugin_rakia_SRCS
+ rakia-account-ui-plugin.cpp
+ rakia-account-ui.cpp
+ rakia-main-options-widget.cpp
+ rakia-advanced-options-widget.cpp
+)
+
+kde4_add_ui_files (kcmtelepathyaccounts_plugin_rakia_SRCS
+ rakia-main-options-widget.ui
+ rakia-advanced-options-widget.ui
+)
+
+kde4_add_plugin (kcmtelepathyaccounts_plugin_rakia
+ ${kcmtelepathyaccounts_plugin_rakia_SRCS}
+)
+
+target_link_libraries (kcmtelepathyaccounts_plugin_rakia
+ ${KCMTELEPATHYACCOUNTS_LIBRARIES}
+ ${QT_LIBRARIES}
+ ${KDE4_KDEUI_LIBS}
+ ${TELEPATHY_QT4_LIBRARIES}
+)
+
+# Install:
+install (TARGETS kcmtelepathyaccounts_plugin_rakia
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+install (FILES kcmtelepathyaccounts_plugin_rakia.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+)
+
diff --git a/haze/Messages.sh b/rakia/Messages.sh
old mode 100755
new mode 100644
similarity index 89%
copy from haze/Messages.sh
copy to rakia/Messages.sh
index e6231eb..a2aad44
--- a/haze/Messages.sh
+++ b/rakia/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_rakia.pot
rm -f rc.cpp
diff --git a/rakia/kcmtelepathyaccounts_plugin_rakia.desktop b/rakia/kcmtelepathyaccounts_plugin_rakia.desktop
new file mode 100644
index 0000000..fb11dda
--- /dev/null
+++ b/rakia/kcmtelepathyaccounts_plugin_rakia.desktop
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Encoding=UTF-8
+Comment=Custom account configuration user interface for accounts using the Rakia/SofiaSIP connection manager.
+Icon=blockdevice
+Name=Rakia/SofiaSIP Account Configuration User Interface
+Type=Service
+ServiceTypes=KCMTelepathyAccounts/AccountUiPlugin
+
+X-KDE-Library=kcmtelepathyaccounts_plugin_rakia
+X-KDE-PluginInfo-Author=Florian Reinhard
+X-KDE-PluginInfo-Email=florian.reinhard at googlemail.com
+X-KDE-PluginInfo-Name=rakia
+X-KDE-PluginInfo-Version=0.1
+X-KDE-PluginInfo-Website=http://techbase.kde.org/Projects/Telepathy
+X-KDE-PluginInfo-License=LGPL
+X-KDE-PluginInfo-EnabledByDefault=true
diff --git a/rakia/rakia-account-ui-plugin.cpp b/rakia/rakia-account-ui-plugin.cpp
new file mode 100644
index 0000000..9a09052
--- /dev/null
+++ b/rakia/rakia-account-ui-plugin.cpp
@@ -0,0 +1,71 @@
+/*
+ * This file is part of telepathy-accounts-kcm-plugins
+ *
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.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 "rakia-account-ui-plugin.h"
+
+#include "rakia-account-ui.h"
+
+#include <KCMTelepathyAccounts/PluginMacros>
+
+#include <KDebug>
+#include <KGenericFactory>
+
+#include <QtCore/QVariantList>
+
+RakiaAccountUiPlugin::RakiaAccountUiPlugin(QObject *parent, const QVariantList &)
+ : AbstractAccountUiPlugin(parent)
+{
+ kDebug();
+
+ // Register supported cm/protocol combinations
+ // We support rakia/sip and the renamed version rakia/sip combination.
+ registerProvidedProtocol("rakia", "sip");
+ registerProvidedProtocol("sofiasip", "sip");
+}
+
+RakiaAccountUiPlugin::~RakiaAccountUiPlugin()
+{
+ kDebug();
+}
+
+AbstractAccountUi* RakiaAccountUiPlugin::accountUi(const QString &connectionManager,
+ const QString &protocol,
+ const QString &serviceName)
+{
+ kDebug();
+ kDebug() << "connectionManager: " << connectionManager <<
+ ", protocol: " << protocol <<
+ ", servicename: " << serviceName;
+
+ // We support rakia/sip and the renamed version rakia/sip combination.
+ if(((connectionManager == "rakia") && (protocol == "sip")) ||
+ ((connectionManager == "sofiasip") && (protocol == "sip"))
+ ) {
+ return new RakiaAccountUi;
+ }
+
+ return 0;
+}
+
+K_PLUGIN_FACTORY(factory, registerPlugin<RakiaAccountUiPlugin>();)\
+K_EXPORT_PLUGIN(factory("kcmtelepathyaccounts_plugin_rakia"))
+
+
+#include "rakia-account-ui-plugin.moc"
diff --git a/butterfly/butterfly-account-ui-plugin.h b/rakia/rakia-account-ui-plugin.h
similarity index 61%
copy from butterfly/butterfly-account-ui-plugin.h
copy to rakia/rakia-account-ui-plugin.h
index 8c027d5..b29aad3 100644
--- a/butterfly/butterfly-account-ui-plugin.h
+++ b/rakia/rakia-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) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,30 +18,28 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_BUTTERFLY_ACCOUNT_UI_PLUGIN_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_BUTTERFLY_ACCOUNT_UI_PLUGIN_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_ACCOUNT_UI_PLUGIN_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_ACCOUNT_UI_PLUGIN_H
#include <KCMTelepathyAccounts/AbstractAccountUiPlugin>
#include <QVariantList>
-class ButterflyAccountUiPlugin : public AbstractAccountUiPlugin
+class RakiaAccountUiPlugin : public AbstractAccountUiPlugin
{
Q_OBJECT
public:
- ButterflyAccountUiPlugin(QObject *parent, const QVariantList &);
- virtual ~ButterflyAccountUiPlugin();
+ RakiaAccountUiPlugin(QObject *parent, const QVariantList &);
+ virtual ~RakiaAccountUiPlugin();
- virtual AbstractAccountUi* accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName);
+ virtual AbstractAccountUi* accountUi(const QString &connectionManager,
+ const QString &protocol,
+ const QString &serviceName);
private:
- Q_DISABLE_COPY(ButterflyAccountUiPlugin);
-
- class Private;
- Private * const d;
+ Q_DISABLE_COPY(RakiaAccountUiPlugin);
};
#endif // header guard
-
diff --git a/rakia/rakia-account-ui.cpp b/rakia/rakia-account-ui.cpp
new file mode 100644
index 0000000..97c7842
--- /dev/null
+++ b/rakia/rakia-account-ui.cpp
@@ -0,0 +1,131 @@
+/*
+ * This file is part of telepathy-accounts-kcm-plugins
+ *
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.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 "rakia-account-ui.h"
+
+#include "rakia-main-options-widget.h"
+#include "rakia-advanced-options-widget.h"
+
+#include <KCMTelepathyAccounts/ParameterEditModel>
+#include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
+#include <KCMTelepathyAccounts/GenericAdvancedOptionsWidget>
+
+#include <KDebug>
+
+RakiaAccountUi::RakiaAccountUi(QObject *parent)
+ : AbstractAccountUi(parent)
+{
+ kDebug();
+ // Register supported parameters
+ // Main Options
+ /**< public SIP address (SIP URI) */
+ registerSupportedParameter("account", QVariant::String);
+ /**< account password (for registration) */
+ registerSupportedParameter("password", QVariant::String);
+ /**< Display name for self */
+ registerSupportedParameter("alias", QVariant::String);
+
+ // Advanced Options
+ /**< account username (if different from public address userinfo part) */
+ registerSupportedParameter("auth-user", QVariant::String);
+ /**< SIP registrar (SIP URI) */
+ registerSupportedParameter("registrar", QVariant::String);
+
+ // Parameters being used to compose the proxy uri
+ /**< outbound SIP proxy (SIP URI) */
+ registerSupportedParameter("proxy-host", QVariant::String);
+ registerSupportedParameter("port", QVariant::UInt);
+ /**< outbound transport */
+ registerSupportedParameter("transport", QVariant::String);
+
+ /**< Discover STUN server name using DNS SRV lookup */
+ registerSupportedParameter("discover-stun", QVariant::Bool);
+ /**< STUN server address (if not set, derived from public SIP address) */
+ registerSupportedParameter("stun-server", QVariant::String);
+ /**< STUN port */
+ registerSupportedParameter("stun-port", QVariant::UInt);
+
+ /**< enable discovery of public binding */
+ registerSupportedParameter("discover-binding", QVariant::Bool);
+ /**< enable loose routing behavior */
+ registerSupportedParameter("loose-routing", QVariant::Bool);
+ /**< keepalive mechanism as defined by TpsipConnectionKeepaliveMechanism
+ * "auto","register","options","stun","off" */
+ registerSupportedParameter("keepalive-mechanism", QVariant::String);
+ /**< keepalive interval in seconds */
+ registerSupportedParameter("keepalive-interval", QVariant::UInt);
+
+// Parameters, we know about their existance but don't expose them to the user
+// for eventual later usage, we keep them documented here:
+
+// immuteable-streams: if set to True, you can't add video to an already running voice call.
+// /**< If the session content is immutable once set up */
+// registerSupportedParameter("immutable-streams", QVariant::Bool);
+
+// local-ip-addres, local-port:
+// These affect the socket binding of the SIP UA. It's a way to ensure that Sofia-SIP uses a
+// particular local IP binding on multi-homed hosts, something that it does not do in a
+// satisfactory way automatically.
+// /**< Local IP address (normally not needed, chosen by stack) */
+// registerSupportedParameter("local-ip-address", QVariant::String);
+// /**< Local port for SIP (normally not needed, chosen by stack) */
+// registerSupportedParameter("local-port", QVariant::UInt);
+
+// extra-auth-user, extra-auth-password:
+// ifdigest authentication on demand is implemented, these parameters are obsolete.
+// /**< User name to use for extra authentication challenges */
+// registerSupportedParameter("extra-auth-user", QVariant::String);
+// /**< Password to use for extra authentication challenges */
+// registerSupportedParameter("extra-auth-password", QVariant::String);
+}
+
+RakiaAccountUi::~RakiaAccountUi()
+{
+ kDebug();
+}
+
+AbstractAccountParametersWidget *RakiaAccountUi::mainOptionsWidget(
+ ParameterEditModel *model,
+ QWidget *parent) const
+{
+ kDebug();
+
+ return new RakiaMainOptionsWidget(model, parent);
+}
+
+bool RakiaAccountUi::hasAdvancedOptionsWidget() const
+{
+ kDebug();
+
+ return true;
+}
+
+AbstractAccountParametersWidget *RakiaAccountUi::advancedOptionsWidget(
+ ParameterEditModel *model,
+ QWidget *parent) const
+{
+ kDebug();
+
+ AbstractAccountParametersWidget* aowidget = new RakiaAdvancedOptionsWidget(model, parent);
+
+ return aowidget;
+}
+
+#include "rakia-account-ui.moc"
diff --git a/haze/haze-yahoo-account.h b/rakia/rakia-account-ui.h
similarity index 71%
copy from haze/haze-yahoo-account.h
copy to rakia/rakia-account-ui.h
index 1f94f44..0f5b148 100644
--- a/haze/haze-yahoo-account.h
+++ b/rakia/rakia-account-ui.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 Lasath Fernando <kde at lasath.org>
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,20 +18,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_YAHOO_ACCOUNT_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_YAHOO_ACCOUNT_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_ACCOUNT_UI_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_ACCOUNT_UI_H
#include <KCMTelepathyAccounts/AbstractAccountUi>
-#include "yahoo-main-options-widget.h"
-
-class HazeYahooAccount : public AbstractAccountUi
+class RakiaAccountUi : public AbstractAccountUi
{
Q_OBJECT
public:
- explicit HazeYahooAccount(QObject *parent = 0);
- virtual ~HazeYahooAccount();
+ explicit RakiaAccountUi(QObject *parent = 0);
+ virtual ~RakiaAccountUi();
virtual AbstractAccountParametersWidget
*mainOptionsWidget(ParameterEditModel *model,
@@ -42,12 +40,7 @@ public:
QWidget *parent = 0) const;
private:
- Q_DISABLE_COPY(HazeYahooAccount);
-
- class Private;
- Private * const d;
-
+ Q_DISABLE_COPY(RakiaAccountUi);
};
#endif // header guard
-
diff --git a/rakia/rakia-advanced-options-widget.cpp b/rakia/rakia-advanced-options-widget.cpp
new file mode 100644
index 0000000..c6fa94a
--- /dev/null
+++ b/rakia/rakia-advanced-options-widget.cpp
@@ -0,0 +1,129 @@
+/*
+ * This file is part of telepathy-accounts-kcm-plugins
+ *
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.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 "rakia-advanced-options-widget.h"
+
+#include <KDebug>
+#include <KCMTelepathyAccounts/ParameterEditModel>
+
+RakiaAdvancedOptionsWidget::RakiaAdvancedOptionsWidget(ParameterEditModel* model, QWidget* parent)
+ : AbstractAccountParametersWidget(model, parent)
+{
+ kDebug();
+
+ // Set up the UI.
+ m_ui = new Ui::RakiaAdvancedOptionsWidget;
+ m_ui->setupUi(this);
+
+ handleParameter("auth-user", QVariant::String,
+ m_ui->authUserLineEdit,
+ m_ui->authUserLabel);
+ handleParameter("registrar", QVariant::String,
+ m_ui->registrarLineEdit,
+ m_ui->registrarLabel);
+
+ handleParameter("proxy-host", QVariant::String,
+ m_ui->proxyLineEdit,
+ m_ui->proxyLabel);
+ handleParameter("port", QVariant::UInt,
+ m_ui->portSpinBox,
+ m_ui->portLabel);
+ handleParameter("transport", QVariant::String,
+ m_ui->transportComboBox,
+ m_ui->transportLabel);
+
+ handleParameter("stun-server", QVariant::String,
+ m_ui->stunServerLineEdit,
+ m_ui->stunServerLabel);
+ handleParameter("stun-port", QVariant::UInt,
+ m_ui->stunPortSpinBox,
+ m_ui->stunPortLabel);
+
+ handleParameter("loose-routing", QVariant::Bool,
+ m_ui->looseRoutingCheckBox,
+ m_ui->looseRoutingLabel);
+ handleParameter("discover-binding", QVariant::Bool,
+ m_ui->discoverBindingCheckBox,
+ m_ui->discoverBindingLabel);
+
+ handleParameter("keepalive-mechanism", QVariant::String,
+ m_ui->keepaliveMechanismComboBox,
+ m_ui->keepaliveMechanismLabel);
+ handleParameter("keepalive-interval", QVariant::UInt,
+ m_ui->keepaliveIntervalNumInput,
+ m_ui->keepaliveIntervalLabel);
+
+ kDebug() << parameterModel()->data(
+ parameterModel()->indexForParameter(parameterModel()->parameter("discover-stun")),
+ ParameterEditModel::ValueRole);
+
+ // enable/disable the stunGroupBox if discover-stun is false/true
+ m_ui->stunGroupBox->setChecked(
+ !parameterModel()->data(
+ parameterModel()->indexForParameter(parameterModel()->parameter("discover-stun")),
+ ParameterEditModel::ValueRole).toBool()
+ );
+
+ // enable/disable keepalive-interval depending on keepalive-mechanism
+ connect(m_ui->keepaliveMechanismComboBox,
+ SIGNAL(currentIndexChanged(int)),
+ SLOT(updateKeepalive(int))
+ );
+
+ // enable/disable keepalive-interval depending on current keepalive-mechanism
+ updateKeepalive(m_ui->keepaliveMechanismComboBox->currentIndex());
+}
+
+void RakiaAdvancedOptionsWidget::updateKeepalive(int index)
+{
+ kDebug() << index;
+ switch(index) {
+ case 0:
+ case 3:
+ case 4:
+ m_ui->keepaliveIntervalNumInput->setEnabled(false);
+ break;
+ default:
+ m_ui->keepaliveIntervalNumInput->setEnabled(true);
+ break;
+ }
+}
+
+void RakiaAdvancedOptionsWidget::submit()
+{
+ // the gui does not use the telepathy-sofiasip/rakia parameter disvover-stun directly.
+ // if the goupbox is enabled, discover-stun is disabled and vice versa.
+ // TODO: the telepathy-sofiasip/rakia is buggy, atm till 0.6.6 and 0.7.1, see
+ // https://bugs.freedesktop.org/show_bug.cgi?id=34227 for details
+ kDebug() << "ok, we're saving now, we need to do some magic!";
+ parameterModel()->setData(
+ parameterModel()->indexForParameter(parameterModel()->parameter("discover-stun")),
+ !m_ui->stunGroupBox->isChecked(),
+ ParameterEditModel::ValueRole);
+
+ AbstractAccountParametersWidget::submit();
+}
+
+RakiaAdvancedOptionsWidget::~RakiaAdvancedOptionsWidget()
+{
+ delete m_ui;
+}
+
+#include "rakia-advanced-options-widget.moc"
diff --git a/gabble/main-options-widget.h b/rakia/rakia-advanced-options-widget.h
similarity index 53%
copy from gabble/main-options-widget.h
copy to rakia/rakia-advanced-options-widget.h
index 7b04473..0b619d4 100644
--- a/gabble/main-options-widget.h
+++ b/rakia/rakia-advanced-options-widget.h
@@ -1,7 +1,7 @@
/*
- * This file is part of telepathy-accounts-kcm
+ * This file is part of telepathy-accounts-kcm-plugins
*
- * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,26 +18,31 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ACCOUNT_PARAMETERS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_GABBLE_ACCOUNT_PARAMETERS_WIDGET_H
+#include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
+
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_AO_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_AO_WIDGET_H
#include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
+#include "ui_rakia-advanced-options-widget.h"
-class MainOptionsWidget : public AbstractAccountParametersWidget
+class RakiaAdvancedOptionsWidget : public AbstractAccountParametersWidget
{
Q_OBJECT
public:
- explicit MainOptionsWidget(ParameterEditModel *model,
- QWidget *parent = 0);
- virtual ~MainOptionsWidget();
+ explicit RakiaAdvancedOptionsWidget(ParameterEditModel *model,
+ QWidget *parent = 0);
+ virtual ~RakiaAdvancedOptionsWidget();
+ virtual void submit();
-private:
- Q_DISABLE_COPY(MainOptionsWidget);
+public slots:
+ void updateKeepalive(int index);
- class Private;
- Private * const d;
+private:
+ Q_DISABLE_COPY(RakiaAdvancedOptionsWidget);
+ Ui::RakiaAdvancedOptionsWidget *m_ui;
};
-#endif // header guard
+#endif // header guard
diff --git a/rakia/rakia-advanced-options-widget.ui b/rakia/rakia-advanced-options-widget.ui
new file mode 100644
index 0000000..eefd823
--- /dev/null
+++ b/rakia/rakia-advanced-options-widget.ui
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RakiaAdvancedOptionsWidget</class>
+ <widget class="QWidget" name="RakiaAdvancedOptionsWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>421</width>
+ <height>498</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="authGroupBox">
+ <property name="title">
+ <string>Authentication</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_6">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="authUserLabel">
+ <property name="text">
+ <string>User:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="authUserLineEdit">
+ <property name="toolTip">
+ <string>Username for your SIP account. If your username is different from the user part your SIP URI, provide it here.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="registrarLabel">
+ <property name="text">
+ <string>Registrar:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="registrarLineEdit">
+ <property name="toolTip">
+ <string>Registrar for your SIP account. If your registrar is different from the server part your SIP URI, provide it here.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="proxyGroupBox">
+ <property name="title">
+ <string>Proxy</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_5">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="proxyLabel">
+ <property name="text">
+ <string>Proxy Host:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="proxyLineEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="portLabel">
+ <property name="text">
+ <string>Proxy Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="transportLabel">
+ <property name="text">
+ <string>Transport:</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>udp</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>tcp</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>tls</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KIntSpinBox" name="portSpinBox">
+ <property name="maximum">
+ <number>65536</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="stunGroupBox">
+ <property name="title">
+ <string>Custom STUN settings</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <layout class="QFormLayout" name="formLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="stunServerLabel">
+ <property name="text">
+ <string>STUN Server:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="stunPortLabel">
+ <property name="text">
+ <string>STUN Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="KIntSpinBox" name="stunPortSpinBox">
+ <property name="maximum">
+ <number>65535</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KLineEdit" name="stunServerLineEdit">
+ <property name="toolTip">
+ <string>STUN server address (FQDN or IP address)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="networkingGroupBox">
+ <property name="title">
+ <string>Network and Routing</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_4">
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="discoverBindingCheckBox">
+ <property name="toolTip">
+ <string>Enable discovery of public IP address beyond NAT</string>
+ </property>
+ <property name="text">
+ <string>Discover Public Contact</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="looseRoutingCheckBox">
+ <property name="toolTip">
+ <string>Enable loose routing as per RFC 3261</string>
+ </property>
+ <property name="text">
+ <string>Use Loose Routing</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="looseRoutingLabel">
+ <property name="text">
+ <string>Routing:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="discoverBindingLabel">
+ <property name="text">
+ <string>NAT</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="keepaliveGroupBox">
+ <property name="title">
+ <string>KeepAlive</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_2">
+ <item row="2" column="0">
+ <widget class="QLabel" name="keepaliveIntervalLabel">
+ <property name="text">
+ <string>Interval:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="KIntNumInput" name="keepaliveIntervalNumInput">
+ <property name="toolTip">
+ <string>Interval between keepalive probes in seconds (0 = disabled, unset = use a default interval)</string>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KComboBox" name="keepaliveMechanismComboBox">
+ <property name="toolTip">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Ubuntu'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Keepalive mechanism for SIP registration</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">auto</span>: Keepalive management is up to the implementation</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">options</span>: Maintain registration with OPTIONS requests</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">register</span>: Maintain registration with REGISTER requests</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">stun</span>: Maintain registration with STUN as described in IETF draft-sip-outbound</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">off</span>: Disable keepalive management</p></body></html></string>
+ </property>
+ <item>
+ <property name="text">
+ <string>auto</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>register</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>options</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>stun</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>off</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="keepaliveMechanismLabel">
+ <property name="text">
+ <string>Mechanism:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </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>
+ <customwidget>
+ <class>KComboBox</class>
+ <extends>QComboBox</extends>
+ <header>kcombobox.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KIntNumInput</class>
+ <extends>QWidget</extends>
+ <header>knuminput.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/rakia/rakia-main-options-widget.cpp b/rakia/rakia-main-options-widget.cpp
new file mode 100644
index 0000000..c6ef831
--- /dev/null
+++ b/rakia/rakia-main-options-widget.cpp
@@ -0,0 +1,52 @@
+/*
+ * This file is part of telepathy-accounts-kcm-plugins
+ *
+ * Copyright (C) 2011 Florian Reinhard <florian.reinhard at googlemail.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 "rakia-main-options-widget.h"
+
+#include <KCMTelepathyAccounts/ParameterEditModel>
+
+#include <KDebug>
+#include <KUser>
+
+RakiaMainOptionsWidget::RakiaMainOptionsWidget(ParameterEditModel *model, QWidget *parent)
+ : AbstractAccountParametersWidget(model, parent)
+{
+ // Set up the UI.
+ m_ui = new Ui::RakiaMainOptionsWidget;
+ m_ui->setupUi(this);
+
+ handleParameter("account", QVariant::String, m_ui->accountLineEdit, m_ui->accountLabel);
+ handleParameter("password", QVariant::String, m_ui->passwordLineEdit, m_ui->passwordLabel);
+ handleParameter("alias", QVariant::String, m_ui->aliasLineEdit, m_ui->aliasLabel);
+
+ // if the account is empty on startup we add a new account, therefore
+ // set the alias to the current users full name
+ if(m_ui->accountLineEdit->text().isEmpty()) {
+ KUser user = KUser();
+ m_ui->aliasLineEdit->setText(user.property(KUser::FullName).toString());
+ }
+}
+
+RakiaMainOptionsWidget::~RakiaMainOptionsWidget()
+{
+ kDebug();
+
+ delete m_ui;
+}
diff --git a/haze/icq-server-settings-widget.h b/rakia/rakia-main-options-widget.h
similarity index 59%
copy from haze/icq-server-settings-widget.h
copy to rakia/rakia-main-options-widget.h
index 6353269..efcc07a 100644
--- a/haze/icq-server-settings-widget.h
+++ b/rakia/rakia-main-options-widget.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) 2011 Florian Reinhard <florian.reinhard at googlemail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,27 +18,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_ICQ_SERVER_SETTINGS_WIDGET_H
-#define KCMTELEPATHYACCOUNTS_PLUGIN_HAZE_ICQ_SERVER_SETTINGS_WIDGET_H
+#ifndef KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_ACCOUNT_PARAMETERS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_PLUGIN_RAKIA_ACCOUNT_PARAMETERS_WIDGET_H
#include <KCMTelepathyAccounts/AbstractAccountParametersWidget>
+#include "ui_rakia-main-options-widget.h"
-class IcqServerSettingsWidget : public AbstractAccountParametersWidget
+class RakiaMainOptionsWidget : public AbstractAccountParametersWidget
{
Q_OBJECT
public:
- explicit IcqServerSettingsWidget(ParameterEditModel *model,
- QWidget *parent = 0);
- virtual ~IcqServerSettingsWidget();
+ explicit RakiaMainOptionsWidget(ParameterEditModel *model,
+ QWidget *parent = 0);
+ virtual ~RakiaMainOptionsWidget();
private:
- Q_DISABLE_COPY(IcqServerSettingsWidget);
-
- class Private;
- Private * const d;
+ Q_DISABLE_COPY(RakiaMainOptionsWidget);
+ Ui::RakiaMainOptionsWidget *m_ui;
};
-
#endif // header guard
-
diff --git a/gabble/main-options-widget.ui b/rakia/rakia-main-options-widget.ui
similarity index 60%
copy from gabble/main-options-widget.ui
copy to rakia/rakia-main-options-widget.ui
index c3d6d30..9ba9ef2 100644
--- a/gabble/main-options-widget.ui
+++ b/rakia/rakia-main-options-widget.ui
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>MainOptionsWidget</class>
- <widget class="QWidget" name="MainOptionsWidget">
+ <class>RakiaMainOptionsWidget</class>
+ <widget class="QWidget" name="RakiaMainOptionsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
- <height>62</height>
+ <height>106</height>
</rect>
</property>
<property name="windowTitle">
@@ -19,7 +19,7 @@
<item row="0" column="1">
<widget class="KLineEdit" name="accountLineEdit"/>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="KLineEdit" name="passwordLineEdit">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
@@ -32,14 +32,14 @@
<item row="0" column="0">
<widget class="QLabel" name="accountLabel">
<property name="text">
- <string>Jabber ID:</string>
+ <string>SIP URI:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="passwordLabel">
<property name="text">
<string>Password:</string>
@@ -49,6 +49,30 @@
</property>
</widget>
</item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="aliasLabel">
+ <property name="text">
+ <string>Alias:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="KLineEdit" name="aliasLineEdit">
+ <property name="toolTip">
+ <string>This Alias is being used for SIMPLE, a instant messaging extension for SIP. If left blank, your SIP URI will be shown to the reciever instead of your Alias.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="label">
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string><b>Example:</b> user at my.sip.server</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
--
ktp-accounts-kcm packaging
More information about the pkg-kde-commits
mailing list