← Back to team overview

ubuntu-accomplishments-contributors team mailing list archive

Major change in accomplishments-viewer

 

Hello everyone,

This is a note praticularly interesting for those who either
extensivelly hack on the viewer, or are willing to contribute there.
I've just merged in a significant change that slightly reorganizes the
way GtkIconViews filter trophies. We used to call update_view at any
time we wanted to refilter them, and that used to be not efficient at
all.
I've gotten rid of that function, and the new way of filtering is by
the use of set_display.
The set_display function takes care of setting up filters and applying
changes to the UI. It's called with one of it's arguments:


	def set_display(self,
                    mode              = DISPLAY_MODE_UNSPECIFIED,
                    accomID           = "",
                    trophies_mode     = MYTROPHIES_FILTER_UNSPECIFIED,
                    filter_locked     = DISPLAY_FILTER_LOCKED_UNSPECIFIED,
                    filter_collection = DISPLAY_FILTER_COLLECTION_UNSPECIFIED,
                    filter_category   = DISPLAY_FILTER_CATEGORY_UNSPECIFIED,
                    filter_subcat     = DISPLAY_FILTER_SUBCAT_UNSPECIFIED,
                    search_query      = DISPLAY_FILTER_SEARCH_UNSPECIFIED):

This way you can set only the element of the filter that you need. For
example, to switch to trophies display, one would call:
     self.set_display(mode=DISPLAY_MODE_MYTROPHIES)
etc. and that function will switch display to desired GtkNotebook
page, update toolbar buttons, proper filtering, and other details.

As usually, in case of any questions do not hesitate to ask me.

Rafał Cieślak