Commit Graph

41 Commits (master)

Author SHA1 Message Date
NiLuJe 75ffc3bb76 Terminal: Better yet, disable it properly on prereq failure 3 months ago
NiLuJe a906838123 Terminal: Clearer error message on prereq failures
Pluginloader uses pcall, so, throw with an actual error message

Re: #11394
3 months ago
mergen3107 0d2f8fbb3f
Terminal Emulator: Fix former_buffer crash (#11230)
Closes #11229
5 months ago
NiLuJe eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2 years ago
NiLuJe fadee1f5dc
Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2 years ago
zwim 5bcd3d0962
[plugin, Terminal] fix crash on clear screen (#9119)
This fixes https://github.com/koreader/koreader/issues/9108#issuecomment-1132243061

Tapping on clear screen during a running program like top, let's KOReader crash.
2 years ago
zwim d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2 years ago
NiLuJe 5bb22709f7
Terminal: Make sure devpts is mounted on Kobo (#8998)
* Terminal: Make sure devpts is mounted on Kobo

Fix #8986
2 years ago
NiLuJe 2c25181644
Terminal: Make the prerequisites check verbose (#8994)
So we actually have a chance of understanding why it fails to load ;).

(Also, properly require posix FFI stuff, in the unlikely event they aren't already in the main namespace).
2 years ago
NiLuJe 23cd7e24bb
Minor Lua I/O cleanups (#8921)
Mostly making sure we always explicitly close io handles.
2 years ago
zwim eef4dc1c0d
Terminal: fix regression from #8845 (#8848)
This should fix a regression introduced with #8845 with reopening a running shell.

Adds more checks and more verbose logging messages on failures.
2 years ago
zwim 1cd396f9c4
Teminal: fix crash when grantpt or unlockpt fail (#8845)
* Fix crash when grantpt or unlockpt fail
* Disable plugin if grantpt or unlockpt fail
2 years ago
Frans de Jonge 67445beea5
[plugin] Terminal: remove stray space at end of string (#8831) 2 years ago
Frans de Jonge 8ff8a05ff3
[plugin] Terminal: move stray newlines outside of translated string (#8830) 2 years ago
Frans de Jonge 4d6a789f6d
[plugin] Terminal: fix @translators comments (#8829) 2 years ago
Frans de Jonge c2812c7956
[plugin] Update capitalization style "Terminal Emulator" → "Terminal emulator" (#8759) 2 years ago
zwim 8cff5f88b0
Teminal emulator: fix translatable, fix potential crash (#8756) 2 years ago
zwim b924f38dc0
Terminal emulator: fix elinks 'q' crash (#8749)
This fixes a crash in terminal emulator on exit of elinks.
see: https://github.com/koreader/koreader/pull/8636#issuecomment-1024956177
2 years ago
zwim 7220bdea4f
[fix, plugin] Terminal ldoc (#8742) 2 years ago
zwim f2557a7aa6
Terminal emulator: full rewrite, real vt52 emulator (#8636)
New real terminal emulator, replacing the old plugin.
The emulator is basically a vt52 terminal (enriched with
some ANSI-sequences, as ash, vi and mksh don't behave well
on a vt52 term).
So far working: ash, mksh, bash, nano, vi, busybox, watch...
The input supports: tab-completion; cursor movement;
backspace; start of line, end of line (long press);
page up, page down (long press).
User scripts may be placed in the koterm.koplugin/scripts/
folder, aliases can be put in the file aliases and startup
command in the file profile.user in that folder.
2 years ago
hius07 859327dea5
Input dialogs: keep size in rotation (#8223) 3 years ago
yparitcher f5dc7b4539 Dispatcher: Revamp sections and item order 3 years ago
NiLuJe 03d85bbf99 Terminal: Read settings at instantiation time, not loading time 3 years ago
NiLuJe bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
3 years ago
yparitcher 433b82f162 Dispatcher: allow registering actions at runtime 4 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
smartscripts-nl 4e281f00ed
Dispatcher: adds Show terminal (#6626) 4 years ago
Frans de Jonge d7aa626ee8
Fix order of requires 4 years ago
smartscripts-nl 20ddad2951
Terminal: add shortcuts for re-useable commands (#6609)
To be able to quickly repeat often used terminal commands
4 years ago
smartscripts-nl 4cff623244
Terminal: support multiple lines and make it re-invokeable (#6599)
With this changes you can enter multiple lines with commands and after viewing the output you can re-invoke the terminal with a button
4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
poire-z 55d7109042
Terminal plugin: a few tweaks (#5985)
- Show output in a TextViewer with a monospace font.
- Include stderr, so errors are shown
- Use Trapper to allow interrupting command (and to fix
  some refresh issues)
4 years ago
poire-z d6d49a64a7 [RTL UI] use auto or LTR text direction in some specific cases
Allow TextBoxWidget new text direction/lang parameters to be
set on upper widgets, and propagate them all the way to it
(ScrollTextWidget, InputText, InputDialog, TextViewer).

Use specific non-default ones in some specific cases:
- Force LTR text direction when showing HTML and CSS, and
  configuration files (in some plugins).
- Use Wikipedia server language and text direction when
  showing an article.
- Use auto with Dictionary results, as we don't know the
  dictionary language, and they may contain mixed content.
- Force LTR when showing some paths (still needs more of them)

TextEditor plugin: add 2 new options "Auto paragraph direction"
and "Force paragraph direction LTR".

Footnotes popup: grab HTML direction, and forward it
to MuPDF for proper display.
4 years ago
poire-z 850be52177
Keep some menus open when Tap or Hold (#4189)
TouchMenu: added options to menu items with the following defaults:
    keep_menu_open = false
    hold_keep_menu_open = true
So, default for Tap callback is to close menu, and for Hold callback
to keep menu open.
In both cases, provide the TouchMenu instance as the 1st argument to
the callback functions (instead of a refresh_menu_func I added in #3941)
so the callback can do more things, like closing, refreshing,
changing menu items text and re-ordering...

ReaderZooming: show symbol for default (like it was done for
ReaderFont, ReaderHyphenation...)
TextEditor plugin: update the previously opened files list in real
time, so the menu can be kept open and used as the TextEditor main
interface.
SSH plugin: keep menu open and update the Start/Stop state in real time
ReadTimer plugin: tried to do what feels right (but I don't use it)

Also remove forgotten cp in the move/paste file code
6 years ago
Robert 5344e0b672 [Fix] Don't load disabled plugins (#4169) 6 years ago
Robert 4428ecb422 Plugin manager (#4159)
Also adds descriptions to all plugins.
6 years ago
onde2rock e502bf04d3 [feat, UX] Support the virtualKeyboard on non touch-device (#3796)
* [VirtualKeyboard] Add support for keynaviguation

Also rename the variable "layout" to "keyboard_layout" because conflict
with the layout from the focusmanager

* Make the goto dialog compatible with key naviguation

My solution is to change the order of the widget. The last one will the
virtualkeybard so it catch all the keybinding, and below it, make the
dialog "is_always_active = true" so it can receive touch event.

* Correctly show the virtual keyboard on dpad devices

* change the order to call the virtualKeyboard so it end up on top

* Handle the multi input dialog

* Support reopening the virtualKeyboard by the Press key

* add check focusmanager

* Fix https://github.com/koreader/koreader/issues/3797

* MultiInputDialog : Now work on non touch-device

* Set the virtualkeyboard to be a modal widget

* Fix the layout in multiinputwidget

* Fix for the various combination of
hasKeys,hasDpad,isTouchDevice

* [Focusmanager] Better handling of malformed layout
6 years ago
Frans de Jonge e1aa57f27e Font: unify font styling 7 years ago
Hzj_jie 999898fa69 Merge various information into systemstat (#2764)
* Merge various information to systemstat
7 years ago
Frans de Jonge d91bd91840 Terminal plugin: minor language fixes
* ... should be a proper ellipsis
* "written" is a bit more end-user friendly than "dumped"
7 years ago
Hzj_jie 339e16636b Terminal plugin (#2646) 7 years ago