New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TouchMenu: added hook to show help text on long-press #3980

Merged
merged 2 commits into from May 25, 2018

Conversation

Projects
None yet
3 participants
@poire-z
Contributor

poire-z commented May 25, 2018

When there is no hold callback attached to a menu item, a help_text attribute, when present, is shown in an InfoMessage.
This is one more step towards an inline user manual as envisionned by @KenMaltby in #3952 (comment), after @robert00s recent works in #3952 and #3967.

I added just a few to the items in the Links> submenu (as I added some of these).
Dunno to which level of information we should go (facts, suggestions for different use cases...).
image

Just curious how it works for translation, when we just correct a typo in some english message: do they see their previous entered translation, or it's lost as it's no more associated to the now modified message?

TouchMenu: added hook to show help text on Hold
When Hold and there is no hold callback attached to a menu item, a help_text
attribute, when present, is shown in an InfoMessage.
@KenMaltby

This comment has been minimized.

KenMaltby commented May 25, 2018

Looks great to me, the inclusion of an example use, is a nice touch. At some point, it may become useful to include links to the project's Wiki, for more detailed explanations. This will probably be a long term effort, it may be a while before enough is completed so that its use becomes expected by the users. As new features are added to the menus, the developer of the feature can provide a description of the use and any caveats needed. Users should be more comfortable trying features they have a better understanding of, also unrealistic expectations can be avoided.

@Frenzie

This comment has been minimized.

Member

Frenzie commented May 25, 2018

Just curious how it works for translation, when we just correct a typo in some english message: do they see their previous entered translation, or it's lost as it's no more associated to the now modified message?

Transifex (and probably most translation platforms) maintains a history of translations. I don't think it can be exported, so it's a kind of vendor lock-in. These show up in suggestions in the web GUI and presumably in the concordance as well. You then either reuse the old translation wholesale or make minor adjustments where appropriate.

@@ -104,6 +105,7 @@ function ReaderLink:addToMainMenu(menu_items)
G_reader_settings:saveSetting("swipe_to_go_back",
not isSwipeToGoBackEnabled())
end,
help_text = _([[Swipe to the right to go back to the previous location after you have followed a link. When the location stack is empty, swiping to the right takes you normally to previous page.]]),

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

Just takes you to the previous page should suffice (without normally, but with the determiner)

@@ -115,6 +117,7 @@ function ReaderLink:addToMainMenu(menu_items)
G_reader_settings:delSetting("swipe_to_follow_nearest_link") -- can't have both
end
end,
help_text = _([[Swipe to the left to go the first link in the current page.]]),

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

Why not follow? Nothing wrong with go as such, except that it's perhaps slightly generic. (Almost anything "goes.")

@@ -126,6 +129,7 @@ function ReaderLink:addToMainMenu(menu_items)
G_reader_settings:delSetting("swipe_to_follow_first_link") -- can't have both
end
end,
help_text = _([[Swipe to the left to go the link nearest to where you started the swipe. This is useful when a small font is used and taping on small links is tedious.]]),

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

Why not follow?

Tapping.

@@ -135,6 +139,9 @@ function ReaderLink:addToMainMenu(menu_items)
G_reader_settings:saveSetting("swipe_to_jump_to_latest_bookmark",
not isSwipeToJumpToLatestBookmarkEnabled())
end,
help_text = _([[Swipe to the left to go the most recently bookmarked page.
This can be useful to quickly swipe back and forth between your reading and some reference page (for example a map, a characters list...)

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

Maybe…

`between what you are reading and some reference page (for example, notes, a map or a character list).

@@ -135,6 +139,9 @@ function ReaderLink:addToMainMenu(menu_items)
G_reader_settings:saveSetting("swipe_to_jump_to_latest_bookmark",
not isSwipeToJumpToLatestBookmarkEnabled())
end,
help_text = _([[Swipe to the left to go the most recently bookmarked page.
This can be useful to quickly swipe back and forth between your reading and some reference page (for example a map, a characters list...)
If any of the other Swipe to follow link option is enabled, this will work only when the current page contains no link.]]),

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

If any of the other Swipe to follow link options is enabled

elseif item.help_text or type(item.help_text_func) == "function" then
local help_text = item.help_text
if item.help_text_func then
help_text = item.help_text_func()

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

Interesting… some kind of setup wizards in the works? :-P

This comment has been minimized.

@poire-z

poire-z May 25, 2018

Contributor

uh, no :) just thought why not (and for similarity with the 2 previous if ... item.hold_input_func and if .. item.hold_callback_func)

This comment has been minimized.

@Frenzie

Frenzie May 25, 2018

Member

Sure, sure. I was just wondering what one might do with it.

@poire-z poire-z merged commit 9b6b91b into koreader:master May 25, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@poire-z poire-z deleted the poire-z:touchmenu_help_text branch May 25, 2018

@poire-z poire-z referenced this pull request Aug 14, 2018

Merged

Plugin manager #4159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment