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

double confirm on gps

parent 9090da10
...@@ -641,6 +641,20 @@ ...@@ -641,6 +641,20 @@
(list-ref d 5))))) (list-ref d 5)))))
(define (do-gps display-id key-prepend) (define (do-gps display-id key-prepend)
(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)))) (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 "-lat") "real" (car loc))
(entity-set-value! (string-append key-prepend "-lon") "real" (cadr loc)) (entity-set-value! (string-append key-prepend "-lon") "real" (cadr loc))
...@@ -655,6 +669,8 @@ ...@@ -655,6 +669,8 @@
(get-id (string-append (symbol->string display-id) "-lon")) (get-id (string-append (symbol->string display-id) "-lon"))
'text 'text
(number->string (cadr loc)))))) (number->string (cadr loc))))))
(else '()))))))
(else '()))))))
(define (mupdate-gps display-id key-prepend) (define (mupdate-gps display-id key-prepend)
(let ((lat (entity-get-value (string-append key-prepend "-lat"))) (let ((lat (entity-get-value (string-append key-prepend "-lat")))
......
...@@ -244,4 +244,7 @@ ...@@ -244,4 +244,7 @@
(list 'house-id (list "House ID" )) (list 'house-id (list "House ID" ))
(list 'photo-id (list "Photo ID" )) (list 'photo-id (list "Photo ID" ))
(list 'add-are-you-sure (list "Are you sure you want to add this individual?" )) (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 @@ ...@@ -241,3 +241,6 @@
"house-id","House ID",,, "house-id","House ID",,,
"photo-id","Photo ID",,, "photo-id","Photo ID",,,
"add-are-you-sure","Are you sure you want to add this individual?",,, "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