mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Playlist Viewer: Reload indices after saving currently playing playlist
First index may have changed Change-Id: If6c2fbb42014610aeae48918168c32ca82fb9b5b
This commit is contained in:
parent
35f9a5b415
commit
a7d0ff2000
1 changed files with 7 additions and 5 deletions
|
@ -81,6 +81,7 @@ enum pv_onplay_result {
|
||||||
PV_ONPLAY_ITEM_REMOVED,
|
PV_ONPLAY_ITEM_REMOVED,
|
||||||
PV_ONPLAY_CHANGED,
|
PV_ONPLAY_CHANGED,
|
||||||
PV_ONPLAY_UNCHANGED,
|
PV_ONPLAY_UNCHANGED,
|
||||||
|
PV_ONPLAY_SAVED,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct playlist_buffer
|
struct playlist_buffer
|
||||||
|
@ -661,7 +662,8 @@ static enum pv_onplay_result onplay_menu(int index)
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
save_playlist_screen(viewer.playlist);
|
save_playlist_screen(viewer.playlist);
|
||||||
ret = PV_ONPLAY_UNCHANGED;
|
/* playlist indices of current playlist may have changed */
|
||||||
|
ret = viewer.playlist ? PV_ONPLAY_UNCHANGED : PV_ONPLAY_SAVED;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
/* playlist viewer settings */
|
/* playlist viewer settings */
|
||||||
|
@ -784,11 +786,9 @@ static int playlist_callback_voice(int selected_item, void *data)
|
||||||
static void update_lists(struct gui_synclist * playlist_lists, bool init)
|
static void update_lists(struct gui_synclist * playlist_lists, bool init)
|
||||||
{
|
{
|
||||||
if (init)
|
if (init)
|
||||||
{
|
|
||||||
gui_synclist_init(playlist_lists, playlist_callback_name,
|
gui_synclist_init(playlist_lists, playlist_callback_name,
|
||||||
&viewer, false, 1, NULL);
|
&viewer, false, 1, NULL);
|
||||||
gui_synclist_set_nb_items(playlist_lists, viewer.num_tracks);
|
gui_synclist_set_nb_items(playlist_lists, viewer.num_tracks);
|
||||||
}
|
|
||||||
gui_synclist_set_voice_callback(playlist_lists,
|
gui_synclist_set_voice_callback(playlist_lists,
|
||||||
global_settings.talk_file?
|
global_settings.talk_file?
|
||||||
&playlist_callback_voice:NULL);
|
&playlist_callback_voice:NULL);
|
||||||
|
@ -805,8 +805,10 @@ static bool update_viewer_with_changes(struct gui_synclist *playlist_lists, enum
|
||||||
{
|
{
|
||||||
bool exit = false;
|
bool exit = false;
|
||||||
if (res == PV_ONPLAY_CHANGED ||
|
if (res == PV_ONPLAY_CHANGED ||
|
||||||
|
res == PV_ONPLAY_SAVED ||
|
||||||
res == PV_ONPLAY_ITEM_REMOVED)
|
res == PV_ONPLAY_ITEM_REMOVED)
|
||||||
{
|
{
|
||||||
|
if (res != PV_ONPLAY_SAVED)
|
||||||
playlist_set_modified(viewer.playlist, true);
|
playlist_set_modified(viewer.playlist, true);
|
||||||
|
|
||||||
if (res == PV_ONPLAY_ITEM_REMOVED)
|
if (res == PV_ONPLAY_ITEM_REMOVED)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue