Example #1
0
/**
 * Initiates a browse host request to the currently selected host.
 */
void
on_popup_nodes_browse_host_activate(GtkMenuItem *unused_menuitem,
	gpointer unused_udata)
{
    GtkCList *clist = GTK_CLIST(gui_main_window_lookup("clist_nodes"));
    GSList *sl, *node_list;

    g_assert(clist != NULL);

	(void) unused_menuitem;
	(void) unused_udata;

    node_list = clist_collect_data(clist, TRUE, NULL);

	for (sl = node_list; sl != NULL; sl = g_slist_next(sl)) {
		const struct nid *handle = sl->data;
		gnet_node_info_t *info = guc_node_get_info(handle);

		if (!info)
			continue;

		if (!info->is_pseudo) {
			search_gui_new_browse_host(NULL, info->gnet_addr, info->gnet_port,
				&info->gnet_guid, NULL, info->is_g2 ? SOCK_F_G2 : 0);
		}
		guc_node_free_info(info);
	}
}
Example #2
0
/**
 * Callback: called when a node is added from the backend.
 *
 * Adds the node to the gui.
 */
static void
nodes_gui_node_added(const struct nid *node_id)
{
    gnet_node_info_t *info;

    if (GUI_PROPERTY(gui_debug) >= 5)
        g_debug("nodes_gui_node_added(%s)\n", nid_to_string(node_id));

    info = guc_node_get_info(node_id);
	if (info) {
    	nodes_gui_add_node(info);
    	guc_node_free_info(info);
	}
}
Example #3
0
static inline void
nodes_gui_browse_selected_helper(GtkTreeModel *model,
		GtkTreePath *unused_path, GtkTreeIter *iter, gpointer unused_data)
{
	gnet_node_info_t *info;
	struct node_data *data;

	(void) unused_path;
	(void) unused_data;
	
	gtk_tree_model_get(model, iter, 0, &data, (-1));
	info = guc_node_get_info(data->node_id);
	if (!info->is_pseudo) {
		search_gui_new_browse_host(NULL, info->gnet_addr, info->gnet_port,
			&info->gnet_guid, NULL, info->is_g2 ? SOCK_F_G2 : 0);
	}
	guc_node_free_info(info);
}