Commit cb6bdfdf authored by Dave Griffiths's avatar Dave Griffiths
Browse files

small fixes

parent 22387655
......@@ -90,20 +90,21 @@
;; version to check the entity has the key
(define (entity-set-value! key type value)
(let ((existing-type (ktv-get-type (get-current 'entity-values '()) key)))
(if (equal? existing-type type)
; (let ((existing-type (ktv-get-type (get-current 'entity-values '()) key)))
; (if (equal? existing-type type)
(set-current!
'entity-values
(ktv-set
(get-current 'entity-values '())
(ktv key type value)))
;;
(begin
(msg "entity-set-value! - adding new " key "of type" type "to entity")
(entity-add-value-create! key type value)))
; (begin
; (msg "entity-set-value! - adding new " key "of type" type "to entity")
; (entity-add-value-create! key type value)))
;; save straight to local db every time
;;(entity-update-single-value! (list key type value))
))
;; )
)
(define (date-time->string dt)
......
......@@ -53,7 +53,6 @@
;; (chop (1 2 3 4) 2) -> ((1 2) (3 4))
(define (chop l n)
(define (_ in out c)
(display c)(newline)
(cond
((null? in) out)
((zero? c) (_ (cdr in) (cons (list (car in)) out) (- n 1)))
......@@ -791,7 +790,7 @@
((null? w) #f)
;; drill deeper
((eq? (update-widget-token w) 'contents)
(msg "updateing contents from callback")
;;(msg "updateing contents from callback")
(update-callbacks! (update-widget-value w)))
((eq? (update-widget-token w) 'grid-buttons)
(add-callback! (callback (update-widget-id w)
......@@ -834,7 +833,7 @@
(define (update-dialogs! events)
(msg "update-dialogs" events)
;;(msg "update-dialogs" events)
(when (list? events)
(for-each
(lambda (event)
......@@ -850,7 +849,8 @@
(equal? (list-ref event 0) "gps-start"))
(add-new-dialog! event)))
events))
(msg "update-dialogs end"))
;;(msg "update-dialogs end")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......@@ -879,7 +879,7 @@
r))
(define (top-callback type activity-name activity args)
(display "activity/fragment-callback ")(display type)(display " ")(display args)(newline)
;;(display "activity/fragment-callback ")(display type)(display " ")(display args)(newline)
(if (not activity)
(begin (display "no activity/fragment called ")(display activity-name)(newline))
(let ((ret (cond
......@@ -899,7 +899,7 @@
(update-callbacks! (list ret)))
(else
(update-dialogs! ret)
(msg "top-callback inbetween")
;;(msg "top-callback inbetween")
(update-callbacks-from-update! ret)))
(send (scheme->json ret)))))
......@@ -909,10 +909,10 @@
(activity-list-find fragments name))))
(define (widget-callback activity-name widget-id args)
(msg "widget-callback" activity-name widget-id args)
;;(msg "widget-callback" activity-name widget-id args)
(prof-start "widget-callback")
(let ((cb (find-callback widget-id)))
(msg cb)
;;(msg cb)
(if (not cb)
(msg "no widget" widget-id "found!")
(let ((events
......@@ -938,7 +938,7 @@
;; this was just update-callbacks, commented out,
;; expecting trouble here... (but seems to fix new widgets from
;; widget callbacks so far)
(msg "callback returned" events)
;;(msg "callback returned" events)
(update-callbacks-from-update! events)
(update-dialogs! events)
(send (scheme->json events))
......
......@@ -791,6 +791,7 @@
(list
(mbutton "pf-grpint-done" "Done"
(lambda ()
(msg "entity-record-values about to be called?")
(entity-record-values!)
(list (replace-fragment (get-id "event-holder") "events"))))
(mbutton "pf-grpint-cancel" "Cancel"
......
......@@ -65,6 +65,7 @@
;; add all the keys
(for-each
(lambda (ktv)
(msg "inserting" ktv)
(insert-value db table id ktv dirty))
ktvlist)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment