diff --git a/src/gui/client/gempub-window.lisp b/src/gui/client/gempub-window.lisp index 7cf97cb..b582b8c 100644 --- a/src/gui/client/gempub-window.lisp +++ b/src/gui/client/gempub-window.lisp @@ -153,10 +153,27 @@ (let* ((table (make-instance 'gempub-frame :master toplevel :rows query-results))) - (gui:grid table 0 0 :sticky :nwe) + (gui:grid table 0 0 :sticky :nwe) (gui:bind (gui:treeview (gui-goodies:tree table)) #$<>$ (open-gempub-clsr main-window table)) + (gui:bind (gui:treeview (gui-goodies:tree table)) + #$$ + (lambda (event) + (declare (ignore event)) + (with-accessors ((tree gui-goodies:tree)) table + (a:when-let* ((selection (a:first-elt (gui:treeview-get-selection tree))) + (delete (gui:ask-yesno (_ "Are you sure? This operation is irreversible.") + :title (_ "Attention") + :parent main-window)) + (id (gui:id selection)) + (row (cev:enqueue-request-and-wait-results :gempub-file-id->row + 1 + ev:+standard-event-priority+ + id))) + + (fs:delete-file-if-exists (row-path row)) + (gui-goodies:info-operation-completed main-window))))) (gui:focus (gui:treeview (gui-goodies:tree table))) (gui:transient toplevel master))))