-
Notifications
You must be signed in to change notification settings - Fork 997
feat: client integration with server features #9403
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
41aa7ad
feat(socketapii): add file actions option to list of options for files.
camilasan b5caa1e
feat(declarativeui): style file actions window.
camilasan 49fba7f
feat(declarativeui): improve the looks of the file actions Window.
camilasan b5f646a
fix(declarativeui/fileactions): file actions context menu.
camilasan 088bdc7
feat(declarativeui): add logging category to FileActionsModel.
camilasan d14d741
feat(declarativeui/fileactions): return default icon when server does…
camilasan ea59b6b
fix(declarativeui/fileactions): parse response with declarative UI el…
camilasan abd44e9
refactor(declarativeui): remove unused DeclarativeUi class.
camilasan 50621a5
fix(declarativeui): files license.
camilasan 8707fe5
refactor(declarativeui): remove Declarative UI menu item.
camilasan 776a5b1
fix(capabilities): update capabilities with new json key + adjust mim…
camilasan cd70372
fix(declarativeui): use EnforcedPlainTextLabel instead of Label.
camilasan 804cb9c
fix(capabilities): an empty mimetype_filters means the action is avai…
camilasan fc1a41c
fix(declarativeui/fileactions): handle the new params format.
camilasan d681705
style(integration): rename from declarativeui to integration.
camilasan 55aba16
fix(integratio): return true if there isn't an empty client_integrati…
camilasan b5a78c2
feat(integration): do not list file actions if the server doesn't sup…
camilasan 1a1e493
style(tray): modernize ActivityListModel::data.
camilasan 705eb8e
fix(integration): use ActivityData function to retrieve server icon.
camilasan 5580efc
refactor(tray): modernize Activity::relativeServerFileTypeIconPath.
camilasan 83aa524
feat(integration): align icons and make sure they all have the same s…
camilasan 441eda5
fix(integration): address review's comments.
camilasan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,261 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: GPL-2.0-or-later | ||
| */ | ||
|
|
||
| pragma ComponentBehavior: Bound | ||
|
|
||
| import QtQuick | ||
| import QtQuick.Window | ||
| import QtQuick.Layouts | ||
| import QtQuick.Controls | ||
| import Qt5Compat.GraphicalEffects | ||
| import com.nextcloud.desktopclient | ||
| import Style | ||
| import "./../tray" | ||
|
|
||
| ApplicationWindow { | ||
| id: root | ||
| height: Style.filesActionsHeight | ||
| width: Style.filesActionsWidth | ||
| flags: Systray.useNormalWindow ? Qt.Window : Qt.Dialog | Qt.FramelessWindowHint | ||
|
camilasan marked this conversation as resolved.
|
||
| visible: true | ||
| color: "transparent" | ||
|
|
||
| property var accountState: ({}) | ||
| property string localPath: "" | ||
| property string shortLocalPath: "" | ||
|
|
||
| readonly property int windowRadius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius | ||
|
|
||
| title: qsTr("File actions for %1").arg(root.shortLocalPath) | ||
|
|
||
| FileActionsModel { | ||
| id: fileActionModel | ||
| accountState: root.accountState | ||
| localPath: root.localPath | ||
| } | ||
|
|
||
| background: Rectangle { | ||
| id: maskSource | ||
| radius: root.windowRadius | ||
| border.width: Style.trayWindowBorderWidth | ||
| border.color: palette.dark | ||
| color: palette.window | ||
| } | ||
|
|
||
| OpacityMask { | ||
| anchors.fill: parent | ||
| anchors.margins: Style.trayWindowBorderWidth | ||
| source: maskSourceItem | ||
| maskSource: maskSource | ||
| } | ||
|
|
||
| Rectangle { | ||
| id: maskSourceItem | ||
| anchors.fill: parent | ||
| anchors.margins: Style.standardSpacing | ||
| radius: root.windowRadius | ||
| clip: true | ||
| color: Style.colorWithoutTransparency(palette.base) | ||
|
|
||
| ColumnLayout { | ||
| id: windowContent | ||
| anchors.fill: parent | ||
| anchors.margins: Style.standardSpacing | ||
|
|
||
| RowLayout { | ||
| id: windowHeader | ||
| Layout.fillWidth: true | ||
| spacing: Style.standardSpacing | ||
|
|
||
| Image { | ||
| source: fileActionModel.fileIcon + palette.windowText | ||
| Layout.preferredWidth: Style.minimumActivityItemHeight | ||
| Layout.preferredHeight: Style.minimumActivityItemHeight | ||
| Layout.alignment: Qt.AlignVCenter | ||
| Layout.margins: Style.extraSmallSpacing | ||
| } | ||
|
|
||
| EnforcedPlainTextLabel { | ||
| id: headerLocalPath | ||
| text: root.shortLocalPath | ||
| elide: Text.ElideRight | ||
| font.bold: true | ||
| font.pixelSize: Style.pixelSize | ||
| color: palette.text | ||
| Layout.fillWidth: true | ||
| Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
| } | ||
|
|
||
| Button { | ||
| id: closeButton | ||
| flat: true | ||
| padding: Style.extraSmallSpacing | ||
| spacing: 0 | ||
| icon.source: "image://svgimage-custom-color/close.svg/" + palette.windowText | ||
| icon.width: Style.extraSmallIconSize | ||
| icon.height: Style.extraSmallIconSize | ||
| Layout.alignment: Qt.AlignTop | Qt.AlignRight | ||
| Layout.rightMargin: Style.extraSmallSpacing | ||
| Layout.topMargin: Style.extraSmallSpacing | ||
| onClicked: root.close() | ||
| background: Rectangle { | ||
| color: "transparent" | ||
| radius: root.windowRadius | ||
| border.width: closeButton.hovered ? Style.trayWindowBorderWidth : 0 | ||
| border.color: palette.dark | ||
| anchors.fill: parent | ||
| Layout.margins: Style.extraSmallSpacing | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Rectangle { | ||
| id: lineTop | ||
| Layout.fillWidth: true | ||
| Layout.minimumHeight: Style.extraExtraSmallSpacing | ||
| color: palette.dark | ||
| } | ||
|
|
||
| ListView { | ||
| id: fileActionsView | ||
| model: fileActionModel | ||
| clip: true | ||
| spacing: Style.trayHorizontalMargin | ||
| Layout.fillWidth: true | ||
| Layout.fillHeight: true | ||
| delegate: fileActionsDelegate | ||
| } | ||
|
|
||
| Button { | ||
| id: responseButton | ||
| visible: responseText.text !== "" | ||
| flat: true | ||
| Layout.fillWidth: true | ||
| implicitHeight: responseContent.implicitHeight | ||
|
|
||
| padding: Style.standardSpacing | ||
| leftPadding: Style.standardSpacing | ||
| rightPadding: Style.standardSpacing | ||
| spacing: Style.standardSpacing | ||
|
|
||
| background: Rectangle { | ||
| id: responseBorder | ||
| radius: root.windowRadius | ||
| border.width: Style.trayWindowBorderWidth | ||
| border.color: palette.dark | ||
| color: palette.window | ||
| Layout.fillWidth: true | ||
| } | ||
|
|
||
| contentItem: RowLayout { | ||
| id: responseContent | ||
| anchors.fill: parent | ||
| anchors.margins: Style.smallSpacing | ||
| spacing: Style.standardSpacing | ||
| Layout.fillWidth: true | ||
| Layout.minimumHeight: Style.accountAvatarStateIndicatorSize | ||
|
|
||
| Image { | ||
| source: "image://svgimage-custom-color/backup.svg/" + palette.windowText | ||
| Layout.preferredWidth: Style.minimumActivityItemHeight | ||
| Layout.preferredHeight: Style.minimumActivityItemHeight | ||
| Layout.alignment: Qt.AlignLeft | ||
| Layout.bottomMargin: Style.standardSpacing | ||
| } | ||
|
|
||
| Text { | ||
| id: responseText | ||
| text: fileActionModel.responseLabel | ||
| textFormat: Text.RichText | ||
| color: palette.text | ||
| font.pointSize: Style.pixelSize | ||
| font.underline: true | ||
| wrapMode: Text.WordWrap | ||
| Layout.fillWidth: true | ||
| bottomPadding: Style.standardSpacing | ||
| } | ||
| } | ||
|
|
||
| MouseArea { | ||
| id: responseArea | ||
| anchors.fill: parent | ||
| cursorShape: Qt.PointingHandCursor | ||
| onClicked: Qt.openUrlExternally(fileActionModel.responseUrl) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Component { | ||
| id: fileActionsDelegate | ||
|
|
||
| RowLayout { | ||
| id: fileAction | ||
| Layout.fillWidth: true | ||
| height: implicitHeight | ||
| width: parent.width | ||
|
|
||
| required property string name | ||
| required property int index | ||
| required property string icon | ||
|
|
||
| Button { | ||
| id: fileActionButton | ||
| flat: true | ||
| Layout.fillWidth: true | ||
| implicitHeight: Style.activityListButtonHeight | ||
|
|
||
| padding: Style.standardSpacing | ||
|
|
||
| contentItem: Row { | ||
| id: fileActionsContent | ||
| anchors.fill: parent | ||
| anchors.topMargin: Style.standardSpacing | ||
| anchors.rightMargin: Style.standardSpacing | ||
| anchors.bottomMargin: Style.standardSpacing | ||
| anchors.leftMargin: Style.extraSmallSpacing | ||
| spacing: Style.standardSpacing | ||
| Layout.fillWidth: true | ||
|
|
||
| Image { | ||
| source: fileAction.icon + palette.windowText | ||
| width: Style.minimumActivityItemHeight | ||
| height: Style.minimumActivityItemHeight | ||
| fillMode: Image.PreserveAspectFit | ||
| Layout.preferredWidth: Style.minimumActivityItemHeight | ||
| Layout.preferredHeight: Style.minimumActivityItemHeight | ||
| anchors.verticalCenter: parent.verticalCenter | ||
| } | ||
|
|
||
| EnforcedPlainTextLabel { | ||
| text: fileAction.name | ||
| color: palette.text | ||
| font.pixelSize: Style.defaultFontPtSize | ||
| verticalAlignment: Text.AlignVCenter | ||
| anchors.verticalCenter: parent.verticalCenter | ||
| } | ||
| } | ||
|
|
||
| background: Rectangle { | ||
| color: "transparent" | ||
| radius: root.windowRadius | ||
| border.width: fileActionButton.hovered ? Style.trayWindowBorderWidth : 0 | ||
| border.color: palette.dark | ||
| anchors.margins: Style.standardSpacing | ||
| height: parent.height | ||
| width: parent.width | ||
| } | ||
|
|
||
| MouseArea { | ||
| id: fileActionMouseArea | ||
| anchors.fill: parent | ||
| anchors.margins: Style.standardSpacing | ||
| cursorShape: Qt.PointingHandCursor | ||
| onClicked: fileActionModel.createRequest(fileAction.index) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.