diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-16 08:50:46 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-16 08:50:46 +0200 |
commit | e81fb43b3cecbe1df9f86045919202e0add0b5b7 (patch) | |
tree | 58f89b6b8a39ca21d3ddeffb4982d7793953832b /src/ui/sidebarwidget.c | |
parent | ac768b3e5cce05e463b8ff97243ff13f7119844a (diff) |
SidebarWidget: Added "Copy Fingerprint" for identities
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) { | |||
359 | { "Show Usage", 0, 0, "ident.showuse" }, | 359 | { "Show Usage", 0, 0, "ident.showuse" }, |
360 | { "---", 0, 0, NULL }, | 360 | { "---", 0, 0, NULL }, |
361 | { "Edit Notes...", 0, 0, "ident.edit" }, | 361 | { "Edit Notes...", 0, 0, "ident.edit" }, |
362 | { "Copy Fingerprint", 0, 0, "ident.fingerprint" }, | ||
362 | // { "Pick Icon...", 0, 0, "ident.pickicon" }, | 363 | // { "Pick Icon...", 0, 0, "ident.pickicon" }, |
363 | { "---", 0, 0, NULL }, | 364 | { "---", 0, 0, NULL }, |
364 | //{ "Reveal Files", 0, 0, "ident.reveal" }, | 365 | //{ "Reveal Files", 0, 0, "ident.reveal" }, |
@@ -923,6 +924,15 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
923 | } | 924 | } |
924 | return iTrue; | 925 | return iTrue; |
925 | } | 926 | } |
927 | else if (isCommand_Widget(w, ev, "ident.fingerprint")) { | ||
928 | const iGmIdentity *ident = menuIdentity_SidebarWidget_(d); | ||
929 | if (ident) { | ||
930 | const iString *fps = collect_String( | ||
931 | hexEncode_Block(collect_Block(fingerprint_TlsCertificate(ident->cert)))); | ||
932 | SDL_SetClipboardText(cstr_String(fps)); | ||
933 | } | ||
934 | return iTrue; | ||
935 | } | ||
926 | else if (isCommand_Widget(w, ev, "ident.setnotes")) { | 936 | else if (isCommand_Widget(w, ev, "ident.setnotes")) { |
927 | iGmIdentity *ident = pointerLabel_Command(cmd, "ident"); | 937 | iGmIdentity *ident = pointerLabel_Command(cmd, "ident"); |
928 | if (ident) { | 938 | if (ident) { |