Mercurial > pidgin
changeset 12583:301e9f0841d7
[gaim-migrate @ 14911]
Brutally murdered the per-account statusboxes; but didn't come up with any
replacement
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 20 Dec 2005 22:57:54 +0000 |
parents | f75c0d35e032 |
children | 8e15977b9705 |
files | src/gtkblist.c src/gtkblist.h src/gtkconn.c |
diffstat | 3 files changed, 10 insertions(+), 120 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkblist.c Tue Dec 20 21:58:15 2005 +0000 +++ b/src/gtkblist.c Tue Dec 20 22:57:54 2005 +0000 @@ -3437,45 +3437,6 @@ return result; } -static void account_enabled(GaimAccount *account, GaimGtkBuddyList *gtkblist) -{ - GtkWidget *box; - - if (!gtkblist) - return; - - box = gtk_gaim_status_box_new_with_account(account); - gtkblist->statusboxes = g_list_append(gtkblist->statusboxes, box); - gtk_box_pack_start(GTK_BOX(gtkblist->statusboxbox), box, FALSE, TRUE, 0); - gtk_widget_show(box); - - update_menu_bar(gtkblist); -} - -static void account_disabled(GaimAccount *account, GaimGtkBuddyList *gtkblist) -{ - GList *iter; - - if (!gtkblist) - return; - - for (iter = gtkblist->statusboxes; iter; iter = iter->next) - { - GtkWidget *box = iter->data; - GaimAccount *ac = NULL; - - g_object_get(G_OBJECT(box), "account", &ac, NULL); - if (ac == account) - { - gtkblist->statusboxes = g_list_remove_link(gtkblist->statusboxes, iter); - gtk_widget_destroy(box); - break; - } - } - - update_menu_bar(gtkblist); -} - static void account_modified(GaimAccount *account, GaimGtkBuddyList *gtkblist) { if (!gtkblist) @@ -3515,7 +3476,6 @@ GtkTreeViewColumn *column; GtkWidget *menu; GtkWidget *sw; - GtkWidget *vpane; GtkAccelGroup *accel_group; GtkTreeSelection *selection; GtkTargetEntry dte[] = {{"GAIM_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, @@ -3571,15 +3531,6 @@ accountmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts")); - /****************************** GtkVPaned ************************************/ - vpane = gtk_vpaned_new(); - gtk_widget_show(vpane); - gtk_box_pack_start(GTK_BOX(gtkblist->vbox), vpane, TRUE, TRUE, 0); - gtk_paned_set_position(GTK_PANED(vpane), - gaim_prefs_get_int("/gaim/gtk/blist/pane")); - g_signal_connect(G_OBJECT(vpane), "notify::position", - G_CALLBACK(pane_position_cb), NULL); - /****************************** GtkTreeView **********************************/ sw = gtk_scrolled_window_new(NULL,NULL); gtk_widget_show(sw); @@ -3664,39 +3615,15 @@ gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN); gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), _search_func, NULL, NULL); - gtk_paned_pack1(GTK_PANED(vpane), sw, TRUE, FALSE); + gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0); gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview); gaim_gtk_blist_update_columns(); - /* TODO: functionize this */ - { - GList *accounts, *l; - GtkWidget *sw2 = gtk_scrolled_window_new(NULL, NULL); - - /* Set up some per account status boxes */ - gtkblist->statusboxbox = gtk_vbox_new(FALSE, 0); - gtkblist->statusboxes = NULL; - - for (l = accounts = gaim_accounts_get_all_active(); l; l = l->next) { - GtkWidget *statusbox = gtk_gaim_status_box_new_with_account(l->data); - gtkblist->statusboxes = g_list_append(gtkblist->statusboxes, statusbox); - gtk_box_pack_start(GTK_BOX(gtkblist->statusboxbox), statusbox, FALSE, TRUE, 0); - gtk_widget_show(statusbox); - } - g_list_free(accounts); - - gtk_widget_show(gtkblist->statusboxbox); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), gtkblist->statusboxbox); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_widget_show(sw2); - gtk_paned_pack2(GTK_PANED(vpane), sw2, FALSE, TRUE); - - gtkblist->statusbox = gtk_gaim_status_box_new(); - - gtk_widget_show(gtkblist->statusbox); - gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); - - } + gtkblist->statusbox = gtk_gaim_status_box_new(); + + gtk_widget_show(gtkblist->statusbox); + gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); + /* set the Show Offline Buddies option. must be done * after the treeview or faceprint gets mad. -Robot101 @@ -3752,11 +3679,11 @@ /* Setup some gaim signal handlers. */ gaim_signal_connect(gaim_accounts_get_handle(), "account-enabled", - gtkblist, GAIM_CALLBACK(account_enabled), gtkblist); + gtkblist, GAIM_CALLBACK(account_modified), gtkblist); gaim_signal_connect(gaim_accounts_get_handle(), "account-disabled", - gtkblist, GAIM_CALLBACK(account_disabled), gtkblist); + gtkblist, GAIM_CALLBACK(account_modified), gtkblist); gaim_signal_connect(gaim_accounts_get_handle(), "account-removed", - gtkblist, GAIM_CALLBACK(account_disabled), gtkblist); + gtkblist, GAIM_CALLBACK(account_modified), gtkblist); gaim_signal_connect(gaim_gtk_account_get_handle(), "account-modified", gtkblist, GAIM_CALLBACK(account_modified), gtkblist);
--- a/src/gtkblist.h Tue Dec 20 21:58:15 2005 +0000 +++ b/src/gtkblist.h Tue Dec 20 22:57:54 2005 +0000 @@ -88,8 +88,6 @@ GaimBlistNode *selected_node; /**< The currently selected node */ GtkWidget *statusbox; /**< The status selector dropdown */ - GtkWidget *statusboxbox; /**< A box to hold per account status boxes */ - GList *statusboxes; /**< A list of the per account status boxes */ GdkPixbuf *east, *south; /**< Drop shadow stuff */ GdkWindow *east_shadow, *south_shadow; /**< Drop shadow stuff */
--- a/src/gtkconn.c Tue Dec 20 21:58:15 2005 +0000 +++ b/src/gtkconn.c Tue Dec 20 22:57:54 2005 +0000 @@ -48,25 +48,6 @@ static GHashTable *hash = NULL; static GSList *accountReconnecting = NULL; -static GtkGaimStatusBox * -find_status_box_for_account(GaimAccount *account) -{ - GaimGtkBuddyList *gtkblist; - GList *iter; - - gtkblist = gaim_gtk_blist_get_default_gtk_blist(); - if (!gtkblist) - return NULL; - - for (iter = gtkblist->statusboxes; iter; iter=iter->next) - { - GtkGaimStatusBox *box = iter->data; - if (box->account == account) - return box; - } - return NULL; -} - static void gaim_gtk_connection_connect_progress(GaimConnection *gc, const char *text, size_t step, size_t step_count) { @@ -77,13 +58,6 @@ gtk_gaim_status_box_set_connecting(GTK_GAIM_STATUS_BOX(gtkblist->statusbox), (gaim_connections_get_connecting() != NULL)); gtk_gaim_status_box_pulse_connecting(GTK_GAIM_STATUS_BOX(gtkblist->statusbox)); - - if ((box = find_status_box_for_account(gc->account)) != NULL) - { - gtk_gaim_status_box_set_error(box, NULL); - gtk_gaim_status_box_set_connecting(box, TRUE); - gtk_gaim_status_box_pulse_connecting(box); - } } static void gaim_gtk_connection_connected(GaimConnection *gc) @@ -97,12 +71,6 @@ (gaim_connections_get_connecting() != NULL)); account = gaim_connection_get_account(gc); - if ((box = find_status_box_for_account(account)) != NULL) - { - gtk_gaim_status_box_set_connecting(box, FALSE); - gtk_gaim_status_box_set_error(box, NULL); - } - if (hash != NULL) g_hash_table_remove(hash, account); if (accountReconnecting == NULL) @@ -119,8 +87,6 @@ return; gtk_gaim_status_box_set_connecting(GTK_GAIM_STATUS_BOX(gtkblist->statusbox), (gaim_connections_get_connecting() != NULL)); - gtk_gaim_status_box_set_connecting(find_status_box_for_account(gc->account), - FALSE); if (gaim_connections_get_all() != NULL) return; @@ -189,8 +155,7 @@ if (!gc->wants_to_die) { if (gtkblist != NULL) gtk_gaim_status_box_set_error(GTK_GAIM_STATUS_BOX(gtkblist->statusbox), text); - gtk_gaim_status_box_set_error(find_status_box_for_account(account), text); - + if (info == NULL) { info = g_new0(GaimAutoRecon, 1); g_hash_table_insert(hash, account, info);