diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 5ef595a774..41e8d2d192 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -116,21 +116,22 @@ static bool add_to_playlist(int position, bool queue) | |||
116 | while (!exit) { | 116 | while (!exit) { |
117 | int btn = button_get(true); | 117 | int btn = button_get(true); |
118 | switch (btn) { | 118 | switch (btn) { |
119 | case BUTTON_PLAY: | 119 | case SETTINGS_OK: |
120 | recurse = true; | 120 | recurse = true; |
121 | exit = true; | ||
122 | break; | ||
123 | default: | ||
124 | /* ignore button releases */ | ||
125 | if (!(btn & BUTTON_REL)) | ||
126 | exit = true; | 121 | exit = true; |
127 | break; | 122 | break; |
123 | |||
124 | default: | ||
125 | /* ignore button releases */ | ||
126 | if (!(btn & BUTTON_REL)) | ||
127 | exit = true; | ||
128 | break; | ||
128 | } | 129 | } |
129 | } | 130 | } |
130 | } | 131 | } |
131 | 132 | ||
132 | playlist_insert_directory(NULL, selected_file, position, queue, | 133 | playlist_insert_directory(NULL, selected_file, position, queue, |
133 | recurse); | 134 | recurse); |
134 | } | 135 | } |
135 | else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) | 136 | else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) |
136 | playlist_insert_playlist(NULL, selected_file, position, queue); | 137 | playlist_insert_playlist(NULL, selected_file, position, queue); |
@@ -303,34 +304,34 @@ static bool delete_handler(bool is_dir) | |||
303 | while (!exit) { | 304 | while (!exit) { |
304 | int btn = button_get(true); | 305 | int btn = button_get(true); |
305 | switch (btn) { | 306 | switch (btn) { |
306 | case BUTTON_PLAY: | 307 | case SETTINGS_OK: |
307 | if (is_dir) | 308 | if (is_dir) |
308 | { | 309 | { |
309 | char pathname[MAX_PATH]; /* space to go deep */ | 310 | char pathname[MAX_PATH]; /* space to go deep */ |
310 | strncpy(pathname, selected_file, sizeof pathname); | 311 | strncpy(pathname, selected_file, sizeof pathname); |
311 | res = remove_dir(pathname, sizeof(pathname)); | 312 | res = remove_dir(pathname, sizeof(pathname)); |
312 | } | 313 | } |
313 | else | 314 | else |
314 | { | 315 | { |
315 | res = remove(selected_file); | 316 | res = remove(selected_file); |
316 | } | 317 | } |
317 | 318 | ||
318 | if (!res) { | 319 | if (!res) { |
319 | onplay_result = ONPLAY_RELOAD_DIR; | 320 | onplay_result = ONPLAY_RELOAD_DIR; |
320 | lcd_clear_display(); | 321 | lcd_clear_display(); |
321 | lcd_puts(0,0,str(LANG_DELETED)); | 322 | lcd_puts(0,0,str(LANG_DELETED)); |
322 | lcd_puts_scroll(0,1,selected_file); | 323 | lcd_puts_scroll(0,1,selected_file); |
323 | lcd_update(); | 324 | lcd_update(); |
324 | sleep(HZ); | 325 | sleep(HZ); |
325 | exit = true; | 326 | exit = true; |
326 | } | 327 | } |
327 | break; | 328 | break; |
328 | 329 | ||
329 | default: | 330 | default: |
330 | /* ignore button releases */ | 331 | /* ignore button releases */ |
331 | if (!(btn & BUTTON_REL)) | 332 | if (!(btn & BUTTON_REL)) |
332 | exit = true; | 333 | exit = true; |
333 | break; | 334 | break; |
334 | } | 335 | } |
335 | } | 336 | } |
336 | return false; | 337 | return false; |