From 19b15462b209bdd6a12d44877dafbda2b6b418a2 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Fri, 12 Jun 2020 22:40:48 +0200 Subject: [PATCH] [plugin, UX] Wallabag: aid with setting up missing information (#6262) The MultiConfirmBox indicates which settings are still missing and offers you a quick way to get to them. Cf. . --- plugins/wallabag.koplugin/main.lua | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/plugins/wallabag.koplugin/main.lua b/plugins/wallabag.koplugin/main.lua index 9d4c155f7..1e78abb92 100644 --- a/plugins/wallabag.koplugin/main.lua +++ b/plugins/wallabag.koplugin/main.lua @@ -13,6 +13,7 @@ local InputDialog = require("ui/widget/inputdialog") local JSON = require("json") local LuaSettings = require("frontend/luasettings") local Math = require("optmath") +local MultiConfirmBox = require("ui/widget/multiconfirmbox") local MultiInputDialog = require("ui/widget/multiinputdialog") local NetworkMgr = require("ui/network/manager") local ReadHistory = require("readhistory") @@ -292,9 +293,27 @@ function Wallabag:getBearerToken() return s == nil or s == "" end - if isempty(self.server_url) or isempty(self.username) or isempty(self.password) or isempty(self.client_id) or isempty(self.client_secret) or isempty(self.directory) then - UIManager:show(InfoMessage:new{ - text = _("Please configure the server and local settings.") + local server_empty = isempty(self.server_url) or isempty(self.username) or isempty(self.password) or isempty(self.client_id) or isempty(self.client_secret) + local directory_empty = isempty(self.directory) + if server_empty or directory_empty then + UIManager:show(MultiConfirmBox:new{ + text = _("Please configure the server settings and set a download folder."), + choice1_text_func = function() + if server_empty then + return _("Server (★)") + else + return _("Server") + end + end, + choice1_callback = function() self:editServerSettings() end, + choice2_text_func = function() + if directory_empty then + return _("Folder (★)") + else + return _("Folder") + end + end, + choice2_callback = function() self:setDownloadDirectory() end, }) return false end