[Pkg-owncloud-commits] [owncloud-client] 347/498: Use already available password field
Sandro Knauß
hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:05 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 7e79a7890136b1a319d1f3bcd454329cfb71c91a
Author: Roeland Jago Douma <roeland at famdouma.nl>
Date: Thu Jul 16 20:55:54 2015 +0200
Use already available password field
---
src/gui/sharedialog.cpp | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index c19319a..4d9869b 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -28,7 +28,6 @@
#include <QBuffer>
#include <QFileIconProvider>
#include <QClipboard>
-#include <QInputDialog>
namespace {
int SHARETYPE_PUBLIC = 3;
@@ -260,6 +259,11 @@ void ShareDialog::setPassword(const QString &password)
OcsShareJob *job = new OcsShareJob(verb, url, _account, this);
job->setPostParams(requestParams);
connect(job, SIGNAL(jobFinished(QVariantMap)), this, SLOT(slotPasswordSet(QVariantMap)));
+
+ if (_public_share_id == 0) {
+ connect(job, SIGNAL(jobFinished(QVariantMap)), this, SLOT(slotCreateShareFetched(QVariantMap)));
+ }
+
job->start();
_passwordJobRunning = true;
}
@@ -445,20 +449,15 @@ void ShareDialog::slotCheckBoxShareLinkClicked()
* Ask for it directly
*/
if (_account->capabilities()["files_sharing"].toMap()["public"].toMap()["password"].toMap()["enforced"].toBool()) {
- bool ok;
- const QString pass = QInputDialog::getText(this,
- tr("Password for share by link"),
- tr("Sharing by link requires a password:"),
- QLineEdit::Password,
- QString(),
- &ok);
-
- if (!ok) {
- _pi_link->stopAnimation();
- _ui->checkBox_shareLink->setChecked(false);
- return;
- }
- postParams.append(qMakePair(QString::fromLatin1("password"), pass));
+ _ui->checkBox_password->setChecked(true);
+ _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();
+ return;
}
OcsShareJob *job = new OcsShareJob("POST", url, _account, this);
--
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