syncthingtray/plasmoid/package6/contents/ui/main.qml

76 lines
2.3 KiB
QML
Raw Normal View History

import QtQuick 2.2
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kirigami 2.20 as Kirigami
PlasmoidItem {
id: syncthingApplet
2023-11-14 23:58:22 +01:00
Plasmoid.title: "Syncthing"
Plasmoid.icon: "syncthing"
2023-11-14 23:58:22 +01:00
switchWidth: Kirigami.Units.gridUnit * Plasmoid.size.width
switchHeight: Kirigami.Units.gridUnit * Plasmoid.size.height
compactRepresentation: CompactRepresentation {}
fullRepresentation: FullRepresentation {
2023-11-14 23:58:22 +01:00
Layout.minimumWidth: syncthingApplet.switchWidth
Layout.minimumHeight: syncthingApplet.switchHeight
}
2023-11-14 23:58:22 +01:00
toolTipMainText: Plasmoid.statusText
toolTipSubText: Plasmoid.additionalStatusText
toolTipItem: ToolTipView {}
Plasmoid.contextualActions: [
PlasmaCore.Action {
text: qsTr("Open Syncthing")
icon.name: "syncthing"
onTriggered: Plasmoid.showWebUI()
},
PlasmaCore.Action {
text: qsTr("Rescan all folders")
icon.name: "folder-sync"
onTriggered: Plasmoid.connection.rescanAllDirs()
},
PlasmaCore.Action {
text: qsTr("Show own device ID")
icon.name: "view-barcode-qr"
onTriggered: Plasmoid.showOwnDeviceId()
},
PlasmaCore.Action {
text: qsTr("Restart Syncthing")
icon.name: "system-reboot"
onTriggered: Plasmoid.connection.restart()
},
PlasmaCore.Action {
text: qsTr("Log")
icon.name: "text-x-generic"
onTriggered: Plasmoid.showLog()
},
PlasmaCore.Action {
text: qsTr("Internal errors")
icon.name: "data-error"
onTriggered: Plasmoid.showInternalErrorsDialog()
visible: Plasmoid.hasInternalErrors
},
PlasmaCore.Action {
text: qsTr("About")
icon.name: "help-about"
onTriggered: Plasmoid.showAboutDialog()
}
]
PlasmaCore.Action {
id: configureAction
text: qsTr("Settings")
icon.name: "configure"
onTriggered: Plasmoid.showSettingsDlg()
}
Component.onCompleted: {
Plasmoid.initEngine(this)
Plasmoid.setInternalAction("configure", configureAction)
}
}