Commit 09430c80 authored by Dave Griffiths's avatar Dave Griffiths

implemented feedback from testing

parent 532d3eab
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="foam.symbai"
android:versionCode="10"
android:versionCode="11"
android:versionName="1.0">
<application android:label="@string/app_name"
android:icon="@drawable/logo"
......
......@@ -106,22 +106,15 @@
(when (not (check-type type value))
(msg "INCORRECT TYPE FOR" key ":" type ":" value))
(let ((existing-type (ktv-get-type (get-current 'entity-values '()) key)))
(cond
((equal? existing-type type)
;; save straight to local db every time (checks for modification)
(entity-update-single-value! (list key type value))
;; then save to memory
(set-current!
'entity-values
(ktv-set
(get-current 'entity-values '())
(ktv key type value))))
;;
(else
(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 (checks for modification)
(entity-update-single-value! (list key type value))
;; save to memory
(set-current!
'entity-values
(ktv-set
(get-current 'entity-values '())
(ktv key type value))))
;; version to check the entity has the key
(define (entity-set-value-mem! key type value)
......@@ -192,9 +185,10 @@
(define (entity-update-single-value! ktv)
(let ((db (get-current 'db #f))
(table (get-current 'table #f))
(unique-id (ktv-get (get-current 'entity-values '()) "unique_id")))
(unique-id (ktv-get (get-current 'entity-values '()) "unique_id"))
(previous (ktv-get-whole (get-current 'entity-values '()) (ktv-key ktv))))
(cond
((ktv-eq? (ktv-get-whole (get-current 'entity-values '()) (ktv-key ktv)) ktv)
((and previous (ktv-eq? previous ktv))
(msg "eusv: no change for" (ktv-key ktv)))
(unique-id
(update-entity db table (entity-id-from-unique db table unique-id) (list ktv)))
......@@ -707,9 +701,11 @@
((or (eq? widget-type 'edit-text) (eq? widget-type 'text-view))
(let ((v (entity-get-value key)))
(update-widget widget-type (get-symbol-id id-symbol) 'text
;; hide -1 as it represents unset
(if (and (number? v) (eqv? v -1))
"" v))))
(cond
;; hide -1 as it represents unset
((and (number? v) (eqv? v -1)) "")
((not v) "") ;; unset text
(else v)))))
((eq? widget-type 'toggle-button)
(update-widget widget-type (get-symbol-id id-symbol) 'checked
(entity-get-value key)))
......@@ -837,8 +833,7 @@
(mtitle-scale title)
(button
(make-id (string-append (symbol->string title) "-add"))
(mtext-lookup 'add-item-to-list)
40 (layout 100 'wrap-content 1 'centre 5)
"+" 40 (layout 100 'wrap-content 1 'centre 5)
(lambda ()
(entity-create!
db table entity-type
......
This diff is collapsed.
......@@ -222,6 +222,15 @@
"social-relationship"," Relation"," ",,
"social-residence"," Residence"," ",,
"social-strength"," Strength"," ",,
"friendship-one"," One"," ",,
"friendship-two"," Two"," ",,
"friendship-three"," Three"," ",,
"friendship-four"," Four"," ",,
"friendship-five"," Five"," ",,
"friendship-nickname","Name",,,
"friendship-relationship"," Relation"," ",,
"friendship-residence"," Residence"," ",,
"friendship-strength"," Strength"," ",,
"mother"," Mother"," ",,
"father"," Father"," ",,
"sister"," Sister"," ",,
......
......@@ -12,8 +12,20 @@
(list 'agree-playback (list "Play"))
(list 'photo-agree-record (list "Record"))
(list 'photo-agree-playback (list "Play"))
(list 'general-agreement-text (list "Blah blah..."))
(list 'photo-agreement-text (list "Blah blah..."))
(list 'general-agreement-text (list "General agreement text here..."))
(list 'photo-agreement-text (list "Photo agreement text here..."))
(list 'household-agreement-text (list "Household agreement text here..."))
(list 'locality (list "Locality"))
(list 'num-male-adults (list "Num male adults"))
(list 'num-female-adults (list "Num female adults"))
(list 'num-male-children (list "Num male children"))
(list 'num-female-children (list "Num female children"))
(list 'mother-name (list "Mother name"))
(list 'father-name (list "Father name"))
(list 'mother-alive (list "Alive"))
(list 'father-alive (list "Alive"))
(list 'spouse-name (list "Spouse name"))
(list 'spouse-gender (list "Spouse gender"))
(list 'village-notes (list "Notes"))
(list 'individual-notes (list "Notes"))
(list 'household-notes (list "Notes"))
......@@ -136,7 +148,9 @@
(list 'income-button (list "Income" "" ))
(list 'genealogy-button (list "Genealogy" "" ))
(list 'social-button (list "Social" "" ))
(list 'agreement-button (list "Agreement" "" ))
(list 'household-agreement-button (list "Agreement" "" ))
(list 'photo-agreement-button (list "Agreement" "" ))
(list 'general-agreement-button (list "Agreement" "" ))
(list 'is-a-child (list "Child" "" ))
(list 'change-photo (list "Change photo" "" ))
(list 'details-name (list "Name" "Kyrteng" ))
......@@ -233,9 +247,15 @@
(list 'social-four (list "Four" "" ))
(list 'social-five (list "Five" "" ))
(list 'social-nickname (list "Name" ))
(list 'social-gender (list "Gender" ))
(list 'social-relationship (list "Relation" "" ))
(list 'social-residence (list "Residence" "" ))
(list 'social-strength (list "Strength" "" ))
(list 'friendship-one (list "One" "" ))
(list 'friendship-two (list "Two" "" ))
(list 'friendship-three (list "Three" "" ))
(list 'friendship-four (list "Four" "" ))
(list 'friendship-five (list "Five" "" ))
(list 'mother (list "Mother" "" ))
(list 'father (list "Father" "" ))
(list 'sister (list "Sister" "" ))
......
......@@ -78,10 +78,10 @@
;; order by name
"join " table "_value_varchar "
"as n on n.entity_id = e.entity_id and n.attribute_id = 'name' "
;; ignore deleted (if exists)
"left join " table "_value_int "
;; ignore deleted
"join " table "_value_int "
"as d on d.entity_id = e.entity_id and d.attribute_id = 'deleted' and "
"d.value = 0 or d.value = NULL ")
"d.value = 0 ")
filter)
(if typed "where e.entity_type = ? order by n.value"
"order by n.value")))
......@@ -135,7 +135,7 @@
(let ((s (apply
db-select
(append
(list db (build-query table filter (not (equal? type "*"))))
(list db q)
(build-args filter)
(if (equal? type "*") '() (list type))))))
(msg (db-status db))
......
......@@ -18,26 +18,38 @@
(provide (all-defined-out))
;(define (ktv-get ktv-list key)
; (cond
; ((null? ktv-list) #f)
; ((equal? (ktv-key (car ktv-list)) key)
; (ktv-value (car ktv-list)))
; (else (ktv-get (cdr ktv-list) key))))
(define (ktv-get ktv-list key)
(cond
((null? ktv-list) #f)
((equal? (ktv-key (car ktv-list)) key)
(ktv-value (car ktv-list)))
(else (ktv-get (cdr ktv-list) key))))
(let ((k (assoc-string-fast key ktv-list)))
(if k (ktv-value k) #f)))
;(define (ktv-get-whole ktv-list key)
; (cond
; ((null? ktv-list) #f)
; ((equal? (ktv-key (car ktv-list)) key)
; (car ktv-list))
; (else (ktv-get-whole (cdr ktv-list) key))))
(define (ktv-get-whole ktv-list key)
(cond
((null? ktv-list) #f)
((equal? (ktv-key (car ktv-list)) key)
(car ktv-list))
(else (ktv-get-whole (cdr ktv-list) key))))
(assoc-string-fast key ktv-list))
;(define (ktv-get-type ktv-list key)
; (cond
; ((null? ktv-list) #f)
; ((equal? (ktv-key (car ktv-list)) key)
; (ktv-type (car ktv-list)))
; (else (ktv-get-type (cdr ktv-list) key))))
(define (ktv-get-type ktv-list key)
(cond
((null? ktv-list) #f)
((equal? (ktv-key (car ktv-list)) key)
(ktv-type (car ktv-list)))
(else (ktv-get-type (cdr ktv-list) key))))
(let ((k (assoc-string-fast key ktv-list)))
(if k (ktv-type k) #f)))
(define (ktv-set ktv-list ktv)
(cond
......
dave@fulmar.4670:1404729118
\ No newline at end of file
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