comparison src/prefs.c @ 1214:0baf39dc5437

[gaim-migrate @ 1224] can choose to run command to play sounds committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 08 Dec 2000 07:46:22 +0000
parents 47cf56b72d4b
children 1c4185a78183
comparison
equal deleted inserted replaced
1213:1bdb08cc5d59 1214:0baf39dc5437
907 907
908 gtk_widget_show(prefdialog); 908 gtk_widget_show(prefdialog);
909 } 909 }
910 910
911 static GtkWidget *sndent[NUM_SOUNDS]; 911 static GtkWidget *sndent[NUM_SOUNDS];
912 static GtkWidget *sndcmd = NULL;
912 913
913 void close_sounddialog(GtkWidget *w, GtkWidget *w2) 914 void close_sounddialog(GtkWidget *w, GtkWidget *w2)
914 { 915 {
915 916
916 GtkWidget *dest; 917 GtkWidget *dest;
1020 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); 1021 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
1021 sndent[snd] = entry; 1022 sndent[snd] = entry;
1022 gtk_widget_show(entry); 1023 gtk_widget_show(entry);
1023 } 1024 }
1024 1025
1026 static gint sound_cmd_yeah(GtkEntry *entry, GdkEvent *event, gpointer d)
1027 {
1028 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd)));
1029 save_prefs();
1030 return TRUE;
1031 }
1032
1025 static void event_page() 1033 static void event_page()
1026 { 1034 {
1027 GtkWidget *parent; 1035 GtkWidget *parent;
1028 GtkWidget *box; 1036 GtkWidget *box;
1029 GtkWidget *label; 1037 GtkWidget *label;
1030 GtkWidget *sep; 1038 GtkWidget *sep;
1039 GtkWidget *hbox;
1031 1040
1032 parent = prefdialog->parent; 1041 parent = prefdialog->parent;
1033 gtk_widget_destroy(prefdialog); 1042 gtk_widget_destroy(prefdialog);
1034 1043
1035 prefdialog = gtk_frame_new(_("Sound Events")); 1044 prefdialog = gtk_frame_new(_("Sound Events"));
1061 1070
1062 sound_entry(_("Sound in chat rooms when people enter"), OPT_SOUND_CHAT_JOIN, box, CHAT_JOIN); 1071 sound_entry(_("Sound in chat rooms when people enter"), OPT_SOUND_CHAT_JOIN, box, CHAT_JOIN);
1063 sound_entry(_("Sound in chat rooms when people leave"), OPT_SOUND_CHAT_PART, box, CHAT_LEAVE); 1072 sound_entry(_("Sound in chat rooms when people leave"), OPT_SOUND_CHAT_PART, box, CHAT_LEAVE);
1064 sound_entry(_("Sound in chat rooms when you talk"), OPT_SOUND_CHAT_YOU_SAY, box, CHAT_YOU_SAY); 1073 sound_entry(_("Sound in chat rooms when you talk"), OPT_SOUND_CHAT_YOU_SAY, box, CHAT_YOU_SAY);
1065 sound_entry(_("Sound in chat rooms when others talk"), OPT_SOUND_CHAT_SAY, box, CHAT_SAY); 1074 sound_entry(_("Sound in chat rooms when others talk"), OPT_SOUND_CHAT_SAY, box, CHAT_SAY);
1075
1076 sep = gtk_hseparator_new();
1077 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
1078 gtk_widget_show(sep);
1079
1080 hbox = gtk_hbox_new(FALSE, 5);
1081 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
1082 gtk_widget_show(hbox);
1083
1084 label = gtk_label_new(_("Command to play sound files (%s for filename; internal if empty):"));
1085 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
1086 gtk_widget_show(label);
1087
1088 sndcmd = gtk_entry_new();
1089 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE);
1090 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd);
1091 gtk_box_pack_end(GTK_BOX(hbox), sndcmd, FALSE, FALSE, 5);
1092 gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL);
1093 gtk_widget_show(sndcmd);
1066 1094
1067 gtk_widget_show(prefdialog); 1095 gtk_widget_show(prefdialog);
1068 } 1096 }
1069 1097
1070 static struct away_message *cur_message; 1098 static struct away_message *cur_message;