mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Disable status buttons for deleted files in history
This commit is contained in:
@@ -373,7 +373,7 @@ function FileManager:setupLayout()
|
||||
table.insert(buttons, {
|
||||
{
|
||||
text = _("Reset settings"),
|
||||
enabled = is_file and DocSettings:hasSidecarFile(BaseUtil.realpath(file)),
|
||||
enabled = DocSettings:hasSidecarFile(BaseUtil.realpath(file)),
|
||||
callback = function()
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = T(_("Reset settings for this document?\n\n%1\n\nAny highlights or bookmarks will be permanently lost."), BD.filepath(file)),
|
||||
|
||||
@@ -89,12 +89,13 @@ function FileManagerHistory:onMenuHold(item)
|
||||
local readerui_instance = require("apps/reader/readerui"):_getRunningInstance()
|
||||
local currently_opened_file = readerui_instance and readerui_instance.document and readerui_instance.document.file
|
||||
self.histfile_dialog = nil
|
||||
local is_file = lfs.attributes(item.file, "mode") == "file"
|
||||
local status = filemanagerutil.getStatus(item.file)
|
||||
local buttons = {
|
||||
{
|
||||
{
|
||||
text = _("Mark as reading"),
|
||||
enabled = status ~= "reading",
|
||||
enabled = is_file and status ~= "reading",
|
||||
callback = function()
|
||||
filemanagerutil.setStatus(item.file, "reading")
|
||||
if self._manager.filter ~= "all" then
|
||||
@@ -108,7 +109,7 @@ function FileManagerHistory:onMenuHold(item)
|
||||
},
|
||||
{
|
||||
text = _("Put on hold"),
|
||||
enabled = status ~= "abandoned",
|
||||
enabled = is_file and status ~= "abandoned",
|
||||
callback = function()
|
||||
filemanagerutil.setStatus(item.file, "abandoned")
|
||||
if self._manager.filter ~= "all" then
|
||||
@@ -122,7 +123,7 @@ function FileManagerHistory:onMenuHold(item)
|
||||
},
|
||||
{
|
||||
text = _("Mark as read"),
|
||||
enabled = status ~= "complete",
|
||||
enabled = is_file and status ~= "complete",
|
||||
callback = function()
|
||||
filemanagerutil.setStatus(item.file, "complete")
|
||||
if self._manager.filter ~= "all" then
|
||||
|
||||
Reference in New Issue
Block a user