FS#10820 - Shopper, a shopping list plugin

Attached to Project: Rockbox
Opened by Daniel Rigby (danr) - Saturday, 28 November 2009, 10:04 GMT
Last edited by Nils Wallménius (nls) - Wednesday, 18 August 2010, 09:11 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This is a shopping list plugin. I used the text editor plugin as a starting point, so in theory this plugin should run on any of the devices the text editor can run on, although I've only tested it on the Sansa Fuze v1.

To apply the patch, go to the level above your rockbox source directory and do patch -p0 < shopper.patch.

Hope you will find it of use; I've been using it for some time for my weekly food shopping!


Shopper is a shopping list plugin which allows you to maintain reusable shopping lists. You should create a text file called <name>.list, for example shopping.list, and use a text editor to make a list the items you might want to buy. You will later be able to select which of these items you want to buy at a particular time. If you want to separate the items you can do so by creating categories, which are prepended with '#'.

For example, shopping.list could contain

# groceries
4 apples
6 apples
# dairy

Note that it isn't possible to choose exact quantities, so I often create a number of entries with different quantities in the name of the item, such as for the apples in the above example.

Once you've made your list, if you select the filename in the file viewer in Rockbox, Shopper will load it automatically.

There are two modes, edit mode and view mode. The edit mode shows all the items, and it allows you to select which of the items you want to buy. When you have finished selecting the items, use the menu to go to the view mode, and you will see only the items you wish to buy. If you 'select' an item in view mode then that item will be removed from the list.

When you exit Shopper the last view is saved, including which items you have selected, so if you re-open the shopping list it will be as you left it. There are additional menu options for clearing the list, selecting all items, showing and hiding the categories, toggling the categories, and displaying the playback menu.
This task depends upon

Closed by  Nils Wallménius (nls)
Wednesday, 18 August 2010, 09:11 GMT
Reason for closing:  Accepted
Additional comments about closing:  committed in r 27842, thanks.
btw a manual page would be nice ;)
Comment by Nils Wallménius (nls) - Saturday, 14 August 2010, 12:18 GMT
hi, sounds like a useful thing.
some comments.

* the category for this plugin in apps/plugins/CATEGORIES should probably be "viewers" instead of "apps" since it just returns an error if started without parameter so there's no need to have it in the apps list.

* you break some style guidelines, see docs/CONTRIBUTING specifically "structs are structs, not typedefs" and "Braces for function declarations are put in a new line under the name"
Comment by Nils Wallménius (nls) - Saturday, 14 August 2010, 12:24 GMT
also, ther's no overflow checking in load_file() it the list is too long this seems like it could overwrite arbitrary memory
Comment by Daniel Rigby (danr) - Sunday, 15 August 2010, 10:54 GMT
Hi Nils, many thanks for the feedback.

I've taken your comments into consideration and have provided a new patch, which should adhere to the style guidelines. As you suggested, I've also added some checks to the file load function which should take care of long lists, and also some checks that the view information contained at the end of the file is valid.

Let me know if you'd like me to make any further changes, as I'm quite keen to get Shopper included in the Rockbox distribution ;-)