From: Sean E. <sea...@us...> - 2002-03-09 18:39:50
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv15632/src Modified Files: gaim.h plugins.c prefs.c sound.c Log Message: Reworked sound preference by Robert McQueen. Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.310 retrieving revision 1.311 diff -u -d -r1.310 -r1.311 --- gaim.h 6 Mar 2002 00:18:02 -0000 1.310 +++ gaim.h 9 Mar 2002 18:39:46 -0000 1.311 @@ -276,6 +276,7 @@ #define OPT_SOUND_NAS 0x00004000 #define OPT_SOUND_ARTSC 0x00008000 #define OPT_SOUND_ESD 0x00010000 +#define OPT_SOUND_CMD 0x00020000 #define BUDDY_ARRIVE 0 #define BUDDY_LEAVE 1 Index: plugins.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/plugins.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- plugins.c 15 Nov 2001 22:47:03 -0000 1.86 +++ plugins.c 9 Mar 2002 18:39:46 -0000 1.87 @@ -189,7 +189,7 @@ gtk_widget_show(tophbox); /* Left side: frame with list of plugin file names */ - frame = gtk_frame_new(_("Plugins")); + frame = gtk_frame_new(_("Loaded Plugins")); gtk_box_pack_start(GTK_BOX(tophbox), frame, FALSE, FALSE, 0); gtk_widget_set_usize(frame, 140, -1); gtk_container_set_border_width(GTK_CONTAINER(frame), 6); Index: prefs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prefs.c,v retrieving revision 1.215 retrieving revision 1.216 diff -u -d -r1.215 -r1.216 --- prefs.c 6 Mar 2002 05:26:58 -0000 1.215 +++ prefs.c 9 Mar 2002 18:39:46 -0000 1.216 @@ -1519,7 +1519,7 @@ gaim_button(label, &sound_options, opt, hbox); - button = gtk_button_new_with_label(_("Play")); + button = gtk_button_new_with_label(_("Test")); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 3); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(test_sound), (void *)snd); gtk_widget_show(button); @@ -1556,8 +1556,14 @@ static void set_sound_driver(GtkWidget *w, int option) { + if (option == OPT_SOUND_CMD) + gtk_widget_set_sensitive(sndcmd, TRUE); + else + gtk_widget_set_sensitive(sndcmd, FALSE); + sound_options &= ~(OPT_SOUND_NORMAL | OPT_SOUND_BEEP | - OPT_SOUND_NAS | OPT_SOUND_ARTSC | OPT_SOUND_ESD); + OPT_SOUND_NAS | OPT_SOUND_ARTSC | + OPT_SOUND_ESD | OPT_SOUND_CMD); sound_options |= option; save_prefs(); } @@ -1671,7 +1677,7 @@ i++; #endif - opt = gtk_menu_item_new_with_label("Native"); + opt = gtk_menu_item_new_with_label("Internal"); gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_sound_driver), (gpointer)OPT_SOUND_NORMAL); @@ -1680,6 +1686,15 @@ if ((sound_options & OPT_SOUND_NORMAL) && !driver) driver = i; i++; + opt = gtk_menu_item_new_with_label("Command"); + gtk_signal_connect(GTK_OBJECT(opt), "activate", + GTK_SIGNAL_FUNC(set_sound_driver), + (gpointer)OPT_SOUND_CMD); + gtk_widget_show(opt); + gtk_menu_append(GTK_MENU(menu), opt); + if ((sound_options & OPT_SOUND_CMD) && !driver) driver = i; + i++; + gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), driver - 1); gtk_box_pack_start(GTK_BOX(hbox), omenu, FALSE, FALSE, 5); @@ -1693,7 +1708,7 @@ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); gtk_widget_show(hbox); - label = gtk_label_new(_("Command to play sound files\n(%s for filename; internal if empty)")); + label = gtk_label_new(_("Command to play sound files\n(%s for filename)")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_widget_show(label); @@ -1702,6 +1717,7 @@ gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); gtk_box_pack_end(GTK_BOX(hbox), sndcmd, FALSE, FALSE, 5); gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL); + gtk_widget_set_sensitive(sndcmd, (OPT_SOUND_CMD & sound_options)); gtk_widget_show(sndcmd); frame = gtk_frame_new(_("Events")); Index: sound.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/sound.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- sound.c 4 Mar 2002 19:15:12 -0000 1.49 +++ sound.c 9 Mar 2002 18:39:46 -0000 1.50 @@ -403,7 +403,7 @@ else if (pid == 0) { alarm(30); - if (sound_cmd[0]) { + if ((sound_options & OPT_SOUND_CMD) && sound_cmd[0]) { char *args[4]; char command[4096]; @@ -460,6 +460,12 @@ gdk_beep(); return; } + + else if ((sound_options & OPT_SOUND_CMD) && sound_cmd[0]) { + debug_printf("can't play internal sound with external command -- skipping\n"); + return; + } + pid = fork(); if (pid < 0) |