2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/frontend/ui/elements/reader_menu_order.lua

272 lines
7.5 KiB
Lua
Raw Normal View History

2019-01-21 21:44:13 +00:00
local Device = require("device")
local order = {
["KOMenu:menu_buttons"] = {
"navi",
"typeset",
"setting",
"tools",
"search",
"filemanager",
"main",
},
navi = {
"table_of_contents",
"bookmarks",
"toggle_bookmark", -- if not Device:isTouchDevice()
"bookmark_browsing_mode",
"navi_settings",
"----------------------------",
"page_map",
"hide_nonlinear_flows",
"----------------------------",
"book_map", -- if Device:isTouchDevice()
"page_browser", -- if Device:isTouchDevice()
"----------------------------",
"go_to",
"skim_to",
"autoturn",
"----------------------------",
"go_to_previous_location",
"go_to_next_location",
},
navi_settings = {
"toc_ticks_level_ignore",
"----------------------------",
"toc_items_per_page",
"toc_items_font_size",
"toc_items_show_chapter_length",
"toc_items_with_dots",
"----------------------------",
"toc_alt_toc",
"----------------------------",
"handmade_toc",
"handmade_hidden_flows",
"handmade_settings",
"----------------------------",
"bookmarks_settings",
},
typeset = {
"document_settings",
"----------------------------",
"set_render_style",
"style_tweaks",
"----------------------------",
"change_font",
"typography",
"----------------------------",
"switch_zoom_mode",
"----------------------------",
"page_overlap",
"speed_reading_module_perception_expander",
"----------------------------",
"highlight_options",
"selection_text", -- if Device:hasDPad()
"panel_zoom_options",
"djvu_render_mode",
"start_content_selection", -- if Device:hasDPad(), put this as last one so it is easy to select with "press" and "up" keys
},
setting = {
-- common settings
-- those that don't exist will simply be skipped during menu gen
"frontlight", -- if Device:hasFrontlight()
"night_mode",
"----------------------------",
"network",
"screen",
"----------------------------",
"taps_and_gestures", -- if Device:isTouchDevice()
"navigation",
"document",
"----------------------------",
"language",
"device",
"----------------------------",
"status_bar",
},
document = {
"document_metadata_location",
"document_auto_save",
"document_save",
"document_end_action",
reader: implement language-support plugin system This creates a new plugin system which hooks into a handful of reader operations in order to allow plugins to add language-specific support where the default reader falls short. The two hooks added are: * During hold-without-pan taps, language plugins can modify the selection in order to better match what users expect koreader to highlight when selecting a single word. The vast majority of CJK language words are more than one character, but KOReader treats all CJK characters as a single word by default, so adding this hook means that readers no longer need to manually select the whole word every time they need to look something. * During dictionary lookup, language plugins can propose alternative candidate words to look up if the selected word could not be found in the dictionary. This is pretty necessary for Japanese and Korean, both of which are highly agglutinative languages and the fuzzy searching system of StarDict is simply not usable because often the inflection of the word is so much longer than the dictionary form that sdcv decides to chop off the actual word and search for the inflection (which yields useless results). This system is of particular interest for readers of CJK languages (without this, looking up words using KOReader was fairly painful) but this system is designed to be minimal and language-agnostic enough that other languages could make use of it by creating their own plugins if the default "whole word" highlight and fuzzy-search system doesn't match their needs. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-10-23 10:13:09 +00:00
"language_support",
"----------------------------",
"partial_rerendering",
},
device = {
"keyboard_layout",
"external_keyboard",
"font_ui_fallbacks",
"----------------------------",
"time",
"units",
"device_status_alarm",
"charging_led", -- if Device:canToggleChargingLED()
"autostandby",
"autosuspend",
"autoshutdown",
"ignore_sleepcover",
"ignore_open_sleepcover",
"cover_events",
"ignore_battery_optimizations",
"mass_storage_settings", -- if Device:canToggleMassStorage()
"file_ext_assoc",
"screenshot",
},
navigation = {
"back_to_exit",
"back_in_filemanager",
"back_in_reader",
2022-01-23 17:40:37 +00:00
"backspace_as_back",
"----------------------------",
"physical_buttons_setup",
"----------------------------",
"android_volume_keys",
"android_haptic_feedback",
"android_back_button",
"----------------------------",
"opening_page_location_stack",
2024-06-22 14:57:12 +00:00
"skim_dialog_position",
},
network = {
"network_wifi",
"network_proxy",
Various Wi-Fi QoL improvements (#6424) * Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback). * Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental. * Consistently use "Wi-Fi" everywhere. * On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery. (i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again). * Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic). * restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it). * We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed. * Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state. * Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing. * Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results). * For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
2020-07-27 01:39:06 +00:00
"network_powersave",
"network_restore",
"network_info",
"network_before_wifi_action",
Various Wi-Fi QoL improvements (#6424) * Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback). * Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental. * Consistently use "Wi-Fi" everywhere. * On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery. (i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again). * Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic). * restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it). * We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed. * Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state. * Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing. * Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results). * For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
2020-07-27 01:39:06 +00:00
"network_after_wifi_action",
"network_dismiss_scan",
"----------------------------",
"ssh",
},
screen = {
"screensaver",
"coverimage",
2022-06-01 21:18:48 +00:00
"autodim",
"----------------------------",
"screen_rotation",
"----------------------------",
"screen_dpi",
"screen_eink_opt",
"autowarmth",
"color_rendering",
"----------------------------",
"screen_timeout",
"fullscreen",
"----------------------------",
"screen_notification",
},
taps_and_gestures = {
"gesture_manager",
"gesture_intervals",
"----------------------------",
"ignore_hold_corners",
"screen_disable_double_tab",
"----------------------------",
"follow_links",
"----------------------------",
"menu_activate",
"page_turns",
"scrolling",
"long_press",
},
tools = {
"read_timer",
"calibre",
"exporter",
"statistics",
"progress_sync",
2020-05-02 21:02:36 +00:00
"move_to_archive",
"wallabag",
"news_downloader",
2018-02-22 23:02:32 +00:00
"send2ebook",
"text_editor",
"qrclipboard",
"profiles",
"----------------------------",
"more_tools",
},
more_tools = {
"auto_frontlight",
"battery_statistics",
2021-09-09 20:28:32 +00:00
"book_shortcuts",
"synchronize_time",
"keep_alive",
"doc_setting_tweak",
2017-04-02 06:50:24 +00:00
"terminal",
"----------------------------",
"plugin_management",
"patch_management",
},
search = {
"search_settings",
"----------------------------",
"dictionary_lookup",
"dictionary_lookup_history",
"vocabbuilder",
"----------------------------",
"wikipedia_lookup",
"wikipedia_history",
"----------------------------",
"translate_current_page",
"----------------------------",
"find_book_in_calibre_catalog",
"fulltext_search",
"fulltext_search_findall_results",
"bookmark_search",
},
search_settings = {
"dictionary_settings",
"wikipedia_settings",
"translation_settings",
"----------------------------",
"fulltext_search_settings",
},
filemanager = {},
main = {
"history",
"open_previous_document",
"----------------------------",
2024-05-01 06:01:59 +00:00
"favorites",
"collections",
"----------------------------",
"book_status",
"book_info",
"----------------------------",
"mass_storage_actions", -- if Device:canToggleMassStorage()
"----------------------------",
"ota_update", -- if Device:hasOTAUpdates()
"help",
"----------------------------",
"exit_menu",
},
help = {
"quickstart_guide",
"----------------------------",
"search_menu",
"----------------------------",
"report_bug",
"----------------------------",
"system_statistics", -- if enabled (Plugin)
"version",
"about",
},
exit_menu = {
"restart_koreader", -- if Device:canRestart()
"----------------------------",
"sleep", -- if Device:canSuspend()
"poweroff", -- if Device:canPowerOff()
"reboot", -- if Device:canReboot()
"----------------------------",
"start_bq", -- if Device:isCervantes()
"exit",
}
}
if not Device:hasExitOptions() then
2019-01-21 21:44:13 +00:00
order.exit_menu = nil
end
return order