application/settings.c

changeset 115
e57ca2747782
parent 109
c3dfcb8f0be7
equal deleted inserted replaced
114:3da24640513a 115:e57ca2747782
52 52
53 static void repolist_selection(UiEvent *event, void *userdata) { 53 static void repolist_selection(UiEvent *event, void *userdata) {
54 UiListSelection *selection = event->eventdata; 54 UiListSelection *selection = event->eventdata;
55 SettingsWindow *settings = event->window; 55 SettingsWindow *settings = event->window;
56 if(selection->count > 0) { 56 if(selection->count > 0) {
57 ui_set_group(event->obj->ctx, SETTINGS_STATE_REPOLIST_SELECTED); 57 ui_set_state(event->obj->ctx, SETTINGS_STATE_REPOLIST_SELECTED);
58 settings->selected_repo = selection->rows[0]; 58 settings->selected_repo = selection->rows[0];
59 } else { 59 } else {
60 ui_unset_group(event->obj->ctx, SETTINGS_STATE_REPOLIST_SELECTED); 60 ui_unset_state(event->obj->ctx, SETTINGS_STATE_REPOLIST_SELECTED);
61 } 61 }
62 } 62 }
63 63
64 static void repolist_edit(UiEvent *event, void *userdata) { 64 static void repolist_edit(UiEvent *event, void *userdata) {
65 SettingsWindow *settings = event->window; 65 SettingsWindow *settings = event->window;
85 return; 85 return;
86 } 86 }
87 dav_repository_remove_and_free(settings->config, repo); 87 dav_repository_remove_and_free(settings->config, repo);
88 settings_update_repolist(settings); 88 settings_update_repolist(settings);
89 settings->selected_repo = -1; 89 settings->selected_repo = -1;
90 ui_unset_group(event->obj->ctx, SETTINGS_STATE_REPOLIST_SELECTED); 90 ui_unset_state(event->obj->ctx, SETTINGS_STATE_REPOLIST_SELECTED);
91 } 91 }
92 92
93 static void editrepo_go_back(UiEvent *event, void *userdata) { 93 static void editrepo_go_back(UiEvent *event, void *userdata) {
94 SettingsWindow *settings = event->window; 94 SettingsWindow *settings = event->window;
95 settings_store_repository(settings); 95 settings_store_repository(settings);
339 static void credentials_location_onselect(UiEvent *event, void *userdata) { 339 static void credentials_location_onselect(UiEvent *event, void *userdata) {
340 SettingsWindow *settings = event->window; 340 SettingsWindow *settings = event->window;
341 UiListSelection *sel = event->eventdata; 341 UiListSelection *sel = event->eventdata;
342 if(sel->count > 0) { 342 if(sel->count > 0) {
343 settings->credentials_location_selected_index = sel->rows[0]; 343 settings->credentials_location_selected_index = sel->rows[0];
344 ui_set_group(event->obj->ctx, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED); 344 ui_set_state(event->obj->ctx, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED);
345 } else { 345 } else {
346 settings->credentials_location_selected_index = -1; 346 settings->credentials_location_selected_index = -1;
347 ui_unset_group(event->obj->ctx, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED); 347 ui_unset_state(event->obj->ctx, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED);
348 } 348 }
349 } 349 }
350 350
351 static void credentials_setmasterpw(UiEvent *event, void *userdata) { 351 static void credentials_setmasterpw(UiEvent *event, void *userdata) {
352 if(event->intval == 1) { 352 if(event->intval == 1) {
514 ui_llabel(dialog, .label = "File"); 514 ui_llabel(dialog, .label = "File");
515 ui_textfield(dialog, .value = wdata->file); 515 ui_textfield(dialog, .value = wdata->file);
516 ui_newline(dialog); 516 ui_newline(dialog);
517 517
518 ui_llabel(dialog, .label = "Type"); 518 ui_llabel(dialog, .label = "Type");
519 ui_combobox(dialog, .list = wdata->type, .groups = UI_GROUPS(ADDKEY_DIALOG_STATE_NO_IMPORT)); 519 ui_dropdown(dialog, .list = wdata->type, .states = UI_GROUPS(ADDKEY_DIALOG_STATE_NO_IMPORT));
520 ui_newline(dialog); 520 ui_newline(dialog);
521 521
522 ui_llabel(dialog, .value = wdata->message, .colspan = 2); 522 ui_llabel(dialog, .value = wdata->message, .colspan = 2);
523 } 523 }
524 524
525 ui_set_group(dialog->ctx, ADDKEY_DIALOG_STATE_NO_IMPORT); 525 ui_set_state(dialog->ctx, ADDKEY_DIALOG_STATE_NO_IMPORT);
526 ui_list_setselection(wdata->type, 0); 526 ui_list_setselection(wdata->type, 0);
527 527
528 ui_show(dialog); 528 ui_show(dialog);
529 } 529 }
530 530
545 if(sel->count > 0) { 545 if(sel->count > 0) {
546 settings->keys_selected_index = sel->rows[0]; 546 settings->keys_selected_index = sel->rows[0];
547 DavCfgKey *key = ui_list_get(settings->keys_list, sel->rows[0]); 547 DavCfgKey *key = ui_list_get(settings->keys_list, sel->rows[0]);
548 if(key) { 548 if(key) {
549 settings_edit_key(settings, key); 549 settings_edit_key(settings, key);
550 ui_set_group(event->obj->ctx, SETTINGS_STATE_KEYS_SELECTED); 550 ui_set_state(event->obj->ctx, SETTINGS_STATE_KEYS_SELECTED);
551 } 551 }
552 } else { 552 } else {
553 settings->keys_selected_index = -1; 553 settings->keys_selected_index = -1;
554 settings_clear_key(settings); 554 settings_clear_key(settings);
555 ui_unset_group(event->obj->ctx, SETTINGS_STATE_KEYS_SELECTED); 555 ui_unset_state(event->obj->ctx, SETTINGS_STATE_KEYS_SELECTED);
556 } 556 }
557 } 557 }
558 558
559 static void list_str_destructor(void *data, void *ptr) { 559 static void list_str_destructor(void *data, void *ptr) {
560 UiContext *ctx = data; 560 UiContext *ctx = data;
624 return; 624 return;
625 } 625 }
626 PwdStore *pwdstore = get_pwdstore(); 626 PwdStore *pwdstore = get_pwdstore();
627 pwdstore = pwdstore ? pwdstore_clone(pwdstore) : pwdstore_new(); 627 pwdstore = pwdstore ? pwdstore_clone(pwdstore) : pwdstore_new();
628 628
629 UiObject *obj = ui_simple_window("Settings", NULL); 629 UiObject *obj = ui_simple_window("Settings");
630 ui_context_closefunc(obj->ctx, settings_close, NULL); 630 ui_context_closefunc(obj->ctx, settings_close, NULL);
631 SettingsWindow *wdata = ui_malloc(obj->ctx, sizeof(SettingsWindow)); 631 SettingsWindow *wdata = ui_malloc(obj->ctx, sizeof(SettingsWindow));
632 memset(wdata, 0, sizeof(SettingsWindow)); 632 memset(wdata, 0, sizeof(SettingsWindow));
633 wdata->config = config; 633 wdata->config = config;
634 wdata->pwdstore = pwdstore; 634 wdata->pwdstore = pwdstore;
648 ui_tabview(obj, .value = wdata->repo_tabview, .tabview = UI_TABVIEW_INVISIBLE, .fill = TRUE) { 648 ui_tabview(obj, .value = wdata->repo_tabview, .tabview = UI_TABVIEW_INVISIBLE, .fill = TRUE) {
649 ui_tab(obj, "list") { 649 ui_tab(obj, "list") {
650 ui_grid(obj, .margin = 16, .columnspacing = 10, .rowspacing = 10, .fill = TRUE) { 650 ui_grid(obj, .margin = 16, .columnspacing = 10, .rowspacing = 10, .fill = TRUE) {
651 ui_hbox(obj, .spacing = 4) { 651 ui_hbox(obj, .spacing = 4) {
652 ui_button(obj, .label = "Add", .onclick = repolist_add); 652 ui_button(obj, .label = "Add", .onclick = repolist_add);
653 ui_button(obj, .label = "Edit", .onclick = repolist_edit, .groups = UI_GROUPS(SETTINGS_STATE_REPOLIST_SELECTED)); 653 ui_button(obj, .label = "Edit", .onclick = repolist_edit, .states = UI_GROUPS(SETTINGS_STATE_REPOLIST_SELECTED));
654 ui_button(obj, .label = "Remove", .onclick = repolist_remove, .groups = UI_GROUPS(SETTINGS_STATE_REPOLIST_SELECTED)); 654 ui_button(obj, .label = "Remove", .onclick = repolist_remove, .states = UI_GROUPS(SETTINGS_STATE_REPOLIST_SELECTED));
655 } 655 }
656 ui_newline(obj); 656 ui_newline(obj);
657 657
658 UiModel* model = ui_model(obj->ctx, UI_STRING, "Name", UI_STRING, "URL", UI_STRING, "User", UI_STRING, "Encrypted", -1); 658 UiModel* model = ui_model(obj->ctx, UI_STRING, "Name", UI_STRING, "URL", UI_STRING, "User", UI_STRING, "Encrypted", -1);
659 ui_table(obj, 659 ui_table(obj,
685 ui_newline(obj); 685 ui_newline(obj);
686 686
687 ui_llabel(obj, .label = "Credentials", .style = UI_LABEL_STYLE_TITLE, .colspan = 2); 687 ui_llabel(obj, .label = "Credentials", .style = UI_LABEL_STYLE_TITLE, .colspan = 2);
688 ui_newline(obj); 688 ui_newline(obj);
689 ui_hbox(obj, .spacing = 4, .colspan = 2) { 689 ui_hbox(obj, .spacing = 4, .colspan = 2) {
690 ui_combobox(obj, .list = wdata->repo_credentials); 690 ui_dropdown(obj, .list = wdata->repo_credentials);
691 ui_button(obj, .label = "New Credentials", .onclick = credentials_new); 691 ui_button(obj, .label = "New Credentials", .onclick = credentials_new);
692 } 692 }
693 ui_newline(obj); 693 ui_newline(obj);
694 ui_expander(obj, .spacing = 10, .colspan = 2, .label = "Unencrypted User/Password", .margin = 10) { 694 ui_expander(obj, .spacing = 10, .colspan = 2, .label = "Unencrypted User/Password", .margin = 10) {
695 ui_llabel(obj, .label = "Store the credentials unencrypted in the repository and not in the secret store", .style = UI_LABEL_STYLE_DIM); 695 ui_llabel(obj, .label = "Store the credentials unencrypted in the repository and not in the secret store", .style = UI_LABEL_STYLE_DIM);
705 ui_newline(obj); 705 ui_newline(obj);
706 706
707 ui_llabel(obj, .label = "Encryption", .style = UI_LABEL_STYLE_TITLE, .colspan = 2); 707 ui_llabel(obj, .label = "Encryption", .style = UI_LABEL_STYLE_TITLE, .colspan = 2);
708 ui_newline(obj); 708 ui_newline(obj);
709 709
710 ui_checkbox(obj, .label = "Enable client-side encryption", .value = wdata->repo_encryption, .colspan = 2, .enable_group = SETTINGS_STATE_REPO_ENCRYPTION); 710 ui_checkbox(obj, .label = "Enable client-side encryption", .value = wdata->repo_encryption, .colspan = 2, .enable_state = SETTINGS_STATE_REPO_ENCRYPTION);
711 ui_newline(obj); 711 ui_newline(obj);
712 ui_llabel(obj, .label = "Default key"); 712 ui_llabel(obj, .label = "Default key");
713 ui_hbox(obj, .spacing = 4) { 713 ui_hbox(obj, .spacing = 4) {
714 ui_combobox(obj, .list = wdata->repo_keys, .groups = UI_GROUPS(SETTINGS_STATE_REPO_ENCRYPTION)); 714 ui_dropdown(obj, .list = wdata->repo_keys, .states = UI_GROUPS(SETTINGS_STATE_REPO_ENCRYPTION));
715 ui_button(obj, .label = "Generate Key", .onclick = keys_add, .onclickdata = "repo", .groups = UI_GROUPS(SETTINGS_STATE_REPO_ENCRYPTION)); 715 ui_button(obj, .label = "Generate Key", .onclick = keys_add, .onclickdata = "repo", .states = UI_GROUPS(SETTINGS_STATE_REPO_ENCRYPTION));
716 } 716 }
717 ui_newline(obj); 717 ui_newline(obj);
718 718
719 ui_llabel(obj, .label = "TLS", .style = UI_LABEL_STYLE_TITLE, .colspan = 2); 719 ui_llabel(obj, .label = "TLS", .style = UI_LABEL_STYLE_TITLE, .colspan = 2);
720 ui_newline(obj); 720 ui_newline(obj);
725 } 725 }
726 ui_newline(obj); 726 ui_newline(obj);
727 727
728 ui_llabel(obj, .label = "TLS Version"); 728 ui_llabel(obj, .label = "TLS Version");
729 ui_hbox0(obj) { 729 ui_hbox0(obj) {
730 ui_combobox(obj, .list = wdata->repo_tls_versions); 730 ui_dropdown(obj, .list = wdata->repo_tls_versions);
731 } 731 }
732 ui_newline(obj); 732 ui_newline(obj);
733 ui_checkbox(obj, .label = "Disable TLS verification", .value = wdata->repo_disable_verification, .colspan = 2); 733 ui_checkbox(obj, .label = "Disable TLS verification", .value = wdata->repo_disable_verification, .colspan = 2);
734 } 734 }
735 } 735 }
749 ui_tab(obj, "Credentials") { 749 ui_tab(obj, "Credentials") {
750 ui_hbox(obj, .margin = 16, .spacing = 30, .fill = TRUE) { 750 ui_hbox(obj, .margin = 16, .spacing = 30, .fill = TRUE) {
751 ui_vbox(obj, .spacing = 4) { 751 ui_vbox(obj, .spacing = 4) {
752 ui_hbox(obj, .spacing = 4) { 752 ui_hbox(obj, .spacing = 4) {
753 ui_button(obj, .label = "Add", .onclick = credentials_add); 753 ui_button(obj, .label = "Add", .onclick = credentials_add);
754 ui_button(obj, .label = "Remove", .onclick = credentials_remove, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 754 ui_button(obj, .label = "Remove", .onclick = credentials_remove, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
755 } 755 }
756 ui_listview(obj, .list = wdata->credentials_users, .fill = TRUE, .onselection = credentials_onselect); 756 ui_listview(obj, .list = wdata->credentials_users, .fill = TRUE, .onselection = credentials_onselect);
757 } 757 }
758 758
759 ui_grid(obj, .columnspacing = 30, .rowspacing = 10) { 759 ui_grid(obj, .columnspacing = 30, .rowspacing = 10) {
760 ui_llabel(obj, .label = "Identifier"); 760 ui_llabel(obj, .label = "Identifier");
761 ui_textfield(obj, .value = wdata->credentials_id, .hexpand = TRUE, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 761 ui_textfield(obj, .value = wdata->credentials_id, .hexpand = TRUE, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
762 ui_newline(obj); 762 ui_newline(obj);
763 763
764 ui_llabel(obj, .label = "User"); 764 ui_llabel(obj, .label = "User");
765 ui_textfield(obj, .value = wdata->credentials_user, .hexpand = TRUE, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 765 ui_textfield(obj, .value = wdata->credentials_user, .hexpand = TRUE, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
766 ui_newline(obj); 766 ui_newline(obj);
767 767
768 ui_llabel(obj, .label = "Password"); 768 ui_llabel(obj, .label = "Password");
769 ui_passwordfield(obj, .value = wdata->credentials_password, .hexpand = TRUE, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 769 ui_passwordfield(obj, .value = wdata->credentials_password, .hexpand = TRUE, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
770 ui_newline(obj); 770 ui_newline(obj);
771 771
772 772
773 ui_label(obj, .label = " "); 773 ui_label(obj, .label = " ");
774 ui_newline(obj); 774 ui_newline(obj);
782 #ifndef UI_WINUI 782 #ifndef UI_WINUI
783 ui_callback credentials_activate_callback = credentials_location_edit; 783 ui_callback credentials_activate_callback = credentials_location_edit;
784 #else 784 #else
785 ui_callback credentials_activate_callback = NULL; 785 ui_callback credentials_activate_callback = NULL;
786 #endif 786 #endif
787 ui_listview(obj, .list = wdata->credentials_locations, .onactivate = credentials_activate_callback, .onselection = credentials_location_onselect, .colspan = 2, .fill = TRUE, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 787 ui_listview(obj, .list = wdata->credentials_locations, .onactivate = credentials_activate_callback, .onselection = credentials_location_onselect, .colspan = 2, .fill = TRUE, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
788 ui_vbox(obj, .spacing = 4) { 788 ui_vbox(obj, .spacing = 4) {
789 ui_button(obj, .label = "Add", .onclick = credentials_location_add, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 789 ui_button(obj, .label = "Add", .onclick = credentials_location_add, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
790 ui_button(obj, .label = "Edit", .onclick = credentials_location_edit, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 790 ui_button(obj, .label = "Edit", .onclick = credentials_location_edit, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));
791 ui_button(obj, .label = "Remove", .onclick = credentials_location_remove, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 791 ui_button(obj, .label = "Remove", .onclick = credentials_location_remove, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));
792 ui_button(obj, .label = "Move Up", .onclick = credentials_location_up, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 792 ui_button(obj, .label = "Move Up", .onclick = credentials_location_up, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));
793 ui_button(obj, .label = "Move Down", .onclick = credentials_location_down, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 793 ui_button(obj, .label = "Move Down", .onclick = credentials_location_down, .states = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));
794 } 794 }
795 } 795 }
796 } 796 }
797 } 797 }
798 } 798 }
800 ui_tab(obj, "Keys") { 800 ui_tab(obj, "Keys") {
801 ui_hbox(obj, .margin = 16, .spacing = 30) { 801 ui_hbox(obj, .margin = 16, .spacing = 30) {
802 ui_vbox(obj, .spacing = 4) { 802 ui_vbox(obj, .spacing = 4) {
803 ui_hbox(obj, .spacing = 4) { 803 ui_hbox(obj, .spacing = 4) {
804 ui_button(obj, .label = "Add", .onclick = keys_add); 804 ui_button(obj, .label = "Add", .onclick = keys_add);
805 ui_button(obj, .label = "Remove", .onclick = keys_remove, .groups = UI_GROUPS(SETTINGS_STATE_KEYS_SELECTED)); 805 ui_button(obj, .label = "Remove", .onclick = keys_remove, .states = UI_GROUPS(SETTINGS_STATE_KEYS_SELECTED));
806 } 806 }
807 ui_listview(obj, .list = wdata->keys_list, .fill = TRUE, .onselection = keys_onselect, .getvalue = keylist_getvalue); 807 ui_listview(obj, .list = wdata->keys_list, .fill = TRUE, .onselection = keys_onselect, .getvalue = keylist_getvalue);
808 } 808 }
809 809
810 ui_grid(obj, .columnspacing = 30, .rowspacing = 10) { 810 ui_grid(obj, .columnspacing = 30, .rowspacing = 10) {
811 ui_llabel(obj, .label = "Identifier"); 811 ui_llabel(obj, .label = "Identifier");
812 ui_textfield(obj, .value = wdata->key_name, .groups = UI_GROUPS(SETTINGS_STATE_KEYS_SELECTED)); 812 ui_textfield(obj, .value = wdata->key_name, .states = UI_GROUPS(SETTINGS_STATE_KEYS_SELECTED));
813 ui_newline(obj); 813 ui_newline(obj);
814 ui_llabel(obj, .label = "Type"); 814 ui_llabel(obj, .label = "Type");
815 ui_textfield(obj, .value = wdata->key_type, .groups = UI_GROUPS(SETTINGS_STATE_DISABLED)); 815 ui_textfield(obj, .value = wdata->key_type, .states = UI_GROUPS(SETTINGS_STATE_DISABLED));
816 ui_newline(obj); 816 ui_newline(obj);
817 ui_llabel(obj, .label = "File"); 817 ui_llabel(obj, .label = "File");
818 ui_textfield(obj, .value = wdata->key_file, .groups = UI_GROUPS(SETTINGS_STATE_KEYS_SELECTED)); 818 ui_textfield(obj, .value = wdata->key_file, .states = UI_GROUPS(SETTINGS_STATE_KEYS_SELECTED));
819 } 819 }
820 } 820 }
821 } 821 }
822 822
823 /* 823 /*
1271 } 1271 }
1272 } 1272 }
1273 1273
1274 ui_list_update(settings->credentials_locations); 1274 ui_list_update(settings->credentials_locations);
1275 1275
1276 ui_set_group(settings->obj->ctx, SETTINGS_STATE_CREDENTIALS_SELECTED); 1276 ui_set_state(settings->obj->ctx, SETTINGS_STATE_CREDENTIALS_SELECTED);
1277 } 1277 }
1278 1278
1279 void settings_credentials_clear(SettingsWindow *settings) { 1279 void settings_credentials_clear(SettingsWindow *settings) {
1280 ui_free(settings->obj->ctx, settings->credentials_selected_id); 1280 ui_free(settings->obj->ctx, settings->credentials_selected_id);
1281 settings->credentials_selected_id = NULL; 1281 settings->credentials_selected_id = NULL;
1285 ui_set(settings->credentials_user, ""); 1285 ui_set(settings->credentials_user, "");
1286 ui_set(settings->credentials_password, ""); 1286 ui_set(settings->credentials_password, "");
1287 ui_list_clear(settings->credentials_locations); 1287 ui_list_clear(settings->credentials_locations);
1288 ui_list_update(settings->credentials_locations); 1288 ui_list_update(settings->credentials_locations);
1289 1289
1290 ui_unset_group(settings->obj->ctx, SETTINGS_STATE_CREDENTIALS_SELECTED); 1290 ui_unset_state(settings->obj->ctx, SETTINGS_STATE_CREDENTIALS_SELECTED);
1291 } 1291 }
1292 1292
1293 int settings_credentials_save(SettingsWindow *settings) { 1293 int settings_credentials_save(SettingsWindow *settings) {
1294 if(settings->credentials_selected_index == -1) { 1294 if(settings->credentials_selected_index == -1) {
1295 return 0; 1295 return 0;

mercurial