GNOME Bugzilla – Bug 364824
Auto-completion for Artist and Album in TrackEditor
Last modified: 2008-10-12 15:46:34 UTC
This patch adds the AutoComplete class which is instantiated with a Gtk.Entry and a delegate to a query function. As text is typed into the Entry, it is run through the query function which returns a List<string> of auto-complete suggestions. The List<string> is then packed into a pop-up Window with a TreeView which the user can thumb through. At least, that's how it should work. I am a Gtk novice so I did lots of hacky things to keep the focus where it belongs. It works fine with everything I've thought to try but there could be logical errors that I missed. There were a few minor issues I couldn't figure out: When the TreeViewColumn.Sizing is set to Autosize, the width will only go as large as the first CellRenderer AFTER THE MODEL HAS CHANGED AND BEFORE THE WINDOW IS HIDDEN. That is to say, if the pop-up window is hidden, then the model is changed, the the window is shown, the width is correct, but if the model is then changed again, the width will be only as large as the first cell's width until the window is hidden again. Is this a Gtk bug? Also, I couldn't find a way to give the TreeView the appearance of being focused. It isn't actually focused - the Entry is - but I wanted the cells to be highlighted as though the TreeView had focus. And sometimes the auto-complete window steals focus when it pops up, even though it's AcceptFocus is false. This only happens sometimes.
Created attachment 75329 [details] [review] The patch
Scott: I just tried to quickly test this and I get no autocomplete window. I can see the focus of my track editor window changing (but the entry remains focused), but no popup. This may be an issue with compiz, but is also probably an issue in your code. For instance, the same kind of popup is used in MonoDevelop with its autocompletion.
Created attachment 77940 [details] [review] A cleaned-up version of the patch Hmm. I just tried this with the CVS head and it worked for me. I've tested it successfully with both Beryl and Metacity. I don't know where to start looking for problems. If you're using stock NLD or Suse image that has a live CD, I could pop that in a give it a try. I've cleaned up the code and added some documentation if you want it give it a look yourself. There are no changes in behavior.
The patch doesn't apply to trunk anymore.
This is a feature I definitely miss from iTunes. Has anything happened with this in the past couple years?
This is implemented in 1.3.2 and can be closed, correct?
Yes, thanks, closing.