Example #1
0
static GtkCMCTreeNode *grouplist_create_parent(const gchar *name,
					     const gchar *pattern)
{
	GtkCMCTreeNode *parent;
	GtkCMCTreeNode *node;
	gchar *cols[3];
	gchar *parent_name;

	if (*name == '\0') return NULL;
	node = grouplist_hash_get_branch_node(name);
	if (node != NULL) return node;

	cols[0] = (gchar *)name;
	cols[1] = cols[2] = "";

	parent_name = grouplist_get_parent_name(name);
	parent = grouplist_create_parent(parent_name, pattern);

	node = parent ? GTK_CMCTREE_ROW(parent)->children
		: GTK_CMCTREE_NODE(GTK_CMCLIST(ctree)->row_list);
	node = gtk_sctree_insert_node(GTK_CMCTREE(ctree), parent, node,
				     cols, 0, NULL, NULL,
				     FALSE, FALSE);
	if (parent && g_pattern_match_simple(pattern, parent_name) == FALSE)
		gtk_cmctree_expand(GTK_CMCTREE(ctree), parent);
	gtk_cmctree_node_set_selectable(GTK_CMCTREE(ctree), node, FALSE);

	grouplist_hash_set_branch_node(name, node);

	g_free(parent_name);

	return node;
}
Example #2
0
static void new_folder_cb(GtkAction *action, gpointer data)
{
    FolderView *folderview = (FolderView *)data;
    GtkCMCTree *ctree = GTK_CMCTREE(folderview->ctree);
    FolderItem *item;
    FolderItem *new_item;
    gchar *new_folder;
    gchar *name;
    gchar *p;
    gchar separator = '/';

    if (!folderview->selected) return;

    item = gtk_cmctree_node_get_row_data(ctree, folderview->selected);
    cm_return_if_fail(item != NULL);
    cm_return_if_fail(item->folder != NULL);
    cm_return_if_fail(item->folder->account != NULL);

    new_folder = input_dialog_with_checkbtn
                 (_("New folder"),
                  _("Input the name of new folder:\n"
                    "(if you want to create a folder to store subfolders\n"
                    "only and no mail, append '/' to the folder name)"),
                  _("NewFolder"),
                  _("Inherit properties from parent folder"),
                  &(prefs_common.inherit_folder_props));

    if (!new_folder) return;
    AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
Example #3
0
static void addressbook_foldersel_load_folder( GtkCMCTreeNode *parentNode, ItemFolder *parentFolder,
					FolderInfo *fiParent, FolderPathMatch *match )
{
	GtkCMCTree *tree = GTK_CMCTREE( addressbook_foldersel_dlg.tree_folder );
	GList *list;
	ItemFolder *folder;
	gchar *fName;
	gchar **name;
	GtkCMCTreeNode *node;
	FolderInfo *fi;
	FolderPathMatch *nextmatch = NULL;

	list = parentFolder->listFolder;
	while ( list ) {
		folder = list->data;
		fName = g_strdup( ADDRITEM_NAME(folder) );

		name = &fName;
		node = gtk_cmctree_insert_node( tree, parentNode, NULL, name, FOLDER_SPACING,
				folderXpm, folderXpm,
				FALSE, TRUE );

		/* match folder name, match pointer will be set to NULL if next recursive call
		   doesn't need to match subfolder name */
		if ( match != NULL &&
			 match->matched == FALSE ) {
			if ( strcmp(match->folder_path[match->index], folder->obj.uid) == 0 ) {
				/* folder name matches, prepare next subfolder match */

				debug_print("matched folder name '%s'\n", fName);

				match->index++;

				if ( match->folder_path[match->index] == NULL ) {
					/* we've matched all elements */
					match->matched = TRUE;
					match->node = node;
					debug_print("book/folder path matched!\n");
				} else {
					/* keep on matching */
					nextmatch = match;
				}
			}
		}

		g_free( fName );

		fi = addressbook_foldersel_create_folderinfo( fiParent->book, folder );
		gtk_cmctree_node_set_row_data_full( tree, node, fi,
				( GDestroyNotify ) addressbook_foldersel_free_folderinfo );
		addressbook_foldersel_load_folder( node, folder, fi, nextmatch );
		list = g_list_next( list );
	}
}
Example #4
0
static GtkCMCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo,
					     const gchar *pattern)
{
	GtkCMCTreeNode *node;
	GtkCMCTreeNode *parent;
	gchar *name = (gchar *)ginfo->name;
	gchar *parent_name;
	gchar *count_str;
	gchar *cols[3];
	gint count;

	count = ginfo->last - ginfo->first;
	if (count < 0)
		count = 0;
	count_str = itos(count);

	cols[0] = ginfo->name;
	cols[1] = count_str;
	if (ginfo->type == 'y')
		cols[2] = "";
	else if (ginfo->type == 'm')
		cols[2] = _("moderated");
	else if (ginfo->type == 'n')
		cols[2] = _("readonly");
	else
		cols[2] = _("unknown");

	parent_name = grouplist_get_parent_name(name);
	parent = grouplist_create_parent(parent_name, pattern);
	node = grouplist_hash_get_branch_node(name);
	if (node) {
		gtk_cmctree_set_node_info(GTK_CMCTREE(ctree), node, cols[0], 0,
					NULL, NULL, FALSE, FALSE);
		gtk_cmctree_node_set_text(GTK_CMCTREE(ctree), node, 1, cols[1]);
		gtk_cmctree_node_set_text(GTK_CMCTREE(ctree), node, 2, cols[2]);
	} else {
		node = parent ? GTK_CMCTREE_ROW(parent)->children
			: GTK_CMCTREE_NODE(GTK_CMCLIST(ctree)->row_list);
		node = gtk_sctree_insert_node(GTK_CMCTREE(ctree), parent, node,
					     cols, 0, NULL, NULL,
					     TRUE, FALSE);
		if (parent &&
		    g_pattern_match_simple(pattern, parent_name) == FALSE)
			gtk_cmctree_expand(GTK_CMCTREE(ctree), parent);
	}
	gtk_cmctree_node_set_selectable(GTK_CMCTREE(ctree), node, TRUE);
	if (node)
		gtk_cmctree_node_set_row_data(GTK_CMCTREE(ctree), node, ginfo);

	g_free(parent_name);

	return node;
}
Example #5
0
void rssyl_new_folder_cb(GtkAction *action, gpointer data)
{
	FolderView *folderview = (FolderView *)data;
	GtkCMCTree *ctree = GTK_CMCTREE(folderview->ctree);
	FolderItem *item;
	FolderItem *new_item;
	gchar *new_folder;
	gchar *name;
	gchar *p;
	RSSylFolderItem *ritem = NULL;

	if (!folderview->selected) return;

	item = gtk_cmctree_node_get_row_data(ctree, folderview->selected);
	g_return_if_fail(item != NULL);
	g_return_if_fail(item->folder != NULL);

	new_folder = input_dialog(_("New folder"),
				  _("Input the name of new folder:"),
				  _("NewFolder"));
	if (!new_folder) return;
	AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
Example #6
0
void rssyl_new_feed_cb(GtkAction *action, gpointer data)
{
	FolderView *folderview = (FolderView *)data;
	GtkCMCTree *ctree = GTK_CMCTREE(folderview->ctree);
	FolderItem *item;
	gchar *new_feed;

	debug_print("RSSyl: new_feed_cb\n");

	g_return_if_fail(folderview->selected != NULL);

	item = gtk_cmctree_node_get_row_data(ctree, folderview->selected);
	g_return_if_fail(item != NULL);
	g_return_if_fail(item->folder != NULL);

	new_feed = input_dialog(_("Subscribe feed"),
					 _("Input the URL of the news feed you wish to subscribe:"),
					 "");
	g_return_if_fail(new_feed != NULL);

	rssyl_subscribe_new_feed(item, new_feed, TRUE);

	g_free(new_feed);
}
Example #7
0
gboolean addressbook_foldersel_selection( AddressIndex *addrIndex,
					AddressBookFile **book, ItemFolder **folder, 
					const gchar* path)
{
	FolderPathMatch folder_path_match = { NULL, FALSE, 0, NULL };
	gboolean retVal = FALSE;
	addressbook_foldersel_cancelled = FALSE;

	if ( ! addressbook_foldersel_dlg.window )
		addressbook_foldersel_create();
	gtk_widget_grab_focus(addressbook_foldersel_dlg.ok_btn);
	gtk_widget_show(addressbook_foldersel_dlg.window);
	manage_window_set_transient(GTK_WINDOW(addressbook_foldersel_dlg.window));
	gtk_window_set_modal(GTK_WINDOW(addressbook_foldersel_dlg.window), TRUE);
	
	addressbook_foldersel_dlg.fiSelected = NULL;

	/* split the folder path we've received, we'll try to match this path, subpath by
	   subpath against the book/folder structure in order to select the folder that
       corresponds to what we received */

	if ( path != NULL ) {
		if ( g_utf8_collate(path, _("Any")) == 0 || strcasecmp(path, "Any") ==0 || *path == '\0' )
			/* consider "Any" (both translated or untranslated forms) and ""
			   as valid addressbook roots */
			folder_path_match.matched = TRUE;
		else
			folder_path_match.folder_path = g_strsplit( path, "/", 256 );
	}

	addressbook_foldersel_load_data( addrIndex, &folder_path_match );

	if ( folder_path_match.folder_path != NULL && folder_path_match.matched == FALSE)
		g_warning("addressbook_foldersel_load_data: couldn't match book/folder path '%s'", path);

	g_strfreev( folder_path_match.folder_path );

	if ( folder_path_match.node != NULL)
		gtk_cmctree_select( GTK_CMCTREE( addressbook_foldersel_dlg.tree_folder ),
							GTK_CMCTREE_NODE( folder_path_match.node ) );
	else
		gtk_cmclist_select_row( GTK_CMCLIST( addressbook_foldersel_dlg.tree_folder ), 0, 0 );
	gtk_widget_show(addressbook_foldersel_dlg.window);

	gtk_main();
	gtk_widget_hide( addressbook_foldersel_dlg.window );
	gtk_window_set_modal(GTK_WINDOW(addressbook_foldersel_dlg.window), FALSE);
	if ( ! addressbook_foldersel_cancelled ) {

		*book = NULL;
		*folder = NULL;

		if ( addressbook_foldersel_dlg.fiSelected ) {
			*book = addressbook_foldersel_dlg.fiSelected->book;
			*folder = addressbook_foldersel_dlg.fiSelected->folder;
			retVal = TRUE;
		}
	}

	gtk_cmclist_clear( GTK_CMCLIST( addressbook_foldersel_dlg.tree_folder ) );

	return retVal;
}
Example #8
0
static void addressbook_foldersel_load_data( AddressIndex *addrIndex, 
					     FolderPathMatch* match )
{
	AddressDataSource *ds;
	GList *list, *nodeDS;
	gchar **name;
	gchar *dsName;
	ItemFolder *rootFolder;
	AddressBookFile *abf;
	FolderInfo *fi;
	GtkCMCTree *tree = GTK_CMCTREE( addressbook_foldersel_dlg.tree_folder );
	GtkCMCTreeNode *node;
	FolderPathMatch *nextmatch;

	gtk_cmclist_clear( GTK_CMCLIST( tree ) );
	list = addrindex_get_interface_list( addrIndex );
	while ( list ) {
		AddressInterface *interface = list->data;
		if ( interface->type == ADDR_IF_BOOK ) {
			nodeDS = interface->listSource;
			while ( nodeDS ) {
				ds = nodeDS->data;
				dsName = g_strdup( addrindex_ds_get_name( ds ) );

				/* Read address book */
				if( ! addrindex_ds_get_read_flag( ds ) ) {
					addrindex_ds_read_data( ds );
				}

				/* Add node for address book */
				abf = ds->rawDataSource;
				name = &dsName;
				node = gtk_cmctree_insert_node( tree, NULL, NULL,
						name, FOLDER_SPACING, bookXpm,
						bookXpm,
						FALSE, TRUE );
				g_free( dsName );

				/* try to match subfolders if this book is the right book
					(and if there's smth to match, and not yet matched) */
				nextmatch = NULL;
				if ( match->folder_path != NULL &&
					 match->matched == FALSE &&
					 match->folder_path[0] != NULL &&
					 strcmp(match->folder_path[0], abf->fileName) == 0 ) {

					debug_print("matched book name '%s'\n", abf->fileName);

					match->index = 1;

					if ( match->folder_path[match->index] == NULL ) {
						/* we've matched all elements */
						match->matched = TRUE;
						match->node = node;
						debug_print("book path matched!\n");
					} else {
						/* keep on matching */
						nextmatch = match;
					}
				}

				fi = addressbook_foldersel_create_folderinfo( abf, NULL );
				gtk_cmctree_node_set_row_data_full( tree, node, fi,
						( GDestroyNotify ) addressbook_foldersel_free_folderinfo );

				rootFolder = addrindex_ds_get_root_folder( ds );
				addressbook_foldersel_load_folder( node, rootFolder, fi, nextmatch );

				nodeDS = g_list_next( nodeDS );
			}
		}
		list = g_list_next( list );
	}
}
Example #9
0
static void addressbook_foldersel_create( void )
{
	GtkWidget *window;
	GtkWidget *vbox;
	GtkWidget *tree_folder;
	GtkWidget *vlbox;
	GtkWidget *tree_win;
	GtkWidget *hbbox;
	GtkWidget *ok_btn;
	GtkWidget *cancel_btn;
	static GdkGeometry geometry;
	gchar *titles[1];

	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "addressbook_foldersel" );
	gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
	gtk_window_set_title( GTK_WINDOW(window), _("Select Address Book Folder") );
	gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_MOUSE );
	g_signal_connect( G_OBJECT(window), "delete_event",
			  G_CALLBACK(addressbook_foldersel_delete_event), NULL );
	g_signal_connect( G_OBJECT(window), "key_press_event",
			  G_CALLBACK(addressbook_foldersel_key_pressed), NULL );
	g_signal_connect(G_OBJECT(window), "size_allocate",
			 G_CALLBACK(addressbook_foldersel_size_allocate_cb), NULL);

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add(GTK_CONTAINER(window), vbox);
	gtk_container_set_border_width( GTK_CONTAINER(vbox), 8 );

	/* Address book/folder tree */
	vlbox = gtk_vbox_new(FALSE, 8);
	gtk_box_pack_start(GTK_BOX(vbox), vlbox, TRUE, TRUE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(vlbox), 8 );

	tree_win = gtk_scrolled_window_new( NULL, NULL );
	gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(tree_win),
				        GTK_POLICY_AUTOMATIC,
				        GTK_POLICY_AUTOMATIC );
	gtk_box_pack_start( GTK_BOX(vlbox), tree_win, TRUE, TRUE, 0 );

	titles[0] = _( "Address Book") ;

	tree_folder = gtk_sctree_new_with_titles( 1, 0, titles );
	gtk_container_add( GTK_CONTAINER(tree_win), tree_folder );
	gtk_cmclist_column_titles_show( GTK_CMCLIST(tree_folder) );
	gtk_cmctree_set_line_style(GTK_CMCTREE(tree_folder), GTK_CMCTREE_LINES_NONE);
	gtk_cmctree_set_expander_style(GTK_CMCTREE(tree_folder),
			     GTK_CMCTREE_EXPANDER_TRIANGLE);
	gtk_sctree_set_stripes(GTK_SCTREE(tree_folder), prefs_common.use_stripes_everywhere);
	gtk_cmclist_set_selection_mode( GTK_CMCLIST(tree_folder), GTK_SELECTION_BROWSE );
	gtk_cmctree_set_indent( GTK_CMCTREE(tree_folder), CTREE_INDENT );
	gtk_cmclist_set_auto_sort( GTK_CMCLIST(tree_folder), TRUE );

	/* Button panel */
	gtkut_stock_button_set_create( &hbbox, &cancel_btn, GTK_STOCK_CANCEL,
				      &ok_btn, GTK_STOCK_OK,
				      NULL, NULL );
	gtk_box_pack_end( GTK_BOX(vbox), hbbox, FALSE, FALSE, 0 );
	gtk_container_set_border_width( GTK_CONTAINER(hbbox), 0 );
	gtk_widget_grab_default( ok_btn );

	g_signal_connect( G_OBJECT(ok_btn), "clicked",
			 G_CALLBACK(addressbook_foldersel_ok), NULL );
	g_signal_connect( G_OBJECT(cancel_btn), "clicked",
			 G_CALLBACK(addressbook_foldersel_cancel), NULL );
	g_signal_connect( G_OBJECT(tree_folder), "tree_select_row",
			 G_CALLBACK(addressbook_foldersel_folder_select), NULL );
	g_signal_connect( G_OBJECT(tree_folder), "button_press_event",
			 G_CALLBACK(addressbook_foldersel_tree_button), NULL );

	if ( !geometry.min_height ) {
		geometry.min_width = 300;
		geometry.min_height = 350;
	}

	gtk_window_set_geometry_hints( GTK_WINDOW(window), NULL, &geometry,
				      GDK_HINT_MIN_SIZE );
	gtk_widget_set_size_request( window, prefs_common.addressbook_folderselwin_width,
				    prefs_common.addressbook_folderselwin_height );

	gtk_widget_show_all( vbox );

	addressbook_foldersel_dlg.window      = window;
	addressbook_foldersel_dlg.tree_folder = tree_folder;
	addressbook_foldersel_dlg.ok_btn      = ok_btn;
	addressbook_foldersel_dlg.cancel_btn  = cancel_btn;

	gtk_widget_show_all( window );

	stock_pixbuf_gdk(STOCK_PIXMAP_BOOK, &bookXpm);
	stock_pixbuf_gdk(STOCK_PIXMAP_DIR_OPEN, &folderXpm);
}
Example #10
0
static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
{
	static GdkCursor *watch_cursor = NULL;
	GSList *cur;
	GtkCMCTreeNode *node;
	GPatternSpec *pspec;
	GdkWindow *window;

	if (locked) return;
	locked = TRUE;

	if (!pattern || *pattern == '\0')
		pattern = "*";

	if (!watch_cursor)
		watch_cursor = gdk_cursor_new(GDK_WATCH);
	window = gtk_widget_get_window(dialog);
	gdk_window_set_cursor(window, watch_cursor);
	main_window_cursor_wait(mainwindow_get_mainwindow());
	GTK_EVENTS_FLUSH();
	
	if (refresh) {
		ack = TRUE;
		grouplist_clear();
		recv_set_ui_func(grouplist_recv_func, NULL);
		group_list = news_get_group_list(news_folder);
		group_list = g_slist_reverse(group_list);
		recv_set_ui_func(NULL, NULL);
		if (group_list == NULL && ack == TRUE) {
			alertpanel_error(_("Can't retrieve newsgroup list."));
			locked = FALSE;
			gdk_window_set_cursor(window, NULL);
			main_window_cursor_normal(mainwindow_get_mainwindow());
			return;
		}
	} else
		gtk_cmclist_clear(GTK_CMCLIST(ctree));

	gtk_entry_set_text(GTK_ENTRY(entry), pattern);

	grouplist_hash_init();

	gtk_cmclist_freeze(GTK_CMCLIST(ctree));

	pspec = g_pattern_spec_new(pattern);

	for (cur = group_list; cur != NULL ; cur = cur->next) {
		NewsGroupInfo *ginfo = (NewsGroupInfo *)cur->data;

		if (g_pattern_match_string(pspec, ginfo->name)) {
			node = grouplist_create_branch(ginfo, pattern);
			if (g_slist_find_custom(subscribed, ginfo->name,
						(GCompareFunc)g_ascii_strcasecmp)
			    != NULL)
				gtk_cmctree_select(GTK_CMCTREE(ctree), node);
		}
	}
	for (cur = subscribed; cur; cur = g_slist_next(cur))
		grouplist_expand_upwards(GTK_CMCTREE(ctree), (gchar *)cur->data);

	g_pattern_spec_free(pspec);

	gtk_cmclist_thaw(GTK_CMCLIST(ctree));

	grouplist_hash_done();

	gtk_label_set_text(GTK_LABEL(status_label), _("Done."));

	gdk_window_set_cursor(window, NULL);
	main_window_cursor_normal(mainwindow_get_mainwindow());

	locked = FALSE;
}
Example #11
0
static void grouplist_dialog_create(void)
{
	GtkWidget *vbox;
	GtkWidget *hbox;
	GtkWidget *msg_label;
	GtkWidget *search_button;
	GtkWidget *confirm_area;
	GtkWidget *cancel_button;	
	GtkWidget *refresh_button;	
	GtkWidget *scrolledwin;
	static GdkGeometry geometry;
	gchar *titles[3];
	gint i;

	dialog = gtk_dialog_new();
	gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
	gtk_container_set_border_width
		(GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(dialog))), 5);
	gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
	gtk_window_set_title(GTK_WINDOW(dialog), _("Newsgroup subscription"));
	g_signal_connect(G_OBJECT(dialog), "delete_event",
			 G_CALLBACK(window_deleted), NULL);
	g_signal_connect(G_OBJECT(dialog), "key_press_event",
			 G_CALLBACK(key_pressed), NULL);
	g_signal_connect(G_OBJECT(dialog), "size_allocate",
			 G_CALLBACK(grouplist_size_allocate), NULL);
	MANAGE_WINDOW_SIGNALS_CONNECT(dialog);

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add(GTK_CONTAINER(
				gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox);
	gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);

	hbox = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	msg_label = gtk_label_new(_("Select newsgroups for subscription:"));
	gtk_box_pack_start(GTK_BOX(hbox), msg_label, FALSE, FALSE, 0);

	hbox = gtk_hbox_new(FALSE, 8);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	msg_label = gtk_label_new(_("Find groups:"));
	gtk_box_pack_start(GTK_BOX(hbox), msg_label, FALSE, FALSE, 0);

	entry = gtk_entry_new();
	gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);
	g_signal_connect(G_OBJECT(entry), "activate",
			 G_CALLBACK(entry_activated), NULL);

	search_button = gtk_button_new_with_label(_(" Search "));
	gtk_box_pack_start(GTK_BOX(hbox), search_button, FALSE, FALSE, 0);

	g_signal_connect(G_OBJECT(search_button), "clicked",
			 G_CALLBACK(search_clicked), NULL);

	scrolledwin = gtk_scrolled_window_new(NULL, NULL);
	gtk_box_pack_start(GTK_BOX (vbox), scrolledwin, TRUE, TRUE, 0);
	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolledwin),
				       GTK_POLICY_AUTOMATIC,
				       GTK_POLICY_AUTOMATIC);

	titles[0] = _("Newsgroup name");
	titles[1] = _("Messages");
	titles[2] = _("Type");
	ctree = gtk_sctree_new_with_titles(3, 0, titles);
	gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
	gtk_cmclist_set_column_width
		(GTK_CMCLIST(ctree), 0, GROUPLIST_COL_NAME_WIDTH);
	gtk_cmclist_set_column_auto_resize(GTK_CMCLIST(ctree), 0, TRUE);
	gtk_cmclist_set_selection_mode(GTK_CMCLIST(ctree), GTK_SELECTION_MULTIPLE);
	
	gtk_cmctree_set_expander_style(GTK_CMCTREE(ctree),
				GTK_CMCTREE_EXPANDER_TRIANGLE);

	for (i = 0; i < 3; i++)
		gtk_widget_set_can_focus(GTK_CMCLIST(ctree)->column[i].button, FALSE);
	g_signal_connect(G_OBJECT(ctree), "button-press-event",
			 G_CALLBACK(button_press_cb), NULL);

	hbox = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	status_label = gtk_label_new("");
	gtk_box_pack_start(GTK_BOX(hbox), status_label, FALSE, FALSE, 0);

	gtkut_stock_button_set_create(&confirm_area,
				      &refresh_button, GTK_STOCK_REFRESH,
				      &cancel_button, GTK_STOCK_CANCEL,
				      &ok_button, GTK_STOCK_OK);
	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
			  confirm_area);
	gtk_widget_grab_default(ok_button);

	g_signal_connect(G_OBJECT(ok_button), "clicked",
			 G_CALLBACK(ok_clicked), NULL);
	g_signal_connect(G_OBJECT(cancel_button), "clicked",
			 G_CALLBACK(cancel_clicked), NULL);
	g_signal_connect(G_OBJECT(refresh_button), "clicked",
			 G_CALLBACK(refresh_clicked), NULL);

	if (!geometry.min_width) {
		geometry.min_width = GROUPLIST_DIALOG_WIDTH;
		geometry.min_height = GROUPLIST_DIALOG_HEIGHT;
	}

	gtk_window_set_geometry_hints(GTK_WINDOW(dialog), NULL, &geometry,
				      GDK_HINT_MIN_SIZE);
	gtk_window_set_default_size(GTK_WINDOW(dialog),
					prefs_common.news_subscribe_width,
					prefs_common.news_subscribe_height);

	gtk_widget_show_all(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
}