Shopper: slightly improve plugin and manual
* improve manual (hopefully fixes fs#11988). Parts of the description are taken from fs#10820. * move ACTION_STD_CONTEXT from alternate select to alternate menu action, as not all targets have ACTION_STD_MENU * add menu entries for "Quit" and "Quit without saving" Change-Id: Iec86a1608756a899f9f9d7ec7d479838dfd1d95f
This commit is contained in:
parent
399904a916
commit
59928e6cf5
2 changed files with 82 additions and 4 deletions
|
@ -320,13 +320,13 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
continue;
|
continue;
|
||||||
switch (button)
|
switch (button)
|
||||||
{
|
{
|
||||||
case ACTION_STD_CONTEXT:
|
|
||||||
case ACTION_STD_OK:
|
case ACTION_STD_OK:
|
||||||
{
|
{
|
||||||
changed |= toggle(cur_sel);
|
changed |= toggle(cur_sel);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ACTION_STD_MENU:
|
case ACTION_STD_MENU:
|
||||||
|
case ACTION_STD_CONTEXT:
|
||||||
{
|
{
|
||||||
switch(view)
|
switch(view)
|
||||||
{
|
{
|
||||||
|
@ -338,7 +338,9 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
"Mark all items",
|
"Mark all items",
|
||||||
category_string,
|
category_string,
|
||||||
"Revert to saved",
|
"Revert to saved",
|
||||||
"Show Playback Menu",);
|
"Show Playback Menu",
|
||||||
|
"Quit without saving",
|
||||||
|
"Quit");
|
||||||
|
|
||||||
switch (rb->do_menu(&menu, NULL, NULL, false))
|
switch (rb->do_menu(&menu, NULL, NULL, false))
|
||||||
{
|
{
|
||||||
|
@ -394,6 +396,20 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
playback_control(NULL);
|
playback_control(NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 6:
|
||||||
|
{
|
||||||
|
/* Quit without saving */
|
||||||
|
exit = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 7:
|
||||||
|
{
|
||||||
|
/* Save and quit */
|
||||||
|
if (changed)
|
||||||
|
save_changes();
|
||||||
|
exit = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -409,7 +425,9 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
"Reset list",
|
"Reset list",
|
||||||
category_string,
|
category_string,
|
||||||
"Revert to saved",
|
"Revert to saved",
|
||||||
"Show Playback Menu",);
|
"Show Playback Menu",
|
||||||
|
"Quit without saving",
|
||||||
|
"Quit");
|
||||||
|
|
||||||
switch (rb->do_menu(&menu, NULL, NULL, false))
|
switch (rb->do_menu(&menu, NULL, NULL, false))
|
||||||
{
|
{
|
||||||
|
@ -454,6 +472,20 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
playback_control(NULL);
|
playback_control(NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
/* Quit without saving */
|
||||||
|
exit = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
{
|
||||||
|
/* Save and quit */
|
||||||
|
if (changed)
|
||||||
|
save_changes();
|
||||||
|
exit = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2,4 +2,50 @@
|
||||||
\subsection{Shopper}
|
\subsection{Shopper}
|
||||||
\label{ref:Shopperplugin}
|
\label{ref:Shopperplugin}
|
||||||
|
|
||||||
Shopper is a shopping list plugin which allows you to maintain reusable shopping lists.
|
Shopper is a plugin which allows you to maintain reusable shopping lists.
|
||||||
|
To create a list, use a text editor to write down a list of items (one per
|
||||||
|
line; note that the line length should not exceed 40 characters) and save the
|
||||||
|
file as \fname{<name>.shopper}. If you want to separate the items you can do
|
||||||
|
so by creating categories, which are prepended with `\#'. To open a
|
||||||
|
\fname{.shopper} file just ``play'' it from the file browser.
|
||||||
|
|
||||||
|
\begin{example}
|
||||||
|
#groceries
|
||||||
|
bananas
|
||||||
|
cucumber
|
||||||
|
4 apples
|
||||||
|
6 apples
|
||||||
|
#dairy
|
||||||
|
milk
|
||||||
|
cheese
|
||||||
|
\end{example}
|
||||||
|
Note that it isn't possible to choose exact quantities, but you can create a
|
||||||
|
number of entries with different quantities in the name of the item, such as
|
||||||
|
for the apples in the above example.
|
||||||
|
|
||||||
|
There are two modes, \emph{edit mode} and \emph{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.
|
||||||
|
|
||||||
|
\subsubsection{Shopper Keys}
|
||||||
|
\begin{btnmap}
|
||||||
|
\ActionStdOk{}
|
||||||
|
\opt{HAVEREMOTEKEYMAP}{& \ActionRCStdOk}
|
||||||
|
& Select or clear an item\\
|
||||||
|
|
||||||
|
\ActionStdMenu{} or \ActionStdContext{}
|
||||||
|
\opt{HAVEREMOTEKEYMAP}{& \ActionRCStdMenu{} or \ActionRCStdContext}
|
||||||
|
& Show menu\\
|
||||||
|
|
||||||
|
\ActionStdCancel{}
|
||||||
|
\opt{HAVEREMOTEKEYMAP}{& \ActionRCStdCancel}
|
||||||
|
& Exit\\
|
||||||
|
\end{btnmap}
|
||||||
|
|
Loading…
Reference in a new issue