[Pkg-owncloud-commits] [owncloud-client] 325/470: ShareDialog: Tell a user early if resharing is impossible #4679
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:20 UTC 2016
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 8d300b049fad26087e5243c3020131273201e4fa
Author: Christian Kamm <mail at ckamm.de>
Date: Thu Apr 14 10:03:15 2016 +0200
ShareDialog: Tell a user early if resharing is impossible #4679
---
src/gui/sharedialog.cpp | 12 +++++++++++-
src/gui/sharedialog.ui | 2 +-
src/gui/sharelinkwidget.cpp | 2 +-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index d677c42..8704993 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -160,6 +160,17 @@ void ShareDialog::showSharingUi()
auto theme = Theme::instance();
+ // There's no difference between being unable to reshare and
+ // being unable to reshare with reshare permission.
+ bool canReshare = _maxSharingPermissions & SharePermissionShare;
+
+ if (!canReshare) {
+ auto label = new QLabel(this);
+ label->setText(tr("The file can not be shared because it was shared without sharing permission."));
+ _ui->shareWidgetsLayout->addWidget(label);
+ return;
+ }
+
// We only do user/group sharing from 8.2.0
bool userGroupSharing =
theme->userGroupSharing()
@@ -167,7 +178,6 @@ void ShareDialog::showSharingUi()
bool autoShare = !userGroupSharing;
-
if (userGroupSharing) {
_userGroupWidget = new ShareUserGroupWidget(_accountState->account(), _sharePath, _localPath, _maxSharingPermissions, this);
_ui->shareWidgetsLayout->addWidget(_userGroupWidget);
diff --git a/src/gui/sharedialog.ui b/src/gui/sharedialog.ui
index a0829cc..7b5fca8 100644
--- a/src/gui/sharedialog.ui
+++ b/src/gui/sharedialog.ui
@@ -63,7 +63,7 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
diff --git a/src/gui/sharelinkwidget.cpp b/src/gui/sharelinkwidget.cpp
index 5a1fb55..d7c1755 100644
--- a/src/gui/sharelinkwidget.cpp
+++ b/src/gui/sharelinkwidget.cpp
@@ -292,7 +292,7 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
setShareCheckBoxTitle(true);
} else {
// If its clear that resharing is not allowed, display an error
- if( _maxSharingPermissions == 0 ) {
+ if( !(_maxSharingPermissions & SharePermissionShare) ) {
displayError(tr("The file can not be shared because it was shared without sharing permission."));
_ui->checkBox_shareLink->setEnabled(false);
} else if (_autoShare && _ui->checkBox_shareLink->isEnabled()) {
--
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