Commit b2d61b53 authored by Dave Griffiths's avatar Dave Griffiths

double confirm on gps

parent 9090da10
......@@ -641,20 +641,36 @@
(list-ref d 5)))))
(define (do-gps display-id key-prepend)
(let ((loc (get-current 'location '(0 0))))
(entity-set-value! (string-append key-prepend "-lat") "real" (car loc))
(entity-set-value! (string-append key-prepend "-lon") "real" (cadr loc))
(list
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lat"))
'text
(number->string (car loc)))
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lon"))
'text
(number->string (cadr loc))))))
(list
(alert-dialog
"gps-check"
(mtext-lookup 'gps-are-you-sure)
(lambda (v)
(cond
((eqv? v 1)
(list
(alert-dialog
"gps-check2"
(mtext-lookup 'gps-are-you-sure-2)
(lambda (v)
(cond
((eqv? v 1)
(let ((loc (get-current 'location '(0 0))))
(entity-set-value! (string-append key-prepend "-lat") "real" (car loc))
(entity-set-value! (string-append key-prepend "-lon") "real" (cadr loc))
(list
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lat"))
'text
(number->string (car loc)))
(update-widget
'text-view
(get-id (string-append (symbol->string display-id) "-lon"))
'text
(number->string (cadr loc))))))
(else '()))))))
(else '()))))))
(define (mupdate-gps display-id key-prepend)
(let ((lat (entity-get-value (string-append key-prepend "-lat")))
......
......@@ -244,4 +244,7 @@
(list 'house-id (list "House ID" ))
(list 'photo-id (list "Photo ID" ))
(list 'add-are-you-sure (list "Are you sure you want to add this individual?" ))
(list 'gps-are-you-sure (list "Are you sure you want to record your current position?" ))
(list 'gps-are-you-sure-2 (list "Please confirm again..." ))
(list 'Current-village (list "Your current village" ))
))
......@@ -241,3 +241,6 @@
"house-id","House ID",,,
"photo-id","Photo ID",,,
"add-are-you-sure","Are you sure you want to add this individual?",,,
"gps-are-you-sure","Are you sure you want to record your current position?",,,
"gps-are-you-sure-2","Please confirm again...",,,
"Current-village","Your current village",,,
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