launch read timer with gesture#14061
Conversation
|
Commenting to add that the bug in the original patch @Frenzie provided was that the |
| end | ||
| end | ||
|
|
||
| function ReadTimer:onShowAlarmMenu(touchmenu_instance) |
There was a problem hiding this comment.
I guess you intended this as "called from menu" or something but that's a bit confusing. ;-)
Just onShowAlarm or onShowAlarmDialog/Widget or something should be clearer.
| return seconds | ||
| end | ||
|
|
||
| function ReadTimer:onShowTimerMenu(touchmenu_instance) |
|
|
||
| end | ||
|
|
||
| function ReadTimer:onSetAlarm(alarm_time, callback, then_t) |
There was a problem hiding this comment.
Oh right, I just remembered that my patch was actually a quick abandoned sketch to enable something like "set alarm for 10 minutes from now," which is a bit different than what I responded to. If we're just opening a dialog this doesn't need to be an event.
Which is to say, setAlarm should do the trick.
| UIManager:show(time_widget) | ||
| end | ||
|
|
||
| function ReadTimer:onSetInterval(timer_time, callback) |
| self:unschedule() | ||
| self:rescheduleIn(seconds) | ||
|
|
||
| if callback then |
There was a problem hiding this comment.
I cannot find the call of this method without callback, can you point me to?
| -- Reader | ||
| show_alarm_menu = {category="none", event="ShowAlarmMenu", title=_("Set reader alarm"), reader=true}, | ||
| show_timer_menu = {category="none", event="ShowTimerMenu", title=_("Set reader timer"), reader=true}, | ||
| stop_timer = {category="none", event="StopTimer", title=_("Stop reader timer"), reader=true}, |
There was a problem hiding this comment.
Plugins do this in the following way, for example:
koreader/plugins/statistics.koplugin/main.lua
Lines 112 to 113 in 3e39740
There was a problem hiding this comment.
Do we want to put them under reader? Or elsewhere?
| end | ||
| end | ||
|
|
||
| function ReadTimer:onStopTimer(is_event, touchmenu_instance) |
There was a problem hiding this comment.
touchmenu_instance is a flag, no need for additional is_event.
There was a problem hiding this comment.
I was struggling with this. Thanks for pointing this out
| end | ||
|
|
||
| function ReadTimer:SetAlarm(alarm_time, then_t, touchmenu_instance) | ||
| if not then_t then |
There was a problem hiding this comment.
See above, the concept behind these functions in my quick concept patch was to call onSetAlarm and onSetInterval without displaying a dialog.[1] The way this has been rewritten of course it doesn't make sense anymore, and it can be readded if someone decides to implement that after all.
[1] Concretely, you'd set up an action to set the alarm at 23:30 for example.
There was a problem hiding this comment.
Yeah, that's what I was thinking you had originally planned. I guess it could be implemented like that in addition to how it's currently implemented, if that's wanted, since I'm already working on this
There was a problem hiding this comment.
Tagged issue at the top
There was a problem hiding this comment.
Pardon, I was a bit unclear but that's not why I quickly wrote that patch a few months ago and forgot about it until I saw that issue. ;-)
There was a problem hiding this comment.
Oh you meant for the original patch lol my bad. Yeah I getcha. I Appreciate the jump start regardless
|
All these new event handlers are unique, so please |
Closes #14014.
I plan to move the gesture menu options. Just wanted to get this out here first and we can discuss best place to put this. I would suspect a submenu somewhere.
This change is