gnome-prototypes-team / gnome-music

Gnome Music
https://live.gnome.org/Music
Other
5 stars 13 forks source link

Implement filtering on views #141

Closed seiflotfy closed 11 years ago

vrutkovs commented 11 years ago

Running locally

python3 ./gnome-music
Gtk-Message: Failed to load module "pk-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Running from source tree, using local files
/home/vrutkovs/src/gnome/gnome-music/gnomemusic/window.py:87: Warning: gbinding.c:905: The source object of type GtkButton has no property called 'active'
  self.toolbar._search_button.bind_property("active", self.toolbar.searchbar, "search-mode-enabled", GObject.BindingFlags.BIDIRECTIONAL)
Traceback (most recent call last):
  File "/home/vrutkovs/src/gnome/gnome-music/gnomemusic/application.py", line 29, in do_activate
    self._window = Window(self)
  File "/home/vrutkovs/src/gnome/gnome-music/gnomemusic/window.py", line 20, in __init__
    self._setup_view()
  File "/home/vrutkovs/src/gnome/gnome-music/gnomemusic/window.py", line 87, in _setup_view
    self.toolbar._search_button.bind_property("active", self.toolbar.searchbar, "search-mode-enabled", GObject.BindingFlags.BIDIRECTIONAL)
TypeError: Cannot create binding from <Button object at 0x7fa7b83fb320 (GtkButton at 0x1b7e7f0)>.active to <Searchbar object at 0x7fa7b83f1d70 (gnomemusic+searchbar+Searchbar at 0x17a8900)>.search-mode-enabled
vrutkovs commented 11 years ago

At this point 'Search' function works as 'filter loaded items'. We should split this feature into two parts (according to latest mockups):

Let's concentrate on filtering existing items for now

kyoushuu commented 11 years ago

When I tried it in songs view, I get the following after clicking select button:

/opt/gnome/lib64/python3.3/site-packages/gi/types.py:114: Warning: invalid cast from 'GtkTreeStore' to 'GtkListStore'
  return info.invoke(*args, **kwargs)

(gnome-music:5883): Gtk-CRITICAL **: gtk_list_store_set_valist: assertion 'GTK_IS_LIST_STORE (list_store)' failed

(gnome-music:5883): Gtk-CRITICAL **: gtk_list_store_set_valist: assertion 'GTK_IS_LIST_STORE (list_store)' failed

(gnome-music:5883): Gtk-CRITICAL **: gtk_list_store_set_valist: assertion 'GTK_IS_LIST_STORE (list_store)' failed

...

(sometimes I need to select an item first before it shows up)

vrutkovs commented 11 years ago

@kyoushuu this is a limitation (or a bug) of Gd.MainView - its model should be ListModel, but it cannot be TreeModel

kyoushuu commented 11 years ago

@kyoushuu this is a limitation (or a bug) of Gd.MainView - its model should be ListModel, but it cannot be TreeModel

Eh, that's quite an important limitation, because Gtk.TreeModelSort and Gtk.TreeModelFilter are very useful.

kyoushuu commented 11 years ago

Sometimes, when I do some selection in one view, enables select mode, select some items, cancel selection mode, move to other view, then doing the selection stuff again, it shows this: (gnome-music:16271): Gtk-CRITICAL **: gtk_tree_model_filter_get_path: assertion 'GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed.

Kind of random though, sometimes you need to switch back again then do some selection and cancel selection mode for it to show up.

vrutkovs commented 11 years ago

@kyoushuu Seen this once also, it looks like another libgd problem here, but cannot find the exact line which fails

kyoushuu commented 11 years ago

The search bar doesn't show up here.

Also, we can't use GtkSearchBar if we want to support GTK+ 3.8 :( maybe we should use GdRevealer.

kyoushuu commented 11 years ago
vrutkovs commented 11 years ago

Usually, when I go to Artists view, open up search bar, do a search then go to end of artists list and click load more, another "All Artists" item gets added to the end

Cannot reproduce this, 'Load More' is broken for me

Search doesn't work inside an album in Albums View

Fixed

kyoushuu commented 11 years ago
  1. Go to Songs view
  2. Play a song
  3. Open up search bar
  4. Search for another song (the current song shouldn't be in the results)
  5. Set repeat mode to repeat all
  6. Go to end of song and let it play the next one

Warning:

(gnome-music:28012): Gtk-CRITICAL **: gtk_tree_model_filter_iter_next: assertion 'GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp' failed

Sometimes this happens without doing a search, it will play the first song instead of the next one on repeat all.

kyoushuu commented 11 years ago

I can no longer reproduce All Artists bug after backing up and restoring my journal.

kyoushuu commented 11 years ago

GtkSearchBar needs to be ported to GdRevealer for compatibility with GTK+ 3.8. Just tell me if you don't want to do the porting, I'll do them myself ;)

vrutkovs commented 11 years ago

@kyoushuu

Go to Songs view
Play a song
Open up search bar
Search for another song (the current song shouldn't be in the results)
Set repeat mode to repeat all
Go to end of song and let it play the next one

Reproducible, but I can't find the source yet. I'd propose skipping this warning, as it doesn't crash or stop the song from playing

Just tell me if you don't want to do the porting, I'll do them myself ;)

Yeah, I don't think I want to do this. We can also do this after 3.10 release

kyoushuu commented 11 years ago

Just tell me if you don't want to do the porting, I'll do them myself ;)

Yeah, I don't think I want to do this. We can also do this after 3.10 release

Done!