static void
impl_selected (RBDisplayPage *page)
{
	RBGriloSource *source = RB_GRILO_SOURCE (page);

	RB_DISPLAY_PAGE_CLASS (rb_grilo_source_parent_class)->selected (page);

	if (source->priv->done_initial_browse == FALSE) {
		source->priv->done_initial_browse = TRUE;
		start_browse (source, NULL, NULL, 0);
	}

	rb_search_entry_set_mnemonic (source->priv->search_entry, TRUE);
}
static gboolean
expand_from_marker (RBGriloSource *source, GtkTreeIter *iter)
{
	/* this is a marker row, fetch more containers underneath the parent */
	GrlMedia *container;
	GtkTreeIter browse;
	int position;
	gtk_tree_model_iter_parent (GTK_TREE_MODEL (source->priv->browser_model), &browse, iter);
	gtk_tree_model_get (GTK_TREE_MODEL (source->priv->browser_model),
			    &browse,
			    0, &container,
			    3, &position,
			    -1);
	if (position >= 0) {
		start_browse (source, container, &browse, position);
		return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 3
0
PUBLIC int main(int argc, char** argv)
{
    status* state;
    char path[MAX_PATH];
    int len = 0;
    search_pattern* pattern;

    if (alloc_status(&state) == FAILURE)
        return EXIT_FAILURE;

    if (parse_opt(argc, argv, state, &pattern) == FAILURE)
        return EXIT_FAILURE;

    /* if no path provided take the current one */
    if (argc == 1)
    {
        strncpy(path, ".\0", 2);
        len = 1;
    }

    /* check that the last arg is not an option */
    else
    {
        strncpy(path, argv[argc - 1], strlen(argv[argc - 1]));
        len = strlen(argv[argc - 1]);
        path[len ] = '\0';

        if (path[0] == '-')
            strncpy(path, ".\0", 2);
    }

    if (start_browse(path, 0, state, pattern) == FAILURE)
        return EXIT_FAILURE;

    if (state->opt->d_total == ON)
        print_total(state);

    free(state);
    return EXIT_SUCCESS;
}