Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed logs.

  • Loading branch information...
commit 861f75ccfd8b642a1014974173b5c353526483fe 1 parent f58a52a
@fukamachi authored
View
11 src/L5.clj
@@ -73,15 +73,16 @@
(defn go [n]
(dosync (ref-set (:current (context)) n))
- (repaint))
+ (repaint)
+ (slide/print-info (context)))
(defn export [& [output]]
+ (println "Exporting...")
(reload)
(go 0)
(slide/fullscreen-off (context))
(.setSize @(:frame (context)) (:width (context)) (:height (context)))
- (export/jframe->pdf (file/ensure-file-ext output ["pdf"]) (context))
- (go 0))
+ (export/jframe->pdf (file/ensure-file-ext output ["pdf"]) (context)))
(defn start
([] (start *file*))
@@ -102,5 +103,5 @@
(defn select-file []
(file/open-chooser "L5: Presentation with Clojure"
- #(do (start %)
- (println "Presentation is started. Good Luck!"))))
+ #(do (println "Presentation is started. Good Luck!")
+ (start %))))
View
3  src/L5/context.clj
@@ -106,4 +106,5 @@
(defn start [context]
(doto @(:frame context)
(.repaint)
- (.setVisible true)))
+ (.setVisible true))
+ (slide/print-info context))
View
2  src/L5/export.clj
@@ -28,7 +28,7 @@
(.update @(:frame context) g2d)
(.dispose g2d)
(.addTemplate cb tp 0 0))
- (dosync (alter (:current context) inc))
+ (slide/next-slide context)
;(.setValue progress (+ i 1))
;(.setString progress (str (int (* (/ (inc i) len) 100)) "%"))
(.newPage doc)))
View
16 src/L5/slide.clj
@@ -167,9 +167,6 @@
(defn current-slide [context]
(let [slides @(:slides context)
idx @(:current context)]
- (println
- (format "%d / %d %s"
- (+ 1 idx) (count slides) (:body (first (get slides idx)))))
(when (and @(:g context) slides (get slides idx))
(let [y (ref (-> context :global-padding :top))]
(doseq [elem (get slides idx)]
@@ -182,6 +179,13 @@
(dosync
(ref-set y elem-y))))))))
+(defn print-info [context]
+ (let [slides @(:slides context)
+ idx @(:current context)]
+ (println
+ (format "%d / %d %s"
+ (+ 1 idx) (count slides) (:body (first (get slides idx)))))))
+
(defn repaint [context] (.repaint @(:frame context)))
(defn next-slide [context]
@@ -189,11 +193,13 @@
idx (+ @(:current context) 1)]
(when (> (count slides) idx)
(dosync (alter (:current context) inc))
- (repaint context))))
+ (repaint context)
+ (print-info context))))
(defn prev-slide [context]
(let [slides @(:slides context)
idx (- @(:current context) 1)]
(when (>= idx 0)
(dosync (alter (:current context) dec))
- (repaint context))))
+ (repaint context)
+ (print-info context))))
Please sign in to comment.
Something went wrong with that request. Please try again.