diff options
-rw-r--r-- | examples/Menu.qml | 18 | ||||
-rw-r--r-- | examples/MenuFactory.qml | 33 | ||||
-rw-r--r-- | examples/MenuSection.qml | 30 | ||||
-rw-r--r-- | examples/SubMenu.qml | 14 | ||||
-rw-r--r-- | examples/main.qml | 43 | ||||
-rw-r--r-- | examples/simple-client.py | 26 | ||||
-rw-r--r-- | examples/simple.py | 48 |
7 files changed, 0 insertions, 212 deletions
diff --git a/examples/Menu.qml b/examples/Menu.qml deleted file mode 100644 index 3060edb..0000000 --- a/examples/Menu.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 1.1 -import Ubuntu.Components 0.1 -import Ubuntu.Components.ListItems 0.1 as ListItem - - -ListItem.Standard { - property variant menu - - width: parent.width - text: menu.label - - onClicked: { - if (menu.linkSubMenu) - loadMainMenu(menu.linkSubMenu) - else - loadMainMenu(menu.linkSection) - } -} diff --git a/examples/MenuFactory.qml b/examples/MenuFactory.qml deleted file mode 100644 index faecd9b..0000000 --- a/examples/MenuFactory.qml +++ /dev/null @@ -1,33 +0,0 @@ -import QtQuick 1.1 -import Ubuntu.Components 0.1 -import Ubuntu.Components.ListItems 0.1 as ListItem - -Loader { - property variant menu - //height: childrenRect.height - - onMenuChanged: { - if (menu) { - if (menu.linkSection) - source = "MenuSection.qml" - else if (menu.linkSubMenu) - source = "SubMenu.qml" - else - source = "Menu.qml"; - } - - console.debug("Load: " + source) - } - - onStatusChanged: { - if (status == Loader.Ready) { - if (menu.linkSection) - item.menu = menu - else if (menu.linkSubMenu) - item.menu = menu - else if (menu) - item.menu = menu - } - } -} - diff --git a/examples/MenuSection.qml b/examples/MenuSection.qml deleted file mode 100644 index 170fa89..0000000 --- a/examples/MenuSection.qml +++ /dev/null @@ -1,30 +0,0 @@ -import QtQuick 1.1 -import Ubuntu.Components 0.1 -import Ubuntu.Components.ListItems 0.1 as ListItem - - -Item { - property variant menu - width: parent.width - height: contents.height - - Column { - id: contents - width: parent.width - - ListItem.Header { - text: menu.label - } - - Repeater { - model: menu ? menu.linkSection : undefined - - MenuFactory { - width: contents.width - menu: model - } - } - - ListItem.Divider { } - } -} diff --git a/examples/SubMenu.qml b/examples/SubMenu.qml deleted file mode 100644 index 7049c3b..0000000 --- a/examples/SubMenu.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick 1.1 -import Ubuntu.Components 0.1 -import Ubuntu.Components.ListItems 0.1 as ListItem - - -ListItem.Standard { - property variant menu - - anchors.fill: parent - text: menu.label - progression: true - - onClicked: { loadMainMenu (menu.linkSubMenu) } -} diff --git a/examples/main.qml b/examples/main.qml deleted file mode 100644 index 0615a63..0000000 --- a/examples/main.qml +++ /dev/null @@ -1,43 +0,0 @@ -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" - onStatusChanged: { - console.log("Menu model status update: " + status) - } - } - - ListView { - id: mainMenu - anchors.fill: parent - model: menuModel - - delegate: MenuFactory { - width: parent.width - menu: model - } - - Component.onCompleted: { - menuModel.start() - } - } -} - - diff --git a/examples/simple-client.py b/examples/simple-client.py deleted file mode 100644 index ff7b416..0000000 --- a/examples/simple-client.py +++ /dev/null @@ -1,26 +0,0 @@ -# creates this menu: -# -# Menu Item -# ---------------- -# One -# Two -# Three -# ---------------- -# Submenu > | One -# | Two -# | Three - -from gi.repository import GLib, Gio - -def on_items_changed (model, position, removed, added, data): - print 'items changed:', position, removed, added - -bus = Gio.bus_get_sync (Gio.BusType.SESSION, None) -print dir(bus) -menu = bus.get_menu_model(':1.473', '/menu') -#menu = Gio.dbus_menu_model_get(Gio.BusType.SESSION, ':1.473', '/menu') -menu.connect ('items-changed', on_items_changed) - -loop = GLib.MainLoop () -loop.run () - diff --git a/examples/simple.py b/examples/simple.py deleted file mode 100644 index 4efbb8a..0000000 --- a/examples/simple.py +++ /dev/null @@ -1,48 +0,0 @@ -# creates this menu: -# -# Menu Item -# ---------------- -# One -# Two -# Three -# ---------------- -# Submenu > | One -# | Two -# | Three - -from gi.repository import GLib, Gio - -def action_activated (action, parameter): - print action.get_name () - -actions = Gio.SimpleActionGroup () -for i in ['one', 'two', 'three']: - action = Gio.SimpleAction.new (i, None) - action.connect ('activate', action_activated) - actions.insert (action) - -numbers = Gio.Menu () -numbers.append ('One', 'one') -numbers.append ('Two', 'two') -numbers.append ('Three', 'three') - -numbers2 = Gio.Menu () -numbers2.append ('One2', 'one2') -numbers2.append ('Two2', 'two2') -numbers2.append ('Three2', 'three2') - - -menu = Gio.Menu () -menu.append ('Menu item', 'one') -menu.append_section ('Numbers', numbers) -menu.append_submenu ('Submenu', numbers2) - -# export the menu and action group on d-bus -bus = Gio.bus_get_sync (Gio.BusType.SESSION, None) -bus.export_menu_model ('/menu', menu) -bus.export_action_group ('/menu', actions) -print bus.get_unique_name () - -loop = GLib.MainLoop () -loop.run () - |