| 1498 if (node) |
1498 if (node) |
| 1499 purple_blist_node_set_bool(node, "gtk-mute-sound", !gtkconv->make_sound); |
1499 purple_blist_node_set_bool(node, "gtk-mute-sound", !gtkconv->make_sound); |
| 1500 } |
1500 } |
| 1501 |
1501 |
| 1502 static void |
1502 static void |
| 1503 menu_timestamps_cb(GtkAction *action, gpointer data) |
|
| 1504 { |
|
| 1505 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps", |
|
| 1506 gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); |
|
| 1507 } |
|
| 1508 |
|
| 1509 static void |
|
| 1510 chat_do_im(PidginConversation *gtkconv, const char *who) |
1503 chat_do_im(PidginConversation *gtkconv, const char *who) |
| 1511 { |
1504 { |
| 1512 PurpleConversation *conv = gtkconv->active_conv; |
1505 PurpleConversation *conv = gtkconv->active_conv; |
| 1513 PurpleAccount *account; |
1506 PurpleAccount *account; |
| 1514 PurpleConnection *gc; |
1507 PurpleConnection *gc; |
| 3158 /* Toggle items */ |
3151 /* Toggle items */ |
| 3159 static const GtkToggleActionEntry menu_toggle_entries[] = { |
3152 static const GtkToggleActionEntry menu_toggle_entries[] = { |
| 3160 { "EnableLogging", NULL, N_("Enable _Logging"), NULL, NULL, G_CALLBACK(menu_logging_cb), FALSE }, |
3153 { "EnableLogging", NULL, N_("Enable _Logging"), NULL, NULL, G_CALLBACK(menu_logging_cb), FALSE }, |
| 3161 { "EnableSounds", NULL, N_("Enable _Sounds"), NULL, NULL, G_CALLBACK(menu_sounds_cb), FALSE }, |
3154 { "EnableSounds", NULL, N_("Enable _Sounds"), NULL, NULL, G_CALLBACK(menu_sounds_cb), FALSE }, |
| 3162 { "ShowFormattingToolbars", NULL, N_("Show Formatting _Toolbars"), NULL, NULL, G_CALLBACK(menu_toolbar_cb), FALSE }, |
3155 { "ShowFormattingToolbars", NULL, N_("Show Formatting _Toolbars"), NULL, NULL, G_CALLBACK(menu_toolbar_cb), FALSE }, |
| 3163 { "ShowTimestamps", NULL, N_("Show Ti_mestamps"), NULL, NULL, G_CALLBACK(menu_timestamps_cb), FALSE }, |
|
| 3164 }; |
3156 }; |
| 3165 |
3157 |
| 3166 static const char *conversation_menu = |
3158 static const char *conversation_menu = |
| 3167 "<ui>" |
3159 "<ui>" |
| 3168 "<menubar name='Conversation'>" |
3160 "<menubar name='Conversation'>" |
| 3692 sound_method_pref_changed_cb, win); |
3683 sound_method_pref_changed_cb, win); |
| 3693 |
3684 |
| 3694 win->menu.show_formatting_toolbar = |
3685 win->menu.show_formatting_toolbar = |
| 3695 gtk_ui_manager_get_action(win->menu.ui, |
3686 gtk_ui_manager_get_action(win->menu.ui, |
| 3696 "/Conversation/OptionsMenu/ShowFormattingToolbars"); |
3687 "/Conversation/OptionsMenu/ShowFormattingToolbars"); |
| 3697 win->menu.show_timestamps = |
|
| 3698 gtk_ui_manager_get_action(win->menu.ui, |
|
| 3699 "/Conversation/OptionsMenu/ShowTimestamps"); |
|
| 3700 |
3688 |
| 3701 win->menu.tray = pidgin_menu_tray_new(); |
3689 win->menu.tray = pidgin_menu_tray_new(); |
| 3702 gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar), |
3690 gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar), |
| 3703 win->menu.tray); |
3691 win->menu.tray); |
| 3704 gtk_widget_show(win->menu.tray); |
3692 gtk_widget_show(win->menu.tray); |
| 6669 update_typing_message(gtkconv, NULL); |
6657 update_typing_message(gtkconv, NULL); |
| 6670 } |
6658 } |
| 6671 |
6659 |
| 6672 static gboolean get_iter_from_chatbuddy(PurpleConvChatBuddy *cb, GtkTreeIter *iter) |
6660 static gboolean get_iter_from_chatbuddy(PurpleConvChatBuddy *cb, GtkTreeIter *iter) |
| 6673 { |
6661 { |
| 6674 GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cb); |
6662 GtkTreeRowReference *ref; |
| 6675 GtkTreePath *path; |
6663 GtkTreePath *path; |
| 6676 GtkTreeModel *model; |
6664 GtkTreeModel *model; |
| 6677 |
6665 |
| |
6666 g_return_val_if_fail(cb != NULL, FALSE); |
| |
6667 |
| |
6668 ref = purple_conv_chat_cb_get_ui_data(cb); |
| 6678 if (!ref) |
6669 if (!ref) |
| 6679 return FALSE; |
6670 return FALSE; |
| 6680 |
6671 |
| 6681 if ((path = gtk_tree_row_reference_get_path(ref)) == NULL) |
6672 if ((path = gtk_tree_row_reference_get_path(ref)) == NULL) |
| 6682 return FALSE; |
6673 return FALSE; |
| 6852 |
6843 |
| 6853 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
6844 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) |
| 6854 return; |
6845 return; |
| 6855 |
6846 |
| 6856 cbuddy = purple_conv_chat_cb_find(chat, user); |
6847 cbuddy = purple_conv_chat_cb_find(chat, user); |
| |
6848 if (!cbuddy) |
| |
6849 return; |
| |
6850 |
| 6857 if (get_iter_from_chatbuddy(cbuddy, &iter)) { |
6851 if (get_iter_from_chatbuddy(cbuddy, &iter)) { |
| 6858 GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cbuddy); |
6852 GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cbuddy); |
| 6859 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
6853 gtk_list_store_remove(GTK_LIST_STORE(model), &iter); |
| 6860 gtk_tree_row_reference_free(ref); |
6854 gtk_tree_row_reference_free(ref); |
| 6861 purple_conv_chat_cb_set_ui_data(cbuddy, NULL); |
6855 purple_conv_chat_cb_set_ui_data(cbuddy, NULL); |
| 7876 } |
7870 } |
| 7877 } |
7871 } |
| 7878 } |
7872 } |
| 7879 |
7873 |
| 7880 static void |
7874 static void |
| 7881 show_timestamps_pref_cb(const char *name, PurplePrefType type, |
|
| 7882 gconstpointer value, gpointer data) |
|
| 7883 { |
|
| 7884 GList *l; |
|
| 7885 PurpleConversation *conv; |
|
| 7886 PidginConversation *gtkconv; |
|
| 7887 PidginWindow *win; |
|
| 7888 |
|
| 7889 for (l = purple_get_conversations(); l != NULL; l = l->next) |
|
| 7890 { |
|
| 7891 conv = (PurpleConversation *)l->data; |
|
| 7892 |
|
| 7893 if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv)) |
|
| 7894 continue; |
|
| 7895 |
|
| 7896 gtkconv = PIDGIN_CONVERSATION(conv); |
|
| 7897 win = gtkconv->win; |
|
| 7898 |
|
| 7899 gtk_toggle_action_set_active( |
|
| 7900 GTK_TOGGLE_ACTION(win->menu.show_timestamps), |
|
| 7901 (gboolean)GPOINTER_TO_INT(value)); |
|
| 7902 |
|
| 7903 /* TODO WEBKIT: Use WebKit version of this. */ |
|
| 7904 #if 0 |
|
| 7905 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
|
| 7906 (gboolean)GPOINTER_TO_INT(value)); |
|
| 7907 #endif /* if 0 */ |
|
| 7908 } |
|
| 7909 } |
|
| 7910 |
|
| 7911 static void |
|
| 7912 show_formatting_toolbar_pref_cb(const char *name, PurplePrefType type, |
7875 show_formatting_toolbar_pref_cb(const char *name, PurplePrefType type, |
| 7913 gconstpointer value, gpointer data) |
7876 gconstpointer value, gpointer data) |
| 7914 { |
7877 { |
| 7915 GList *l; |
7878 GList *l; |
| 7916 PurpleConversation *conv; |
7879 PurpleConversation *conv; |
| 8476 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE); |
8445 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", TRUE); |
| 8477 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/resize_custom_smileys", TRUE); |
8446 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/resize_custom_smileys", TRUE); |
| 8478 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/custom_smileys_size", 96); |
8447 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/custom_smileys_size", 96); |
| 8479 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", 2); |
8448 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", 2); |
| 8480 |
8449 |
| 8481 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps", TRUE); |
|
| 8482 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", TRUE); |
8450 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", TRUE); |
| 8483 |
8451 |
| 8484 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/placement", "last"); |
8452 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/placement", "last"); |
| 8485 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/placement_number", 1); |
8453 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/placement_number", 1); |
| 8486 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
8454 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
| 8525 #endif |
8493 #endif |
| 8526 |
8494 |
| 8527 /* Connect callbacks. */ |
8495 /* Connect callbacks. */ |
| 8528 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", |
8496 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", |
| 8529 close_on_tabs_pref_cb, NULL); |
8497 close_on_tabs_pref_cb, NULL); |
| 8530 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_timestamps", |
|
| 8531 show_timestamps_pref_cb, NULL); |
|
| 8532 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
8498 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", |
| 8533 show_formatting_toolbar_pref_cb, NULL); |
8499 show_formatting_toolbar_pref_cb, NULL); |
| 8534 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck", |
8500 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck", |
| 8535 spellcheck_pref_cb, NULL); |
8501 spellcheck_pref_cb, NULL); |
| 8536 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/tab_side", |
8502 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/tab_side", |
| 9745 gtkconv->make_sound); |
9711 gtkconv->make_sound); |
| 9746 |
9712 |
| 9747 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.show_formatting_toolbar), |
9713 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.show_formatting_toolbar), |
| 9748 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")); |
9714 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")); |
| 9749 |
9715 |
| 9750 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.show_timestamps), |
|
| 9751 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps")); |
|
| 9752 |
|
| 9753 /* |
9716 /* |
| 9754 * We pause icons when they are not visible. If this icon should |
9717 * We pause icons when they are not visible. If this icon should |
| 9755 * be animated then start it back up again. |
9718 * be animated then start it back up again. |
| 9756 */ |
9719 */ |
| 9757 if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) && |
9720 if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) && |