aboutsummaryrefslogtreecommitdiff
path: root/tests/script/menuscript.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/script/menuscript.py')
-rw-r--r--tests/script/menuscript.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/script/menuscript.py b/tests/script/menuscript.py
index 60cb33b..542308a 100644
--- a/tests/script/menuscript.py
+++ b/tests/script/menuscript.py
@@ -53,8 +53,9 @@ class Script(dbus.service.Object):
self._list.walk()
steps -= 1
+ """ TODO: We only support string states for now """
@dbus.service.method(dbus_interface=INTERFACE_NAME,
- in_signature='', out_signature='s')
+ in_signature='', out_signature='ss')
def popActivatedAction(self):
return self._list._activatedActions.pop(0)
@@ -94,7 +95,7 @@ class Action(object):
parent.append_item(item)
# Action
- act = Gio.SimpleAction.new(self._kargs['actionName'], None)
+ act = Gio.SimpleAction.new(self._kargs['actionName'], self._kargs['actionStateType'])
act.connect('activate', self._list._onActionActivated)
self._list._rootAction.insert(act)
@@ -135,13 +136,14 @@ class ActionList(object):
self._rootAction = None
self._activatedActions = []
- def appendItem(self, label, actionName, link=None, parentId=None, properties=None):
+ def appendItem(self, label, actionName, link=None, parentId=None, properties=None, actionStateType=None):
self._actions.append(Action(self, 'append',
parentId=parentId,
label=label,
actionName=actionName,
link=link,
- properties=properties))
+ properties=properties,
+ actionStateType=actionStateType))
def removeItem(self, menuId, actionName=None):
self._actions.append(Action(self, 'remove',
@@ -205,7 +207,10 @@ class ActionList(object):
if self._ownNameID:
Gio.bus_unown_name(self._ownNameID)
self._ownNameID = None
+
+ self._root = None
+ self._rootAction = None
self._restore()
def _onActionActivated(self, action, parameter):
- self._activatedActions.append(action.get_name())
+ self._activatedActions.append((action.get_name(), parameter.get_string()))