From 9507bb4be6b7f0f0774438f1382c7caa46f843df Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 8 May 2015 14:53:38 +0200 Subject: [PATCH] ShareDialog: Password ui fixes. #3189 * Change the textedit-empty text to be just "Password" * Hide the 'Copy link' button when the share isn't created yet * Show the checked and disabled 'Password required' checkbox when a password is required. --- src/gui/sharedialog.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 31c44f6c5..355f46c73 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -292,6 +292,7 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply) if (data.value("share_type").toInt() == SHARETYPE_PUBLIC) { _public_share_id = data.value("id").toULongLong(); + _ui->pushButton_copy->show(); _ui->widget_shareLink->show(); _ui->checkBox_shareLink->setChecked(true); @@ -443,9 +444,10 @@ void ShareDialog::slotCreateShareFetched(const QVariantMap &reply) if (code == 403) { // there needs to be a password _ui->checkBox_password->setChecked(true); - _ui->checkBox_password->setVisible(false); - _ui->checkBox_password->setText(tr("Public shå requires a password:")); + _ui->checkBox_password->setEnabled(false); + _ui->checkBox_password->setText(tr("Public shå requires a password")); _ui->lineEdit_password->setFocus(); + _ui->pushButton_copy->hide(); _ui->widget_shareLink->show(); slotCheckBoxPasswordClicked(); @@ -456,6 +458,7 @@ void ShareDialog::slotCreateShareFetched(const QVariantMap &reply) } _public_share_id = reply.value("ocs").toMap().values("data")[0].toMap().value("id").toULongLong(); + _ui->pushButton_copy->show(); getShares(); } @@ -464,7 +467,7 @@ void ShareDialog::slotCheckBoxPasswordClicked() if (_ui->checkBox_password->checkState() == Qt::Checked) { _ui->lineEdit_password->show(); _ui->pushButton_setPassword->show(); - _ui->lineEdit_password->setPlaceholderText(tr("Choose a password for the public link")); + _ui->lineEdit_password->setPlaceholderText(tr("Password")); _ui->lineEdit_password->setFocus(); } else { ShareDialog::setPassword(QString()); -- 2.30.2