comparison src/gtkprefs.c @ 11642:58bc500cf226

[gaim-migrate @ 13919] sf patch #1324285, from Casey Harkins fix "sounds while away" in HEAD This patch adds a GaimAccount as a parameter to the sound playing functions, allowing the caller to specify the account the sound is related to. If the account is not NULL and the while_away preference is not set, then the account is checked to see if it is away, if so, the sound is not played. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 12 Oct 2005 02:27:32 +0000
parents 3a05b53a589e
children 186d2d293ef4
comparison
equal deleted inserted replaced
11641:925c1960af34 11642:58bc500cf226
1495 1495
1496 static void 1496 static void
1497 test_sound(GtkWidget *button, gpointer i_am_NULL) 1497 test_sound(GtkWidget *button, gpointer i_am_NULL)
1498 { 1498 {
1499 char *pref; 1499 char *pref;
1500 gboolean temp_value1, temp_value2; 1500 gboolean temp_value;
1501 1501
1502 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", 1502 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s",
1503 gaim_gtk_sound_get_event_option(sound_row_sel)); 1503 gaim_gtk_sound_get_event_option(sound_row_sel));
1504 1504
1505 temp_value1 = gaim_prefs_get_bool("/core/sound/while_away"); 1505 temp_value = gaim_prefs_get_bool(pref);
1506 temp_value2 = gaim_prefs_get_bool(pref); 1506
1507 1507 if (!temp_value) gaim_prefs_set_bool(pref, TRUE);
1508 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", TRUE); 1508
1509 if (!temp_value2) gaim_prefs_set_bool(pref, TRUE); 1509 gaim_sound_play_event(sound_row_sel, NULL);
1510 1510
1511 gaim_sound_play_event(sound_row_sel); 1511 if (!temp_value) gaim_prefs_set_bool(pref, FALSE);
1512
1513 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", FALSE);
1514 if (!temp_value2) gaim_prefs_set_bool(pref, FALSE);
1515 1512
1516 g_free(pref); 1513 g_free(pref);
1517 } 1514 }
1518 1515
1519 /* 1516 /*