| 436 | } |
| 437 | |
| 438 | int |
| 439 | ghb_ui_update_from_settings (const char *name, const GhbValue *settings) |
| 440 | { |
| 441 | GObject *object; |
| 442 | GhbValue * value; |
| 443 | signal_user_data_t *ud = ghb_ud(); |
| 444 | |
| 445 | ghb_log_func_str(name); |
| 446 | if (name == NULL) |
| 447 | return 0; |
| 448 | value = ghb_dict_get_value(settings, name); |
| 449 | if (value == NULL) |
| 450 | return 0; |
| 451 | object = ghb_builder_object(name); |
| 452 | if (object == NULL) |
| 453 | { |
| 454 | g_debug("Failed to find widget for key: %s", name); |
| 455 | return -1; |
| 456 | } |
| 457 | ghb_update_widget((GtkWidget*)object, value); |
| 458 | // Its possible the value hasn't changed. Since settings are only |
| 459 | // updated when the value changes, I'm initializing settings here as well. |
| 460 | ghb_widget_to_setting(ud->settings, (GtkWidget*)object); |
| 461 | return 0; |
| 462 | } |
| 463 | |
| 464 | int |
| 465 | ghb_ui_update (const gchar *name, const GhbValue *value) |
no test coverage detected