Lines Matching refs:poption

104 static struct widget *option_widget_new(struct option *poption,
107 static void option_widget_update(struct option *poption);
108 static void option_widget_apply(struct option *poption);
261 options_iterate(option_dialog->optset.poptset, poption) { in back_callback()
262 if (option_dialog->optset.category == option_category(poption)) { in back_callback()
263 option_set_gui_data(poption, NULL); in back_callback()
422 options_iterate(option_dialog->optset.poptset, poption) { in apply_callback()
423 if (option_dialog->optset.category == option_category(poption)) { in apply_callback()
424 option_widget_apply(poption); in apply_callback()
480 static struct widget *option_widget_new(struct option *poption, in option_widget_new() argument
489 fc_assert_ret_val(NULL != poption, NULL); in option_widget_new()
492 help_text = fc_strdup(option_help_text(poption)); in option_widget_new()
496 option_description(poption), in option_widget_new()
504 add_to_gui_list(MAX_ID - option_number(poption), widget); in option_widget_new()
507 switch (option_type(poption)) { in option_widget_new()
509 widget = create_checkbox(window->dst, option_bool_get(poption), in option_widget_new()
517 fc_snprintf(buf, sizeof(buf), "%d", option_int_get(poption)); in option_widget_new()
526 const struct strvec *values = option_str_values(poption); in option_widget_new()
530 option_str_get(poption), values, in option_widget_new()
535 option_str_get(poption), in option_widget_new()
544 const struct strvec *values = option_enum_values(poption); in option_widget_new()
554 _(option_enum_get_str(poption)), in option_widget_new()
564 struct video_mode vmode = option_video_mode_get(poption); in option_widget_new()
582 option_type_name(option_type(poption)), in option_widget_new()
583 option_type(poption)); in option_widget_new()
594 if (option_is_changeable(poption)) { in option_widget_new()
599 add_to_gui_list(MAX_ID - option_number(poption), widget); in option_widget_new()
600 option_set_gui_data(poption, widget); in option_widget_new()
610 static void option_widget_update(struct option *poption) in option_widget_update() argument
614 fc_assert_ret(NULL != poption); in option_widget_update()
615 widget = (struct widget *) option_get_gui_data(poption); in option_widget_update()
618 set_wstate(widget, option_is_changeable(poption) in option_widget_update()
621 switch (option_type(poption)) { in option_widget_update()
623 if (option_bool_get(poption) != get_checkbox_state(widget)) { in option_widget_update()
632 fc_snprintf(buf, sizeof(buf), "%d", option_int_get(poption)); in option_widget_update()
638 copy_chars_to_string16(widget->string16, option_str_get(poption)); in option_widget_update()
643 _(option_enum_get_str(poption))); in option_widget_update()
649 struct video_mode vmode = option_video_mode_get(poption); in option_widget_update()
664 option_type_name(option_type(poption)), in option_widget_update()
665 option_type(poption)); in option_widget_update()
676 static void option_widget_apply(struct option *poption) in option_widget_apply() argument
680 fc_assert_ret(NULL != poption); in option_widget_apply()
681 widget = (struct widget *) option_get_gui_data(poption); in option_widget_apply()
684 switch (option_type(poption)) { in option_widget_apply()
686 (void) option_bool_set(poption, get_checkbox_state(widget)); in option_widget_apply()
695 (void) option_int_set(poption, value); in option_widget_apply()
705 (void) option_str_set(poption, str); in option_widget_apply()
719 (void) option_enum_set_int(poption, i); in option_widget_apply()
733 option_video_mode_set(poption, mode); in option_widget_apply()
746 option_type_name(option_type(poption)), in option_widget_apply()
747 option_type(poption)); in option_widget_apply()
883 options_iterate(pdialog->optset.poptset, poption) { in option_dialog_destroy()
884 if (pdialog->optset.category == option_category(poption)) { in option_dialog_destroy()
885 option_set_gui_data(poption, NULL); in option_dialog_destroy()
909 options_iterate(poptset, poption) { in optset_category_option_count()
910 if (category == option_category(poption)) { in optset_category_option_count()
1006 options_iterate(poptset, poption) { in option_dialog_optset_category()
1007 if (category != option_category(poption)) { in option_dialog_optset_category()
1011 widget = option_widget_new(poption, window, i >= MAX_SHOWN); in option_dialog_optset_category()
1446 void option_gui_update(struct option *poption) in option_gui_update() argument
1450 && option_optset(poption) == option_dialog->optset.poptset in option_gui_update()
1451 && option_category(poption) == option_dialog->optset.category) { in option_gui_update()
1452 option_widget_update(poption); in option_gui_update()
1455 if (!strcmp(option_name(poption), "nationset")) { in option_gui_update()
1463 void option_gui_add(struct option *poption) in option_gui_add() argument
1467 && option_optset(poption) == option_dialog->optset.poptset in option_gui_add()
1468 && option_category(poption) == option_dialog->optset.category) { in option_gui_add()
1470 option_dialog_optset_category(option_dialog, option_category(poption)); in option_gui_add()
1477 void option_gui_remove(struct option *poption) in option_gui_remove() argument
1481 && option_optset(poption) == option_dialog->optset.poptset in option_gui_remove()
1482 && option_category(poption) == option_dialog->optset.category) { in option_gui_remove()
1484 option_dialog_optset_category(option_dialog, option_category(poption)); in option_gui_remove()