예제 #1
0
static void confirm_delete (void)
{
    int playlist = aud_playlist_get_active ();
    int entry_count = aud_playlist_entry_count (playlist);

    for (int i = 0; i < entry_count; i ++)
    {
        if (! aud_playlist_entry_get_selected (playlist, i))
            continue;

        char * uri = aud_playlist_entry_get_filename (playlist, i);
        char * filename = uri_to_filename (uri);

        if (filename)
        {
            if (aud_get_bool ("delete_files", "use_trash"))
                move_to_trash (filename);
            else
                really_delete (filename);

            str_unref (filename);
        }
        else
        {
            SPRINTF (error, _("Error deleting %s: not a local file."), uri);
            aud_interface_show_error (error);
        }

        str_unref (uri);
    }

    aud_playlist_delete_selected (playlist);
}
예제 #2
0
static void
browse_action(void)
{
    struct name_list *el;

    switch (vs.browse_action)
    {
    case BA_LOAD:	/* load */
        browse_ok = 1;
        close_menu();
        break;
    case BA_VIEW:	/* view */
        if (push_screen())
        {
            view_fli(cpi_name, &vf, 0);
            pop_screen();
        }
        else
            noroom();
        break;
    case BA_PLAY:	/* play */
        if (push_screen())
        {
            view_fli(cpi_name, &vf, 1);
            pop_screen();
        }
        else
            noroom();
        break;
    case BA_INFO:
        fli_info(cpi_name);
        break;
    case BA_KILL: /* kill */
        if (really_delete(cpi_name))
        {
            if (jdelete_rerr(cpi_name))
            {
                if ((el = find_elix()) != NULL)
                {
                    el->name[0] = 0;	/* mark it dead */
                    vs.file[0] = 0;		/* don't reuse name... */
                    if (elix >= 0)
                        draw_1_browse(elx,ely,el);
                }
                bredraw_cpic();
            }
        }
        break;
    }
}
예제 #3
0
static void fml_kill(void)
{
char *path;
char suffix[WILD_SIZE];
char *ends;
char buf1[50], buf2[16];

	hide_mp();
	ends = file_ends[vs.file_type];
	parse_to_semi(&ends,suffix,sizeof(suffix));
	if ((path = vset_get_filename(stack_string("del_file",buf1),
								suffix,
								stack_string("del_str",buf2),
							    file_paths[vs.file_type],NULL,0)) != NULL)
	{
		if(!pj_exists(path))
			cant_find(path);
		else if(really_delete(path))
			pj_delete(path);
	}
	show_mp();
}