def _get_markup_for_tags(self, tag_names): '''Given a list of tags names, generates the pango markup to render that list with the tag colors used in GTG @param tag_names: the list of the tags (strings) @return str: the pango markup string ''' if ALLTASKS_TAG in tag_names: tags_txt = "" else: tags_txt = get_colored_tags_markup(self.req, tag_names) return "<small>" + tags_txt + "</small>"
def _get_markup_for_tags(self, tag_names): '''Given a list of tags names, generates the pango markup to render that list with the tag colors used in GTG @param tag_names: the list of the tags (strings) @return str: the pango markup string ''' if GenericBackend.ALLTASKS_TAG in tag_names: tags_txt = "" else: tags_txt = get_colored_tags_markup(self.req, tag_names) return "<small>" + tags_txt + "</small>"
def refresh_number_of_tasks(self): '''refreshes the number of synced tasks by this backend''' #FIXME: disabled for now. I'm not sure that this is nice because the # count is correct only after the backend has synced all the pending # tasks, and this is quite misleading (invernizzi) return #This will have to be changed for import/export.. tags = self.backend.get_attached_tags() tasks_number = self.backend.get_number_of_tasks() if GenericBackend.ALLTASKS_TAG in tags: if tasks_number == 0: markup = _("Ready to start syncing") else: markup = ngettext("Syncing your only task", \ "Syncing all %d tasks" % tasks_number, tasks_number) else: tags_txt = get_colored_tags_markup(self.req, tags) if tasks_number == 0: markup = _("There's no task tagged %s") % tags_txt else: markup = ngettext("Syncing a task tagged %s" % tags_txt, \ "Syncing %d tasks tagged %s" % (tasks_number, tags_txt), \ tasks_number) self.sync_desc_label.set_markup(markup)