| 1126 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
1126 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
| 1127 gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); |
1127 gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); |
| 1128 } |
1128 } |
| 1129 |
1129 |
| 1130 static void |
1130 static void |
| 1131 menu_sounds_cb(GtkAction *action, gpointer data) |
|
| 1132 { |
|
| 1133 PidginConvWindow *win = data; |
|
| 1134 PurpleConversation *conv; |
|
| 1135 PidginConversation *gtkconv; |
|
| 1136 PurpleBlistNode *node; |
|
| 1137 |
|
| 1138 conv = pidgin_conv_window_get_active_conversation(win); |
|
| 1139 |
|
| 1140 if (!conv) |
|
| 1141 return; |
|
| 1142 |
|
| 1143 gtkconv = PIDGIN_CONVERSATION(conv); |
|
| 1144 |
|
| 1145 gtkconv->make_sound = |
|
| 1146 gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)); |
|
| 1147 node = get_conversation_blist_node(conv); |
|
| 1148 if (node) |
|
| 1149 purple_blist_node_set_bool(node, "gtk-mute-sound", !gtkconv->make_sound); |
|
| 1150 } |
|
| 1151 |
|
| 1152 static void |
|
| 1153 chat_do_im(PidginConversation *gtkconv, const char *who) |
1131 chat_do_im(PidginConversation *gtkconv, const char *who) |
| 1154 { |
1132 { |
| 1155 PurpleConversation *conv = gtkconv->active_conv; |
1133 PurpleConversation *conv = gtkconv->active_conv; |
| 1156 PurpleAccount *account; |
1134 PurpleAccount *account; |
| 1157 PurpleConnection *gc; |
1135 PurpleConnection *gc; |
| 2602 }; |
2580 }; |
| 2603 |
2581 |
| 2604 /* Toggle items */ |
2582 /* Toggle items */ |
| 2605 static const GtkToggleActionEntry menu_toggle_entries[] = { |
2583 static const GtkToggleActionEntry menu_toggle_entries[] = { |
| 2606 { "EnableLogging", NULL, N_("Enable _Logging"), NULL, NULL, G_CALLBACK(menu_logging_cb), FALSE }, |
2584 { "EnableLogging", NULL, N_("Enable _Logging"), NULL, NULL, G_CALLBACK(menu_logging_cb), FALSE }, |
| 2607 { "EnableSounds", NULL, N_("Enable _Sounds"), NULL, NULL, G_CALLBACK(menu_sounds_cb), FALSE }, |
|
| 2608 { "ShowFormattingToolbars", NULL, N_("Show Formatting _Toolbars"), NULL, NULL, G_CALLBACK(menu_toolbar_cb), FALSE }, |
2585 { "ShowFormattingToolbars", NULL, N_("Show Formatting _Toolbars"), NULL, NULL, G_CALLBACK(menu_toolbar_cb), FALSE }, |
| 2609 }; |
2586 }; |
| 2610 |
2587 |
| 2611 static const char *conversation_menu = |
2588 static const char *conversation_menu = |
| 2612 "<ui>" |
2589 "<ui>" |
| 2645 "<separator/>" |
2622 "<separator/>" |
| 2646 "<menuitem action='Close'/>" |
2623 "<menuitem action='Close'/>" |
| 2647 "</menu>" |
2624 "</menu>" |
| 2648 "<menu action='OptionsMenu'>" |
2625 "<menu action='OptionsMenu'>" |
| 2649 "<menuitem action='EnableLogging'/>" |
2626 "<menuitem action='EnableLogging'/>" |
| 2650 "<menuitem action='EnableSounds'/>" |
|
| 2651 "<separator/>" |
2627 "<separator/>" |
| 2652 "<menuitem action='ShowFormattingToolbars'/>" |
2628 "<menuitem action='ShowFormattingToolbars'/>" |
| 2653 "</menu>" |
2629 "</menu>" |
| 2654 "</menubar>" |
2630 "</menubar>" |
| 2655 "</ui>"; |
2631 "</ui>"; |
| 2656 |
|
| 2657 static void |
|
| 2658 sound_method_pref_changed_cb(const char *name, PurplePrefType type, |
|
| 2659 gconstpointer value, gpointer data) |
|
| 2660 { |
|
| 2661 PidginConvWindow *win = data; |
|
| 2662 const char *method = value; |
|
| 2663 |
|
| 2664 if (purple_strequal(method, "none")) |
|
| 2665 { |
|
| 2666 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->sounds), |
|
| 2667 FALSE); |
|
| 2668 gtk_action_set_sensitive(win->menu->sounds, FALSE); |
|
| 2669 } |
|
| 2670 else |
|
| 2671 { |
|
| 2672 PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win); |
|
| 2673 |
|
| 2674 if (gtkconv != NULL) |
|
| 2675 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->sounds), |
|
| 2676 gtkconv->make_sound); |
|
| 2677 gtk_action_set_sensitive(win->menu->sounds, TRUE); |
|
| 2678 } |
|
| 2679 } |
|
| 2680 |
2632 |
| 2681 /* Returns TRUE if some items were added to the menu, FALSE otherwise */ |
2633 /* Returns TRUE if some items were added to the menu, FALSE otherwise */ |
| 2682 static gboolean |
2634 static gboolean |
| 2683 populate_menu_with_options(GtkWidget *menu, PidginConversation *gtkconv, gboolean all) |
2635 populate_menu_with_options(GtkWidget *menu, PidginConversation *gtkconv, gboolean all) |
| 2684 { |
2636 { |
| 3101 /* --- */ |
3053 /* --- */ |
| 3102 |
3054 |
| 3103 win->menu->logging = |
3055 win->menu->logging = |
| 3104 gtk_ui_manager_get_action(win->menu->ui, |
3056 gtk_ui_manager_get_action(win->menu->ui, |
| 3105 "/Conversation/OptionsMenu/EnableLogging"); |
3057 "/Conversation/OptionsMenu/EnableLogging"); |
| 3106 win->menu->sounds = |
|
| 3107 gtk_ui_manager_get_action(win->menu->ui, |
|
| 3108 "/Conversation/OptionsMenu/EnableSounds"); |
|
| 3109 method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
|
| 3110 if (purple_strequal(method, "none")) |
|
| 3111 { |
|
| 3112 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->sounds), |
|
| 3113 FALSE); |
|
| 3114 gtk_action_set_sensitive(win->menu->sounds, FALSE); |
|
| 3115 } |
|
| 3116 purple_prefs_connect_callback(win, PIDGIN_PREFS_ROOT "/sound/method", |
|
| 3117 sound_method_pref_changed_cb, win); |
|
| 3118 |
|
| 3119 win->menu->show_formatting_toolbar = |
3058 win->menu->show_formatting_toolbar = |
| 3120 gtk_ui_manager_get_action(win->menu->ui, |
3059 gtk_ui_manager_get_action(win->menu->ui, |
| 3121 "/Conversation/OptionsMenu/ShowFormattingToolbars"); |
3060 "/Conversation/OptionsMenu/ShowFormattingToolbars"); |
| 3122 |
3061 |
| 3123 win->menu->tray = pidgin_menu_tray_new(); |
3062 win->menu->tray = pidgin_menu_tray_new(); |
| 4395 gtk_container_set_border_width(GTK_CONTAINER(tab_cont), 6); |
4334 gtk_container_set_border_width(GTK_CONTAINER(tab_cont), 6); |
| 4396 gtk_box_pack_start(GTK_BOX(tab_cont), pane, TRUE, TRUE, 0); |
4335 gtk_box_pack_start(GTK_BOX(tab_cont), pane, TRUE, TRUE, 0); |
| 4397 gtk_widget_show(pane); |
4336 gtk_widget_show(pane); |
| 4398 |
4337 |
| 4399 convnode = get_conversation_blist_node(conv); |
4338 convnode = get_conversation_blist_node(conv); |
| 4400 if (convnode == NULL || !purple_blist_node_get_bool(convnode, "gtk-mute-sound")) |
|
| 4401 gtkconv->make_sound = TRUE; |
|
| 4402 |
|
| 4403 if (convnode != NULL && purple_blist_node_has_setting(convnode, "enable-logging")) { |
4339 if (convnode != NULL && purple_blist_node_has_setting(convnode, "enable-logging")) { |
| 4404 gboolean logging = purple_blist_node_get_bool(convnode, "enable-logging"); |
4340 gboolean logging = purple_blist_node_get_bool(convnode, "enable-logging"); |
| 4405 purple_conversation_set_logging(conv, logging); |
4341 purple_conversation_set_logging(conv, logging); |
| 4406 } |
4342 } |
| 4407 |
4343 |
| 7665 gpointer user_data) |
7601 gpointer user_data) |
| 7666 { |
7602 { |
| 7667 PidginConvWindow *win; |
7603 PidginConvWindow *win; |
| 7668 PurpleConversation *conv; |
7604 PurpleConversation *conv; |
| 7669 PidginConversation *gtkconv; |
7605 PidginConversation *gtkconv; |
| 7670 const char *sound_method; |
|
| 7671 |
7606 |
| 7672 win = user_data; |
7607 win = user_data; |
| 7673 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, page_num); |
7608 gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, page_num); |
| 7674 conv = gtkconv->active_conv; |
7609 conv = gtkconv->active_conv; |
| 7675 |
7610 |
| 7688 generate_send_to_items(win); |
7623 generate_send_to_items(win); |
| 7689 regenerate_options_items(win); |
7624 regenerate_options_items(win); |
| 7690 regenerate_plugins_items(win); |
7625 regenerate_plugins_items(win); |
| 7691 |
7626 |
| 7692 pidgin_conv_switch_active_conversation(conv); |
7627 pidgin_conv_switch_active_conversation(conv); |
| 7693 |
|
| 7694 sound_method = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"); |
|
| 7695 if (!purple_strequal(sound_method, "none")) |
|
| 7696 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->sounds), |
|
| 7697 gtkconv->make_sound); |
|
| 7698 |
7628 |
| 7699 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->show_formatting_toolbar), |
7629 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->show_formatting_toolbar), |
| 7700 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")); |
7630 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")); |
| 7701 |
7631 |
| 7702 /* |
7632 /* |