application/settings.c

changeset 76
641dcc79e0ef
parent 75
73c8a3780c72
equal deleted inserted replaced
75:73c8a3780c72 76:641dcc79e0ef
634 wdata->pwdstore = pwdstore; 634 wdata->pwdstore = pwdstore;
635 obj->window = wdata; 635 obj->window = wdata;
636 wdata->obj = obj; 636 wdata->obj = obj;
637 settings_init(obj, wdata); 637 settings_init(obj, wdata);
638 638
639 ui_tabview(obj) { 639 ui_tabview(obj, .tabview = UI_TABVIEW_NAVIGATION_TOP) {
640 ui_tab(obj, "General") { 640 ui_tab(obj, "General") {
641 ui_grid(obj, .margin = 10) { 641 ui_grid(obj, .margin = 10) {
642 ui_label(obj, .label = "TODO"); 642 ui_label(obj, .label = "TODO");
643 } 643 }
644 } 644 }
766 766
767 ui_llabel(obj, .label = "Password"); 767 ui_llabel(obj, .label = "Password");
768 ui_passwordfield(obj, .value = wdata->credentials_password, .hexpand = TRUE, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 768 ui_passwordfield(obj, .value = wdata->credentials_password, .hexpand = TRUE, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
769 ui_newline(obj); 769 ui_newline(obj);
770 770
771
771 ui_label(obj, .label = " "); 772 ui_label(obj, .label = " ");
772 ui_newline(obj); 773 ui_newline(obj);
773 774
774 ui_llabel(obj, .style = UI_LABEL_STYLE_TITLE, .label = "Locations", .colspan = 2); 775 ui_llabel(obj, .style = UI_LABEL_STYLE_TITLE, .label = "Locations", .colspan = 2);
775 ui_newline(obj); 776 ui_newline(obj);
776 ui_llabel(obj, .style = UI_LABEL_STYLE_DIM, .label = "List of URLs for which these credentials should be used (optional)", .colspan = 2); 777 ui_llabel(obj, .style = UI_LABEL_STYLE_DIM, .label = "List of URLs for which these credentials should be used (optional)", .colspan = 2);
777 ui_newline(obj); 778 ui_newline(obj);
778 779
779 ui_hbox(obj, .colspan = 2, .vexpand = TRUE, .hexpand = TRUE, .spacing = 10) { 780 ui_hbox(obj, .colspan = 2, .vexpand = TRUE, .hexpand = TRUE, .spacing = 10) {
780 ui_listview(obj, .list = wdata->credentials_locations, .onactivate = credentials_location_edit, .onselection = credentials_location_onselect, .colspan = 2, .fill = UI_ON, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 781 #ifndef UI_WINUI
782 ui_callback credentials_activate_callback = credentials_location_edit;
783 #else
784 ui_callback credentials_activate_callback = NULL;
785 #endif
786 ui_listview(obj, .list = wdata->credentials_locations, .onactivate = credentials_activate_callback, .onselection = credentials_location_onselect, .colspan = 2, .fill = UI_ON, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
781 ui_vbox(obj, .fill = UI_OFF, .spacing = 4) { 787 ui_vbox(obj, .fill = UI_OFF, .spacing = 4) {
782 ui_button(obj, .label = "Add", .onclick = credentials_location_add, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED)); 788 ui_button(obj, .label = "Add", .onclick = credentials_location_add, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED));
783 ui_button(obj, .label = "Edit", .onclick = credentials_location_edit, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 789 ui_button(obj, .label = "Edit", .onclick = credentials_location_edit, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));
784 ui_button(obj, .label = "Remove", .onclick = credentials_location_remove, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 790 ui_button(obj, .label = "Remove", .onclick = credentials_location_remove, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));
785 ui_button(obj, .label = "Move Up", .onclick = credentials_location_up, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED)); 791 ui_button(obj, .label = "Move Up", .onclick = credentials_location_up, .groups = UI_GROUPS(SETTINGS_STATE_CREDENTIALS_SELECTED, SETTINGS_STATE_CREDENTIALS_LOCATION_SELECTED));

mercurial