From e81fb43b3cecbe1df9f86045919202e0add0b5b7 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 16 Jan 2021 08:50:46 +0200 Subject: SidebarWidget: Added "Copy Fingerprint" for identities --- src/ui/sidebarwidget.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index db00209f..38c854a2 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -359,6 +359,7 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { { "Show Usage", 0, 0, "ident.showuse" }, { "---", 0, 0, NULL }, { "Edit Notes...", 0, 0, "ident.edit" }, + { "Copy Fingerprint", 0, 0, "ident.fingerprint" }, // { "Pick Icon...", 0, 0, "ident.pickicon" }, { "---", 0, 0, NULL }, //{ "Reveal Files", 0, 0, "ident.reveal" }, @@ -923,6 +924,15 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) } return iTrue; } + else if (isCommand_Widget(w, ev, "ident.fingerprint")) { + const iGmIdentity *ident = menuIdentity_SidebarWidget_(d); + if (ident) { + const iString *fps = collect_String( + hexEncode_Block(collect_Block(fingerprint_TlsCertificate(ident->cert)))); + SDL_SetClipboardText(cstr_String(fps)); + } + return iTrue; + } else if (isCommand_Widget(w, ev, "ident.setnotes")) { iGmIdentity *ident = pointerLabel_Command(cmd, "ident"); if (ident) { -- cgit v1.2.3