]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Hide 'Allow resharing' checkbox when resharing not allowed by server
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 10 Aug 2023 08:55:33 +0000 (16:55 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 11 Aug 2023 14:59:59 +0000 (22:59 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/ShareDelegate.qml
src/gui/filedetails/ShareDetailsPage.qml
src/gui/filedetails/ShareView.qml

index 0539f7119a516a9ae104645b74988d381575344d..26a4db2069bf9afc4f7b5b2b21bc865e92a86591 100644 (file)
@@ -52,6 +52,7 @@ GridLayout {
     property bool backgroundsVisible: true
 
     property bool canCreateLinkShares: true
+    property bool canReshare: true
 
     readonly property bool isLinkShare: model.shareType === ShareModel.ShareTypeLink
     readonly property bool isPlaceholderLinkShare: model.shareType === ShareModel.ShareTypePlaceholderLink
@@ -268,6 +269,7 @@ GridLayout {
                     shareModelData: model
 
                     canCreateLinkShares: root.canCreateLinkShares
+                    canReshare: root.canReshare
 
                     onCloseShareDetails: root.rootStackView.pop(root.rootStackView.initialItem, StackView.PopTransition)
 
index 48f26df994ad835c00f6539f3fd9a74e4eb88f3f..3d908a17c8b6f0cbe8ff55fb649d7e62de71d27e 100644 (file)
@@ -49,6 +49,7 @@ Page {
     property var shareModelData: ({})
 
     property bool canCreateLinkShares: true
+    property bool canReshare: true
 
     readonly property var share: shareModelData.share ?? ({})
 
@@ -447,7 +448,8 @@ Page {
                         checkable: true
                         checked: root.resharingAllowed
                         text: qsTr("Allow resharing")
-                        enabled: !root.isSharePermissionChangeInProgress
+                        enabled: !root.isSharePermissionChangeInProgress && root.canReshare
+                        visible: root.canReshare
                         onClicked: root.toggleAllowResharing(checked);
 
                         Connections {
index 90ad8e899e844e56aec1160be1c48d9783699f7b..5b9ce77b6ac33e8350b573f6d85cc642e258f1ea 100644 (file)
@@ -35,6 +35,7 @@ ColumnLayout {
     readonly property bool sharingPossible: shareModel && shareModel.canShare && shareModel.sharingEnabled
     readonly property bool userGroupSharingPossible: sharingPossible && shareModel.userGroupSharingEnabled
     readonly property bool publicLinkSharingPossible: sharingPossible && shareModel.publicLinkSharesEnabled
+    readonly property bool resharingAllowed: shareModel && shareModel.resharingAllowed
 
     readonly property bool loading: sharingPossible && (!shareModel ||
                                                         shareModel.fetchOngoing ||
@@ -214,6 +215,7 @@ ColumnLayout {
                     rootStackView: root.rootStackView
                     backgroundsVisible: root.backgroundsVisible
                     canCreateLinkShares: root.publicLinkSharingPossible
+                    canReshare: root.resharingAllowed
 
                     onCreateNewLinkShare: {
                         root.waitingForSharesToChange = true;