Can't setup filters for lense using python and libunity-4.0

Asked by Vadim Rutkovsky

Hello,

I'm trying to create a new lens using libunity-4.0 and I'm currently stuck adding filters and categories to the lens.
Here is a short piece of code to create a lens and add a category and a filter:

------
from gi.repository import Unity

<.... class stuff and daemon declaring .... >

scope = Unity.Scope.new ("/com/canonical/unity/scope/gdata")
lens = Unity.Lens.new ("/com/canonical/unity/lens/gdata", "gdata")

# Creating a category
category = Unity.Category.new ("Category", Gio.ThemedIcon.new ("group-most-used").to_string(), Unity.CategoryRenderer.HORIZONTAL_TILE)
scope.props.sources.append(category)

#Creating a filter
filter = Unity.RadioOptionFilter.new ("type", "Type", "type", "type")
scope.props.filters.append(filter)

---------
This compiles perfectly, but filters and categories are not added.
'props.sources' and 'props.filters' variables are empty after append() calls. These variables are read-only, so 'props.filters = [filter]' also fails.

Is this an issue - or there is a correct way to add filters and categories in the scope?

Full code is available at lp:unity-gdata-lens

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu libunity Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.