Make the news category clickable.

This commit is contained in:
Charles Haley 2011-06-13 13:15:38 +01:00
parent a3c461890f
commit 832d0db523

View File

@ -610,7 +610,7 @@ class TagTreeItem(object): # {{{
self.temporary = temporary self.temporary = temporary
self.tag = Tag(data, category=category_key, self.tag = Tag(data, category=category_key,
is_editable=category_key not in ['news', 'search', 'identifiers'], is_editable=category_key not in ['news', 'search', 'identifiers'],
is_searchable=category_key not in ['news', 'search']) is_searchable=category_key not in ['search'])
elif self.type == self.TAG: elif self.type == self.TAG:
self.icon_state_map[0] = QVariant(data.icon) self.icon_state_map[0] = QVariant(data.icon)
@ -1642,6 +1642,12 @@ class TagsModel(QAbstractItemModel): # {{{
for node in self.category_nodes: for node in self.category_nodes:
if node.tag.state: if node.tag.state:
if node.category_key == "news":
if node_searches[node.tag.state] == 'true':
ans.append('tags:=news')
else:
ans.append('( not tags:=news )')
else:
ans.append('%s:%s'%(node.category_key, node_searches[node.tag.state])) ans.append('%s:%s'%(node.category_key, node_searches[node.tag.state]))
key = node.category_key key = node.category_key