GNOME Bugzilla – Bug 324502
Provide Text-Completion in editing fields
Last modified: 2006-02-15 06:19:50 UTC
When one's editing the tags of tracks, it would be very good if the browser tree models could be used to propose completions for the album, artist and genre fields. I'd like to work in this.
Created attachment 56245 [details] [review] patch Start of a patch, unfortunately all it does propose for completion is "All". Please give me a hint about the missing bits.
What you'll need to do to get this working is change rhythmdb_property_model_set_property so that when the query model is changed, it iterates over the contents of the new query model and calls rhythmdb_property_model_row_inserted_cb for each entry. Also, you probably shouldn't (don't need to) run a new query to do this. Instead you should be able to get the query-model property from the library source and use that. I have no specific suggestions as to how you'd get at the library source from there, though..
(In reply to comment #2) > What you'll need to do to get this working is change > rhythmdb_property_model_set_property so that when the query model is changed, > it iterates over the contents of the new query model and calls > rhythmdb_property_model_row_inserted_cb for each entry. The latest patch on bug 118862 fixes this - so you could copy the rhythmdb-property-model.c changes (or wait until they get committed). > Also, you probably shouldn't (don't need to) run a new query to do this. > Instead you should be able to get the query-model property from the library > source and use that. I have no specific suggestions as to how you'd get at the > library source from there, though.. rb_shell_get_source_by_entry_type should probably be exported. You could then do "library_source = rb_shell_get_source_by_entry_type (shell, RHYTHMDB_ENTRY_TYPE_SONG);", if you made the song-info widget get told the shell. Once you got the library source, you could probably use rb_source_get_extra_views to get the property views, and get the property models from them (rather than making a new, identical, one yourself).
I'm happy to wait...
*** Bug 331054 has been marked as a duplicate of this bug. ***
The patch I mentioned has been committed, so this should be doable now. Basically what needs to be done. 1) make rb_shell_get_source_by_entry_type exported, rather than static (trivial) 2) Use the following to get property model for the property "propid" RBSource *library_source; GList *prop_views ; GList *l; library_source = rb_shell_get_source_by_entry_type (shell, RHYTHMDB_ENTRY_TYPE_SONG); prop_views = rb_source_get_property_views (library_source); for (l = prop_views; l != NULL; l = g_list_next (l)) { RhythmDBPropType p; g_object_get (G_OBJECT (l->data), "prop", &p, NULL); if (p == propid) break; } if (l) { RhythmDBPropertyModel *prop_model = rb_property_view_get_model (RHYTHMDB_PROPERTY_VIEW (l->data)); do completing using prop_model }
Created attachment 59328 [details] [review] patch Just to commit my current status into bugzilla. It's missing things from the last comment, but it works right now.
Created attachment 59329 [details] Screenshot of the result
2006-02-14 Sven Herzberg <herzi@gnome-de.org> * widgets/rb-song-info.c: Prove text-completion when editing title, artist or album ==== Committed after talking to James.
I just tested this change in CVS HEAD, and it works great for Artist and Genre, but doesn't work for Album, no completions appear. Re-opening.
This was due to a typo, which I've fixed in cvs.
Thanks, seems to work now. Would be useful to include the bug number in the ChangeLog and there is a small typo at the beginning ("prove" should probably be "provide"), and should read: * widgets/rb-song-info.c: Provide text-completion when editing title, artist or album. Fixes bug #324502.