[Pkg-owncloud-commits] [owncloud-client] 126/164: ShareDialog: If the password is empty, disable button

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:57:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 8e7b7caf04a2b9a81221f5bcda388b5581d4d76d
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Mar 11 14:57:55 2015 +0100

    ShareDialog: If the password is empty, disable button
---
 src/gui/sharedialog.cpp | 9 +++++++++
 src/gui/sharedialog.h   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index ae4506c..3f9af72 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -66,10 +66,12 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
     connect(_ui->checkBox_shareLink, SIGNAL(clicked()), this, SLOT(slotCheckBoxShareLinkClicked()));
     connect(_ui->checkBox_password, SIGNAL(clicked()), this, SLOT(slotCheckBoxPasswordClicked()));
     connect(_ui->lineEdit_password, SIGNAL(returnPressed()), this, SLOT(slotPasswordReturnPressed()));
+    connect(_ui->lineEdit_password, SIGNAL(textChanged(QString)), this, SLOT(slotPasswordChanged(QString)));
     connect(_ui->pushButton_setPassword, SIGNAL(clicked(bool)), SLOT(slotPasswordReturnPressed()));
     connect(_ui->checkBox_expire, SIGNAL(clicked()), this, SLOT(slotCheckBoxExpireClicked()));
     connect(_ui->calendar, SIGNAL(clicked(QDate)), SLOT(slotCalendarClicked(QDate)));
 
+    _ui->pushButton_setPassword->setEnabled(false);
     _ui->widget_shareLink->hide();
     _ui->lineEdit_password->hide();
     _ui->pushButton_setPassword->hide();
@@ -179,6 +181,12 @@ void ShareDialog::slotPasswordReturnPressed()
     _ui->lineEdit_password->clearFocus();
 }
 
+void ShareDialog::slotPasswordChanged(const QString& newText)
+{
+    // disable the set-passwort button
+    _ui->pushButton_setPassword->setEnabled( newText.length() > 0 );
+}
+
 void ShareDialog::setPassword(const QString &password)
 {
     if( _passwordJobRunning ) {
@@ -356,6 +364,7 @@ void ShareDialog::slotDeleteShareFetched(const QString &reply)
     _ui->pushButton_copy->setEnabled(false);
     _ui->widget_shareLink->hide();
     _ui->lineEdit_password->hide();
+    _ui->pushButton_setPassword->setEnabled(false);
     _ui->pushButton_setPassword->hide();
     _ui->checkBox_expire->setChecked(false);
     _ui->checkBox_password->setChecked(false);
diff --git a/src/gui/sharedialog.h b/src/gui/sharedialog.h
index 2d86fd0..50710de 100644
--- a/src/gui/sharedialog.h
+++ b/src/gui/sharedialog.h
@@ -73,6 +73,7 @@ private slots:
     void slotCheckBoxPasswordClicked();
     void slotCheckBoxExpireClicked();
     void slotPasswordReturnPressed();
+    void slotPasswordChanged(const QString& newText);
     void slotPushButtonCopyLinkPressed();
     void slotThumbnailFetched(const int &statusCode, const QByteArray &reply);
 private:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list