git.fiddlerwoaroof.com
Browse code

Minor changes to how the commands work

Log actions to interactor, use views

fiddlerwoaroof authored on 09/12/2016 20:21:19
Showing 1 changed files
... ...
@@ -68,12 +68,23 @@
68 68
 (define-alimenta-command (com-quite :name t) ()
69 69
   (clim:frame-exit clim:*application-frame*))
70 70
 
71
+(defmacro with-interactor ((interactor-symbol) &body body)
72
+  `(let ((,interactor-symbol (clim:find-pane-named clim:*application-frame* 'int)))
73
+     ,@body))
74
+
71 75
 (define-alimenta-command (to-feed :name t) ()
72
-  (let ((pane (clim:find-pane-named clim:*application-frame* 'app)))
73
-    (setf (clim:stream-default-view pane) *feed-view*)))
76
+  (let ((int (clim:find-pane-named clim:*application-frame* 'int))
77
+        (app (clim:find-pane-named clim:*application-frame* 'app)))
78
+    (format int "~&Switching to the feed view~%")
79
+    (setf (clim:stream-default-view app) *feed-view*)))
74 80
 
75
-(define-alimenta-command (com-pick-item :name t) ((item 'alimenta:item))
81
+(define-alimenta-command (com-pick-item :name t) ((item 'alimenta:item :gesture :select))
76 82
   (let ((pane (clim:find-pane-named clim:*application-frame* 'app)))
83
+    (with-interactor (int)
84
+      (format int "~&Switching to the item: ")
85
+      (clim:with-output-as-presentation (int item 'alimenta:item)
86
+        (format int "~a" (alimenta:title item)))
87
+      (terpri int))
77 88
     (setf (clim:stream-default-view pane) (make-instance 'item-view :item item))))
78 89
 
79 90
 (define-alimenta-command (flop-layout :name t) ()