aboutsummaryrefslogtreecommitdiffstats
path: root/src/m_key_server_sync/ui/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/m_key_server_sync/ui/main.lua')
-rw-r--r--src/m_key_server_sync/ui/main.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/m_key_server_sync/ui/main.lua b/src/m_key_server_sync/ui/main.lua
index 2ad2a01..5c9c1e9 100644
--- a/src/m_key_server_sync/ui/main.lua
+++ b/src/m_key_server_sync/ui/main.lua
@@ -6,6 +6,7 @@
local search = commands.get("com.bktus.gpgfrontend.module.key_server_sync.search_key")
local publish = commands.get("com.bktus.gpgfrontend.module.key_server_sync.publish_key")
local refresh = commands.get("com.bktus.gpgfrontend.module.key_server_sync.refresh_key")
+local check = commands.get("com.bktus.gpgfrontend.module.key_server_sync.check_publication")
ui.mount { id = "search", anchor = ui.anchor.dialog {}, widget = native.widget("search") }
@@ -33,3 +34,18 @@ ui.action { id = "publish", anchor = ui.anchor("key.details.actions"),
command = publish, update = for_this_key }
ui.action { id = "refresh", anchor = ui.anchor("key.details.actions"),
command = refresh, update = for_this_key }
+ui.action { id = "check", anchor = ui.anchor("key.details.actions"),
+ command = check, update = for_this_key }
+
+-- The same operations on whatever a key list has selected: one key or many,
+-- sent as one batch.
+local function for_the_selection(ctx)
+ local keys = ctx.keys
+ if not keys or #keys == 0 then return { visible = false } end
+ return { args = { keys = keys } }
+end
+
+ui.action { id = "publish_selected", anchor = ui.anchor("key.list.context"),
+ command = publish, update = for_the_selection }
+ui.action { id = "refresh_selected", anchor = ui.anchor("key.list.context"),
+ command = refresh, update = for_the_selection }