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 382677 - It should remember custom genres
It should remember custom genres
Status: RESOLVED FIXED
Product: sound-juicer
Classification: Applications
Component: interface
2.19.x
Other Linux
: Normal enhancement
: ---
Assigned To: Sound Juicer Maintainers
Sound Juicer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-05 18:05 UTC by Jonh Wendell
Modified: 2007-12-31 19:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Initial patch (8.45 KB, patch)
2007-12-27 19:19 UTC, Jonh Wendell
needs-work Details | Review
Proposed patch, second try (8.63 KB, patch)
2007-12-30 18:30 UTC, Jonh Wendell
committed Details | Review

Description Jonh Wendell 2006-12-05 18:05:45 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.
Comment 1 Pedro Villavicencio 2007-08-14 13:25:27 UTC
There's also an Ubuntu related one about this here: https://bugs.launchpad.net/ubuntu/+source/sound-juicer/+bug/132402
Comment 2 Ross Burton 2007-12-19 17:04:02 UTC
This would be a good weekend hack if anyone is interested.  Basically, it should remember the last 10 (or something) manually entered genres.
Comment 3 Ross Burton 2007-12-24 16:25:44 UTC
Storage could be a file in ~/.config/sound-juicer/genres, plain text with one genre per line.  Nothing complicated required. 
Comment 4 Jonh Wendell 2007-12-27 14:50:16 UTC
I'm working on this.
Comment 5 Jonh Wendell 2007-12-27 19:19:54 UTC
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 :)
Comment 6 Ross Burton 2007-12-30 17:17:40 UTC
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.

Comment 7 Jonh Wendell 2007-12-30 18:30:02 UTC
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?
Comment 8 Ross Burton 2007-12-31 16:59:52 UTC
Looks good to me, thanks!
Comment 9 Jonh Wendell 2007-12-31 19:56:35 UTC
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.