changeset 16958:1a336cfc410e

Change a string, and make sure non-functional items are not added in the conversation window menu.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 09 May 2007 04:08:01 +0000
parents 81ce12035b32
children 9ded461750a9
files finch/gntblist.c finch/gntconv.c
diffstat 2 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntblist.c	Wed May 09 03:12:57 2007 +0000
+++ b/finch/gntblist.c	Wed May 09 04:08:01 2007 +0000
@@ -955,7 +955,7 @@
 
 	prompt = g_strdup_printf(_("Please enter the new name for %s"), name);
 
-	text = PURPLE_BLIST_NODE_IS_GROUP(node) ? _("Rename") : _("Alias");
+	text = PURPLE_BLIST_NODE_IS_GROUP(node) ? _("Rename") : _("Set Alias");
 	purple_request_input(node, text, prompt, _("Enter empty string to reset the name."),
 			name, FALSE, FALSE, NULL, text, G_CALLBACK(rename_blist_node),
 			_("Cancel"), NULL,
--- a/finch/gntconv.c	Wed May 09 03:12:57 2007 +0000
+++ b/finch/gntconv.c	Wed May 09 04:08:01 2007 +0000
@@ -396,17 +396,26 @@
 	gnt_menuitem_set_callback(item, toggle_timestamps_cb, ggc);
 
 	if (purple_conversation_get_type(ggc->active_conv) == PURPLE_CONV_TYPE_IM) {
-		item = gnt_menuitem_new(_("Send File"));
-		gnt_menu_add_item(GNT_MENU(sub), item);
-		gnt_menuitem_set_callback(item, send_file_cb, ggc);
+		PurpleAccount *account = purple_conversation_get_account(ggc->active_conv);
+		PurplePluginProtocolInfo *pinfo = account->gc ? PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl) : NULL;
+
+		if (pinfo && pinfo->get_info) {
+			item = gnt_menuitem_new(_("Get Info"));
+			gnt_menu_add_item(GNT_MENU(sub), item);
+			gnt_menuitem_set_callback(item, get_info_cb, ggc);
+		}
 
 		item = gnt_menuitem_new(_("Add Buddy Pounce..."));
 		gnt_menu_add_item(GNT_MENU(sub), item);
 		gnt_menuitem_set_callback(item, add_pounce_cb, ggc);
 
-		item = gnt_menuitem_new(_("Get Info"));
-		gnt_menu_add_item(GNT_MENU(sub), item);
-		gnt_menuitem_set_callback(item, get_info_cb, ggc);
+		if (pinfo && pinfo->send_file &&
+				(!pinfo->can_receive_file ||
+				 	pinfo->can_receive_file(account->gc, purple_conversation_get_name(ggc->active_conv)))) {
+			item = gnt_menuitem_new(_("Send File"));
+			gnt_menu_add_item(GNT_MENU(sub), item);
+			gnt_menuitem_set_callback(item, send_file_cb, ggc);
+		}
 
 		generate_send_to_menu(ggc);
 	}