From kde-commits Thu Oct 15 21:01:18 2015 From: Alex Fiestas Date: Thu, 15 Oct 2015 21:01:18 +0000 To: kde-commits Subject: [kaccounts-providers] /: Implemented validatePage Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=144494289124973 Git commit dab52cb95a632dfc23f1782ac76a9dbe481bdd68 by Alex Fiestas. Committed on 17/04/2012 at 14:32. Pushed by mklapetek into branch 'master'. Implemented validatePage M +7 -1 basicinfo.cpp M +1 -0 basicinfo.h M +1 -1 basicinfo.ui http://commits.kde.org/kaccounts-providers/dab52cb95a632dfc23f1782ac76a9dbe= 481bdd68 diff --git a/basicinfo.cpp b/basicinfo.cpp index 8eb62d2..440af6e 100644 --- a/basicinfo.cpp +++ b/basicinfo.cpp @@ -27,6 +27,7 @@ = BasicInfo::BasicInfo(OwnCloudWizard* parent) : QWizardPage(parent) + , m_validServer(false) , m_painter(new KPixmapSequenceOverlayPainter(this)) , m_wizard(parent) { @@ -49,7 +50,11 @@ BasicInfo::~BasicInfo() = bool BasicInfo::validatePage() { - return true; + if (username->text().isEmpty() || password->text().isEmpty()) { + return false; + } + + return m_validServer; } = void BasicInfo::checkServer() @@ -149,6 +154,7 @@ void BasicInfo::setResult(bool result) icon =3D "dialog-close"; } = + m_validServer =3D result; setWorking(false); working->setPixmap(QIcon::fromTheme(icon).pixmap(working->sizeHint())); } diff --git a/basicinfo.h b/basicinfo.h index bec7acd..11aab16 100644 --- a/basicinfo.h +++ b/basicinfo.h @@ -54,6 +54,7 @@ class BasicInfo : public QWizardPage, Ui_Owncloud void setResult(bool result); = private: + bool m_validServer; QByteArray m_json; KPixmapSequenceOverlayPainter *m_painter; OwnCloudWizard *m_wizard; diff --git a/basicinfo.ui b/basicinfo.ui index 45a6041..8abede9 100644 --- a/basicinfo.ui +++ b/basicinfo.ui @@ -83,7 +83,7 @@ - +