[app] Fix plugin list
Filter out not loaded plugins Fix loading the plugin components
This commit is contained in:
parent
aa09d338ee
commit
42ce4764d2
2 changed files with 10 additions and 11 deletions
|
@ -46,36 +46,35 @@ Kirigami.ScrollablePage {
|
|||
]
|
||||
|
||||
ListView {
|
||||
model: plugins
|
||||
model: plugins.filter((plugin) => plugin.loaded)
|
||||
delegate: QQC2.ItemDelegate {
|
||||
text: name
|
||||
icon.name: iconName
|
||||
text: modelData.name
|
||||
icon.name: modelData.iconName
|
||||
highlighted: false
|
||||
icon.color: "transparent"
|
||||
width: ListView.view.width
|
||||
visible: loaded
|
||||
onClicked: onClick()
|
||||
onClicked: modelData.onClick()
|
||||
}
|
||||
|
||||
property list<QtObject> plugins: [
|
||||
PluginItem {
|
||||
name: i18nd("kdeconnect-app", "Multimedia control")
|
||||
interfaceFactory: MprisDbusInterfaceFactory
|
||||
component: "qrc:/qml/mpris.qml"
|
||||
component: "mpris.qml"
|
||||
pluginName: "mprisremote"
|
||||
device: root.currentDevice
|
||||
},
|
||||
PluginItem {
|
||||
name: i18nd("kdeconnect-app", "Remote input")
|
||||
interfaceFactory: RemoteControlDbusInterfaceFactory
|
||||
component: "qrc:/qml/mousepad.qml"
|
||||
component: "mousepad.qml"
|
||||
pluginName: "remotecontrol"
|
||||
device: root.currentDevice
|
||||
},
|
||||
PluginItem {
|
||||
name: i18nd("kdeconnect-app", "Presentation Remote")
|
||||
interfaceFactory: RemoteKeyboardDbusInterfaceFactory
|
||||
component: "qrc:/qml/presentationRemote.qml"
|
||||
component: "presentationRemote.qml"
|
||||
pluginName: "remotecontrol"
|
||||
device: root.currentDevice
|
||||
},
|
||||
|
@ -96,7 +95,7 @@ Kirigami.ScrollablePage {
|
|||
PluginItem {
|
||||
name: i18nd("kdeconnect-app", "Run command")
|
||||
interfaceFactory: RemoteCommandsDbusInterfaceFactory
|
||||
component: "qrc:/qml/runcommand.qml"
|
||||
component: "runcommand.qml"
|
||||
pluginName: "remotecommands"
|
||||
device: root.currentDevice
|
||||
},
|
||||
|
@ -116,7 +115,7 @@ Kirigami.ScrollablePage {
|
|||
PluginItem {
|
||||
name: i18nd("kdeconnect-app", "Volume control")
|
||||
interfaceFactory: RemoteSystemVolumeDbusInterfaceFactory
|
||||
component: "qrc:/qml/volume.qml"
|
||||
component: "volume.qml"
|
||||
pluginName: "remotesystemvolume"
|
||||
device: root.currentDevice
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ QtObject
|
|||
|
||||
var obj = interfaceFactory.create(checker.device.id());
|
||||
var page = pageStack.push(
|
||||
component,
|
||||
Qt.resolvedUrl(component),
|
||||
{ pluginInterface: obj,
|
||||
device: checker.device
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue