def __init__(self): SingleScopeLens.__init__(self) provider.connect_to_signal( 'data_changed', self.update_props, dbus_interface="com.everpad.provider", ) self.update_props() self._lens.props.search_in_global = True self._scope.connect('preview-uri', self.preview)
def __init__(self): SingleScopeLens.__init__(self) provider.connect_to_signal( 'data_changed', self.update_props, dbus_interface="com.everpad.provider", ) provider.connect_to_signal( 'settings_changed', self.settings_changed, dbus_interface="com.everpad.provider", ) self.update_props() self._scope.connect('preview-uri', self.preview)
def on_filtering_changed(self, scope): tags = scope.get_filter('tags') self.tag_filter_ids = map(lambda tag: int(tag.props.id), filter(lambda tag: tag.props.active, tags.options)) notebook = scope.get_filter('notebooks').get_active_option() if notebook: self.notebook_filter_id = int(notebook.props.id) else: self.notebook_filter_id = None place = scope.get_filter('places').get_active_option() if place: self.place_filter_id = int(place.props.id) else: self.place_filter_id = None SingleScopeLens.on_filtering_changed(self, scope)
def on_filtering_changed(self, scope): tags = scope.get_filter('tags') self.tag_filter_ids = map( lambda tag: int(tag.props.id), filter(lambda tag: tag.props.active, tags.options)) notebook = scope.get_filter('notebooks').get_active_option() if notebook: self.notebook_filter_id = int(notebook.props.id) else: self.notebook_filter_id = None place = scope.get_filter('places').get_active_option() if place: self.place_filter_id = int(place.props.id) else: self.place_filter_id = None SingleScopeLens.on_filtering_changed(self, scope)
def __init__(self): SingleScopeLens.__init__(self) icon = Gio.ThemedIcon.new("/usr/share/icons/unity-icon-theme/places/svg/group-recent.svg") tags = Unity.CheckOptionFilter.new('tags', _('Tags'), icon, True) for tag_struct in provider.list_tags(): tag = Tag.from_tuple(tag_struct) tags.add_option(str(tag.id), tag.name, icon) notebooks = Unity.RadioOptionFilter.new('notebooks', _('Notebooks'), icon, True) for notebook_struct in provider.list_notebooks(): notebook = Notebook.from_tuple(notebook_struct) notebooks.add_option(str(notebook.id), notebook.name, icon) places = Unity.RadioOptionFilter.new('places', _('Places'), icon, True) for place_struct in provider.list_places(): place = Place.from_tuple(place_struct) places.add_option(str(place.id), place.name, icon) self._lens.props.filters = [notebooks, tags, places]
def __init__(self): SingleScopeLens.__init__(self) self._lens.props.search_in_global = True
def __init__(self): SingleScopeLens.__init__(self) self._lens.props.search_in_global = True self.EnglishToPersian = self.ConvertXmlToDict('/usr/share/unity-dilmaj/generic.xdb')