~mmcg069/software-center/image-data-cleanup

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/views/appview.py

  • Committer: Matthew McGowan
  • Date: 2011-08-24 12:03:03 UTC
  • mfrom: (2131.1.56 software-center)
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110824120303-hvqa291osfyeic7x
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
    _SORT_METHOD_INDEX = (SortMethods.BY_ALPHABET,
56
56
                          SortMethods.BY_TOP_RATED,
57
 
                          SortMethods.BY_SEARCH_RANKING)
 
57
                          SortMethods.BY_SEARCH_RANKING,
 
58
                          SortMethods.BY_CATALOGED_TIME)
58
59
    # indices that relate to the above tuple
59
60
    _SORT_BY_ALPHABET = 0
60
61
    _SORT_BY_TOP_RATED = 1
61
62
    _SORT_BY_SEARCH_RANKING = 2
 
63
    _SORT_BY_NEWEST_FIRST = 3
62
64
 
63
65
    def __init__(self, db, cache, icons, show_ratings):
64
66
        Gtk.VBox.__init__(self)
135
137
        combo.append_text(_("By Name"))
136
138
        combo.append_text(_("By Popularity"))
137
139
        combo.append_text(_("By Relevance"))
 
140
        combo.append_text(_("By Newest First"))
138
141
        combo.set_active(self._SORT_BY_TOP_RATED)
139
142
        return combo
140
143
 
145
148
        combo.handler_unblock(self._handler_changed)
146
149
        return
147
150
 
 
151
    def set_allow_user_sorting(self, do_allow):
 
152
        if do_allow:
 
153
            self.sort_methods_combobox.show()
 
154
        else:
 
155
            self.sort_methods_combobox.hide()
 
156
 
148
157
    def set_header_labels(self, first_line, second_line):
149
158
        if second_line:
150
159
            markup = '%s\n<big><b>%s</b></big>' % (first_line, second_line)