diff options
author | Kalle Wallin <kaw@linux.se> | 2005-02-13 22:04:03 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2005-02-13 22:04:03 +0000 |
commit | 86d464488b8fdaa9481401b056c5acee311fe1cb (patch) | |
tree | 9890b91d50af72c1710c71779436e80d8df3e40f /src/screen_file.c | |
parent | b1a02a4b2223ae2e522c229983f5f54e4723ddc9 (diff) | |
download | mpd-86d464488b8fdaa9481401b056c5acee311fe1cb.tar.gz mpd-86d464488b8fdaa9481401b056c5acee311fe1cb.tar.xz mpd-86d464488b8fdaa9481401b056c5acee311fe1cb.zip |
Enable playlist saving on the browse screen
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2949 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/screen_file.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/screen_file.c b/src/screen_file.c index 1e13cc4c7..002e9cd73 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -284,6 +284,26 @@ load_playlist(screen_t *screen, mpdclient_t *c, filelist_entry_t *entry) return 0; } +static int +handle_save(screen_t *screen, mpdclient_t *c) +{ + filelist_entry_t *entry; + char *defaultname = NULL; + + + entry=( filelist_entry_t *) g_list_nth_data(filelist->list,lw->selected); + if( entry && entry->entity ) + { + mpd_InfoEntity *entity = entry->entity; + if( entity->type==MPD_INFO_ENTITY_TYPE_PLAYLISTFILE ) + { + mpd_PlaylistFile *plf = entity->info.playlistFile; + defaultname = plf->path; + } + } + return playlist_save(screen, c, NULL, defaultname); +} + static int handle_delete(screen_t *screen, mpdclient_t *c) { @@ -649,6 +669,9 @@ browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) case CMD_DELETE: handle_delete(screen, c); break; + case CMD_SAVE_PLAYLIST: + handle_save(screen, c); + break; case CMD_SCREEN_UPDATE: screen->painted = 0; lw->clear = 1; |