GNOME Bugzilla – Bug 382677
It should remember custom genres
Last modified: 2007-12-31 19:56:35 UTC
Hi! It would be nice if sound-juicer 'remember' the custom genres i've already typed. I ripped a lot of 'gospel' cd's, every time i had to type the word 'Gospel' in genre field. I think custom genre should be saved in somewhere (gconf, file). What do you think? Thanks, Wendell.
There's also an Ubuntu related one about this here: https://bugs.launchpad.net/ubuntu/+source/sound-juicer/+bug/132402
This would be a good weekend hack if anyone is interested. Basically, it should remember the last 10 (or something) manually entered genres.
Storage could be a file in ~/.config/sound-juicer/genres, plain text with one genre per line. Nothing complicated required.
I'm working on this.
Created attachment 101690 [details] [review] Initial patch What i did: Created sj-genre.[ch], which takes care of this feature. It has 2 public functions: - setup_genre_entry(), is called in the program initialization; - save_genre(), is called when the user extracts a CD. Suggestions, corrections are welcome, this is my first patch to sound-juicer :)
Just a small changes: +static char* genre_filename () { + return g_build_filename (g_get_home_dir (), + ".config", + "sound-juicer", + "genres", + NULL); +} g_get_user_config_dir() should be used instead of g_get_home_dir(), ".config". g_file_set_contents() should have a GError argument, and check it. It's fine to just g_warning() the error message instead of producing a dialog though.
Created attachment 101855 [details] [review] Proposed patch, second try Hi, Ross. Here it is, with your suggestions. One side effect: One new string to translators, we have to send an e-mail to i18n list announcing that. Okay to commit?
Looks good to me, thanks!
Okay, commited. Will send the e-mail. 2007-12-31 Jonh Wendell <jwendell@gnome.org> * src/sj-genres.[ch]: * src/Makefile.am: Add sj-genre, to handle the genre entry, by saving custom genres. Closes #382677. * src/sj-main.c: Call setup_genre_entry() to setup the genre entry. * src/sj-extracting.c: Call save_genre() to save the custom genre when extracting.