changeset 28554:de93712181c1

Don't reset the sound theme pref if we're just loading the list of themes. Otherwise, any custom sounds will be reset whenever you open the preferences. Fixes #9955.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 04 Sep 2009 03:41:31 +0000
parents 561679822c97
children ba35d96b9440
files ChangeLog pidgin/gtkprefs.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Sep 04 03:00:04 2009 +0000
+++ b/ChangeLog	Fri Sep 04 03:41:31 2009 +0000
@@ -47,6 +47,8 @@
 	* Fix the auto-personize functionality in the Buddy List.
 	* Set the window icon for the media window to an icon corresponding to
 	  the type of call (headphone or webcam).
+	* Customized sound files are no longer reset whenever opening the
+	  Preferences dialog.
 
 version 2.6.1 (08/18/2009):
 	* Fix a crash when some users send you a link in a Yahoo IM
--- a/pidgin/gtkprefs.c	Fri Sep 04 03:00:04 2009 +0000
+++ b/pidgin/gtkprefs.c	Fri Sep 04 03:41:31 2009 +0000
@@ -91,6 +91,8 @@
 static GtkWidget *prefs_blist_themes_combo_box;
 static GtkWidget *prefs_status_themes_combo_box;
 
+static gboolean prefs_sound_themes_loading;
+
 /*
  * PROTOTYPES
  */
@@ -580,6 +582,7 @@
 	gchar *filename;
 	GtkTreeIter iter;
 
+	prefs_sound_themes_loading = TRUE;
 	/* refresh the list of themes in the manager */
 	purple_theme_manager_refresh();
 
@@ -614,6 +617,7 @@
 	prefs_set_active_theme_combo(prefs_sound_themes_combo_box, prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"));
 	prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"));
 	prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"));
+	prefs_sound_themes_loading = FALSE;
 }
 
 /* init all the theme variables so that the themes can be sorted later and used by pref pages */
@@ -965,7 +969,7 @@
 	gchar *new_theme;
 	GtkTreeIter new_iter;
 
-	if(gtk_combo_box_get_active_iter(combo_box, &new_iter)) {
+	if(gtk_combo_box_get_active_iter(combo_box, &new_iter) && !prefs_sound_themes_loading) {
 
 		gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &new_iter, 2, &new_theme, -1);