From ac32e27fccbc5c7262fb399a2b70afd1f8f429ed Mon Sep 17 00:00:00 2001 From: cage Date: Tue, 14 Mar 2023 18:50:47 +0100 Subject: [PATCH] - [GUI] instructed the client to open local file using external software. --- src/gui/client/main-window.lisp | 18 ++++++++++-------- src/gui/client/os-utils.lisp | 4 +++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gui/client/main-window.lisp b/src/gui/client/main-window.lisp index bcaa1b8..6a0c6b1 100644 --- a/src/gui/client/main-window.lisp +++ b/src/gui/client/main-window.lisp @@ -417,7 +417,7 @@ (getf response :cached) (getf response :iri))) -(defun open-local-path (path main-window) +(defun open-local-path (path main-window &key (force-rendering nil)) (cond ((fs:file-exists-p path) (if (fs:has-extension path +gemini-file-extension+) @@ -428,13 +428,15 @@ (ev:with-enqueued-process-and-unblock () (clean-gemtext main-window) (collect-ir-lines path gui-goodies:*main-frame* parsed-lines))) - (let ((lines (cev:enqueue-request-and-wait-results :gemini-slurp-local-file - 1 - ev:+standard-event-priority+ - path))) - (ev:with-enqueued-process-and-unblock () - (clean-gemtext main-window) - (set-text-gemtext main-window lines))))) + (if force-rendering + (let ((lines (cev:enqueue-request-and-wait-results :gemini-slurp-local-file + 1 + ev:+standard-event-priority+ + path))) + (ev:with-enqueued-process-and-unblock () + (clean-gemtext main-window) + (set-text-gemtext main-window lines))) + (client-os-utils:open-resource-with-external-program main-window path)))) ((fs:directory-exists-p path) (gui:choose-directory :initial-dir path :parent main-window :mustexist t)) (t diff --git a/src/gui/client/os-utils.lisp b/src/gui/client/os-utils.lisp index 8a5e871..98e222e 100644 --- a/src/gui/client/os-utils.lisp +++ b/src/gui/client/os-utils.lisp @@ -28,7 +28,9 @@ ((swconf:use-tinmop-as-external-program-p program) (if open-for-edit (edit resource) - (client-main-window:open-local-path resource main-window))) + (client-main-window:open-local-path resource + main-window + :force-rendering t))) (t (os-utils:open-link-with-program program resource :wait open-for-edit))) (if open-for-edit