Initial work to allow auto tagging

pull/9009/head
Dylan Garrett 2 years ago committed by Frans de Jonge
parent e88bda6826
commit 7d04370558

@ -214,6 +214,19 @@ function Wallabag:addToMainMenu(menu_items)
end,
separator = true,
},
{
text_func = function()
if not self.auto_tags or self.auto_tags == "" then
return _("Automatic tags")
end
return T(_("Automatic tags (%1)"), self.auto_tags)
end,
keep_menu_open = true,
callback = function(touchmenu_instance)
self:setAutoTags(touchmenu_instance)
end,
separator = true,
},
{
text = _("Article deletion"),
separator = true,
@ -966,6 +979,38 @@ function Wallabag:setIgnoreTags(touchmenu_instance)
self.ignore_tags_dialog:onShowKeyboard()
end
function Wallabag:setAutoTags(touchmenu_instance)
self.auto_tags_dialog = InputDialog:new {
title = _("Tags to automatically add"),
description = _("Enter a comma-separated list of tags to automatically add."),
input = self.auto_tags,
input_type = "string",
buttons = {
{
{
text = _("Cancel"),
id = "close",
callback = function()
UIManager:close(self.auto_tags_dialog)
end,
},
{
text = _("Set tags"),
is_enter_default = true,
callback = function()
self.auto_tags = self.auto_tags_dialog:getInputText()
self:saveSettings()
touchmenu_instance:updateItems()
UIManager:close(self.auto_tags_dialog)
end,
}
}
},
}
UIManager:show(self.auto_tags_dialog)
self.auto_tags_dialog:onShowKeyboard()
end
function Wallabag:editServerSettings()
local text_info = T(_([[
Enter the details of your Wallabag server and account.

Loading…
Cancel
Save