2020-01-18 16:37:20 +01:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import QtQml.Models 2.2
|
2020-11-27 19:09:47 +01:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
2020-01-18 16:37:20 +01:00
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
2023-05-21 20:14:24 +02:00
|
|
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
2020-01-18 16:37:20 +01:00
|
|
|
|
|
|
|
Item {
|
|
|
|
property alias view: recentChangesView
|
|
|
|
objectName: "RecentChangesPage"
|
|
|
|
|
2022-05-05 20:51:53 +02:00
|
|
|
PlasmaComponents3.ScrollView {
|
2020-01-18 16:37:20 +01:00
|
|
|
anchors.fill: parent
|
|
|
|
|
2022-05-09 23:14:22 +02:00
|
|
|
// HACK: workaround for https://bugreports.qt.io/browse/QTBUG-83890
|
|
|
|
PlasmaComponents3.ScrollBar.horizontal.policy: PlasmaComponents3.ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
contentItem: TopLevelView {
|
2020-01-18 16:37:20 +01:00
|
|
|
id: recentChangesView
|
2023-05-21 20:14:24 +02:00
|
|
|
model: plasmoid.recentChangesModel
|
2020-01-18 16:37:20 +01:00
|
|
|
delegate: TopLevelItem {
|
2022-09-01 22:32:17 +02:00
|
|
|
width: recentChangesView.effectiveWidth()
|
2020-01-18 16:37:20 +01:00
|
|
|
ColumnLayout {
|
|
|
|
width: parent.width
|
|
|
|
spacing: 0
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2023-11-14 01:50:24 +01:00
|
|
|
Kirigami.Icon {
|
2023-05-21 20:14:24 +02:00
|
|
|
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
|
|
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
|
|
source: actionIcon
|
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
|
|
Layout.fillWidth: true
|
|
|
|
elide: Text.ElideRight
|
|
|
|
text: extendedAction
|
|
|
|
}
|
|
|
|
Item {
|
2023-05-21 20:14:24 +02:00
|
|
|
width: Kirigami.Units.smallSpacing
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
2021-10-15 23:16:58 +02:00
|
|
|
Image {
|
2023-05-21 20:14:24 +02:00
|
|
|
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
|
|
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
2021-10-15 23:16:58 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2023-05-21 20:14:24 +02:00
|
|
|
source: plasmoid.faUrl + "calendar"
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
|
|
elide: Text.ElideRight
|
|
|
|
text: eventTime
|
|
|
|
}
|
|
|
|
Item {
|
2023-05-21 20:14:24 +02:00
|
|
|
width: Kirigami.Units.smallSpacing
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
2021-10-15 23:16:58 +02:00
|
|
|
Image {
|
2023-05-21 20:14:24 +02:00
|
|
|
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
|
|
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
2021-10-15 23:16:58 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2023-05-21 20:14:24 +02:00
|
|
|
source: plasmoid.faUrl + "qrcode"
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
|
|
|
elide: Text.ElideRight
|
|
|
|
text: modifiedBy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2021-10-15 23:16:58 +02:00
|
|
|
Image {
|
2023-05-21 20:14:24 +02:00
|
|
|
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
|
|
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
2021-10-15 23:16:58 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2023-05-21 20:14:24 +02:00
|
|
|
source: plasmoid.faUrl + (itemType === "file" ? "file-o" : "folder-o")
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2020-01-18 16:37:20 +01:00
|
|
|
text: directoryId + ": "
|
|
|
|
font.weight: Font.DemiBold
|
|
|
|
}
|
2020-11-27 19:09:47 +01:00
|
|
|
PlasmaComponents3.Label {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
text: path
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function copyPath() {
|
2023-05-21 20:14:24 +02:00
|
|
|
plasmoid.copyToClipboard(path)
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
|
|
|
function copyDeviceId() {
|
2023-05-21 20:14:24 +02:00
|
|
|
plasmoid.copyToClipboard(modifiedBy)
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
2022-04-09 14:52:00 +02:00
|
|
|
function copyFolderId() {
|
2023-05-21 20:14:24 +02:00
|
|
|
plasmoid.copyToClipboard(folderId)
|
2022-04-09 14:52:00 +02:00
|
|
|
}
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
|
|
|
|
2023-05-21 20:14:24 +02:00
|
|
|
PlasmaExtras.Menu {
|
2020-01-18 16:37:20 +01:00
|
|
|
id: contextMenu
|
2023-05-21 20:14:24 +02:00
|
|
|
PlasmaExtras.MenuItem {
|
2020-01-18 16:37:20 +01:00
|
|
|
text: qsTr("Copy path")
|
|
|
|
icon: "edit-copy"
|
|
|
|
onClicked: recentChangesView.currentItem.copyPath()
|
|
|
|
}
|
2023-05-21 20:14:24 +02:00
|
|
|
PlasmaExtras.MenuItem {
|
2020-01-18 16:37:20 +01:00
|
|
|
text: qsTr("Copy device ID")
|
|
|
|
icon: "network-server-symbolic"
|
|
|
|
onClicked: recentChangesView.currentItem.copyDeviceId()
|
|
|
|
}
|
2023-05-21 20:14:24 +02:00
|
|
|
PlasmaExtras.MenuItem {
|
2023-09-17 20:33:31 +02:00
|
|
|
text: qsTr("Copy folder ID")
|
2022-04-09 14:52:00 +02:00
|
|
|
icon: "folder"
|
|
|
|
onClicked: recentChangesView.currentItem.copyFolderId()
|
|
|
|
}
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|