summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-06-23 01:31:26 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-06-23 01:31:26 +0000
commit6e0436f65cd461bb2b21c9a0178dfa6978213d27 (patch)
treefdd57985a0dd04959d3d7e6856a02ddab1b6dc51 /apps/bookmark.c
parent8b493fa6c4c2ef8245bf991daf350085d128729e (diff)
downloadrockbox-6e0436f65cd461bb2b21c9a0178dfa6978213d27.tar.gz
rockbox-6e0436f65cd461bb2b21c9a0178dfa6978213d27.tar.bz2
rockbox-6e0436f65cd461bb2b21c9a0178dfa6978213d27.zip
Henrik Backes patch for WPS and tag database context menus. Tag database context menus still don't work as expected. Hold Play/Select to pop up the menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6835 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c65
1 files changed, 31 insertions, 34 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index d2911af39d..4afba78d14 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -53,7 +53,6 @@
#define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark"
static bool add_bookmark(const char* bookmark_file_name, const char* bookmark);
-static bool bookmark_load_menu(void);
static bool check_bookmark(const char* bookmark);
static char* create_bookmark(void);
static bool delete_bookmark(const char* bookmark_file_name, int bookmark_id);
@@ -87,38 +86,6 @@ static char global_bookmark[MAX_BOOKMARK_SIZE];
static char global_filename[MAX_PATH];
/* ----------------------------------------------------------------------- */
-/* Displays the bookmark menu options for the user to decide. This is an */
-/* interface function. */
-/* ----------------------------------------------------------------------- */
-bool bookmark_menu(void)
-{
- int m;
- bool result;
-
- static const struct menu_item items[] = {
- { ID2P(LANG_BOOKMARK_MENU_CREATE), bookmark_create_menu},
- { ID2P(LANG_BOOKMARK_MENU_LIST), bookmark_load_menu},
- { ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), bookmark_mrb_load},
- };
-
- m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL,
- NULL, NULL, NULL);
-
-#ifdef HAVE_LCD_CHARCELLS
- status_set_param(true);
-#endif
- result = menu_run(m);
-#ifdef HAVE_LCD_CHARCELLS
- status_set_param(false);
-#endif
- menu_exit(m);
-
- settings_save();
-
- return result;
-}
-
-/* ----------------------------------------------------------------------- */
/* This is the interface function from the main menu. */
/* ----------------------------------------------------------------------- */
bool bookmark_create_menu(void)
@@ -133,7 +100,7 @@ bool bookmark_create_menu(void)
/* for the user. The user can then select a bookmark to load. */
/* If no file/directory is currently playing, the menu item does not work. */
/* ----------------------------------------------------------------------- */
-static bool bookmark_load_menu(void)
+bool bookmark_load_menu(void)
{
bool success = true;
int offset;
@@ -628,6 +595,8 @@ static char* select_bookmark(const char* bookmark_file_name)
int bookmark_count = 0;
#ifdef HAVE_LCD_BITMAP
+ int x = lcd_getxmargin();
+ int y = lcd_getymargin();
lcd_setmargins(0, 0);
#endif
@@ -712,6 +681,9 @@ static char* select_bookmark(const char* bookmark_file_name)
#ifdef SETTINGS_OK2
case SETTINGS_OK2:
#endif
+#ifdef HAVE_LCD_BITMAP
+ lcd_setmargins(x, y);
+#endif
return NULL;
default:
@@ -1142,6 +1114,31 @@ static bool generate_bookmark_file_name(const char *in)
}
/* ----------------------------------------------------------------------- */
+/* Returns the bookmark name for the current playlist */
+/* ----------------------------------------------------------------------- */
+bool bookmark_exist(void)
+{
+ bool exist=false;
+
+ if(system_check())
+ {
+ char* name = playlist_get_name(NULL, global_temp_buffer,
+ sizeof(global_temp_buffer));
+ if (generate_bookmark_file_name(name))
+ {
+ int fd=open(global_bookmark_file_name, O_RDONLY);
+ if (fd >=0)
+ {
+ close(fd);
+ exist=true;
+ }
+ }
+ }
+
+ return exist;
+}
+
+/* ----------------------------------------------------------------------- */
/* Checks the current state of the system and returns if it is in a */
/* bookmarkable state. */
/* ----------------------------------------------------------------------- */