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


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

The following commit has been merged in the master branch:
commit d89a65a7c01b13e701027bab627d28d9f67378fc
Author: Dominik Schmidt <dev at dominik-schmidt.de>
Date:   Wed Jan 12 22:22:13 2011 +0100

    Add GenericAdvancedOptionsWidget
---
 .../generic-advanced-options-widget.cpp            | 117 +++++++++++++++++++++
 ...-widget.h => generic-advanced-options-widget.h} |  31 +++---
 .../include/GenericAdvancedOptionsWidget           |   6 ++
 3 files changed, 138 insertions(+), 16 deletions(-)

diff --git a/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp b/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp
new file mode 100644
index 0000000..4333268
--- /dev/null
+++ b/src/KCMTelepathyAccounts/generic-advanced-options-widget.cpp
@@ -0,0 +1,117 @@
+/*
+ * This file is part of telepathy-accounts-kcm
+ *
+ * Copyright (C) 2011 Dominik Schmidt <kde at dominik-schmidt.de>
+ *
+ * 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 <KDebug>
+#include <KTabWidget>
+#include <KLocale>
+#include <QHBoxLayout>
+
+
+#include "protocol-parameter-value.h"
+
+#include "generic-advanced-options-widget.h"
+
+
+class GenericAdvancedOptionsWidget::Private
+{
+public:
+    Private()
+    {
+        kDebug();
+    }
+    KTabWidget tabWidget;
+    QList<AbstractAccountParametersWidget*> widgets;
+};
+
+GenericAdvancedOptionsWidget::GenericAdvancedOptionsWidget(Tp::ProtocolParameterList parameters,
+                                             const QVariantMap &values,
+                                             QWidget *parent)
+ : AbstractAccountParametersWidget(parameters, values, parent),
+   d(new Private)
+{
+    Q_UNUSED(parameters);
+    Q_UNUSED(values);
+    Q_UNUSED(parent);
+
+    QHBoxLayout *layout = new QHBoxLayout(this);
+    layout->addWidget(&(d->tabWidget));
+
+    d->tabWidget.setTabBarHidden(true);
+}
+
+GenericAdvancedOptionsWidget::~GenericAdvancedOptionsWidget()
+{
+    kDebug();
+
+    delete d;
+}
+
+QList<ProtocolParameterValue> GenericAdvancedOptionsWidget::parameterValues() const
+{
+    kDebug();
+
+    // the server parameter values
+    QList<ProtocolParameterValue> parameters;
+    foreach(AbstractAccountParametersWidget *widget, d->widgets)
+    {
+        kDebug() << "Got these values for storing...";
+        foreach(ProtocolParameterValue value, widget->parameterValues())
+        {
+            kDebug() << value.name() << value.value();
+        }
+        parameters.append(widget->parameterValues());
+    }
+
+    return parameters;
+}
+
+bool GenericAdvancedOptionsWidget::validateParameterValues()
+{
+    kDebug();
+
+    // validate one tab at a time so that the user is not flooded with dialogs
+    foreach(AbstractAccountParametersWidget *widget, d->widgets)
+    {
+        if (!widget->validateParameterValues())
+        return false;
+    }
+
+    return true;
+}
+
+void GenericAdvancedOptionsWidget::setTabBarHidden(bool hidden)
+{
+    d->tabWidget.setTabBarHidden(hidden);
+}
+
+void GenericAdvancedOptionsWidget::addTab(AbstractAccountParametersWidget* tab, const QString& label)
+{
+    if(d->tabWidget.count() == 1)
+    {
+        d->tabWidget.setTabBarHidden(false);
+    }
+
+    d->tabWidget.addTab(tab, label);
+    d->widgets.append(tab);
+}
+
+
+#include "generic-advanced-options-widget.moc"
+
diff --git a/src/KCMTelepathyAccounts/parameter-edit-widget.h b/src/KCMTelepathyAccounts/generic-advanced-options-widget.h
similarity index 56%
copy from src/KCMTelepathyAccounts/parameter-edit-widget.h
copy to src/KCMTelepathyAccounts/generic-advanced-options-widget.h
index 566cbe1..8d94204 100644
--- a/src/KCMTelepathyAccounts/parameter-edit-widget.h
+++ b/src/KCMTelepathyAccounts/generic-advanced-options-widget.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of telepathy-accounts-kcm
  *
- * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2011 Dominik Schmidt <kde at dominik-schmidt.de>
  *
  * 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,36 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef TELEPATHY_ACCOUNTS_KCM_PARAMETER_EDIT_WIDGET_H
-#define TELEPATHY_ACCOUNTS_KCM_PARAMETER_EDIT_WIDGET_H
-
-#include <KCMTelepathyAccounts/abstract-account-parameters-widget.h>
+#ifndef KCMTELEPATHYACCOUNTS_GENERIC_ADVANCED_OPTIONS_WIDGET_H
+#define KCMTELEPATHYACCOUNTS_GENERIC_ADVANCED_OPTIONS_WIDGET_H
 
 #include <kdemacros.h>
 
-#include <TelepathyQt4/ConnectionManager>
+#include "abstract-account-parameters-widget.h"
 
-class KDE_EXPORT ParameterEditWidget : public AbstractAccountParametersWidget
+class KDE_EXPORT GenericAdvancedOptionsWidget : public AbstractAccountParametersWidget
 {
     Q_OBJECT
 
 public:
-    explicit ParameterEditWidget(Tp::ProtocolParameterList parameters,
-                                 const QVariantMap &values = QVariantMap(),
-                                 QWidget *parent = 0);
-    ~ParameterEditWidget();
+    explicit GenericAdvancedOptionsWidget(Tp::ProtocolParameterList parameters,
+                                   const QVariantMap &values = QVariantMap(),
+                                   QWidget *parent = 0);
+    virtual ~GenericAdvancedOptionsWidget();
 
     virtual QList<ProtocolParameterValue> parameterValues() const;
-
     virtual bool validateParameterValues();
 
-private Q_SLOTS:
-    void onDelegateDataChanged(const QModelIndex &index, const QVariant &value, int role);
+    void setTabBarHidden(bool hidden);
+
+    void addTab(AbstractAccountParametersWidget *tab, const QString &label);
 
 private:
+    Q_DISABLE_COPY(GenericAdvancedOptionsWidget);
+
     class Private;
     Private * const d;
 };
 
-
-#endif  // Header guard
+#endif // header guard
 
diff --git a/src/KCMTelepathyAccounts/include/GenericAdvancedOptionsWidget b/src/KCMTelepathyAccounts/include/GenericAdvancedOptionsWidget
new file mode 100644
index 0000000..3147d32
--- /dev/null
+++ b/src/KCMTelepathyAccounts/include/GenericAdvancedOptionsWidget
@@ -0,0 +1,6 @@
+#ifndef LIB_KCM_TELEPATHY_ACCOUNTS_GENERIC_ADVANCED_OPTIONS_WIDGET_PRETTY_H
+#define LIB_KCM_TELEPATHY_ACCOUNTS_GENERIC_ADVANCED_OPTIONS_WIDGET_PRETTY_H
+
+#include <KCMTelepathyAccounts/generic-advanced-options-widget.h>
+
+#endif

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list