Merge lp://staging/~rafalcieslak256/ubuntu-accomplishments-viewer/uav-display-modes into lp://staging/ubuntu-accomplishments-viewer
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 209 | ||||||||
Proposed branch: | lp://staging/~rafalcieslak256/ubuntu-accomplishments-viewer/uav-display-modes | ||||||||
Merge into: | lp://staging/ubuntu-accomplishments-viewer | ||||||||
Diff against target: |
1635 lines (+702/-460) 3 files modified
Changelog (+5/-0) accomplishments_viewer/AccomplishmentsViewerWindow.py (+499/-383) data/ui/AccomplishmentsViewerWindow.ui (+198/-77) |
||||||||
To merge this branch: | bzr merge lp://staging/~rafalcieslak256/ubuntu-accomplishments-viewer/uav-display-modes | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matt Fischer | Approve | ||
Review via email: mp+133583@code.staging.launchpad.net |
Description of the change
This branch introduces lighting-fast filtering (fixes: #1076574), as well as search feature (#1076561) (which are actually fairly related).
It saves lots of time by not recreating treemodels everytime the filters change. Instead, this implementation makes heavy use of GtkTreeModelFil
Another mass efficiency gain is from dropping that terrible update_views function, which used to recreate all data we had from scratch, and is was called far too frequently. I solved that by implementing set_display(...) function, that takes a lot of optional arguments which are used to set new filter details. Usually called with just one parameter that has to be changed in the filter, it determines how to apply that change, and what will need refiltering. It also hides unnecesary UI elements. It's quite elegant, and very clear to use from many other places in code. It's also easily extensible, if one day we'll want to add a 'welcome' page, or implement help within the main window, it will be a piece of cake.
The search bar UI design is a suggestion, we may want to reorder the entry field with label, place them horisontally etc. Note that searching works for both opportunities and trophies (I find it most amazing in the "latest trophies view", as searching through it may cause some groups of accomplishments to appear/hide).
I have tested this branch carefully on both Quantal and Precise. I might have missed some UX details, let me know about any concerns you have and we'll discuss solutions.
I don't claim to understand all the GTK stuff here, but the theory makes sense to me. I do have a few questions.
What about the XXX on line 178? I don't follow what the optimization is?
Q: Why is the code in on_window_resized() all moved into a string?
I see this note about making these global, I think they'd make sense as global: date.today( ) timedelta( days = 1) timedelta( days = 7) timedelta( days = 31) timedelta( days = 180)
951 + today = datetime.
952 + margin_today = datetime.
953 + margin_week = datetime.
954 + margin_month = datetime.
955 + margin_sixmonths = datetime.
Why did you remove all these lines? What did they do? action_ appearance" >False< /property>
<property name="use_