comparison finch/gntblist.c @ 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 6bf32c9e15a7
children 591267f6f1d5 54ff514fdd04
comparison
equal deleted inserted replaced
20560:817dd6f507f4 20561:c7b2c6ae3bea
2223 NULL, NULL, NULL, 2223 NULL, NULL, NULL,
2224 NULL); 2224 NULL);
2225 } 2225 }
2226 2226
2227 static void 2227 static void
2228 menu_add_buddy_cb(GntMenuItem *item, gpointer null)
2229 {
2230 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL);
2231 }
2232
2233 static void
2234 menu_add_chat_cb(GntMenuItem *item, gpointer null)
2235 {
2236 purple_blist_request_add_chat(NULL, NULL, NULL, NULL);
2237 }
2238
2239 static void
2240 menu_add_group_cb(GntMenuItem *item, gpointer null)
2241 {
2242 purple_blist_request_add_group();
2243 }
2244
2245 static void
2228 create_menu() 2246 create_menu()
2229 { 2247 {
2230 GntWidget *menu, *sub; 2248 GntWidget *menu, *sub, *subsub;
2231 GntMenuItem *item; 2249 GntMenuItem *item;
2232 GntWindow *window; 2250 GntWindow *window;
2233 2251
2234 if (!ggblist) 2252 if (!ggblist)
2235 return; 2253 return;
2246 2264
2247 item = gnt_menuitem_new(_("Send IM...")); 2265 item = gnt_menuitem_new(_("Send IM..."));
2248 gnt_menu_add_item(GNT_MENU(sub), item); 2266 gnt_menu_add_item(GNT_MENU(sub), item);
2249 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), send_im_select, NULL); 2267 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), send_im_select, NULL);
2250 2268
2251 item = gnt_menuitem_check_new(_("Show empty groups")); 2269 item = gnt_menuitem_new(_("Show"));
2270 gnt_menu_add_item(GNT_MENU(sub), item);
2271 subsub = gnt_menu_new(GNT_MENU_POPUP);
2272 gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
2273
2274 item = gnt_menuitem_check_new(_("Empty groups"));
2252 gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), 2275 gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
2253 purple_prefs_get_bool(PREF_ROOT "/emptygroups")); 2276 purple_prefs_get_bool(PREF_ROOT "/emptygroups"));
2254 gnt_menu_add_item(GNT_MENU(sub), item); 2277 gnt_menu_add_item(GNT_MENU(subsub), item);
2255 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/emptygroups"); 2278 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/emptygroups");
2256 2279
2257 item = gnt_menuitem_check_new(_("Show offline buddies")); 2280 item = gnt_menuitem_check_new(_("Offline buddies"));
2258 gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item), 2281 gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
2259 purple_prefs_get_bool(PREF_ROOT "/showoffline")); 2282 purple_prefs_get_bool(PREF_ROOT "/showoffline"));
2283 gnt_menu_add_item(GNT_MENU(subsub), item);
2284 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/showoffline");
2285
2286 item = gnt_menuitem_new(_("Sort"));
2260 gnt_menu_add_item(GNT_MENU(sub), item); 2287 gnt_menu_add_item(GNT_MENU(sub), item);
2261 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/showoffline"); 2288 subsub = gnt_menu_new(GNT_MENU_POPUP);
2262 2289 gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
2263 item = gnt_menuitem_new(_("Sort by status")); 2290
2291 item = gnt_menuitem_new(_("By Status"));
2292 gnt_menu_add_item(GNT_MENU(subsub), item);
2293 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "status");
2294
2295 item = gnt_menuitem_new(_("Alphabetically"));
2296 gnt_menu_add_item(GNT_MENU(subsub), item);
2297 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "text");
2298
2299 item = gnt_menuitem_new(_("By Log Size"));
2300 gnt_menu_add_item(GNT_MENU(subsub), item);
2301 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log");
2302
2303 item = gnt_menuitem_new(_("Add"));
2264 gnt_menu_add_item(GNT_MENU(sub), item); 2304 gnt_menu_add_item(GNT_MENU(sub), item);
2265 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "status"); 2305
2266 2306 subsub = gnt_menu_new(GNT_MENU_POPUP);
2267 item = gnt_menuitem_new(_("Sort alphabetically")); 2307 gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
2268 gnt_menu_add_item(GNT_MENU(sub), item); 2308
2269 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "text"); 2309 item = gnt_menuitem_new("Buddy");
2270 2310 gnt_menu_add_item(GNT_MENU(subsub), item);
2271 item = gnt_menuitem_new(_("Sort by log size")); 2311 gnt_menuitem_set_callback(item, menu_add_buddy_cb, NULL);
2272 gnt_menu_add_item(GNT_MENU(sub), item); 2312
2273 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log"); 2313 item = gnt_menuitem_new("Chat");
2314 gnt_menu_add_item(GNT_MENU(subsub), item);
2315 gnt_menuitem_set_callback(item, menu_add_chat_cb, NULL);
2316
2317 item = gnt_menuitem_new("Group");
2318 gnt_menu_add_item(GNT_MENU(subsub), item);
2319 gnt_menuitem_set_callback(item, menu_add_group_cb, NULL);
2274 2320
2275 reconstruct_accounts_menu(); 2321 reconstruct_accounts_menu();
2276 gnt_menu_add_item(GNT_MENU(menu), ggblist->accounts); 2322 gnt_menu_add_item(GNT_MENU(menu), ggblist->accounts);
2277 2323
2278 reconstruct_plugins_menu(); 2324 reconstruct_plugins_menu();