[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-08-03 13:19:09
Message-ID: 1249305549.747618.18840.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1006315 by gberg:

Implement checking all mandatory paramters are filled in.

 M  +16 -0     mandatory-parameters-widget.cpp  
 M  +1 -0      mandatory-parameters-widget.h  


--- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/mandatory-parameters-widget.cpp \
#1006314:1006315 @@ -23,6 +23,7 @@
 #include "ui_mandatory-parameters-widget.h"
 
 #include <KDebug>
+#include <KMessageBox>
 
 class MandatoryParametersWidget::Private
 {
@@ -106,6 +107,21 @@
     return parameters;
 }
 
+bool MandatoryParametersWidget::validateParameterValues()
+{
+    // Check if both the password and account have been entered. If not, alert the \
user. +    if ((d->ui->passwordLineEdit->text().isEmpty()) ||
+        (d->ui->accountLineEdit->text().isEmpty())) {
+        kDebug() << "Returning false and alerting the user.";
 
+        KMessageBox::error(this, i18n("Please enter both a Jabber ID and a \
Password.")); +
+        return false;
+    }
+
+    return true;
+}
+
+
 #include "mandatory-parameters-widget.moc"
 
--- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/mandatory-parameters-widget.h \
#1006314:1006315 @@ -33,6 +33,7 @@
     virtual ~MandatoryParametersWidget();
 
     virtual QMap<Tp::ProtocolParameter*, QVariant> parameterValues() const;
+    virtual bool validateParameterValues();
 
 private:
     Q_DISABLE_COPY(MandatoryParametersWidget);


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

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