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 2.0 as PlasmaComponents // for Menu and MenuItem
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
model: plasmoid.nativeInterface.recentChangesModel
|
|
|
|
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
|
|
|
|
PlasmaCore.IconItem {
|
|
|
|
Layout.preferredWidth: units.iconSizes.small
|
|
|
|
Layout.preferredHeight: units.iconSizes.small
|
|
|
|
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 {
|
|
|
|
width: units.smallSpacing
|
|
|
|
}
|
2021-10-15 23:16:58 +02:00
|
|
|
Image {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.preferredWidth: units.iconSizes.small
|
|
|
|
Layout.preferredHeight: units.iconSizes.small
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
2021-10-15 23:16:58 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2022-02-05 21:31:53 +01:00
|
|
|
source: plasmoid.nativeInterface.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 {
|
|
|
|
width: units.smallSpacing
|
|
|
|
}
|
2021-10-15 23:16:58 +02:00
|
|
|
Image {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.preferredWidth: units.iconSizes.small
|
|
|
|
Layout.preferredHeight: units.iconSizes.small
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
2021-10-15 23:16:58 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2022-02-05 21:31:53 +01:00
|
|
|
source: plasmoid.nativeInterface.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 {
|
2020-01-18 16:37:20 +01:00
|
|
|
Layout.preferredWidth: units.iconSizes.small
|
|
|
|
Layout.preferredHeight: units.iconSizes.small
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
|
2021-10-15 23:16:58 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2022-02-05 21:31:53 +01:00
|
|
|
source: plasmoid.nativeInterface.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() {
|
|
|
|
plasmoid.nativeInterface.copyToClipboard(path)
|
|
|
|
}
|
|
|
|
function copyDeviceId() {
|
|
|
|
plasmoid.nativeInterface.copyToClipboard(modifiedBy)
|
|
|
|
}
|
2022-04-09 14:52:00 +02:00
|
|
|
function copyFolderId() {
|
|
|
|
plasmoid.nativeInterface.copyToClipboard(folderId)
|
|
|
|
}
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PlasmaComponents.Menu {
|
|
|
|
id: contextMenu
|
|
|
|
PlasmaComponents.MenuItem {
|
|
|
|
text: qsTr("Copy path")
|
|
|
|
icon: "edit-copy"
|
|
|
|
onClicked: recentChangesView.currentItem.copyPath()
|
|
|
|
}
|
|
|
|
PlasmaComponents.MenuItem {
|
|
|
|
text: qsTr("Copy device ID")
|
|
|
|
icon: "network-server-symbolic"
|
|
|
|
onClicked: recentChangesView.currentItem.copyDeviceId()
|
|
|
|
}
|
2022-04-09 14:52:00 +02:00
|
|
|
PlasmaComponents.MenuItem {
|
|
|
|
text: qsTr("Copy directory ID")
|
|
|
|
icon: "folder"
|
|
|
|
onClicked: recentChangesView.currentItem.copyFolderId()
|
|
|
|
}
|
2020-01-18 16:37:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|