mirror of https://codeberg.org/cage/tinmop/
- [GUI] added command to import a gempub file.
This commit is contained in:
parent
f6f3428dbb
commit
42bbdfc6fb
|
@ -273,6 +273,9 @@
|
|||
(gui:make-menubutton gempub
|
||||
(_ "Make gempub file")
|
||||
(menu:make-gempub-clsr main-window))
|
||||
(gui:make-menubutton gempub
|
||||
(_ "Import gempub file")
|
||||
(menu:install-gempub-clsr main-window))
|
||||
(gui:make-menubutton file
|
||||
(_ "Quit")
|
||||
#'menu:quit
|
||||
|
|
|
@ -168,3 +168,20 @@
|
|||
(let ((directory (gui:choose-directory :title (_ "Choose directory with the gempub sources"))))
|
||||
(when (text-utils:string-not-empty-p directory)
|
||||
(client-gempub-window:create-gempub directory)))))
|
||||
|
||||
(defun install-gempub-clsr (main-window)
|
||||
(lambda ()
|
||||
(let* ((input-file-path (gui:get-open-file :title (_ "Choose gempub file")
|
||||
:file-types '(("Gempub files" "*.gpub"))))
|
||||
(output-file (fs:cat-parent-dir (swconf:gempub-library-directory)
|
||||
(fs:path-last-element input-file-path))))
|
||||
(when (and (text-utils:string-not-empty-p input-file-path)
|
||||
(fs:file-exists-p input-file-path)
|
||||
(zip-info:zip-file-p input-file-path))
|
||||
(let ((overwrite (or (not (fs:file-exists-p output-file))
|
||||
(gui:ask-yesno (_ "A file with this name exists in your library: overwrite?")
|
||||
:title (_ "Question")
|
||||
:parent main-window))))
|
||||
(fs:copy-a-file input-file-path
|
||||
output-file
|
||||
:overwrite overwrite))))))
|
||||
|
|
|
@ -3616,7 +3616,8 @@
|
|||
:manage-gemlogs
|
||||
:show-page-source-clsr
|
||||
:search-gempub-library-clsr
|
||||
:make-gempub-clsr))
|
||||
:make-gempub-clsr
|
||||
:install-gempub-clsr))
|
||||
|
||||
(defpackage :client-certificates-window
|
||||
(:use
|
||||
|
|
Loading…
Reference in New Issue