[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/network/telepathy-accounts-kcm-plugins/gabble
From:       George Goldberg <grundleborg () googlemail ! com>
Date:       2009-09-14 9:05:33
Message-ID: 1252919133.618867.1986.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1023215 by gberg:

Use new validation support on int and uint entry fields.

 M  +21 -0     proxy-settings-widget.cpp  
 M  +14 -0     server-settings-widget.cpp  


--- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/proxy-settings-widget.cpp \
#1023214:1023215 @@ -312,6 +312,27 @@
 {
     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;
+    }
+
     return true;
 }
 
--- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/server-settings-widget.cpp \
#1023214:1023215 @@ -264,6 +264,20 @@
 {
     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;
+    }
+
     return true;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic