Fix long-pressing on unopened book with status (#14947)

This commit is contained in:
hius07 authored and GitHub committed 2026-02-07 17:28:37 +02:00
1 parent 642ec66d68
commit 788d4e0c52
4 files changed
+38 -20

No files matched your search

+8 -5
View File
@@ -286,11 +286,14 @@ function FileManager:setupLayout()
FileManagerConverter:genConvertButton(file, close_dialog_callback, refresh_callback)
})
end
if been_opened and #doc_settings_or_file:readSetting("annotations") > 0 then
table.insert(buttons, {
file_manager.collections:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
file_manager.collections:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
if been_opened then
local annotations = doc_settings_or_file:readSetting("annotations")
if annotations and #annotations > 0 then
table.insert(buttons, {
file_manager.collections:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
file_manager.collections:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
end
end
table.insert(buttons, {
{
@@ -286,11 +286,14 @@ function FileManagerCollection:onMenuHold(item)
end,
},
})
if been_opened and #doc_settings_or_file:readSetting("annotations") > 0 then
table.insert(buttons, {
self._manager:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
self._manager:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
if been_opened then
local annotations = doc_settings_or_file:readSetting("annotations")
if annotations and #annotations > 0 then
table.insert(buttons, {
self._manager:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
self._manager:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
end
end
table.insert(buttons, {
filemanagerutil.genShowFolderButton(file, close_dialog_menu_callback),
@@ -1556,7 +1559,7 @@ end
function FileManagerCollection:genExportHighlightsButton(files, caller_pre_callback, button_disabled)
return {
text = _("Export highlights"),
enabled = self.ui.exporter and not button_disabled or false,
enabled = (self.ui.exporter and self.ui.exporter:isReady()) and not button_disabled or false,
callback = function()
if caller_pre_callback then
caller_pre_callback()
@@ -340,7 +340,7 @@ function FileSearcher:onMenuSelect(item)
if item.is_file then
item.dim = not item.dim and true or nil
self._manager.selected_files[item.path] = item.dim
self._manager:updateItemTable()
self:updateItems(1, true)
end
else
if item.is_file then
@@ -449,6 +449,15 @@ function FileSearcher:onMenuHold(item)
end,
},
})
if been_opened then
local annotations = doc_settings_or_file:readSetting("annotations")
if annotations and #annotations > 0 then
table.insert(buttons, {
self._manager.ui.collections:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
self._manager.ui.collections:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
end
end
table.insert(buttons, {
filemanagerutil.genShowFolderButton(file, close_dialog_menu_callback),
filemanagerutil.genBookInformationButton(doc_settings_or_file, book_props, close_dialog_callback),
@@ -517,7 +526,7 @@ function FileSearcher:showSelectModeDialog()
for _, item in ipairs(item_table) do
item.dim = nil
end
self:updateItemTable()
self.booklist_menu:updateItems(1, true)
end,
},
{
@@ -530,7 +539,7 @@ function FileSearcher:showSelectModeDialog()
self.selected_files[item.path] = true
end
end
self:updateItemTable()
self.booklist_menu:updateItems(1, true)
end,
},
},
@@ -546,7 +555,7 @@ function FileSearcher:showSelectModeDialog()
item.dim = nil
end
end
self:updateItemTable()
self.booklist_menu:updateItems(1, true)
end,
},
{
@@ -256,11 +256,14 @@ function FileManagerHistory:onMenuHold(item)
end,
},
})
if been_opened and #doc_settings_or_file:readSetting("annotations") > 0 then
table.insert(buttons, {
self._manager.ui.collections:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
self._manager.ui.collections:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
if been_opened then
local annotations = doc_settings_or_file:readSetting("annotations")
if annotations and #annotations > 0 then
table.insert(buttons, {
self._manager.ui.collections:genExportHighlightsButton({ [file] = true }, close_dialog_callback),
self._manager.ui.collections:genBookmarkBrowserButton({ [file] = true }, close_dialog_callback),
})
end
end
table.insert(buttons, {
filemanagerutil.genShowFolderButton(file, close_dialog_menu_callback, item.dim),