diff options
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r-- | apps/bookmark.c | 57 |
1 files changed, 17 insertions, 40 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index c01567848a..4ca828089f 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -49,6 +49,8 @@ | |||
49 | #include "misc.h" | 49 | #include "misc.h" |
50 | #include "abrepeat.h" | 50 | #include "abrepeat.h" |
51 | #include "splash.h" | 51 | #include "splash.h" |
52 | #include "yesno.h" | ||
53 | |||
52 | #define MAX_BOOKMARKS 10 | 54 | #define MAX_BOOKMARKS 10 |
53 | #define MAX_BOOKMARK_SIZE 350 | 55 | #define MAX_BOOKMARK_SIZE 350 |
54 | #define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark" | 56 | #define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark" |
@@ -189,10 +191,6 @@ bool bookmark_mrb_load() | |||
189 | /* ----------------------------------------------------------------------- */ | 191 | /* ----------------------------------------------------------------------- */ |
190 | bool bookmark_autobookmark(void) | 192 | bool bookmark_autobookmark(void) |
191 | { | 193 | { |
192 | /* prompts the user as to create a bookmark */ | ||
193 | bool done = false; | ||
194 | int key = 0; | ||
195 | |||
196 | if (!system_check()) | 194 | if (!system_check()) |
197 | return false; | 195 | return false; |
198 | 196 | ||
@@ -208,42 +206,23 @@ bool bookmark_autobookmark(void) | |||
208 | case BOOKMARK_RECENT_ONLY_YES: | 206 | case BOOKMARK_RECENT_ONLY_YES: |
209 | return write_bookmark(false); | 207 | return write_bookmark(false); |
210 | } | 208 | } |
211 | |||
212 | /* Prompting user to confirm bookmark creation */ | ||
213 | lcd_clear_display(); | ||
214 | #ifdef HAVE_LCD_BITMAP | 209 | #ifdef HAVE_LCD_BITMAP |
215 | lcd_setmargins(0, STATUSBAR_HEIGHT); | 210 | char *lines[]={str(LANG_AUTO_BOOKMARK_QUERY), |
216 | lcd_puts(0,0, str(LANG_AUTO_BOOKMARK_QUERY)); | 211 | str(LANG_CONFIRM_WITH_PLAY_RECORDER), |
217 | lcd_puts(0,1, str(LANG_CONFIRM_WITH_PLAY_RECORDER)); | 212 | str(LANG_CANCEL_WITH_ANY_RECORDER)}; |
218 | lcd_puts(0,2, str(LANG_CANCEL_WITH_ANY_RECORDER)); | 213 | struct text_message message={lines, 3}; |
219 | #else | 214 | #else |
220 | status_draw(false); | 215 | char *lines[]={str(LANG_AUTO_BOOKMARK_QUERY), |
221 | lcd_puts(0,0, str(LANG_AUTO_BOOKMARK_QUERY)); | 216 | str(LANG_RESUME_CONFIRM_PLAYER)}; |
222 | lcd_puts(0,1,str(LANG_RESUME_CONFIRM_PLAYER)); | 217 | struct text_message message={lines, 2}; |
223 | #endif | 218 | #endif |
224 | lcd_update(); | 219 | gui_syncstatusbar_draw(&statusbars, false); |
225 | 220 | if(gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES) | |
226 | while (!done) | ||
227 | { | 221 | { |
228 | /* Wait for a key to be pushed */ | 222 | if (global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK) |
229 | key = button_get(true); | 223 | return write_bookmark(false); |
230 | switch (key) | 224 | else |
231 | { | 225 | return write_bookmark(true); |
232 | case SETTINGS_OK: | ||
233 | if (global_settings.autocreatebookmark == | ||
234 | BOOKMARK_RECENT_ONLY_ASK) | ||
235 | return write_bookmark(false); | ||
236 | else | ||
237 | return write_bookmark(true); | ||
238 | break; | ||
239 | |||
240 | default: | ||
241 | /* Handle sys events, ignore button releases & repeats */ | ||
242 | if(default_event_handler(key) || | ||
243 | !(key & (BUTTON_REL|BUTTON_REPEAT))) | ||
244 | done = true; | ||
245 | break; | ||
246 | } | ||
247 | } | 226 | } |
248 | return false; | 227 | return false; |
249 | } | 228 | } |
@@ -434,7 +413,6 @@ bool bookmark_autoload(const char* file) | |||
434 | { | 413 | { |
435 | return false; | 414 | return false; |
436 | } | 415 | } |
437 | |||
438 | fd = open(global_bookmark_file_name, O_RDONLY); | 416 | fd = open(global_bookmark_file_name, O_RDONLY); |
439 | if(fd<0) | 417 | if(fd<0) |
440 | return false; | 418 | return false; |
@@ -444,7 +422,6 @@ bool bookmark_autoload(const char* file) | |||
444 | return false; | 422 | return false; |
445 | } | 423 | } |
446 | close(fd); | 424 | close(fd); |
447 | |||
448 | if(global_settings.autoloadbookmark == BOOKMARK_YES) | 425 | if(global_settings.autoloadbookmark == BOOKMARK_YES) |
449 | { | 426 | { |
450 | return bookmark_load(global_bookmark_file_name, true); | 427 | return bookmark_load(global_bookmark_file_name, true); |
@@ -453,6 +430,7 @@ bool bookmark_autoload(const char* file) | |||
453 | { | 430 | { |
454 | /* Prompting user to confirm bookmark load */ | 431 | /* Prompting user to confirm bookmark load */ |
455 | lcd_clear_display(); | 432 | lcd_clear_display(); |
433 | gui_syncstatusbar_draw(&statusbars, false); | ||
456 | #ifdef HAVE_LCD_BITMAP | 434 | #ifdef HAVE_LCD_BITMAP |
457 | lcd_setmargins(0, STATUSBAR_HEIGHT); | 435 | lcd_setmargins(0, STATUSBAR_HEIGHT); |
458 | lcd_puts_scroll(0,0, str(LANG_BOOKMARK_AUTOLOAD_QUERY)); | 436 | lcd_puts_scroll(0,0, str(LANG_BOOKMARK_AUTOLOAD_QUERY)); |
@@ -460,7 +438,6 @@ bool bookmark_autoload(const char* file) | |||
460 | lcd_puts(0,2, str(LANG_BOOKMARK_SELECT_LIST_BOOKMARKS)); | 438 | lcd_puts(0,2, str(LANG_BOOKMARK_SELECT_LIST_BOOKMARKS)); |
461 | lcd_puts(0,3, str(LANG_CANCEL_WITH_ANY_RECORDER)); | 439 | lcd_puts(0,3, str(LANG_CANCEL_WITH_ANY_RECORDER)); |
462 | #else | 440 | #else |
463 | status_draw(false); | ||
464 | lcd_puts_scroll(0,0, str(LANG_BOOKMARK_AUTOLOAD_QUERY)); | 441 | lcd_puts_scroll(0,0, str(LANG_BOOKMARK_AUTOLOAD_QUERY)); |
465 | lcd_puts(0,1,str(LANG_RESUME_CONFIRM_PLAYER)); | 442 | lcd_puts(0,1,str(LANG_RESUME_CONFIRM_PLAYER)); |
466 | #endif | 443 | #endif |
@@ -857,7 +834,7 @@ static void display_bookmark(const char* bookmark, | |||
857 | global_filename); | 834 | global_filename); |
858 | } | 835 | } |
859 | 836 | ||
860 | status_draw(false); | 837 | gui_syncstatusbar_draw(&statusbars, false); |
861 | lcd_puts_scroll(0,0,global_temp_buffer); | 838 | lcd_puts_scroll(0,0,global_temp_buffer); |
862 | lcd_puts(0,1,str(LANG_RESUME_CONFIRM_PLAYER)); | 839 | lcd_puts(0,1,str(LANG_RESUME_CONFIRM_PLAYER)); |
863 | if (dot) | 840 | if (dot) |