Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
citizen-science
symbai
Commits
40a5ffbf
Commit
40a5ffbf
authored
May 16, 2014
by
Dave Griffiths
Browse files
removed save button - saving all the time
parent
1bbfac8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
+29
-15
android/assets/dbsync.scm
android/assets/dbsync.scm
+15
-1
android/assets/starwisp.scm
android/assets/starwisp.scm
+14
-14
No files found.
android/assets/dbsync.scm
View file @
40a5ffbf
...
...
@@ -100,7 +100,10 @@
;;
(
begin
(
msg
"entity-set-value! - adding new "
key
"of type"
type
"to entity"
)
(
entity-add-value-create!
key
type
value
)))))
(
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
)
...
...
@@ -155,6 +158,17 @@
(
else
(
msg
"no values or no id to update as entity:"
unique-id
"values:"
values
))))))
(
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"
)))
(
cond
(
unique-id
(
update-entity
db
table
(
entity-id-from-unique
db
table
unique-id
)
(
list
ktv
)))
(
else
(
msg
"no values or no id to update as entity:"
unique-id
"values:"
values
)))))
(
define
(
entity-reset!
)
(
set-current!
'entity-values
'
())
(
set-current!
'db
"reset"
)
...
...
android/assets/starwisp.scm
View file @
40a5ffbf
...
...
@@ -328,20 +328,20 @@
(
layout
'fill-parent
'fill-parent
1
'centre
0
)
(
list
0
0
0
0
)
(
list
(
mbutton-scale
'save
(
lambda
()
(
list
(
alert-dialog
"ok-check"
(
mtext-lookup
'save-are-you-sure
)
(
lambda
(
v
)
(
cond
((
eqv?
v
1
)
(
entity-update-values!
)
(
list
))
(
else
(
list
))))))))
;
(mbutton-scale
;
'save
;
(lambda ()
;
(list
;
(alert-dialog
;
"ok-check"
;
(mtext-lookup 'save-are-you-sure)
;
(lambda (v)
;
(cond
;
((eqv? v 1)
;
(entity-update-values!)
;
(list))
;
(else
;
(list))))))))
(
mbutton-scale
'back
(
lambda
()
(
list
(
finish-activity
1
))))))
(
lambda
(
fragment
arg
)
(
activity-layout
fragment
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment