Mercurial > pidgin.yaz
comparison pidgin/gtkblist.c @ 29858:2cccb8588c12
Resurrect the PRPL actions to show up in the account submenu
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 08 Feb 2010 21:50:15 +0000 |
parents | a0fb6798d87c |
children | 185677f47825 |
comparison
equal
deleted
inserted
replaced
29857:f3654983e1da | 29858:2cccb8588c12 |
---|---|
8148 | 8148 |
8149 pidgin_separator(submenu); | 8149 pidgin_separator(submenu); |
8150 | 8150 |
8151 gc = purple_account_get_connection(account); | 8151 gc = purple_account_get_connection(account); |
8152 plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; | 8152 plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; |
8153 | 8153 prpl_info = plugin ? PURPLE_PLUGIN_PROTOCOL_INFO(plugin) : NULL; |
8154 if (plugin && | 8154 |
8155 (prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) && | 8155 if (prpl_info && |
8156 PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) | 8156 (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) || |
8157 { | 8157 PURPLE_PLUGIN_HAS_ACTIONS(plugin))) { |
8158 GList *types; | 8158 if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) { |
8159 for (types = purple_account_get_status_types(account); | 8159 GList *types; |
8160 types != NULL ; types = types->next) | 8160 for (types = purple_account_get_status_types(account); |
8161 { | 8161 types != NULL ; types = types->next) { |
8162 PurpleStatusType *type = types->data; | 8162 PurpleStatusType *type = types->data; |
8163 | 8163 |
8164 if (strcmp(purple_status_type_get_id(type), "mood") != 0) | 8164 if (strcmp(purple_status_type_get_id(type), "mood") != 0) |
8165 continue; | 8165 continue; |
8166 | 8166 |
8167 menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood...")); | 8167 menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood...")); |
8168 g_signal_connect(G_OBJECT(menuitem), "activate", | 8168 g_signal_connect(G_OBJECT(menuitem), "activate", |
8169 G_CALLBACK(set_mood_cb), account); | 8169 G_CALLBACK(set_mood_cb), account); |
8170 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); | 8170 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); |
8171 | 8171 |
8172 /* Be safe. It shouldn't match more than once anyway */ | 8172 /* Be safe. It shouldn't match more than once anyway */ |
8173 break; | 8173 break; |
8174 } | |
8174 } | 8175 } |
8175 } | 8176 if (PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { |
8176 else | |
8177 { | |
8178 if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { | |
8179 build_plugin_actions(submenu, plugin, gc); | 8177 build_plugin_actions(submenu, plugin, gc); |
8180 } else { | |
8181 menuitem = gtk_menu_item_new_with_label(_("No actions available")); | |
8182 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); | |
8183 gtk_widget_set_sensitive(menuitem, FALSE); | |
8184 } | 8178 } |
8179 } else { | |
8180 menuitem = gtk_menu_item_new_with_label(_("No actions available")); | |
8181 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); | |
8182 gtk_widget_set_sensitive(menuitem, FALSE); | |
8185 } | 8183 } |
8186 | 8184 |
8187 pidgin_separator(submenu); | 8185 pidgin_separator(submenu); |
8188 | 8186 |
8189 menuitem = gtk_menu_item_new_with_mnemonic(_("_Disable")); | 8187 menuitem = gtk_menu_item_new_with_mnemonic(_("_Disable")); |