changeset 20561:c7b2c6ae3bea

Re-arrange the menu. Add 'Add buddy/chat/group' in the menu.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 19 Sep 2007 21:37:12 +0000
parents 817dd6f507f4
children 9d812753d26a
files finch/gntblist.c
diffstat 1 files changed, 56 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntblist.c	Wed Sep 19 21:35:25 2007 +0000
+++ b/finch/gntblist.c	Wed Sep 19 21:37:12 2007 +0000
@@ -2225,9 +2225,27 @@
 }
 
 static void
+menu_add_buddy_cb(GntMenuItem *item, gpointer null)
+{
+	purple_blist_request_add_buddy(NULL, NULL, NULL, NULL);
+}
+
+static void
+menu_add_chat_cb(GntMenuItem *item, gpointer null)
+{
+	purple_blist_request_add_chat(NULL, NULL, NULL, NULL);
+}
+
+static void
+menu_add_group_cb(GntMenuItem *item, gpointer null)
+{
+	purple_blist_request_add_group();
+}
+
+static void
 create_menu()
 {
-	GntWidget *menu, *sub;
+	GntWidget *menu, *sub, *subsub;
 	GntMenuItem *item;
 	GntWindow *window;
 
@@ -2248,29 +2266,57 @@
 	gnt_menu_add_item(GNT_MENU(sub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), send_im_select, NULL);
 
-	item = gnt_menuitem_check_new(_("Show empty groups"));
+	item = gnt_menuitem_new(_("Show"));
+	gnt_menu_add_item(GNT_MENU(sub), item);
+	subsub = gnt_menu_new(GNT_MENU_POPUP);
+	gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
+
+	item = gnt_menuitem_check_new(_("Empty groups"));
 	gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
 				purple_prefs_get_bool(PREF_ROOT "/emptygroups"));
-	gnt_menu_add_item(GNT_MENU(sub), item);
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/emptygroups");
 	
-	item = gnt_menuitem_check_new(_("Show offline buddies"));
+	item = gnt_menuitem_check_new(_("Offline buddies"));
 	gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
 				purple_prefs_get_bool(PREF_ROOT "/showoffline"));
-	gnt_menu_add_item(GNT_MENU(sub), item);
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/showoffline");
 
-	item = gnt_menuitem_new(_("Sort by status"));
+	item = gnt_menuitem_new(_("Sort"));
 	gnt_menu_add_item(GNT_MENU(sub), item);
+	subsub = gnt_menu_new(GNT_MENU_POPUP);
+	gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
+
+	item = gnt_menuitem_new(_("By Status"));
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "status");
 
-	item = gnt_menuitem_new(_("Sort alphabetically"));
-	gnt_menu_add_item(GNT_MENU(sub), item);
+	item = gnt_menuitem_new(_("Alphabetically"));
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "text");
 
-	item = gnt_menuitem_new(_("Sort by log size"));
+	item = gnt_menuitem_new(_("By Log Size"));
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log");
+
+	item = gnt_menuitem_new(_("Add"));
 	gnt_menu_add_item(GNT_MENU(sub), item);
-	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log");
+
+	subsub = gnt_menu_new(GNT_MENU_POPUP);
+	gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
+
+	item = gnt_menuitem_new("Buddy");
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(item, menu_add_buddy_cb, NULL);
+
+	item = gnt_menuitem_new("Chat");
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(item, menu_add_chat_cb, NULL);
+
+	item = gnt_menuitem_new("Group");
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(item, menu_add_group_cb, NULL);
 
 	reconstruct_accounts_menu();
 	gnt_menu_add_item(GNT_MENU(menu), ggblist->accounts);