mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-10 07:20:35 +01:00
- [GUI] added callback for toolbar certificate button (change password for certificate).
This commit is contained in:
parent
8a2ba82b0d
commit
ecfd7a19cd
@ -70,25 +70,7 @@
|
|||||||
(second row-values)))
|
(second row-values)))
|
||||||
(change-passphrase ()
|
(change-passphrase ()
|
||||||
(a:when-let ((file-path (key-path)))
|
(a:when-let ((file-path (key-path)))
|
||||||
(handler-case
|
(client-main-window::change-client-certificate-key-passphrase treeview-widget file-path)))
|
||||||
(multiple-value-bind (old-password new-password)
|
|
||||||
(gui-mw:change-password-dialog treeview-widget
|
|
||||||
(_ "Change password")
|
|
||||||
(_ "Change the password of the certificate")
|
|
||||||
(_ "Old password")
|
|
||||||
(_ "New password")
|
|
||||||
(_ "Repeat new password")
|
|
||||||
(_ "password and confirmation does not match")
|
|
||||||
:button-message (_ "OK"))
|
|
||||||
(os-utils:change-ssl-key-passphrase file-path
|
|
||||||
old-password
|
|
||||||
new-password)
|
|
||||||
(gui-goodies:info-dialog treeview-widget
|
|
||||||
(format nil
|
|
||||||
(_ "Password changed for key")
|
|
||||||
file-path)))
|
|
||||||
(error (e)
|
|
||||||
(gui-goodies:error-dialog treeview-widget (format nil "~a" e))))))
|
|
||||||
(copy-key-path ()
|
(copy-key-path ()
|
||||||
(a:when-let ((file-path (key-path)))
|
(a:when-let ((file-path (key-path)))
|
||||||
(os-utils:copy-to-clipboard file-path)
|
(os-utils:copy-to-clipboard file-path)
|
||||||
|
@ -1302,6 +1302,36 @@ local file paths."
|
|||||||
main-window))
|
main-window))
|
||||||
(print-info-message (_ "Tour is terminated") :bold t)))))
|
(print-info-message (_ "Tour is terminated") :bold t)))))
|
||||||
|
|
||||||
|
(defun change-client-certificate-key-passphrase (parent-widget key-path)
|
||||||
|
(handler-case
|
||||||
|
(multiple-value-bind (old-password new-password)
|
||||||
|
(gui-mw:change-password-dialog parent-widget
|
||||||
|
(_ "Change password")
|
||||||
|
(_ "Change the password of the certificate")
|
||||||
|
(_ "Old password")
|
||||||
|
(_ "New password")
|
||||||
|
(_ "Repeat new password")
|
||||||
|
(_ "password and confirmation does not match")
|
||||||
|
:button-message (_ "OK"))
|
||||||
|
(os-utils:change-ssl-key-passphrase key-path
|
||||||
|
old-password
|
||||||
|
new-password)
|
||||||
|
(gui-goodies:info-dialog parent-widget
|
||||||
|
(format nil
|
||||||
|
(_ "Password changed for key")
|
||||||
|
key-path)))
|
||||||
|
(error (e)
|
||||||
|
(gui-goodies:error-dialog parent-widget (format nil "~a" e)))))
|
||||||
|
|
||||||
|
(defun change-client-certificate-passphrase-clsr (main-window)
|
||||||
|
(lambda ()
|
||||||
|
(a:when-let ((key-path
|
||||||
|
(cev:enqueue-request-and-wait-results :gemini-url-certificate-keypath
|
||||||
|
1
|
||||||
|
ev:+standard-event-priority+
|
||||||
|
(get-address-bar-text main-window))))
|
||||||
|
(change-client-certificate-key-passphrase main-window key-path))))
|
||||||
|
|
||||||
(defun setup-main-window-events (main-window)
|
(defun setup-main-window-events (main-window)
|
||||||
(with-accessors ((tool-bar tool-bar)
|
(with-accessors ((tool-bar tool-bar)
|
||||||
(toc-frame toc-frame)
|
(toc-frame toc-frame)
|
||||||
@ -1333,6 +1363,8 @@ local file paths."
|
|||||||
(setf (gui:command reload-button) (reload-iri-clsr main-window))
|
(setf (gui:command reload-button) (reload-iri-clsr main-window))
|
||||||
(setf (gui:command back-button) (back-iri-clsr main-window))
|
(setf (gui:command back-button) (back-iri-clsr main-window))
|
||||||
(setf (gui:command up-button) (up-iri-clsr main-window))
|
(setf (gui:command up-button) (up-iri-clsr main-window))
|
||||||
|
(setf (gui:command certificate-button)
|
||||||
|
(change-client-certificate-passphrase-clsr main-window))
|
||||||
(setf (gui:command bookmark-button) (toggle-bookmark-iri-clsr main-window))
|
(setf (gui:command bookmark-button) (toggle-bookmark-iri-clsr main-window))
|
||||||
(setf (gui:command tour-button) (tour-visit-next-iri-clsr main-window))
|
(setf (gui:command tour-button) (tour-visit-next-iri-clsr main-window))
|
||||||
(setf (gui:command subscribe-button) (toggle-subscribtion-iri-clsr main-window))
|
(setf (gui:command subscribe-button) (toggle-subscribtion-iri-clsr main-window))
|
||||||
|
@ -75,6 +75,12 @@
|
|||||||
(gemini-client:save-cache-certificate-password certificate-path password)
|
(gemini-client:save-cache-certificate-password certificate-path password)
|
||||||
t)
|
t)
|
||||||
|
|
||||||
|
(defun gemini-url-certificate-keypath (url)
|
||||||
|
(multiple-value-bind (x keypath)
|
||||||
|
(gemini-client:fetch-cached-certificate url :if-does-not-exist nil)
|
||||||
|
(declare (ignore x))
|
||||||
|
keypath))
|
||||||
|
|
||||||
(defun gemini-url-using-certificate-p (url)
|
(defun gemini-url-using-certificate-p (url)
|
||||||
(a:when-let* ((certificate-path (gemini-client:fetch-cached-certificate url
|
(a:when-let* ((certificate-path (gemini-client:fetch-cached-certificate url
|
||||||
:if-does-not-exist nil))
|
:if-does-not-exist nil))
|
||||||
|
@ -96,6 +96,9 @@
|
|||||||
(gen-rpc "gemini-url-using-certificate-p"
|
(gen-rpc "gemini-url-using-certificate-p"
|
||||||
'gemini-url-using-certificate-p
|
'gemini-url-using-certificate-p
|
||||||
"url" 0)
|
"url" 0)
|
||||||
|
(gen-rpc "gemini-url-certificate-keypath"
|
||||||
|
'gemini-url-certificate-keypath
|
||||||
|
"url" 0)
|
||||||
(gen-rpc "gemini-table-of-contents"
|
(gen-rpc "gemini-table-of-contents"
|
||||||
'gemini-table-of-contents
|
'gemini-table-of-contents
|
||||||
"iri" 0
|
"iri" 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user