comparison src/gtkblist.c @ 10325:1657438d537b

[gaim-migrate @ 11532] I wanted to get this out of my local tree. I don't know how much of this we'll end up using, but I have a feeling we can use some of it. I think it's hard to know what UI will work best without actually using a few of them... I'm going to try to get reading from status.xml working again this week. I think we'll be able to use the same format, just extend it a little bit. If anyone has done any work on that please let me know so I don't duplicate anyone's work. I imagine I'll start by seeing how much of the old status.xml-reading code is usable (I'm guessing a lot of it). committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 07 Dec 2004 04:59:27 +0000
parents 61852117568f
children 7fcdd669eb49
comparison
equal deleted inserted replaced
10324:1034e77ff0ce 10325:1657438d537b
50 #include "gtkpounce.h" 50 #include "gtkpounce.h"
51 #include "gtkprefs.h" 51 #include "gtkprefs.h"
52 #include "gtkprivacy.h" 52 #include "gtkprivacy.h"
53 #include "gtkroomlist.h" 53 #include "gtkroomlist.h"
54 #include "gtksound.h" 54 #include "gtksound.h"
55 #include "gtkstatus.h"
55 #include "gtkstatusselector.h" 56 #include "gtkstatusselector.h"
56 #include "gtkutils.h" 57 #include "gtkutils.h"
57
58 #include "gaim.h"
59 58
60 #include <gdk/gdkkeysyms.h> 59 #include <gdk/gdkkeysyms.h>
61 #include <gtk/gtk.h> 60 #include <gtk/gtk.h>
62 #include <gdk/gdk.h> 61 #include <gdk/gdk.h>
63 62
105 GList *entries; 104 GList *entries;
106 } GaimGtkJoinChatData; 105 } GaimGtkJoinChatData;
107 106
108 107
109 static GtkWidget *protomenu = NULL; 108 static GtkWidget *protomenu = NULL;
110 static GtkWidget *awaymenu = NULL;
111 static GtkWidget *pluginmenu = NULL; 109 static GtkWidget *pluginmenu = NULL;
112 110
113 GSList *gaim_gtk_blist_sort_methods = NULL; 111 GSList *gaim_gtk_blist_sort_methods = NULL;
114 static struct gaim_gtk_blist_sort_method *current_sort_method = NULL; 112 static struct gaim_gtk_blist_sort_method *current_sort_method = NULL;
115 static GtkTreeIter sort_method_none(GaimBlistNode *node, GaimBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur); 113 static GtkTreeIter sort_method_none(GaimBlistNode *node, GaimBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur);
990 gaim_gtk_blist_expand_contact_cb(GtkWidget *w, GaimBlistNode *node) 988 gaim_gtk_blist_expand_contact_cb(GtkWidget *w, GaimBlistNode *node)
991 { 989 {
992 struct _gaim_gtk_blist_node *gtknode; 990 struct _gaim_gtk_blist_node *gtknode;
993 GtkTreeIter iter, parent; 991 GtkTreeIter iter, parent;
994 GaimBlistNode *bnode; 992 GaimBlistNode *bnode;
995 GtkTreePath *path; 993 GtkTreePath *path;
996 994
997 if(!GAIM_BLIST_NODE_IS_CONTACT(node)) 995 if(!GAIM_BLIST_NODE_IS_CONTACT(node))
998 return; 996 return;
999 997
1000 gtknode = (struct _gaim_gtk_blist_node *)node->ui_data; 998 gtknode = (struct _gaim_gtk_blist_node *)node->ui_data;
2376 { N_("/Buddies/_Log Out"), "<CTL>D", gaim_connections_disconnect_all, 0, "<StockItem>", GAIM_STOCK_SIGN_OFF }, 2374 { N_("/Buddies/_Log Out"), "<CTL>D", gaim_connections_disconnect_all, 0, "<StockItem>", GAIM_STOCK_SIGN_OFF },
2377 { N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT }, 2375 { N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
2378 2376
2379 /* Tools */ 2377 /* Tools */
2380 { N_("/_Tools"), NULL, NULL, 0, "<Branch>" }, 2378 { N_("/_Tools"), NULL, NULL, 0, "<Branch>" },
2381 { N_("/Tools/_Away"), NULL, NULL, 0, "<Branch>" },
2382 { N_("/Tools/Buddy _Pounce"), NULL, NULL, 0, "<Branch>" }, 2379 { N_("/Tools/Buddy _Pounce"), NULL, NULL, 0, "<Branch>" },
2383 { N_("/Tools/Account Ac_tions"), NULL, NULL, 0, "<Branch>" }, 2380 { N_("/Tools/Account Ac_tions"), NULL, NULL, 0, "<Branch>" },
2384 { N_("/Tools/Pl_ugin Actions"), NULL, NULL, 0, "<Branch>" }, 2381 { N_("/Tools/Pl_ugin Actions"), NULL, NULL, 0, "<Branch>" },
2385 { "/Tools/sep1", NULL, NULL, 0, "<Separator>" }, 2382 { "/Tools/sep1", NULL, NULL, 0, "<Separator>" },
2383 { N_("/Tools/_Statuses"), NULL, gaim_gtk_status_window_show, 0, "<StockItem>", GAIM_STOCK_ICON_AWAY },
2386 { N_("/Tools/A_ccounts"), "<CTL>A", gaim_gtk_accounts_window_show, 0, "<StockItem>", GAIM_STOCK_ACCOUNTS }, 2384 { N_("/Tools/A_ccounts"), "<CTL>A", gaim_gtk_accounts_window_show, 0, "<StockItem>", GAIM_STOCK_ACCOUNTS },
2385 { N_("/Tools/Pr_eferences"), "<CTL>P", gaim_gtk_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES },
2386 { N_("/Tools/Pr_ivacy"), NULL, gaim_gtk_privacy_dialog_show, 0, NULL },
2387 { N_("/Tools/_File Transfers"), "<CTL>T", gaim_show_xfer_dialog, 0, "<StockItem>", GAIM_STOCK_FILE_TRANSFER }, 2387 { N_("/Tools/_File Transfers"), "<CTL>T", gaim_show_xfer_dialog, 0, "<StockItem>", GAIM_STOCK_FILE_TRANSFER },
2388 { N_("/Tools/R_oom List"), NULL, gaim_gtk_roomlist_dialog_show, 0, NULL }, 2388 { N_("/Tools/R_oom List"), NULL, gaim_gtk_roomlist_dialog_show, 0, NULL },
2389 { N_("/Tools/Pr_eferences"), "<CTL>P", gaim_gtk_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, 2389 { "/Tools/sep2", NULL, NULL, 0, "<Separator>" },
2390 { N_("/Tools/Pr_ivacy"), NULL, gaim_gtk_privacy_dialog_show, 0, NULL },
2391 { N_("/Tools/Mute _Sounds"), "<CTL>S", gaim_gtk_blist_mute_sounds_cb, 0, "<CheckItem>"}, 2390 { N_("/Tools/Mute _Sounds"), "<CTL>S", gaim_gtk_blist_mute_sounds_cb, 0, "<CheckItem>"},
2392 { "/Tools/sep2", NULL, NULL, 0, "<Separator>" },
2393 { N_("/Tools/View System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, NULL }, 2391 { N_("/Tools/View System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, NULL },
2394 2392
2395 /* Help */ 2393 /* Help */
2396 { N_("/_Help"), NULL, NULL, 0, "<Branch>" }, 2394 { N_("/_Help"), NULL, NULL, 0, "<Branch>" },
2397 { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP }, 2395 { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP },
3141 G_CALLBACK(gaim_gtk_save_accels_cb), NULL); 3139 G_CALLBACK(gaim_gtk_save_accels_cb), NULL);
3142 menu = gtk_item_factory_get_widget(gtkblist->ift, "<GaimMain>"); 3140 menu = gtk_item_factory_get_widget(gtkblist->ift, "<GaimMain>");
3143 gtk_widget_show(menu); 3141 gtk_widget_show(menu);
3144 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), menu, FALSE, FALSE, 0); 3142 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), menu, FALSE, FALSE, 0);
3145 3143
3146 awaymenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Away"));
3147
3148 /* FIXME: Status */
3149 #if 0
3150 do_away_menu();
3151 #endif
3152
3153 gtkblist->bpmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Buddy Pounce")); 3144 gtkblist->bpmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Buddy Pounce"));
3154 gaim_gtkpounce_menu_build(gtkblist->bpmenu); 3145 gaim_gtkpounce_menu_build(gtkblist->bpmenu);
3155 3146
3156 protomenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Account Actions")); 3147 protomenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Account Actions"));
3157 gaim_gtk_blist_update_protocol_actions(); 3148 gaim_gtk_blist_update_protocol_actions();
3158 3149
3159 pluginmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Plugin Actions")); 3150 pluginmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Plugin Actions"));
3160 gaim_gtk_blist_update_plugin_actions(); 3151 gaim_gtk_blist_update_plugin_actions();
3152
3161 /****************************** GtkTreeView **********************************/ 3153 /****************************** GtkTreeView **********************************/
3162 sw = gtk_scrolled_window_new(NULL,NULL); 3154 sw = gtk_scrolled_window_new(NULL,NULL);
3163 gtk_widget_show(sw); 3155 gtk_widget_show(sw);
3164 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); 3156 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
3165 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); 3157 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
3806 gtkblist->idle_column = NULL; 3798 gtkblist->idle_column = NULL;
3807 gtkblist->warning_column = gtkblist->buddy_icon_column = NULL; 3799 gtkblist->warning_column = gtkblist->buddy_icon_column = NULL;
3808 g_object_unref(G_OBJECT(gtkblist->ift)); 3800 g_object_unref(G_OBJECT(gtkblist->ift));
3809 protomenu = NULL; 3801 protomenu = NULL;
3810 pluginmenu = NULL; 3802 pluginmenu = NULL;
3811 awaymenu = NULL;
3812 gtkblist = NULL; 3803 gtkblist = NULL;
3813 3804
3814 gaim_prefs_disconnect_by_handle(gaim_gtk_blist_get_handle()); 3805 gaim_prefs_disconnect_by_handle(gaim_gtk_blist_get_handle());
3815 } 3806 }
3816 3807
3817 static void gaim_gtk_blist_set_visible(GaimBuddyList *list, gboolean show) 3808 static void gaim_gtk_blist_set_visible(GaimBuddyList *list, gboolean show)
3818 { 3809 {
3819 if (!(gtkblist && gtkblist->window)) 3810 if (!(gtkblist && gtkblist->window))
3820 return; 3811 return;
3821 3812
3822 gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", show); 3813 gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", show);
3823 3814
3824 if (show) { 3815 if (show) {
3825 gaim_gtk_blist_restore_position(); 3816 gaim_gtk_blist_restore_position();
3826 gtk_window_present(GTK_WINDOW(gtkblist->window)); 3817 gtk_window_present(GTK_WINDOW(gtkblist->window));
3827 } else { 3818 } else {
3828 if (!gaim_connections_get_all() || docklet_count) { 3819 if (!gaim_connections_get_all() || docklet_count) {