After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 324502 - Provide Text-Completion in editing fields
Provide Text-Completion in editing fields
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: Sven Herzberg
RhythmBox Maintainers
: 331054 (view as bug list)
Depends on: 118862
Blocks:
 
 
Reported: 2005-12-19 14:58 UTC by Sven Herzberg
Modified: 2006-02-15 06:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.67 KB, patch)
2005-12-21 06:17 UTC, Sven Herzberg
needs-work Details | Review
patch (4.69 KB, patch)
2006-02-14 12:00 UTC, Sven Herzberg
committed Details | Review
Screenshot of the result (131.55 KB, image/png)
2006-02-14 12:02 UTC, Sven Herzberg
  Details

Description Sven Herzberg 2005-12-19 14:58: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.
Comment 1 Sven Herzberg 2005-12-21 06:17:35 UTC
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.
Comment 2 Jonathan Matthew 2005-12-22 08:31:49 UTC
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..
Comment 3 James "Doc" Livingston 2006-01-28 04:11:06 UTC
(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).
Comment 4 Sven Herzberg 2006-01-29 12:03:10 UTC
I'm happy to wait...
Comment 5 James "Doc" Livingston 2006-02-14 06:44:02 UTC
*** Bug 331054 has been marked as a duplicate of this bug. ***
Comment 6 James "Doc" Livingston 2006-02-14 06:51:57 UTC
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
}
Comment 7 Sven Herzberg 2006-02-14 12:00:23 UTC
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.
Comment 8 Sven Herzberg 2006-02-14 12:02:16 UTC
Created attachment 59329 [details]
Screenshot of the result
Comment 9 Sven Herzberg 2006-02-14 12:27:06 UTC
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.
Comment 10 Alex Lancaster 2006-02-14 17:07:04 UTC
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.
Comment 11 James "Doc" Livingston 2006-02-15 06:04:37 UTC
This was due to a typo, which I've fixed in cvs.
Comment 12 Alex Lancaster 2006-02-15 06:19:50 UTC
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.