This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#7486 - Favourites plugin.
Attached to Project:
Rockbox
Opened by Bryan Childs (GodEater) - Thursday, 26 July 2007, 17:03 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Sunday, 05 August 2007, 14:14 GMT+2
Opened by Bryan Childs (GodEater) - Thursday, 26 July 2007, 17:03 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Sunday, 05 August 2007, 14:14 GMT+2
|
DetailsThis is a first effort at a "favourites" plugin, which will allow the user to store up to ten shortcuts to directories somewhere in their file tree.
TODO: Add functionality to write the .rockbox/rocks/favourites.link file since this currently needs to already exist with entries in it for the plugin to do much. The format of the file is assumed to be one directory path per line, e.g. : /dir1/ /dir2/dir3/ The trailing slash is a must have. BUGS: Currently the call to set_current_file(), which is supposed to move the file browser to the selected directory is causing the sim to seg fault. Haven't even tried this on an actual DAP yet. |
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Sunday, 05 August 2007, 14:14 GMT+2
Reason for closing: Accepted
Sunday, 05 August 2007, 14:14 GMT+2
Reason for closing: Accepted
This means hacking the dirfilter setting on the plugin browser, but I don't think anyone will notice ;)
TODO:
1) Still need the ability to write the favourites file itself.
2) Possibly add directly to the context menu for directories to make adding entries quick
BUGS:
None that I know of ;)
Still TODO:
Allow user to remove entries from the favourites file.
Fixed a bug with saving a new file.
Error is "directory no longer exist on disk"
for all links made by the plugin.
If I edit the link file and remove the end /
the plugin exits to the file browser with the
favourite link selected.
In other words one directory up from the link
with the link directory selected.
I would like to see this selectable from the main menu
and be able to start plugins as well or songs.
GRaTT
I'm willing to bet you created the .link file on your computer and copied it to the sansa correct ?
@jeton
No need to include a template - the plugin creates the file and adds the entries to it itself. Having a template file will only lead people to editing it in a windows text editor and breaking the format.
Secondly - this has now been completely reworked to use the rb->read_line() function instead of my own file parsing code - so windows edited files shouldn't break the functionality anymore.
Thirdly - you can now mark individual files as well as directories.
Fourthly - I've renamed the patch to "shortcuts" to avoid confusion with an earlier "favourites" plugin which was ditched months and months back.
I only used the link file as created on the sansa.
Also edited it on the sansa to test it by removing the end slash(/).
I will try the new patch and recreate the link file.
GRaTT
In order to delete an entry from the links file, click on it with the "Menu" key.
**WARNING* There is no prompt currently to check if you're sure of not - it just gets wiped.
This patch now handles user created .link files too (you have to create them in some sort of text editor).
1) If you wish your shortcut to enter a directory, make sure the entry has a trailing / on it. If it doesn't, the plugin will "select" the directory in it's parent, rather than entering it.
2) If your user created .link file has only one entry, the plugin will take you straight there rather than displaying the menu.
3) I've disallowed deleting entries in user created .link files. At least for the time being.
I have to remove the trailing slash (/) and then it will
go to the directory and highlight it not enter it.
As is it will display ""Directory no longer exists on disk"
The single link does not work for me either.
Thanks for relenting.
GRaTT
If I run the plugin from the plugins menu
and select my fixed link tailing slash removed,
or a file link, the plugin just drops me in the
directory and does not highlight the link file/dir.
If run from the link file it highlights the file/dir.
GRaTT
@GRaTT:
Could you attach some of your .link files for me to look at please ?
I have not yet updated to the last patch, and
I do have some other patches in my build.
If there is a trailing slash in the link file
an error as above "no longer exists"
GRaTT
Thanks for the file.
I have no idea if the <microSD1> entries will work or not as they're "fake" file system entries, but the first two look like they should work to me.
---
/MUSIC/
/RECORD/VOICE/
/<microSD1>/GRaTT/slideshow/
/<microSD1>/movies/movies/
/<microSD1>/music/Shakira/Laundry Service/Eyes Like Yours (Ojos Asi).mp3
---
Only the one that points to a file works.
The others will work if I remove the trailing slash,
but only enter the dir above and highlight the link dir.
The <microSD1> "fake" file system entries act the same way so they do "work".
It did work originally for me so it may be one of the other patches.
I just svn uped and will try with just this patch.
GRaTT
Including different behavior between running the link file
and the plugin. Also single line links go to the list.
info: sansa E260 with 2GB SD card
OF Version ...18A
RB ver. r14147M-070802
shorcuts ver. Aug 02 10:23
The version I think worked. The comment was "Bit more reorganisation.
I will verify this in the next few days.
GRaTT
I've also removed the shortcuts.h file and put its content into shortcuts.c - linuxstb suggested this since the shortcuts code is currently unreferenced by any other part of the RB code - and so the .h file isn't really required.
Have so far not done anything about his suggestion to move away from a linked list to a static buffer. That's just too much re-writing for now!
The above discrepancies between running the link file
or running the plugin and the file/dir getting selected/highlighted still apply.
The single link still does not work.
GRaTT
only on user defined link files.
GRaTT
The "shortcuts.link" file however can't work like that, or the user is unable to delete the entry from it.
I only get the non highlight behavior when run from the plugins menu.
I tried running the shorcuts.rock file from the directory view and
both the directory without a / and the file were highlighted as expected.
GRaTT