1
0
Fork 0

- [GUI] added commands to shuffle the tour.

This commit is contained in:
cage 2023-04-14 15:09:38 +02:00
parent fbdfe648fc
commit 9d19de2bcf
6 changed files with 40 additions and 12 deletions

BIN
data/icons/fmw_dice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -36,6 +36,8 @@
(a:define-constant +bus-go+ "fmw_bus-go" :test #'string=)
(a:define-constant +dice+ "fmw_dice" :test #'string=)
(defparameter *search* nil)
(defparameter *back* nil)
@ -70,6 +72,8 @@
(defparameter *bus-go* nil)
(defparameter *dice* nil)
(defun load-icon (filename)
(let ((path (if (not (re:scan "(?i)png$" filename))
(res:get-data-file (fs:cat-parent-dir +icon-dir+
@ -96,4 +100,5 @@
(setf *arrow-up* (load-icon +arrow-up+))
(setf *arrow-down* (load-icon +arrow-down+))
(setf *cross* (load-icon +cross+))
(setf *bus-go* (load-icon +bus-go+)))
(setf *bus-go* (load-icon +bus-go+))
(setf *dice* (load-icon +dice+)))

View File

@ -197,13 +197,14 @@
(let* ((bar (gui:make-menubar parent))
(file (gui:make-menu bar (_ "File") :underline 0))
(tools (gui:make-menu bar (_ "Tools") :underline 0))
(tour (gui:make-menu bar (_ "Tour") :underline 0))
(bookmarks (gui:make-menu bar (_ "Bookmarks") :underline 0))
(help (gui:make-menu bar (_ "Help") :underline 0)))
(gui:make-menubutton tools (_ "Certificates") #'menu:show-certificates :underline 0)
(gui:make-menubutton tools (_ "Streams") #'menu:show-streams :underline 0)
(gui:make-menubutton tools (_ "Search") (menu:show-search-frame-clsr main-window)
:underline 1)
(gui:make-menubutton tools (_ "Tour") #'menu:show-tour :underline 0)
(gui:make-menubutton file (_ "Quit") #'menu:quit :underline 0)
(gui:make-menubutton help (_ "About") #'menu:help-about :underline 0)
(gui:make-menubutton bookmarks
@ -213,6 +214,11 @@
(gui:make-menubutton bookmarks
(_ "Manage")
(menu:manage-bookmarks-clsr main-window)
:underline 0)
(gui:make-menubutton tour (_ "Manage") #'menu:show-tour :underline 0)
(gui:make-menubutton tour
(_ "Shuffle")
(lambda () (client-tour-window:enqueue-shuffle-tour))
:underline 0)))
(defclass tool-bar (gui:frame)

View File

@ -50,6 +50,16 @@
(let ((new-rows (all-rows)))
(resync-rows tour-frame new-rows)))))))
(defun enqueue-shuffle-tour ()
(ev:with-enqueued-process-and-unblock ()
(comm:make-request :tour-shuffle 1)))
(defun shuffle-tour-clsr (tour-frame)
(lambda ()
(enqueue-shuffle-tour)
(let ((new-rows (all-rows)))
(resync-rows tour-frame new-rows))))
(defun init-window (master)
(gui:with-toplevel (toplevel :master master :title (_ "Tour"))
(gui:transient toplevel master)
@ -58,8 +68,14 @@
(delete-button (make-instance 'gui:button
:master buttons-frame
:image icons:*document-delete*
:command (delete-tour-clsr table))))
(gui-goodies:attach-tooltips (delete-button (_ "delete selected links")))
(gui:grid table 0 0 :sticky :nwe)
(gui:grid buttons-frame 1 0 :sticky :s)
(gui:grid delete-button 0 0 :sticky :s))))
:command (delete-tour-clsr table)))
(shuffle-button (make-instance 'gui:button
:master buttons-frame
:image icons:*dice*
:command (shuffle-tour-clsr table))))
(gui-goodies:attach-tooltips (delete-button (_ "delete selected links"))
(shuffle-button (_ "shuffle selected links")))
(gui:grid table 0 0 :sticky :nwe)
(gui:grid buttons-frame 1 0 :sticky :s)
(gui:grid delete-button 0 0 :sticky :s)
(gui:grid shuffle-button 0 1 :sticky :s))))

View File

@ -18,7 +18,9 @@
(in-package :json-rpc-communication)
(defun tour-shuffle ()
(shuffle-tour *gemini-window*))
(progn
(shuffle-tour *gemini-window*)
t))
(defun tour-add-link (link-value link-label)
(progn

View File

@ -3338,7 +3338,8 @@
:*arrow-up*
:*arrow-down*
:*cross*
:*bus-go*))
:*bus-go*
:*dice*))
(defpackage :validation
(:use
@ -3455,9 +3456,7 @@
(:gui-shapes :nodgui.shapes)
(:menu :client-menu-command))
(:export
:certificate-frame
:tree
:rows
:enqueue-shuffle-tour
:init-window))
(defpackage :client-stream-window