+
+ def updateTags(self):
+ # get a list of tags available in this list
+ self.tags = list(self["list"].tags)
+
+ # by default, we do not display any filtering options
+ self.tag_first = ""
+ self.tag_second = ""
+
+ # when tags are present, however, the first two are
+ # directly mapped to the second, third ("green", "yellow") buttons
+ if len(self.tags) > 0:
+ self.tag_first = self.tags[0]
+
+ if len(self.tags) > 1:
+ self.tag_second = self.tags[1]
+
+ self["key_green"].text = self.tag_first
+ self["key_yellow"].text = self.tag_second
+
+ # the rest is presented in a list, available on the
+ # fourth ("blue") button
+ if len(self.tags) > 2:
+ self["key_blue"].text = _("Other...")
+ else:
+ self["key_blue"].text = ""
+
+ def reloadList(self):
+ self["list"].reload(self.current_ref, self.selected_tags)
+ self.lengthTimer.start(10, 1)
+ self.lengthPosition = 0
+ self.lengthLength = len(self["list"])
+
+ def showAll(self):
+ self.selected_tags = None
+ self.reloadList()
+
+ def showTagsN(self, n):
+ if len(self.tags) < n:
+ self.showTagWarning()
+ else:
+ self.selected_tags = set([self.tags[n - 1]])
+ self.reloadList()
+
+ def showTagsFirst(self):
+ self.showTagsN(1)
+
+ def showTagsSecond(self):
+ self.showTagsN(2)
+
+ def showTagsMenu(self):
+ if len(self.tags) < 3:
+ self.showTagWarning()
+ else:
+ pass
+
+ def showTagWarning(self):
+ print "select some tags first!"