mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Remember the final rotation during Reboot/PowerOff/AutoSuspend, too (#7133)
Re #7096, Fix #7125 Co-authored-by: yparitcher <y@paritcher.com>
This commit is contained in:
@@ -58,7 +58,8 @@ function UIManager:init()
|
||||
end,
|
||||
}
|
||||
self.poweroff_action = function()
|
||||
self._entered_poweroff_stage = true;
|
||||
self._entered_poweroff_stage = true
|
||||
Device.orig_rotation_mode = Device.screen:getRotationMode()
|
||||
Screen:setRotationMode(Screen.ORIENTATION_PORTRAIT)
|
||||
require("ui/screensaver"):show("poweroff", _("Powered off"))
|
||||
if Device:needsScreenRefreshAfterResume() then
|
||||
@@ -74,7 +75,8 @@ function UIManager:init()
|
||||
end)
|
||||
end
|
||||
self.reboot_action = function()
|
||||
self._entered_poweroff_stage = true;
|
||||
self._entered_poweroff_stage = true
|
||||
Device.orig_rotation_mode = Device.screen:getRotationMode()
|
||||
Screen:setRotationMode(Screen.ORIENTATION_PORTRAIT)
|
||||
require("ui/screensaver"):show("reboot", _("Rebooting…"))
|
||||
if Device:needsScreenRefreshAfterResume() then
|
||||
|
||||
@@ -339,8 +339,8 @@ local function exitReader()
|
||||
-- Save any device settings before closing G_reader_settings
|
||||
Device:saveSettings()
|
||||
|
||||
-- Save current rotation to have it for next startup
|
||||
G_reader_settings:saveSetting("closed_rotation_mode", Device.screen:getRotationMode())
|
||||
-- Save current rotation (or the original rotation if ScreenSaver temporarily modified it) to remember it for next startup
|
||||
G_reader_settings:saveSetting("closed_rotation_mode", Device.orig_rotation_mode or Device.screen:getRotationMode())
|
||||
|
||||
G_reader_settings:close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user