pidgin/pidgin

Apply some changes that don't require GTK+ 3.0.
cpw.qulogic.gtk3
2011-10-08, Elliott Sales de Andrade
61be8c069f7b
Parents 221cc41b948a
Children ac8c85044e35
Apply some changes that don't require GTK+ 3.0.

applied changes from 26816ff01c715b8be636c7575f2bb94d44ae3023
through 4532c15d999487ce36760791463cad3c227f6323
Changelog: Hide some Facebook settings hacks for now.

applied changes from 4532c15d999487ce36760791463cad3c227f6323
through de0aaedf2fd8e0ebed1f31e3854bb3e70425ad2f
Changelog: We don't need this extra slash.

applied changes from de0aaedf2fd8e0ebed1f31e3854bb3e70425ad2f
through b63cac732d6e9e4ebb651536af993f0bf55b310f
Changelog: Add back the More and plugin action menu entries.

applied changes from 24aa672083047c3c28cff92f9c8a374f65cb123c
through f5ffae7772f18eb58efbfa82c94363ce5f8d8c30
Changelog: Enable the menu-refreshing logic in the conversation
menu, now that the signal (un)blocking affects the
correct widget.
--- a/pidgin/gtkaccount.c Sat Oct 08 21:24:14 2011 +0000
+++ b/pidgin/gtkaccount.c Sat Oct 08 21:48:38 2011 +0000
@@ -829,8 +829,11 @@
gtk_label_new_with_mnemonic(_("Ad_vanced")), 1);
gtk_widget_show(vbox);
+/* FIXME: Facebook forced-options hack */
+#if 0
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu));
item = gtk_menu_get_active(GTK_MENU(menu));
+#endif
for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next)
{
@@ -946,9 +949,12 @@
model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
opt_entry->widget = combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model));
+/* FIXME: Facebook forced-options hack */
+#if 0
if (g_object_get_data(G_OBJECT(item), "fakefacebook") &&
!strcmp(opt_entry->setting, "connection_security"))
str_value = "opportunistic_tls";
+#endif
/* Loop through list of PurpleKeyValuePair items */
for (node = list; node != NULL; node = node->next) {
--- a/pidgin/gtkconv.c Sat Oct 08 21:24:14 2011 +0000
+++ b/pidgin/gtkconv.c Sat Oct 08 21:48:38 2011 +0000
@@ -3132,7 +3132,7 @@
{ "MediaMenu", NULL, N_("M_edia"), NULL, NULL, NULL },
{ "AudioCall", PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, N_("_Audio Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) },
{ "VideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("_Video Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) },
- { "AudioVideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("Audio\\/Video _Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) },
+ { "AudioVideoCall", PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, N_("Audio/Video _Call"), NULL, NULL, G_CALLBACK(menu_initiate_media_call_cb) },
#endif
{ "SendFile", PIDGIN_STOCK_TOOLBAR_SEND_FILE, N_("Se_nd File..."), NULL, NULL, G_CALLBACK(menu_send_file_cb) },
@@ -3464,14 +3464,21 @@
static void
regenerate_options_items(PidginWindow *win)
{
-#if GTK_CHECK_VERSION(2,6,0)
-#else
GtkWidget *menu;
PidginConversation *gtkconv;
GList *list;
+#if GTK_CHECK_VERSION(2,6,0)
+ GtkWidget *more_menu;
gtkconv = pidgin_conv_window_get_active_gtkconv(win);
+ more_menu = gtk_ui_manager_get_widget(win->menu.ui,
+ "/Conversation/ConversationMenu/MoreMenu");
+ gtk_widget_show(more_menu);
+ menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(more_menu));
+#else
+ gtkconv = pidgin_conv_window_get_active_gtkconv(win);
menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/More"));
+#endif
/* Remove the previous entries */
for (list = gtk_container_get_children(GTK_CONTAINER(menu)); list; )
@@ -3489,7 +3496,6 @@
}
gtk_widget_show_all(menu);
-#endif
}
static void
@@ -3503,8 +3509,6 @@
static void
regenerate_plugins_items(PidginWindow *win)
{
-#if GTK_CHECK_VERSION(2,6,0)
-#else
GList *action_items;
GtkWidget *menu;
GList *list;
@@ -3530,7 +3534,12 @@
action_items = g_list_delete_link(action_items, action_items);
}
+#if GTK_CHECK_VERSION(2,6,0)
+ item = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/OptionsMenu");
+ menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(item));
+#else
menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Options"));
+#endif
list = purple_conversation_get_extended_menu(conv);
if (list) {
@@ -3546,10 +3555,8 @@
g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remove_from_list), win);
}
g_object_set_data(G_OBJECT(win->window), "plugin-actions", action_items);
-#endif
-}
-
-#if 0
+}
+
static void menubar_activated(GtkWidget *item, gpointer data)
{
PidginWindow *win = data;
@@ -3568,12 +3575,11 @@
{
/* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time
* the 'Conversation' menu pops up. */
- GtkWidget *menuitem = gtk_item_factory_get_item(win->menu.item_factory, N_("/Conversation"));
+ GtkWidget *menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu");
g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), G_CALLBACK(menubar_activated), win);
g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu.menubar),
G_CALLBACK(focus_out_from_menubar), win);
}
-#endif
static GtkWidget *
setup_menubar(PidginWindow *win)
@@ -3582,6 +3588,7 @@
const char *method;
GtkActionGroup *action_group;
GError *error;
+ GtkWidget *menuitem;
action_group = gtk_action_group_new("ConversationActions");
gtk_action_group_add_actions(action_group,
@@ -3616,6 +3623,9 @@
win->menu.menubar =
gtk_ui_manager_get_widget(win->menu.ui, "/Conversation");
+ menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu");
+ g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(menubar_activated), win);
+
win->menu.view_log =
gtk_ui_manager_get_action(win->menu.ui,
"/Conversation/ConversationMenu/ViewLog");
@@ -10773,4 +10783,4 @@
}
return colors;
-}
\ No newline at end of file
+}