summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/shopper.c38
-rw-r--r--manual/plugins/shopper.tex48
2 files changed, 82 insertions, 4 deletions
diff --git a/apps/plugins/shopper.c b/apps/plugins/shopper.c
index 15b44ca21a..7129291c10 100644
--- a/apps/plugins/shopper.c
+++ b/apps/plugins/shopper.c
@@ -320,13 +320,13 @@ enum plugin_status plugin_start(const void* parameter)
320 continue; 320 continue;
321 switch (button) 321 switch (button)
322 { 322 {
323 case ACTION_STD_CONTEXT:
324 case ACTION_STD_OK: 323 case ACTION_STD_OK:
325 { 324 {
326 changed |= toggle(cur_sel); 325 changed |= toggle(cur_sel);
327 break; 326 break;
328 } 327 }
329 case ACTION_STD_MENU: 328 case ACTION_STD_MENU:
329 case ACTION_STD_CONTEXT:
330 { 330 {
331 switch(view) 331 switch(view)
332 { 332 {
@@ -338,7 +338,9 @@ enum plugin_status plugin_start(const void* parameter)
338 "Mark all items", 338 "Mark all items",
339 category_string, 339 category_string,
340 "Revert to saved", 340 "Revert to saved",
341 "Show Playback Menu",); 341 "Show Playback Menu",
342 "Quit without saving",
343 "Quit");
342 344
343 switch (rb->do_menu(&menu, NULL, NULL, false)) 345 switch (rb->do_menu(&menu, NULL, NULL, false))
344 { 346 {
@@ -394,6 +396,20 @@ enum plugin_status plugin_start(const void* parameter)
394 playback_control(NULL); 396 playback_control(NULL);
395 break; 397 break;
396 } 398 }
399 case 6:
400 {
401 /* Quit without saving */
402 exit = 1;
403 break;
404 }
405 case 7:
406 {
407 /* Save and quit */
408 if (changed)
409 save_changes();
410 exit = 1;
411 break;
412 }
397 default: 413 default:
398 { 414 {
399 break; 415 break;
@@ -409,7 +425,9 @@ enum plugin_status plugin_start(const void* parameter)
409 "Reset list", 425 "Reset list",
410 category_string, 426 category_string,
411 "Revert to saved", 427 "Revert to saved",
412 "Show Playback Menu",); 428 "Show Playback Menu",
429 "Quit without saving",
430 "Quit");
413 431
414 switch (rb->do_menu(&menu, NULL, NULL, false)) 432 switch (rb->do_menu(&menu, NULL, NULL, false))
415 { 433 {
@@ -454,6 +472,20 @@ enum plugin_status plugin_start(const void* parameter)
454 playback_control(NULL); 472 playback_control(NULL);
455 break; 473 break;
456 } 474 }
475 case 5:
476 {
477 /* Quit without saving */
478 exit = 1;
479 break;
480 }
481 case 6:
482 {
483 /* Save and quit */
484 if (changed)
485 save_changes();
486 exit = 1;
487 break;
488 }
457 default: 489 default:
458 { 490 {
459 break; 491 break;
diff --git a/manual/plugins/shopper.tex b/manual/plugins/shopper.tex
index 0abd185dda..b2e23e46ee 100644
--- a/manual/plugins/shopper.tex
+++ b/manual/plugins/shopper.tex
@@ -2,4 +2,50 @@
2\subsection{Shopper} 2\subsection{Shopper}
3\label{ref:Shopperplugin} 3\label{ref:Shopperplugin}
4 4
5Shopper is a shopping list plugin which allows you to maintain reusable shopping lists. 5Shopper is a plugin which allows you to maintain reusable shopping lists.
6To create a list, use a text editor to write down a list of items (one per
7line; note that the line length should not exceed 40 characters) and save the
8file as \fname{<name>.shopper}. If you want to separate the items you can do
9so by creating categories, which are prepended with `\#'. To open a
10\fname{.shopper} file just ``play'' it from the file browser.
11
12\begin{example}
13 #groceries
14 bananas
15 cucumber
16 4 apples
17 6 apples
18 #dairy
19 milk
20 cheese
21\end{example}
22Note that it isn't possible to choose exact quantities, but you can create a
23number of entries with different quantities in the name of the item, such as
24for the apples in the above example.
25
26There are two modes, \emph{edit mode} and \emph{view mode}. The edit mode
27shows all the items, and it allows you to select which of the items you want
28to buy. When you have finished selecting the items, use the menu to go to the
29view mode, and you will see only the items you wish to buy. If you `select'
30an item in view mode then that item will be removed from the list.
31
32When you exit Shopper the last view is saved, including which items you have
33selected, so if you re-open the shopping list it will be as you left it. There
34are additional menu options for clearing the list, selecting all items, showing
35and hiding the categories, toggling the categories, and displaying the playback
36menu.
37
38\subsubsection{Shopper Keys}
39\begin{btnmap}
40 \ActionStdOk{}
41 \opt{HAVEREMOTEKEYMAP}{& \ActionRCStdOk}
42 & Select or clear an item\\
43
44 \ActionStdMenu{} or \ActionStdContext{}
45 \opt{HAVEREMOTEKEYMAP}{& \ActionRCStdMenu{} or \ActionRCStdContext}
46 & Show menu\\
47
48 \ActionStdCancel{}
49 \opt{HAVEREMOTEKEYMAP}{& \ActionRCStdCancel}
50 & Exit\\
51\end{btnmap}