# HG changeset patch # User Sean Egan # Date 1049151351 0 # Node ID 8a20332821b6be81d71242a3f77b268cafa37580 # Parent 36c06909823ea4f375605a6f5a728e33d492a92d [gaim-migrate @ 5263] And now you can keep offline buddies shown all the time. committer: Tailor Script diff -r 36c06909823e -r 8a20332821b6 src/buddy.c --- a/src/buddy.c Mon Mar 31 22:40:56 2003 +0000 +++ b/src/buddy.c Mon Mar 31 22:55:51 2003 +0000 @@ -391,7 +391,8 @@ gdk_window_set_cursor(gtkblist->window->window, cursor); while (gtk_events_pending()) gtk_main_iteration(); - gtkblist->editmode = !gtkblist->editmode; + blist_options ^= OPT_BLIST_SHOW_OFFLINE; + save_prefs(); gdk_cursor_unref(cursor); cursor = gdk_cursor_new(GDK_LEFT_PTR); gdk_window_set_cursor(gtkblist->window->window, cursor); @@ -899,7 +900,7 @@ /* Idle grey buddies affects the whole row. This converts the status icon to greyscale. */ - if (!b->present && gtkblist->editmode) + if (!b->present && blist_options & OPT_BLIST_SHOW_OFFLINE) gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.0, FALSE); else if (b->idle && blist_options & OPT_BLIST_GREY_IDLERS) gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.25, FALSE); @@ -923,7 +924,7 @@ if (buf) { - if (!b->present && gtkblist->editmode) + if (!b->present && blist_options & OPT_BLIST_SHOW_OFFLINE) gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.0, FALSE); if (b->idle && blist_options & OPT_BLIST_GREY_IDLERS) gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.25, FALSE); @@ -948,7 +949,7 @@ time_t t; if (!(blist_options & OPT_BLIST_SHOW_ICONS)) { - if ((b->idle > 0 && blist_options & OPT_BLIST_GREY_IDLERS && !selected) || gtkblist->editmode) { + if ((b->idle > 0 && blist_options & OPT_BLIST_GREY_IDLERS && !selected) || blist_options & OPT_BLIST_SHOW_OFFLINE) { text = g_strdup_printf("%s", esc); g_free(esc); @@ -1341,7 +1342,7 @@ if (get_iter_from_node(node, &iter)) { gtk_tree_store_remove(gtkblist->treemodel, &iter); if(GAIM_BLIST_NODE_IS_BUDDY(node) && - !gtkblist->editmode && + !blist_options & OPT_BLIST_SHOW_OFFLINE && gaim_blist_get_group_online_count((struct group *)node->parent) == 0) { GtkTreeIter groupiter; if(get_iter_from_node(node->parent, &groupiter)) @@ -1395,7 +1396,7 @@ if (!get_iter_from_node(node, &iter)) { /* This is a newly added node */ new_entry = TRUE; if (GAIM_BLIST_NODE_IS_BUDDY(node)) { - if (((struct buddy*)node)->present || (gtkblist->editmode && ((struct buddy*)node)->account->gc)) { + if (((struct buddy*)node)->present || (blist_options & OPT_BLIST_SHOW_OFFLINE && ((struct buddy*)node)->account->gc)) { GtkTreeIter groupiter; GaimBlistNode *oldersibling; GtkTreeIter oldersiblingiter; @@ -1445,7 +1446,7 @@ } } } - else if (GAIM_BLIST_NODE_IS_GROUP(node) && gtkblist->editmode) { + else if (GAIM_BLIST_NODE_IS_GROUP(node) && blist_options & OPT_BLIST_SHOW_OFFLINE) { GaimBlistNode *oldersibling; GtkTreeIter oldersiblingiter; GdkPixbuf *groupicon = gtk_widget_render_icon(gtkblist->treeview, @@ -1469,7 +1470,7 @@ } } else if (GAIM_BLIST_NODE_IS_GROUP(node)) { - if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter) == FALSE && gtkblist->editmode == FALSE) + if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter) == FALSE && blist_options & OPT_BLIST_SHOW_OFFLINE == FALSE) gtk_tree_store_remove(gtkblist->treemodel, &iter); else { char *esc = g_markup_escape_text(((struct group*)node)->name, -1); @@ -1482,7 +1483,7 @@ } } - if (GAIM_BLIST_NODE_IS_BUDDY(node) && (((struct buddy*)node)->present || (gtkblist->editmode && ((struct buddy*)node)->account->gc))) { + if (GAIM_BLIST_NODE_IS_BUDDY(node) && (((struct buddy*)node)->present || (blist_options & OPT_BLIST_SHOW_OFFLINE && ((struct buddy*)node)->account->gc))) { GdkPixbuf *status, *avatar; char *mark; char *warning = NULL, *idle = NULL; diff -r 36c06909823e -r 8a20332821b6 src/gaim.h --- a/src/gaim.h Mon Mar 31 22:40:56 2003 +0000 +++ b/src/gaim.h Mon Mar 31 22:55:51 2003 +0000 @@ -239,6 +239,7 @@ #define OPT_BLIST_BOTTOM_TAB 0X00000800 #define OPT_BLIST_POPUP 0x00001000 #define OPT_BLIST_SHOW_ICONS 0x00002000 +#define OPT_BLIST_SHOW_OFFLINE 0x00004000 extern guint convo_options; #define OPT_CONVO_ENTER_SENDS 0x00000001 diff -r 36c06909823e -r 8a20332821b6 src/gtklist.h --- a/src/gtklist.h Mon Mar 31 22:40:56 2003 +0000 +++ b/src/gtklist.h Mon Mar 31 22:55:51 2003 +0000 @@ -52,8 +52,6 @@ GtkWidget *treeview; /**< It's a treeview... d'uh. */ GtkTreeStore *treemodel; /**< This is the treemodel. */ - gboolean editmode; /**< TRUE if offline buddies are to be shown in the list. */ - GtkTreeViewColumn *idle_column, *warning_column, *buddy_icon_column;