blob: 857351c5253c5c5f32619e3e69c086420c94cbaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
import QtQuick 1.1
import QMenuModel 1.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem
Rectangle {
id: main
height: 800
width: 480
color: "#eeeeee"
function loadMainMenu(menu) {
mainMenu.model = menu
}
QDBusMenuModel {
id: menuModel
busType: 1
busName: "com.ubuntu.networksettings"
objectPath: "/com/ubuntu/networksettings"
onConnected: {
console.log("Menu appears ")
}
}
ListView {
id: mainMenu
anchors.fill: parent
model: menuModel
delegate: MenuFactory {
width: parent.width
menu: model
}
Component.onCompleted: {
menuModel.connect()
}
}
}
|