Kaynağa Gözat

Prefill saved MRZ info

Eric Betts 9 ay önce
ebeveyn
işleme
75b7d2eb99

+ 3 - 2
scenes/passy_scene_dob_input.c

@@ -16,10 +16,11 @@ void passy_scene_dob_input_on_enter(void* context) {
     // Setup view
     // Setup view
     TextInput* text_input = passy->text_input;
     TextInput* text_input = passy->text_input;
 
 
-    // TODO: reload from saved data
-
     text_input_set_header_text(text_input, "DoB: YYMMDD");
     text_input_set_header_text(text_input, "DoB: YYMMDD");
     text_input_set_minimum_length(text_input, 6);
     text_input_set_minimum_length(text_input, 6);
+    if(passy->date_of_birth[0] != '\0') {
+        strlcpy(passy->text_store, passy->date_of_birth, sizeof(passy->text_store));
+    }
     text_input_set_result_callback(
     text_input_set_result_callback(
         text_input,
         text_input,
         passy_scene_dob_input_text_input_callback,
         passy_scene_dob_input_text_input_callback,

+ 3 - 2
scenes/passy_scene_doe_input.c

@@ -15,10 +15,11 @@ void passy_scene_doe_input_on_enter(void* context) {
     // Setup view
     // Setup view
     TextInput* text_input = passy->text_input;
     TextInput* text_input = passy->text_input;
 
 
-    // TODO: reload from saved data
-
     text_input_set_header_text(text_input, "DoE: YYMMDD");
     text_input_set_header_text(text_input, "DoE: YYMMDD");
     text_input_set_minimum_length(text_input, 6);
     text_input_set_minimum_length(text_input, 6);
+    if(passy->date_of_expiry[0] != '\0') {
+        strlcpy(passy->text_store, passy->date_of_expiry, sizeof(passy->text_store));
+    }
     text_input_set_result_callback(
     text_input_set_result_callback(
         text_input,
         text_input,
         passy_scene_doe_input_text_input_callback,
         passy_scene_doe_input_text_input_callback,

+ 4 - 2
scenes/passy_scene_passport_number_input.c

@@ -15,9 +15,11 @@ void passy_scene_passport_number_input_on_enter(void* context) {
     // Setup view
     // Setup view
     TextInput* text_input = passy->text_input;
     TextInput* text_input = passy->text_input;
 
 
-    // TODO: reload from saved data
-
     text_input_set_header_text(text_input, "Passport Number");
     text_input_set_header_text(text_input, "Passport Number");
+    text_input_set_minimum_length(text_input, 9);
+    if(passy->passport_number[0] != '\0') {
+        strlcpy(passy->text_store, passy->passport_number, sizeof(passy->text_store));
+    }
     text_input_set_result_callback(
     text_input_set_result_callback(
         text_input,
         text_input,
         passy_scene_passport_number_input_text_input_callback,
         passy_scene_passport_number_input_text_input_callback,