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


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

The following commit has been merged in the master branch:
commit ea10ad476f6e9ef22d54d89f16dd31688ff13d4e
Author: Gustavo P. Boiko <gustavo.boiko at kdemail.net>
Date:   Mon Oct 4 17:41:23 2010 +0000

    Replace the custom integer widgets by spinboxes
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm-plugins/; revision=1182475
---
 gabble/proxy-settings-widget.cpp  | 45 +++++++++--------------------
 gabble/proxy-settings-widget.ui   | 32 ++------------------
 gabble/server-settings-widget.cpp | 30 ++++++-------------
 gabble/server-settings-widget.ui  | 61 ++++++++++++++++++---------------------
 4 files changed, 53 insertions(+), 115 deletions(-)

diff --git a/gabble/proxy-settings-widget.cpp b/gabble/proxy-settings-widget.cpp
index 06b6990..fb4302f 100644
--- a/gabble/proxy-settings-widget.cpp
+++ b/gabble/proxy-settings-widget.cpp
@@ -125,9 +125,9 @@ ProxySettingsWidget::ProxySettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (d->stunPortParameter) {
         if (values.contains(d->stunPortParameter->name())) {
-            d->ui->stunPortLineEdit->setValue(values.value(d->stunPortParameter->name()).toUInt());
+            d->ui->stunPortSpinBox->setValue(values.value(d->stunPortParameter->name()).toUInt());
         } else {
-            d->ui->stunPortLineEdit->setValue(d->stunPortParameter->defaultValue().toUInt());
+            d->ui->stunPortSpinBox->setValue(d->stunPortParameter->defaultValue().toUInt());
         }
     }
 
@@ -143,10 +143,10 @@ ProxySettingsWidget::ProxySettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (d->fallbackStunPortParameter) {
         if (values.contains(d->fallbackStunPortParameter->name())) {
-            d->ui->fallbackStunPortLineEdit->setValue(values.value(
+            d->ui->fallbackStunPortSpinBox->setValue(values.value(
                     d->fallbackStunPortParameter->name()).toUInt());
         } else {
-            d->ui->fallbackStunPortLineEdit->setValue(
+            d->ui->fallbackStunPortSpinBox->setValue(
                     d->fallbackStunPortParameter->defaultValue().toUInt());
         }
     }
@@ -163,10 +163,10 @@ ProxySettingsWidget::ProxySettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (d->httpsProxyPortParameter) {
         if (values.contains(d->httpsProxyPortParameter->name())) {
-            d->ui->httpsProxyPortLineEdit->setValue(values.value(
+            d->ui->httpsProxyPortSpinBox->setValue(values.value(
                     d->httpsProxyPortParameter->name()).toUInt());
         } else {
-            d->ui->httpsProxyPortLineEdit->setValue(
+            d->ui->httpsProxyPortSpinBox->setValue(
                     d->httpsProxyPortParameter->defaultValue().toUInt());
         }
     }
@@ -203,7 +203,7 @@ ProxySettingsWidget::ProxySettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (!d->stunPortParameter) {
         d->ui->stunPortLabel->hide();
-        d->ui->stunPortLineEdit->hide();
+        d->ui->stunPortSpinBox->hide();
     }
 
     if (!d->fallbackStunServerParameter) {
@@ -213,7 +213,7 @@ ProxySettingsWidget::ProxySettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (!d->fallbackStunPortParameter) {
         d->ui->fallbackStunPortLabel->hide();
-        d->ui->fallbackStunPortLineEdit->hide();
+        d->ui->fallbackStunPortSpinBox->hide();
     }
 
     if (!d->httpsProxyServerParameter) {
@@ -223,7 +223,7 @@ ProxySettingsWidget::ProxySettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (!d->httpsProxyPortParameter) {
         d->ui->httpsProxyPortLabel->hide();
-        d->ui->httpsProxyPortLineEdit->hide();
+        d->ui->httpsProxyPortSpinBox->hide();
     }
 
     if (!d->fallbackSocks5ProxiesParameter) {
@@ -274,7 +274,7 @@ QMap<Tp::ProtocolParameter*, QVariant> ProxySettingsWidget::parameterValues() co
     }
 
     if (d->stunPortParameter) {
-        parameters.insert(d->stunPortParameter, d->ui->stunPortLineEdit->value());
+        parameters.insert(d->stunPortParameter, d->ui->stunPortSpinBox->value());
     }
 
     if (d->fallbackStunServerParameter) {
@@ -283,7 +283,7 @@ QMap<Tp::ProtocolParameter*, QVariant> ProxySettingsWidget::parameterValues() co
     }
 
     if (d->fallbackStunPortParameter) {
-        parameters.insert(d->fallbackStunPortParameter, d->ui->fallbackStunPortLineEdit->value());
+        parameters.insert(d->fallbackStunPortParameter, d->ui->fallbackStunPortSpinBox->value());
     }
 
     if (d->httpsProxyServerParameter) {
@@ -291,7 +291,7 @@ QMap<Tp::ProtocolParameter*, QVariant> ProxySettingsWidget::parameterValues() co
     }
 
     if (d->httpsProxyPortParameter) {
-        parameters.insert(d->httpsProxyPortParameter, d->ui->httpsProxyPortLineEdit->value());
+        parameters.insert(d->httpsProxyPortParameter, d->ui->httpsProxyPortSpinBox->value());
     }
 
     if (d->fallbackSocks5ProxiesParameter) {
@@ -312,26 +312,7 @@ bool ProxySettingsWidget::validateParameterValues()
 {
     kDebug();
 
-    // Validate all the int's and uint's.
-    if (d->ui->stunPortLineEdit->validity() != QValidator::Acceptable) {
-        KMessageBox::error(this,
-                              i18n("\"<b>%1</b>\" is not an acceptable value for <b>%2</b>")
-                              .arg(d->ui->stunPortLineEdit->text())
-                              .arg(d->ui->stunPortLabel->text()));
-        return false;
-    } else if (d->ui->fallbackStunPortLineEdit->validity() != QValidator::Acceptable) {
-        KMessageBox::error(this,
-                              i18n("\"<b>%1</b>\" is not an acceptable value for <b>%2</b>")
-                              .arg(d->ui->fallbackStunPortLineEdit->text())
-                              .arg(d->ui->fallbackStunPortLabel->text()));
-        return false;
-    } else if (d->ui->httpsProxyPortLineEdit->validity() != QValidator::Acceptable) {
-        KMessageBox::error(this,
-                              i18n("\"<b>%1</b>\" is not an acceptable value for <b>%2</b>")
-                              .arg(d->ui->httpsProxyPortLineEdit->text())
-                              .arg(d->ui->httpsProxyPortLabel->text()));
-        return false;
-    }
+    //TODO: check what parameters should be validated
 
     return true;
 }
diff --git a/gabble/proxy-settings-widget.ui b/gabble/proxy-settings-widget.ui
index 2c84cb4..418ca75 100644
--- a/gabble/proxy-settings-widget.ui
+++ b/gabble/proxy-settings-widget.ui
@@ -40,14 +40,7 @@
          </widget>
         </item>
         <item>
-         <widget class="UnsignedIntegerEdit" name="stunPortLineEdit">
-          <property name="maximumSize">
-           <size>
-            <width>60</width>
-            <height>16777215</height>
-           </size>
-          </property>
-         </widget>
+         <widget class="QSpinBox" name="stunPortSpinBox"/>
         </item>
        </layout>
       </item>
@@ -71,14 +64,7 @@
          </widget>
         </item>
         <item>
-         <widget class="UnsignedIntegerEdit" name="fallbackStunPortLineEdit">
-          <property name="maximumSize">
-           <size>
-            <width>60</width>
-            <height>16777215</height>
-           </size>
-          </property>
-         </widget>
+         <widget class="QSpinBox" name="fallbackStunPortSpinBox"/>
         </item>
        </layout>
       </item>
@@ -111,14 +97,7 @@
          </widget>
         </item>
         <item>
-         <widget class="UnsignedIntegerEdit" name="httpsProxyPortLineEdit">
-          <property name="maximumSize">
-           <size>
-            <width>60</width>
-            <height>16777215</height>
-           </size>
-          </property>
-         </widget>
+         <widget class="QSpinBox" name="httpsProxyPortSpinBox"/>
         </item>
        </layout>
       </item>
@@ -171,11 +150,6 @@
    <extends>QTextEdit</extends>
    <header>ktextedit.h</header>
   </customwidget>
-  <customwidget>
-   <class>UnsignedIntegerEdit</class>
-   <extends>QLineEdit</extends>
-   <header location="global">KCMTelepathyAccounts/UnsignedIntegerEdit</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
diff --git a/gabble/server-settings-widget.cpp b/gabble/server-settings-widget.cpp
index 15cff02..d484ca3 100644
--- a/gabble/server-settings-widget.cpp
+++ b/gabble/server-settings-widget.cpp
@@ -112,18 +112,18 @@ ServerSettingsWidget::ServerSettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (d->portParameter) {
         if (values.contains(d->portParameter->name())) {
-            d->ui->portLineEdit->setValue(values.value(d->portParameter->name()).toUInt());
+            d->ui->portSpinBox->setValue(values.value(d->portParameter->name()).toUInt());
         } else {
-            d->ui->portLineEdit->setValue(d->portParameter->defaultValue().toUInt());
+            d->ui->portSpinBox->setValue(d->portParameter->defaultValue().toUInt());
         }
     }
 
     if (d->keepaliveIntervalParameter) {
         if (values.contains(d->keepaliveIntervalParameter->name())) {
-            d->ui->keepaliveIntervalLineEdit->setValue(values.value(
+            d->ui->keepaliveIntervalSpinBox->setValue(values.value(
                     d->keepaliveIntervalParameter->name()).toUInt());
         } else {
-            d->ui->keepaliveIntervalLineEdit->setValue(
+            d->ui->keepaliveIntervalSpinBox->setValue(
                     d->keepaliveIntervalParameter->defaultValue().toUInt());
         }
     }
@@ -174,12 +174,12 @@ ServerSettingsWidget::ServerSettingsWidget(Tp::ProtocolParameterList parameters,
 
     if (!d->portParameter) {
         d->ui->portLabel->hide();
-        d->ui->portLineEdit->hide();
+        d->ui->portSpinBox->hide();
     }
 
     if (!d->keepaliveIntervalParameter) {
         d->ui->keepaliveIntervalLabel->hide();
-        d->ui->keepaliveIntervalLineEdit->hide();
+        d->ui->keepaliveIntervalSpinBox->hide();
     }
 
     if (!d->lowBandwidthParameter) {
@@ -233,11 +233,11 @@ QMap<Tp::ProtocolParameter*, QVariant> ServerSettingsWidget::parameterValues() c
     }
 
     if (d->portParameter) {
-        parameters.insert(d->portParameter, d->ui->portLineEdit->value());
+        parameters.insert(d->portParameter, d->ui->portSpinBox->value());
     }
 
     if (d->keepaliveIntervalParameter) {
-        parameters.insert(d->keepaliveIntervalParameter, d->ui->keepaliveIntervalLineEdit->value());
+        parameters.insert(d->keepaliveIntervalParameter, d->ui->keepaliveIntervalSpinBox->value());
     }
 
     if (d->lowBandwidthParameter) {
@@ -264,19 +264,7 @@ bool ServerSettingsWidget::validateParameterValues()
 {
     kDebug();
 
-    if (d->ui->portLineEdit->validity() != QValidator::Acceptable) {
-        KMessageBox::error(this,
-                              i18n("\"<b>%1</b>\" is not an acceptable value for <b>%2</b>")
-                              .arg(d->ui->portLineEdit->text())
-                              .arg(d->ui->portLabel->text()));
-        return false;
-    } else if (d->ui->keepaliveIntervalLineEdit->validity() != QValidator::Acceptable) {
-        KMessageBox::error(this,
-                              i18n("\"<b>%1</b>\" is not an acceptable value for <b>%2</b>")
-                              .arg(d->ui->keepaliveIntervalLineEdit->text())
-                              .arg(d->ui->keepaliveIntervalLabel->text()));
-        return false;
-    }
+    //TODO: check which parameters need validation
 
     return true;
 }
diff --git a/gabble/server-settings-widget.ui b/gabble/server-settings-widget.ui
index 804b967..12fadbc 100644
--- a/gabble/server-settings-widget.ui
+++ b/gabble/server-settings-widget.ui
@@ -19,38 +19,38 @@
      <property name="title">
       <string>Server Settings</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLabel" name="serverLabel">
-          <property name="text">
-           <string>Server Address:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="KLineEdit" name="serverLineEdit"/>
-        </item>
-       </layout>
+     <layout class="QFormLayout" name="formLayout">
+      <item row="0" column="0">
+       <widget class="QLabel" name="serverLabel">
+        <property name="text">
+         <string>Server Address:</string>
+        </property>
+       </widget>
       </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QLabel" name="portLabel">
-          <property name="text">
-           <string>Server Port:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="UnsignedIntegerEdit" name="portLineEdit"/>
-        </item>
-       </layout>
+      <item row="0" column="1">
+       <widget class="KLineEdit" name="serverLineEdit"/>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="portLabel">
+        <property name="text">
+         <string>Server Port:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QSpinBox" name="portSpinBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
       </item>
      </layout>
      <zorder></zorder>
      <zorder></zorder>
+     <zorder>serverLineEdit</zorder>
     </widget>
    </item>
    <item>
@@ -69,7 +69,7 @@
          </widget>
         </item>
         <item>
-         <widget class="UnsignedIntegerEdit" name="keepaliveIntervalLineEdit"/>
+         <widget class="QSpinBox" name="keepaliveIntervalSpinBox"/>
         </item>
        </layout>
       </item>
@@ -121,11 +121,6 @@
    <extends>QLineEdit</extends>
    <header>klineedit.h</header>
   </customwidget>
-  <customwidget>
-   <class>UnsignedIntegerEdit</class>
-   <extends>QLineEdit</extends>
-   <header location="global">KCMTelepathyAccounts/UnsignedIntegerEdit</header>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list