Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 01-31-2025, 09:28 AM   #1
sdothum
Enthusiast
sdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it is
 
Posts: 36
Karma: 2062
Join Date: Oct 2021
Device: Kobo Libra 2
Is there a way to patch a plugin?

Specifically the vocabbuilder.koplugin.

i want to close the dictionary lookup popup when a word is added to the Vocabulary Builder database.

i am assuming the close needs be added to VocabBuilder:onDictButtonsReady function.

Saves just one button press action on the dictionary lookup.. but curious if this can be achieved.

Last edited by sdothum; 02-02-2025 at 10:58 AM.
sdothum is offline   Reply With Quote
Old 01-31-2025, 11:13 AM   #2
hius07
Wizard
hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.
 
Posts: 1,137
Karma: 3592801
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
Example of patching a plugin
https://github.com/koreader/koreader...ent-2393154113
hius07 is online now   Reply With Quote
Advert
Old 02-01-2025, 12:17 PM   #3
sdothum
Enthusiast
sdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it is
 
Posts: 36
Karma: 2062
Join Date: Oct 2021
Device: Kobo Libra 2
Thank you for the plugin patch example.

i've managed to override the VocabBuilder: onDictButtonsReady function but am stumped at what i was expecting to be the easiest part -- closing the DictQuickLookup window. More needs be done than simply calling DictQuickLookup: onClose() after the button tap.

Any ideas? before i create another thread post?

Last edited by sdothum; 02-11-2025 at 05:18 AM.
sdothum is offline   Reply With Quote
Old 02-02-2025, 12:23 PM   #4
sdothum
Enthusiast
sdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it is
 
Posts: 36
Karma: 2062
Join Date: Oct 2021
Device: Kobo Libra 2
Found the answer.. at least what appears to work. Instead of using DictQuickLookup:onClose..

UIManager:sendEvent(Event:new("Close"))
sdothum is offline   Reply With Quote
Old 02-02-2025, 01:19 PM   #5
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,727
Karma: 730679
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
It's probably more proper to do UIManager:close(the_widget_in_question)
Frenzie is offline   Reply With Quote
Advert
Old 02-03-2025, 06:42 AM   #6
sdothum
Enthusiast
sdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it is
 
Posts: 36
Karma: 2062
Join Date: Oct 2021
Device: Kobo Libra 2
Quote:
Originally Posted by Frenzie View Post
It's probably more proper to do UIManager:close(the_widget_in_question)
i thought about that but could not figure out how to specify the widget id of the QuickDictLookup widget.
sdothum is offline   Reply With Quote
Old 02-03-2025, 06:52 AM   #7
hius07
Wizard
hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.
 
Posts: 1,137
Karma: 3592801
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
It is dict_popup.
hius07 is online now   Reply With Quote
Old 02-11-2025, 05:13 AM   #8
sdothum
Enthusiast
sdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it is
 
Posts: 36
Karma: 2062
Join Date: Oct 2021
Device: Kobo Libra 2
The UIManager:close(dict_popup) does close the widget..

BUT this action also appears to bypass the widget's DictQuickLookup: onClose() function -- at least, the scheduled highlight clear is not triggered after the widget is closed (i do patch that to lengthen its duration before clearing).

The UIManager:sendEvent() close appears to be a more graceful action in this regard, clearing the highlight afterwards.

Last edited by sdothum; 02-11-2025 at 05:20 AM.
sdothum is offline   Reply With Quote
Old 02-11-2025, 05:29 AM   #9
hius07
Wizard
hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.
 
Posts: 1,137
Karma: 3592801
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
Code:
dict_popup:onClose()
hius07 is online now   Reply With Quote
Old 02-11-2025, 10:56 AM   #10
sdothum
Enthusiast
sdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it issdothum knows what time it is
 
Posts: 36
Karma: 2062
Join Date: Oct 2021
Device: Kobo Libra 2
Thank you! Adding that direct call works.

A question:
- the UIManager:close() plus dict_popup: onClose() are two statements versus the single UIManager:sendEvent() statement -- with the proposed changes more widget explicit.

Is there a reason to discourage the sendEvent() usage (which has not presented any issues for this usecase)? i'm guessing the above is more immune to future coding changes or are there other possible semantic reasons?

Last edited by sdothum; 02-11-2025 at 11:07 AM.
sdothum is offline   Reply With Quote
Old 02-11-2025, 11:31 AM   #11
hius07
Wizard
hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.
 
Posts: 1,137
Karma: 3592801
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
Direct calls are cheaper than events.
Events can be handled by many listeners, for example, renaming a book title and resetting some caches here and there.
hius07 is online now   Reply With Quote
Old 02-11-2025, 11:33 AM   #12
hius07
Wizard
hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.hius07 ought to be getting tired of karma fortunes by now.
 
Posts: 1,137
Karma: 3592801
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
https://koreader.rocks/doc/topics/Events.md.html#
hius07 is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] LOI-Generator - edit] plugin to generate a List of Illustrations KevinH Plugins 1 01-19-2023 04:31 PM
Updating plugin fails because plugin file is in use by Calibre? ownedbycats Calibre 1 12-03-2022 08:34 PM
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) mneimeyer Plugins 3 11-11-2019 08:07 PM
[Plugin] QuickPrefsEdit - Edit plugin prefs json files. slowsmile Plugins 3 07-25-2018 08:14 PM
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) www KOReader 4 09-28-2017 10:34 AM


All times are GMT -4. The time now is 05:51 AM.


MobileRead.com is a privately owned, operated and funded community.