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


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

The following commit has been merged in the master branch:
commit d8bb369bad182fed9a9af81f13c69bb1b18fb074
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Mon Aug 3 13:19:08 2009 +0000

    Implement checking all mandatory paramters are filled in.
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm-plugins/; revision=1006315
---
 gabble/mandatory-parameters-widget.cpp | 16 ++++++++++++++++
 gabble/mandatory-parameters-widget.h   |  1 +
 2 files changed, 17 insertions(+)

diff --git a/gabble/mandatory-parameters-widget.cpp b/gabble/mandatory-parameters-widget.cpp
index 96b8688..e29fb29 100644
--- a/gabble/mandatory-parameters-widget.cpp
+++ b/gabble/mandatory-parameters-widget.cpp
@@ -23,6 +23,7 @@
 #include "ui_mandatory-parameters-widget.h"
 
 #include <KDebug>
+#include <KMessageBox>
 
 class MandatoryParametersWidget::Private
 {
@@ -106,6 +107,21 @@ QMap<Tp::ProtocolParameter*, QVariant> MandatoryParametersWidget::parameterValue
     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"
 
diff --git a/gabble/mandatory-parameters-widget.h b/gabble/mandatory-parameters-widget.h
index 021c43f..4af3e28 100644
--- a/gabble/mandatory-parameters-widget.h
+++ b/gabble/mandatory-parameters-widget.h
@@ -33,6 +33,7 @@ public:
     virtual ~MandatoryParametersWidget();
 
     virtual QMap<Tp::ProtocolParameter*, QVariant> parameterValues() const;
+    virtual bool validateParameterValues();
 
 private:
     Q_DISABLE_COPY(MandatoryParametersWidget);

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list