plugins/notify.c

changeset 13237
9556cdf38196
parent 13234
1d8e569b2053
child 13550
55c77cece2d0
equal deleted inserted replaced
13236:004c99e1a602 13237:9556cdf38196
242 242
243 static gboolean 243 static gboolean
244 message_displayed_cb(GaimAccount *account, const char *who, char *message, 244 message_displayed_cb(GaimAccount *account, const char *who, char *message,
245 GaimConversation *conv, GaimMessageFlags flags) 245 GaimConversation *conv, GaimMessageFlags flags)
246 { 246 {
247 if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT &&
248 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick") &&
249 !(flags & GAIM_MESSAGE_NICK)))
250 return FALSE;
251
247 if ((flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_DELAYED)) 252 if ((flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_DELAYED))
248 notify(conv, TRUE); 253 notify(conv, TRUE);
249 254
250 return FALSE; 255 return FALSE;
251 } 256 }
622 static GtkWidget * 627 static GtkWidget *
623 get_config_frame(GaimPlugin *plugin) 628 get_config_frame(GaimPlugin *plugin)
624 { 629 {
625 GtkWidget *ret = NULL, *frame = NULL; 630 GtkWidget *ret = NULL, *frame = NULL;
626 GtkWidget *vbox = NULL, *hbox = NULL; 631 GtkWidget *vbox = NULL, *hbox = NULL;
627 GtkWidget *toggle = NULL, *entry = NULL; 632 GtkWidget *toggle = NULL, *entry = NULL, *ref;
628 633
629 ret = gtk_vbox_new(FALSE, 18); 634 ret = gtk_vbox_new(FALSE, 18);
630 gtk_container_set_border_width(GTK_CONTAINER (ret), 12); 635 gtk_container_set_border_width(GTK_CONTAINER (ret), 12);
631 636
632 /*---------- "Notify For" ----------*/ 637 /*---------- "Notify For" ----------*/
645 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); 650 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
646 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), 651 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
647 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat")); 652 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat"));
648 g_signal_connect(G_OBJECT(toggle), "toggled", 653 g_signal_connect(G_OBJECT(toggle), "toggled",
649 G_CALLBACK(type_toggle_cb), "type_chat"); 654 G_CALLBACK(type_toggle_cb), "type_chat");
655
656 ref = toggle;
657 toggle = gtk_check_button_new_with_mnemonic(_("\t_Only when someone says your nick"));
658 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
659 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
660 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick"));
661 g_signal_connect(G_OBJECT(toggle), "toggled",
662 G_CALLBACK(type_toggle_cb), "type_chat_nick");
663 gtk_widget_set_sensitive(toggle, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ref)));
664 g_signal_connect(G_OBJECT(ref), "toggled",
665 G_CALLBACK(gaim_gtk_toggle_sensitive), toggle);
650 666
651 toggle = gtk_check_button_new_with_mnemonic(_("_Focused windows")); 667 toggle = gtk_check_button_new_with_mnemonic(_("_Focused windows"));
652 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); 668 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0);
653 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), 669 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle),
654 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused")); 670 gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused"));
861 gaim_prefs_add_none("/plugins/gtk/X11"); 877 gaim_prefs_add_none("/plugins/gtk/X11");
862 gaim_prefs_add_none("/plugins/gtk/X11/notify"); 878 gaim_prefs_add_none("/plugins/gtk/X11/notify");
863 879
864 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_im", TRUE); 880 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_im", TRUE);
865 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_chat", FALSE); 881 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_chat", FALSE);
882 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_chat_nick", FALSE);
866 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE); 883 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE);
867 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE); 884 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE);
868 gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)"); 885 gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)");
869 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE); 886 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE);
870 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE); 887 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE);

mercurial