| 3130 |
3130 |
| 3131 #ifdef USE_VV |
3131 #ifdef USE_VV |
| 3132 { "MediaMenu", NULL, N_("M_edia"), NULL, NULL, NULL }, |
3132 { "MediaMenu", NULL, N_("M_edia"), NULL, NULL, NULL }, |
| 3133 { "AudioCall", PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, N_("_Audio Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) }, |
3133 { "AudioCall", PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, N_("_Audio Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) }, |
| 3134 { "VideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("_Video Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) }, |
3134 { "VideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("_Video Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) }, |
| 3135 { "AudioVideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("Audio\\/Video _Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) }, |
3135 { "AudioVideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("Audio/Video _Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) }, |
| 3136 #endif |
3136 #endif |
| 3137 |
3137 |
| 3138 { "SendFile", PIDGIN_STOCK_TOOLBAR_SEND_FILE, N_("Se_nd File..."), NULL, NULL, G_CALLBACK(menu_send_file_cb) }, |
3138 { "SendFile", PIDGIN_STOCK_TOOLBAR_SEND_FILE, N_("Se_nd File..."), NULL, NULL, G_CALLBACK(menu_send_file_cb) }, |
| 3139 { "GetAttention", PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, N_("Get _Attention"), NULL, NULL, G_CALLBACK(menu_get_attention_cb) }, |
3139 { "GetAttention", PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, N_("Get _Attention"), NULL, NULL, G_CALLBACK(menu_get_attention_cb) }, |
| 3140 { "AddBuddyPounce", NULL, N_("Add Buddy _Pounce..."), NULL, NULL, G_CALLBACK(menu_add_pounce_cb) }, |
3140 { "AddBuddyPounce", NULL, N_("Add Buddy _Pounce..."), NULL, NULL, G_CALLBACK(menu_add_pounce_cb) }, |
| 3462 } |
3462 } |
| 3463 |
3463 |
| 3464 static void |
3464 static void |
| 3465 regenerate_options_items(PidginWindow *win) |
3465 regenerate_options_items(PidginWindow *win) |
| 3466 { |
3466 { |
| 3467 #if GTK_CHECK_VERSION(2,6,0) |
|
| 3468 #else |
|
| 3469 GtkWidget *menu; |
3467 GtkWidget *menu; |
| 3470 PidginConversation *gtkconv; |
3468 PidginConversation *gtkconv; |
| 3471 GList *list; |
3469 GList *list; |
| 3472 |
3470 #if GTK_CHECK_VERSION(2,6,0) |
| |
3471 GtkWidget *more_menu; |
| |
3472 |
| |
3473 gtkconv = pidgin_conv_window_get_active_gtkconv(win); |
| |
3474 more_menu = gtk_ui_manager_get_widget(win->menu.ui, |
| |
3475 "/Conversation/ConversationMenu/MoreMenu"); |
| |
3476 gtk_widget_show(more_menu); |
| |
3477 menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(more_menu)); |
| |
3478 #else |
| 3473 gtkconv = pidgin_conv_window_get_active_gtkconv(win); |
3479 gtkconv = pidgin_conv_window_get_active_gtkconv(win); |
| 3474 menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/More")); |
3480 menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/More")); |
| |
3481 #endif |
| 3475 |
3482 |
| 3476 /* Remove the previous entries */ |
3483 /* Remove the previous entries */ |
| 3477 for (list = gtk_container_get_children(GTK_CONTAINER(menu)); list; ) |
3484 for (list = gtk_container_get_children(GTK_CONTAINER(menu)); list; ) |
| 3478 { |
3485 { |
| 3479 GtkWidget *w = list->data; |
3486 GtkWidget *w = list->data; |
| 3528 G_CALLBACK(remove_from_list), win); |
3532 G_CALLBACK(remove_from_list), win); |
| 3529 gtk_widget_destroy(action_items->data); |
3533 gtk_widget_destroy(action_items->data); |
| 3530 action_items = g_list_delete_link(action_items, action_items); |
3534 action_items = g_list_delete_link(action_items, action_items); |
| 3531 } |
3535 } |
| 3532 |
3536 |
| |
3537 #if GTK_CHECK_VERSION(2,6,0) |
| |
3538 item = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/OptionsMenu"); |
| |
3539 menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(item)); |
| |
3540 #else |
| 3533 menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Options")); |
3541 menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Options")); |
| |
3542 #endif |
| 3534 |
3543 |
| 3535 list = purple_conversation_get_extended_menu(conv); |
3544 list = purple_conversation_get_extended_menu(conv); |
| 3536 if (list) { |
3545 if (list) { |
| 3537 action_items = g_list_prepend(NULL, (item = pidgin_separator(menu))); |
3546 action_items = g_list_prepend(NULL, (item = pidgin_separator(menu))); |
| 3538 g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win); |
3547 g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win); |
| 3544 action_items = g_list_prepend(action_items, item); |
3553 action_items = g_list_prepend(action_items, item); |
| 3545 gtk_widget_show_all(item); |
3554 gtk_widget_show_all(item); |
| 3546 g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win); |
3555 g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win); |
| 3547 } |
3556 } |
| 3548 g_object_set_data(G_OBJECT(win->window), "plugin-actions", action_items); |
3557 g_object_set_data(G_OBJECT(win->window), "plugin-actions", action_items); |
| 3549 #endif |
3558 } |
| 3550 } |
3559 |
| 3551 |
|
| 3552 #if 0 |
|
| 3553 static void menubar_activated(GtkWidget *item, gpointer data) |
3560 static void menubar_activated(GtkWidget *item, gpointer data) |
| 3554 { |
3561 { |
| 3555 PidginWindow *win = data; |
3562 PidginWindow *win = data; |
| 3556 regenerate_media_items(win); |
3563 regenerate_media_items(win); |
| 3557 regenerate_options_items(win); |
3564 regenerate_options_items(win); |
| 3566 static void |
3573 static void |
| 3567 focus_out_from_menubar(GtkWidget *wid, PidginWindow *win) |
3574 focus_out_from_menubar(GtkWidget *wid, PidginWindow *win) |
| 3568 { |
3575 { |
| 3569 /* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time |
3576 /* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time |
| 3570 * the 'Conversation' menu pops up. */ |
3577 * the 'Conversation' menu pops up. */ |
| 3571 GtkWidget *menuitem = gtk_item_factory_get_item(win->menu.item_factory, N_("/Conversation")); |
3578 GtkWidget *menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu"); |
| 3572 g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), G_CALLBACK(menubar_activated), win); |
3579 g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), G_CALLBACK(menubar_activated), win); |
| 3573 g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu.menubar), |
3580 g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu.menubar), |
| 3574 G_CALLBACK(focus_out_from_menubar), win); |
3581 G_CALLBACK(focus_out_from_menubar), win); |
| 3575 } |
3582 } |
| 3576 #endif |
|
| 3577 |
3583 |
| 3578 static GtkWidget * |
3584 static GtkWidget * |
| 3579 setup_menubar(PidginWindow *win) |
3585 setup_menubar(PidginWindow *win) |
| 3580 { |
3586 { |
| 3581 GtkAccelGroup *accel_group; |
3587 GtkAccelGroup *accel_group; |
| 3582 const char *method; |
3588 const char *method; |
| 3583 GtkActionGroup *action_group; |
3589 GtkActionGroup *action_group; |
| 3584 GError *error; |
3590 GError *error; |
| |
3591 GtkWidget *menuitem; |
| 3585 |
3592 |
| 3586 action_group = gtk_action_group_new("ConversationActions"); |
3593 action_group = gtk_action_group_new("ConversationActions"); |
| 3587 gtk_action_group_add_actions(action_group, |
3594 gtk_action_group_add_actions(action_group, |
| 3588 menu_entries, |
3595 menu_entries, |
| 3589 G_N_ELEMENTS(menu_entries), |
3596 G_N_ELEMENTS(menu_entries), |
| 3613 exit(EXIT_FAILURE); |
3620 exit(EXIT_FAILURE); |
| 3614 } |
3621 } |
| 3615 |
3622 |
| 3616 win->menu.menubar = |
3623 win->menu.menubar = |
| 3617 gtk_ui_manager_get_widget(win->menu.ui, "/Conversation"); |
3624 gtk_ui_manager_get_widget(win->menu.ui, "/Conversation"); |
| |
3625 |
| |
3626 menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu"); |
| |
3627 g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(menubar_activated), win); |
| 3618 |
3628 |
| 3619 win->menu.view_log = |
3629 win->menu.view_log = |
| 3620 gtk_ui_manager_get_action(win->menu.ui, |
3630 gtk_ui_manager_get_action(win->menu.ui, |
| 3621 "/Conversation/ConversationMenu/ViewLog"); |
3631 "/Conversation/ConversationMenu/ViewLog"); |
| 3622 |
3632 |