expand nodes containing subscribed groups

This commit is contained in:
Thorsten Maerz 2004-01-19 23:19:36 +00:00
parent 2d6e1b661b
commit d954fd3d1d
2 changed files with 23 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2004-01-20 Thorsten Maerz <torte@netztorte.de>
* src/grouplistdialog.c
expand nodes containing subscribed groups
2004-01-19 Thorsten Maerz <torte@netztorte.de>
* src/textview.c
textview: hide cursor, restore old click behaviour

View file

@ -379,6 +379,19 @@ static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo,
return node;
}
static void grouplist_expand_upwards(GtkCTree *ctree, const gchar *name) {
const gchar *ptr;
gchar *newname=g_malloc0(strlen(name));
for (ptr=name; *ptr; ptr++) {
if (*ptr == '.')
gtk_ctree_expand(ctree,
grouplist_hash_get_branch_node(newname));
newname[ptr-name] = *ptr;
}
g_free(newname);
}
static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
{
GSList *cur;
@ -418,8 +431,8 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
gtk_clist_freeze(GTK_CLIST(ctree));
g_signal_handlers_block_by_func(G_OBJECT(ctree),
G_CALLBACK(ctree_selected),
NULL);
G_CALLBACK(ctree_selected),
NULL);
for (cur = group_list; cur != NULL ; cur = cur->next) {
NewsGroupInfo *ginfo = (NewsGroupInfo *)cur->data;
@ -428,10 +441,13 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
node = grouplist_create_branch(ginfo, pattern);
if (g_slist_find_custom(subscribed, ginfo->name,
(GCompareFunc)g_strcasecmp)
!= NULL)
!= NULL) {
gtk_ctree_select(GTK_CTREE(ctree), node);
}
}
}
for (cur = subscribed; cur; cur = g_slist_next(cur))
grouplist_expand_upwards(GTK_CTREE(ctree), (gchar *)cur->data);
g_signal_handlers_unblock_by_func(G_OBJECT(ctree),
G_CALLBACK(ctree_selected),