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 09-15-2020, 06:36 AM   #1
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 50
Karma: 10
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
An unresolved programming issue

Hi,
I'm still looking for a way to call readerfooter.lua functions from dispatcher.lua (for example, call "onUpdaterFooter()" ). I want to update the footer so that the update appears immediately on the screen. Can someone help me and tell me how to do it? Thank you.
Carmelocotonto is offline   Reply With Quote
Old 09-15-2020, 06:49 AM   #2
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 600
Karma: 461002
Join Date: Apr 2014
Device: BQ Cervantes 4
Instead of calling a function yourself you emit a new event that is handled by the reader footer. See http://koreader.rocks/doc/topics/Events.md.html
pazos is offline   Reply With Quote
Old 09-15-2020, 07:33 AM   #3
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 50
Karma: 10
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
Thanks Pazos, but I don't understand "event" concept and how is its implementation. I don't know LUA. I have tried looking some LUA's files to use the same ideas, but I don't understand the concept. Can you tell me an example of event that is handled by the reader footer. Then I will try something similar.
Carmelocotonto is offline   Reply With Quote
Old 09-15-2020, 07:55 AM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 10,740
Karma: 18600000
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2; Kobo H2O & Forma
The extremely short-lived bit of code in #6648 could do just that. (Specifically, the commented out part, so, check the commit progression).
NiLuJe is offline   Reply With Quote
Old 09-15-2020, 07:59 AM   #5
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 600
Karma: 461002
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Carmelocotonto View Post
Thanks Pazos, but I don't understand "event" concept and how is its implementation. I don't know LUA. I have tried looking some LUA's files to use the same ideas, but I don't understand the concept. Can you tell me an example of event that is handled by the reader footer. Then I will try something similar.
functions that are part of an object and start with "on" are normally events, like https://github.com/koreader/koreader...ua#L1819-L1867

Instead of having to remember an instance of the object and its name to call the function you broadcast the event and each widget that can handle the event will react accordly to the event you broadcasted.

Have a look at https://github.com/koreader/koreader...broadcastEvent.

For a function called "onDoFoo" you broadcast a new event "DoFoo", and the event is delivered to all widgets and handled by widgets that implemented "onDoFoo"
pazos is offline   Reply With Quote
Old 09-16-2020, 05:53 AM   #6
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 50
Karma: 10
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
I'm doing tests. Thanks to both of you.
Carmelocotonto is offline   Reply With Quote
Old 09-16-2020, 07:12 AM   #7
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 50
Karma: 10
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
Gracias Pazos, he aprendido mucho con tus enlaces y sugerencias. Un camino nuevo que no conocía.
Thanks NiJule, I have learned a lot with your suggestions.

This is what I needed and it works:

UIManager:broadcastEvent(Event:new("UpdateFooter", true, true))

Carmelocotonto is offline   Reply With Quote
Old 09-16-2020, 07:40 AM   #8
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 10,740
Karma: 18600000
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2; Kobo H2O & Forma
Oh, duh, I'd forgotten that there already was an event handler for it ;p.

(Sidebar: you *probably* don't need the second true, unless you're doing some fairly wacky stuff ^^).
NiLuJe is offline   Reply With Quote
Old 09-16-2020, 08:18 AM   #9
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 50
Karma: 10
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
Effectively, the second 'true' is not necessary. All is 'ok' with one 'true'.
Carmelocotonto is offline   Reply With Quote
Old 09-17-2020, 11:09 AM   #10
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 600
Karma: 461002
Join Date: Apr 2014
Device: BQ Cervantes 4
Happy to help @Carmelocotonto. Un saludo
pazos is offline   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
How to get started with programming? otanim Lounge 5 11-28-2017 06:53 AM
Marvin 3 EPUB rendering bugs unresolved cedhax Marvin 1 02-21-2017 06:34 PM
KindleGen unresolved hyperlinks? Fluor Kindle Formats 5 09-13-2013 03:20 PM
Kobo Account Problems Remain Unresolved exiga Kobo Reader 8 01-26-2013 05:50 PM
eBooks unresolved Ashutosh Pandey Introduce Yourself 4 05-27-2010 03:59 AM


All times are GMT -4. The time now is 04:06 PM.


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