Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide password field in share settings when share type does not support passwords #5948

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/gui/filedetails/ShareDetailsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Page {
readonly property int currentPermissionMode: shareModelData.currentPermissionMode

readonly property bool isLinkShare: shareModelData.shareType === ShareModel.ShareTypeLink
readonly property bool isEmailShare: shareModelData.shareType === ShareModel.ShareTypeEmail
readonly property bool shareSupportsPassword: isLinkShare || isEmailShare

readonly property bool isFolderItem: shareModelData.sharedItemType === ShareModel.SharedItemTypeFolder
readonly property bool isEncryptedItem: shareModelData.sharedItemType === ShareModel.SharedItemTypeEncryptedFile || shareModelData.sharedItemType === ShareModel.SharedItemTypeEncryptedFolder || shareModelData.sharedItemType === ShareModel.SharedItemTypeEncryptedTopLevelFolder
Expand Down Expand Up @@ -560,7 +562,10 @@ Page {
checkable: true
checked: root.passwordProtectEnabled
text: qsTr("Password protect")
enabled: !root.waitingForPasswordProtectEnabledChange && !root.passwordEnforced
visible: root.shareSupportsPassword
enabled: visible &&
!root.waitingForPasswordProtectEnabledChange &&
!root.passwordEnforced

onClicked: {
root.togglePasswordProtect(checked);
Expand All @@ -581,7 +586,7 @@ Page {
height: visible ? implicitHeight : 0
spacing: scrollContentsColumn.indicatorSpacing

visible: root.passwordProtectEnabled
visible: root.shareSupportsPassword && root.passwordProtectEnabled

Image {
Layout.preferredWidth: scrollContentsColumn.indicatorItemWidth
Expand All @@ -603,7 +608,8 @@ Page {
height: visible ? implicitHeight : 0

text: root.password !== "" ? root.password : root.passwordPlaceholder
enabled: root.passwordProtectEnabled &&
enabled: visible &&
root.passwordProtectEnabled &&
!root.waitingForPasswordChange &&
!root.waitingForPasswordProtectEnabledChange

Expand Down
Loading