static void reconfig_file_set_cb (GtkFileChooser *chooser, gpointer data) { if (config_file_path) g_free(config_file_path); config_file_path = gtk_file_chooser_get_filename(chooser); pr_config_file_apply(config_file_path); }
static int pr_config_handle_driver(const char *attrib, const char *value) { if (MATCH_ATTRIB("config_file")) { pr_config_file_apply(value); } else if (MATCH_ATTRIB("adc_active")) { gtk_combo_box_set_active(GTK_COMBO_BOX(regmap_select), atoi(value) ? ADC_REGMAP : DAC_REGMAP); } else { return -EINVAL; } return 0; }
static void load_profile(const char *ini_fn) { char *value = read_token_from_ini(ini_fn, THIS_DRIVER, "config_file"); if (value) { if (value[0]) pr_config_file_apply(value); free(value); } value = read_token_from_ini(ini_fn, THIS_DRIVER, "adc_active"); if (value) { if (value[0]) gtk_combo_box_set_active(GTK_COMBO_BOX(regmap_select), atoi(value) ? ADC_REGMAP : DAC_REGMAP); free(value); } }