2017-08-29 23:58:49 +02:00
|
|
|
import QtQuick 2.0
|
|
|
|
import org.kde.plasma.plasmoid 2.0
|
|
|
|
import org.kde.kquickcontrolsaddons 2.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: syncthingApplet
|
|
|
|
|
2017-09-09 21:40:00 +02:00
|
|
|
Plasmoid.switchWidth: units.gridUnit * 25
|
|
|
|
Plasmoid.switchHeight: units.gridUnit * 20
|
|
|
|
|
2017-08-29 23:58:49 +02:00
|
|
|
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
|
2017-09-09 21:40:00 +02:00
|
|
|
Plasmoid.compactRepresentation: CompactRepresentation {
|
|
|
|
}
|
2019-02-12 00:23:51 +01:00
|
|
|
Plasmoid.fullRepresentation: Loader {
|
|
|
|
source: "FullRepresentation.qml"
|
|
|
|
onLoaded: item.updateSize()
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|
2017-09-09 21:40:00 +02:00
|
|
|
|
2017-08-29 23:58:49 +02:00
|
|
|
Plasmoid.icon: "syncthingtray"
|
|
|
|
Plasmoid.toolTipMainText: plasmoid.nativeInterface.statusText
|
|
|
|
Plasmoid.toolTipSubText: plasmoid.nativeInterface.additionalStatusText
|
2017-09-09 21:40:00 +02:00
|
|
|
Plasmoid.toolTipItem: Loader {
|
|
|
|
source: "ToolTipView.qml"
|
|
|
|
}
|
|
|
|
|
2017-08-29 23:58:49 +02:00
|
|
|
Plasmoid.hideOnWindowDeactivate: true
|
|
|
|
|
|
|
|
function action_showWebUI() {
|
|
|
|
plasmoid.nativeInterface.showWebUI()
|
|
|
|
}
|
|
|
|
|
|
|
|
function action_showSettings() {
|
2017-09-08 16:59:53 +02:00
|
|
|
plasmoid.nativeInterface.showSettingsDlg()
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function action_rescanAllDirs() {
|
|
|
|
plasmoid.nativeInterface.connection.rescanAllDirs()
|
|
|
|
}
|
|
|
|
|
2018-02-19 01:38:41 +01:00
|
|
|
function action_restartSyncthing() {
|
|
|
|
plasmoid.nativeInterface.connection.restart()
|
|
|
|
}
|
|
|
|
|
2017-08-29 23:58:49 +02:00
|
|
|
function action_showLog() {
|
|
|
|
plasmoid.nativeInterface.showLog()
|
|
|
|
}
|
|
|
|
|
2017-09-08 16:59:53 +02:00
|
|
|
function action_showErrors() {
|
|
|
|
plasmoid.nativeInterface.showInternalErrorsDialog()
|
|
|
|
}
|
|
|
|
|
2017-08-29 23:58:49 +02:00
|
|
|
function action_showAboutDialog() {
|
2017-08-30 22:41:02 +02:00
|
|
|
plasmoid.nativeInterface.showAboutDialog()
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2017-09-09 21:40:00 +02:00
|
|
|
plasmoid.removeAction("configure")
|
|
|
|
plasmoid.setAction("showWebUI", qsTr("Web UI"), "internet-web-browser")
|
|
|
|
plasmoid.setAction("showSettings", qsTr("Settings"), "configure")
|
|
|
|
plasmoid.setAction("showLog", qsTr("Log"), "text-x-generic")
|
2019-02-26 17:43:28 +01:00
|
|
|
plasmoid.setAction(
|
|
|
|
"showErrors", qsTr("Internal errors"),
|
|
|
|
":/icons/hicolor/scalable/emblems/emblem-important-old.svg")
|
2018-02-19 01:38:41 +01:00
|
|
|
plasmoid.setAction("rescanAllDirs", qsTr("Rescan all directories"),
|
|
|
|
"folder-sync")
|
|
|
|
plasmoid.setAction("restartSyncthing", qsTr("Restart Syncthing"),
|
|
|
|
"system-reboot")
|
2017-09-09 21:40:00 +02:00
|
|
|
plasmoid.setAction("showAboutDialog", qsTr("About"), "help-about")
|
2017-08-29 23:58:49 +02:00
|
|
|
}
|
|
|
|
}
|