Skip to content

Satisfy FR #13163: Option to hide the "night mode changed" warning#13253

Merged
Frenzie merged 6 commits into
koreader:masterfrom
ly-pa:disable-nightmode-warning
Jul 30, 2025
Merged

Satisfy FR #13163: Option to hide the "night mode changed" warning#13253
Frenzie merged 6 commits into
koreader:masterfrom
ly-pa:disable-nightmode-warning

Conversation

@ly-pa

@ly-pa ly-pa commented Feb 13, 2025

Copy link
Copy Markdown
Contributor

Resolves #13163 FR: Hide the AutoWarmth Plugin "Night Mode changed" popup forever.

It adds 3 simple things:

  1. New G_reader_settings called "hide_nightmode_warning".
  2. Adds a radio button to the popup in question to disable it permanently.
  3. Adds a button in the plugin sub-menu to turn it back on (or turn it off from the menu if desired).

This change is Reviewable

Satisfies the koreader#13163
FR: Hide the AutoWarmth Plugin "Night Mode changed" popup forever koreader#13163
Use spaces because KOReader build does not seem to like tabs.
@ly-pa ly-pa changed the title FR: Hide the "night mode changed" warning #13163 Satisfy FR #13163: Hide the "night mode changed" warning Feb 13, 2025
@ly-pa ly-pa changed the title Satisfy FR #13163: Hide the "night mode changed" warning Satisfy FR #13163: Option to hide the "night mode changed" warning Feb 13, 2025
@Frenzie Frenzie added the Plugin label Feb 13, 2025

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me (barring formatting).

Comment thread plugins/autowarmth.koplugin/main.lua Outdated
@ly-pa

ly-pa commented Feb 13, 2025

Copy link
Copy Markdown
Contributor Author

Fixed that, I'm not sure what formatting changes are requested but feel free to let me know and I'll work on it.

@Frenzie

Frenzie commented Feb 13, 2025

Copy link
Copy Markdown
Member

I think you fixed it in the meantime.

Change `isTrue()` not needing a default as requested, and also noticed `SaveSettings(_, true)` can use `makeTrue()` to make it a little more clear (it does the same thing but is nicer syntax).
@kadudesousa

kadudesousa commented May 24, 2025

Copy link
Copy Markdown

Hi @ly-pa, I tested the recent changes you made to the AutoWarmth plugin. The new menu entry to hide the night mode warning appeared as expected, but after applying the change ("Hide this warning permanently"), the popup still showed up when opening a document.

I tracked down the issue — the setting was being saved under the wrong key:

G_reader_settings:makeTrue("hide_nightmode_warning")

But the plugin reads the value from:

G_reader_settings:isTrue("autowarmth_hide_nightmode_warning")

Because of this mismatch, the setting was never actually applied. Changing the key in makeTrue(...) to "autowarmth_hide_nightmode_warning" fixed the problem.

Comment thread plugins/autowarmth.koplugin/main.lua Outdated
text = _("Hide this warning permanently"),
provider = function()
self.hide_nightmode_warning = true
G_reader_settings:makeTrue("hide_nightmode_warning")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
G_reader_settings:makeTrue("hide_nightmode_warning")
G_reader_settings:makeTrue("autowarmth_hide_nightmode_warning")

Comment thread plugins/autowarmth.koplugin/main.lua Outdated
end,
callback = function()
self.hide_nightmode_warning = not self.hide_nightmode_warning
G_reader_settings:saveSetting("hide_nightmode_warning", self.hide_nightmode_warning)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
G_reader_settings:saveSetting("hide_nightmode_warning", self.hide_nightmode_warning)
G_reader_settings:saveSetting("autowarmth_hide_nightmode_warning", self.hide_nightmode_warning)

@Frenzie Frenzie merged commit a674bc8 into koreader:master Jul 30, 2025
4 checks passed
@Frenzie Frenzie added this to the 2025.06 milestone Jul 30, 2025
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Hide the AutoWarmth Plugin "Night Mode changed" popup forever

3 participants