[gnac/devel] Code refactoring
- From: BenoÃt Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Code refactoring
- Date: Thu, 29 Dec 2011 10:57:16 +0000 (UTC)
commit ea08ee00f097cf18468bfc5590c2527190222cd8
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date: Wed Dec 28 18:48:07 2011 +0100
Code refactoring
src/profiles/formats/gnac-profiles-aac.c | 11 +-
src/profiles/formats/gnac-profiles-flac.c | 4 +-
src/profiles/formats/gnac-profiles-lame.c | 21 +--
src/profiles/formats/gnac-profiles-speex.c | 24 +--
src/profiles/formats/gnac-profiles-vorbis.c | 12 +-
src/profiles/formats/gnac-profiles-wavpack.c | 23 +--
src/profiles/gnac-profiles-default.c | 7 +-
src/profiles/gnac-profiles-utils.c | 228 ++++++++++----------------
src/profiles/gnac-profiles-utils.h | 21 +--
9 files changed, 135 insertions(+), 216 deletions(-)
---
diff --git a/src/profiles/formats/gnac-profiles-aac.c b/src/profiles/formats/gnac-profiles-aac.c
index 1cd4379..3eef9b0 100755
--- a/src/profiles/formats/gnac-profiles-aac.c
+++ b/src/profiles/formats/gnac-profiles-aac.c
@@ -113,10 +113,9 @@ static void
gnac_profiles_aac_reset_ui(void)
{
gnac_profiles_default_reset_ui(&aac_bfi);
- gnac_profiles_utils_reset_values_combo(&aac_bfi,
- "combo-bitrate", "combo-outputformat", "combo-profile", NULL);
- gnac_profiles_utils_reset_values_check(&aac_bfi,
- "checkbutton-tns", NULL);
+ gnac_profiles_utils_reset_values(&aac_bfi,
+ "combo-bitrate", "combo-outputformat",
+ "combo-profile", "checkbutton-tns", NULL);
}
@@ -129,12 +128,10 @@ gnac_profiles_aac_fullfill_fields(gpointer data)
}
AudioProfileAAC *profile = (AudioProfileAAC *) data;
- gnac_profiles_utils_set_values_combo(&aac_bfi,
+ gnac_profiles_utils_set_values(&aac_bfi,
"combo-bitrate", profile->bitrate,
"combo-outputformat", profile->outputformat,
"combo-profile", profile->profile,
- NULL);
- gnac_profiles_utils_set_values_check(&aac_bfi,
"checkbutton-tns", profile->tns,
NULL);
}
diff --git a/src/profiles/formats/gnac-profiles-flac.c b/src/profiles/formats/gnac-profiles-flac.c
index d2a874d..b1dcffa 100755
--- a/src/profiles/formats/gnac-profiles-flac.c
+++ b/src/profiles/formats/gnac-profiles-flac.c
@@ -86,7 +86,7 @@ static void
gnac_profiles_flac_reset_ui(void)
{
gnac_profiles_default_reset_ui(&flac_bfi);
- gnac_profiles_utils_reset_values_slider(&flac_bfi,
+ gnac_profiles_utils_reset_values(&flac_bfi,
"slider-compression", NULL);
}
@@ -100,7 +100,7 @@ gnac_profiles_flac_fullfill_fields(gpointer data)
}
AudioProfileFlac *profile = (AudioProfileFlac *) data;
- gnac_profiles_utils_set_values_slider(&flac_bfi,
+ gnac_profiles_utils_set_values(&flac_bfi,
"slider-compression", profile->quality, NULL);
}
diff --git a/src/profiles/formats/gnac-profiles-lame.c b/src/profiles/formats/gnac-profiles-lame.c
index 925782a..2de0a74 100755
--- a/src/profiles/formats/gnac-profiles-lame.c
+++ b/src/profiles/formats/gnac-profiles-lame.c
@@ -333,12 +333,11 @@ gnac_profiles_lame_advanced_bitrate_on_toggle(GtkWidget *widget,
static void
gnac_profiles_lame_reset_ui(void)
{
- gnac_profiles_utils_reset_values_combo(&lame_bfi,
+ gnac_profiles_utils_reset_values(&lame_bfi,
"combo-mode", "combo-bitrate", "combo-min-vbr", "combo-max-vbr",
- "combo-preset", "combo-encoding-mode", NULL);
- gnac_profiles_utils_reset_values_slider(&lame_bfi,
- "slider-vbr-quality", "slider-compression-ratio",
- "slider-mean-vbr", "slider-mean-abr", NULL);
+ "combo-preset", "combo-encoding-mode", "slider-vbr-quality",
+ "slider-compression-ratio", "slider-mean-vbr", "slider-mean-abr",
+ NULL);
gnac_profiles_utils_set_active_toggle_button(&lame_bfi, FALSE,
"checkbutton-mean-bitrate", "checkbutton-min-bitrate",
"checkbutton-max-bitrate", NULL);
@@ -354,23 +353,23 @@ gnac_profiles_lame_fullfill_fields(gpointer data)
}
AudioProfileLame *profile = (AudioProfileLame *) data;
- gnac_profiles_utils_set_values_combo(&lame_bfi,
+ gnac_profiles_utils_set_values(&lame_bfi,
"combo-encoding-mode", profile->encoding_mode,
"combo-mode", profile->mode, NULL);
if (profile->bitrate)
{
- gnac_profiles_utils_set_values_combo(&lame_bfi,
+ gnac_profiles_utils_set_values(&lame_bfi,
"combo-bitrate", profile->bitrate, NULL);
}
else if (profile->preset)
{
- gnac_profiles_utils_set_values_combo(&lame_bfi,
+ gnac_profiles_utils_set_values(&lame_bfi,
"combo-preset", profile->preset, NULL);
}
else if (profile->mean_abr != -1)
{
- gnac_profiles_utils_set_values_slider(&lame_bfi,
+ gnac_profiles_utils_set_values(&lame_bfi,
"slider-mean-abr", profile->mean_abr, NULL);
gnac_profiles_utils_set_values_checked_combo(&lame_bfi,
"combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
@@ -379,7 +378,7 @@ gnac_profiles_lame_fullfill_fields(gpointer data)
}
else if (profile->quality != -1)
{
- gnac_profiles_utils_set_values_slider(&lame_bfi,
+ gnac_profiles_utils_set_values(&lame_bfi,
"slider-vbr-quality", profile->quality, NULL);
gnac_profiles_utils_set_values_checked_combo(&lame_bfi,
"combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
@@ -391,7 +390,7 @@ gnac_profiles_lame_fullfill_fields(gpointer data)
}
else if (profile->compression_ratio != -1)
{
- gnac_profiles_utils_set_values_slider(&lame_bfi,
+ gnac_profiles_utils_set_values(&lame_bfi,
"slider-compression-ratio", profile->compression_ratio, NULL);
}
}
diff --git a/src/profiles/formats/gnac-profiles-speex.c b/src/profiles/formats/gnac-profiles-speex.c
index f5f317f..337b1d7 100644
--- a/src/profiles/formats/gnac-profiles-speex.c
+++ b/src/profiles/formats/gnac-profiles-speex.c
@@ -323,13 +323,10 @@ static void
gnac_profiles_speex_reset_ui(void)
{
gnac_profiles_default_reset_ui(&speex_bfi);
- gnac_profiles_utils_reset_values_combo(&speex_bfi,
- "combo-bitrate-mode", "combo-mode", NULL);
- gnac_profiles_utils_reset_values_slider(&speex_bfi,
- "slider-quality-cbr", "slider-quality-vbr", "slider-bitrate-cbr",
- "slider-bitrate-abr", "slider-complexity", NULL);
- gnac_profiles_utils_reset_values_check(&speex_bfi,
- "checkbutton-vad", "checkbutton-dtx", NULL);
+ gnac_profiles_utils_reset_values(&speex_bfi,
+ "combo-bitrate-mode", "combo-mode", "slider-quality-cbr",
+ "slider-quality-vbr", "slider-bitrate-cbr", "slider-bitrate-abr",
+ "slider-complexity", "checkbutton-vad", "checkbutton-dtx", NULL);
gnac_profiles_utils_set_active_toggle_button(&speex_bfi, FALSE,
"checkbutton-complexity", "checkbutton-bitrate-cbr", NULL);
}
@@ -348,9 +345,8 @@ gnac_profiles_speex_fullfill_fields(gpointer data)
gnac_profiles_utils_set_values_checked_slider(&speex_bfi,
"slider-complexity", "checkbutton-complexity",
profile->complexity, NULL);
- gnac_profiles_utils_set_values_combo(&speex_bfi,
- "combo-mode", profile->mode, NULL);
- gnac_profiles_utils_set_values_check(&speex_bfi,
+ gnac_profiles_utils_set_values(&speex_bfi,
+ "combo-mode", profile->mode,
"checkbutton-vad", profile->vad,
"checkbutton-dtx", profile->dtx, NULL);
@@ -359,8 +355,8 @@ gnac_profiles_speex_fullfill_fields(gpointer data)
if (profile->quality_cbr != -1)
{
- gnac_profiles_utils_set_values_slider(&speex_bfi, "slider-bitrate-cbr",
- profile->bitrate_cbr, NULL);
+ gnac_profiles_utils_set_values(&speex_bfi,
+ "slider-bitrate-cbr", profile->bitrate_cbr, NULL);
if (profile->bitrate_cbr != 1) {
gnac_profiles_utils_set_values_checked_slider(&speex_bfi,
@@ -374,13 +370,13 @@ gnac_profiles_speex_fullfill_fields(gpointer data)
{
gnac_profiles_utils_set_active_toggle_button(&speex_bfi, TRUE,
"checkbutton-vbr", NULL);
- gnac_profiles_utils_set_values_slider(&speex_bfi,
+ gnac_profiles_utils_set_values(&speex_bfi,
"slider-quality-vbr", profile->quality_vbr, NULL);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), VARIABLE_BITRATE);
}
else
{
- gnac_profiles_utils_set_values_slider(&speex_bfi,
+ gnac_profiles_utils_set_values(&speex_bfi,
"slider-bitrate-abr", profile->bitrate_abr, NULL);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), AVERAGE_BITRATE);
}
diff --git a/src/profiles/formats/gnac-profiles-vorbis.c b/src/profiles/formats/gnac-profiles-vorbis.c
index 96f18a2..b387947 100755
--- a/src/profiles/formats/gnac-profiles-vorbis.c
+++ b/src/profiles/formats/gnac-profiles-vorbis.c
@@ -203,11 +203,9 @@ static void
gnac_profiles_vorbis_reset_ui(void)
{
gnac_profiles_default_reset_ui(&vorbis_bfi);
- gnac_profiles_utils_reset_values_combo(&vorbis_bfi,
- "combo-encoding-mode", "combo-bitrate",
- "combo-min-vbr", "combo-max-vbr", NULL);
- gnac_profiles_utils_reset_values_slider(&vorbis_bfi,
- "slider-quality", NULL);
+ gnac_profiles_utils_reset_values(&vorbis_bfi,
+ "combo-encoding-mode", "combo-bitrate", "combo-min-vbr",
+ "combo-max-vbr", "slider-quality", NULL);
gnac_profiles_utils_set_active_toggle_button(&vorbis_bfi, FALSE,
"checkbutton-min-bitrate", "checkbutton-max-bitrate", NULL);
}
@@ -227,11 +225,11 @@ gnac_profiles_vorbis_fullfill_fields(gpointer data)
gnac_profiles_default_init_fields(profile->generic, &vorbis_bfi);
if (profile->quality == -1) {
- gnac_profiles_utils_set_values_combo(&vorbis_bfi,
+ gnac_profiles_utils_set_values(&vorbis_bfi,
"combo-bitrate", profile->bitrate, NULL);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), CONSTANT_BITRATE);
} else {
- gnac_profiles_utils_set_values_slider(&vorbis_bfi,
+ gnac_profiles_utils_set_values(&vorbis_bfi,
"slider-quality", profile->quality, NULL);
gnac_profiles_utils_set_values_checked_combo(&vorbis_bfi,
"combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
diff --git a/src/profiles/formats/gnac-profiles-wavpack.c b/src/profiles/formats/gnac-profiles-wavpack.c
index 1effb38..e0d13d9 100644
--- a/src/profiles/formats/gnac-profiles-wavpack.c
+++ b/src/profiles/formats/gnac-profiles-wavpack.c
@@ -258,12 +258,9 @@ static void
gnac_profiles_wavpack_reset_ui(void)
{
gnac_profiles_default_reset_ui(&wavpack_bfi);
- gnac_profiles_utils_reset_values_combo(&wavpack_bfi,
- "combo-mode", "combo-bitrate-control", "combo-joint-stereo-mode", NULL);
- gnac_profiles_utils_reset_values_check(&wavpack_bfi,
- "checkbutton-md5", NULL);
- gnac_profiles_utils_reset_values_slider(&wavpack_bfi,
- "slider-bitrate", "slider-bits-per-sample",
+ gnac_profiles_utils_reset_values(&wavpack_bfi,
+ "combo-mode", "combo-bitrate-control", "combo-joint-stereo-mode",
+ "checkbutton-md5", "slider-bitrate", "slider-bits-per-sample",
"slider-extra-processing", NULL);
gnac_profiles_utils_set_active_toggle_button(&wavpack_bfi, FALSE,
"checkbutton-bitrate-control", NULL);
@@ -279,15 +276,13 @@ gnac_profiles_wavpack_fullfill_fields(gpointer data)
}
AudioProfileWavpack *profile = (AudioProfileWavpack *) data;
- gnac_profiles_utils_set_values_combo(&wavpack_bfi,
- "combo-mode", profile->mode, NULL);
+ gnac_profiles_utils_set_values(&wavpack_bfi,
+ "combo-mode", profile->mode,
+ "slider-extra-processing", profile->extra_processing,
+ "checkbutton-md5", profile->md5, NULL);
gnac_profiles_utils_set_values_checked_combo(&wavpack_bfi,
"combo-joint-stereo-mode", "checkbutton-joint-stereo-mode",
profile->joint_stereo_mode, NULL);
- gnac_profiles_utils_set_values_slider(&wavpack_bfi,
- "slider-extra-processing", profile->extra_processing, NULL);
- gnac_profiles_utils_set_values_check(&wavpack_bfi,
- "checkbutton-md5", profile->md5, NULL);
GtkWidget *widget = gnac_profiles_utils_get_widget(&wavpack_bfi,
"combo-bitrate-control");
@@ -295,12 +290,12 @@ gnac_profiles_wavpack_fullfill_fields(gpointer data)
"checkbutton-bitrate-control");
if (profile->bitrate != -1.0) {
- gnac_profiles_utils_set_values_slider(&wavpack_bfi,
+ gnac_profiles_utils_set_values(&wavpack_bfi,
"slider-bitrate", profile->bitrate, NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), AVERAGE_BITRATE);
} else if (profile->bits_per_sample != -1) {
- gnac_profiles_utils_set_values_slider(&wavpack_bfi,
+ gnac_profiles_utils_set_values(&wavpack_bfi,
"slider-bits-per-sample", profile->bits_per_sample, NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), BITS_PER_SAMPLE);
diff --git a/src/profiles/gnac-profiles-default.c b/src/profiles/gnac-profiles-default.c
index b3d44c4..c52203c 100755
--- a/src/profiles/gnac-profiles-default.c
+++ b/src/profiles/gnac-profiles-default.c
@@ -143,7 +143,7 @@ gnac_profiles_default_get_combo_format_name(BasicFormatInfo *bfi)
void
gnac_profiles_default_reset_ui(BasicFormatInfo *bfi)
{
- gnac_profiles_utils_reset_values_combo(bfi,
+ gnac_profiles_utils_reset_values(bfi,
"combo-channels", "combo-sample-rate", NULL);
}
@@ -154,8 +154,9 @@ gnac_profiles_default_init_fields(AudioProfileGeneric *profile,
{
g_return_if_fail(profile);
- gnac_profiles_utils_set_value_combo(bfi, "combo-channels", profile->channels);
- gnac_profiles_utils_set_value_combo(bfi, "combo-sample-rate", profile->rate);
+ gnac_profiles_utils_set_values(bfi,
+ "combo-channels", profile->channels,
+ "combo-sample-rate", profile->rate, NULL);
}
diff --git a/src/profiles/gnac-profiles-utils.c b/src/profiles/gnac-profiles-utils.c
index f020166..add6cbc 100755
--- a/src/profiles/gnac-profiles-utils.c
+++ b/src/profiles/gnac-profiles-utils.c
@@ -160,68 +160,122 @@ gnac_profiles_utils_init_widget(BasicFormatInfo *bfi,
static void
-gnac_profiles_utils_reset_value_combo(BasicFormatInfo *bfi,
- const gchar *combo_name)
+gnac_profiles_utils_set_value_combo(GtkWidget *combo,
+ const gchar *value)
{
- GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, combo_name);
- ComboValues *values = g_object_get_data(G_OBJECT(widget), "combo-values");
- gnac_profiles_utils_set_value_combo(bfi, combo_name, values->default_value);
+ ComboValues *combo_values = g_object_get_data(G_OBJECT(combo), "combo-values");
+ GList *values = combo_values->values;
+
+ if (!value) value = combo_values->default_value;
+
+ gint index = 0;
+ while (values) {
+ if (gnac_utils_str_equal(value, values->data)) {
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
+ }
+
+ values = g_list_next(values);
+ index++;
+ }
+}
+
+
+static void
+gnac_profiles_utils_set_value_check(GtkWidget *widget,
+ const gchar *value)
+{
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
+ gnac_utils_str_equal(value, "true"));
+}
+
+
+static void
+gnac_profiles_utils_set_value_slider(GtkWidget *widget,
+ const gdouble value)
+{
+ gtk_range_set_value(GTK_RANGE(widget), value);
}
void
-gnac_profiles_utils_reset_values_combo(BasicFormatInfo *bfi, ...)
+gnac_profiles_utils_set_values(BasicFormatInfo *bfi, ...)
{
va_list ap;
va_start(ap, bfi);
- const gchar *combo_name = va_arg(ap, const gchar *);
- while (combo_name) {
- gnac_profiles_utils_reset_value_combo(bfi, combo_name);
- combo_name = va_arg(ap, const gchar *);
+ const gchar *name = va_arg(ap, const gchar *);
+
+ while (name) {
+ GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, name);
+
+ if (GTK_IS_COMBO_BOX(widget)) {
+ const gchar *value = va_arg(ap, const gchar *);
+ gnac_profiles_utils_set_value_combo(widget, value);
+ } else if (GTK_IS_CHECK_BUTTON(widget)) {
+ const gchar *value = va_arg(ap, const gchar *);
+ gnac_profiles_utils_set_value_check(widget, value);
+ } else if (GTK_IS_RANGE(widget)) {
+ gdouble value = va_arg(ap, gdouble);
+ gnac_profiles_utils_set_value_slider(widget, value);
+ } else {
+ libgnac_debug("Unhandled widget type: %s",
+ g_type_name(G_OBJECT_TYPE(widget)));
+ }
+
+ name = va_arg(ap, const gchar *);
}
va_end(ap);
}
-void
-gnac_profiles_utils_set_value_combo(BasicFormatInfo *bfi,
- const gchar *combo_name,
- const gchar *value)
+static void
+gnac_profiles_utils_reset_value_combo(GtkWidget *widget)
{
- GtkWidget *combo = gnac_profiles_utils_get_widget(bfi, combo_name);
- ComboValues *combo_values = g_object_get_data(G_OBJECT(combo), "combo-values");
- GList *values = combo_values->values;
+ ComboValues *values = g_object_get_data(G_OBJECT(widget), "combo-values");
+ gnac_profiles_utils_set_value_combo(widget, values->default_value);
+}
- if (!value) value = combo_values->default_value;
- gint index = 0;
- while (values) {
- if (gnac_utils_str_equal(value, values->data)) {
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
- }
+static void
+gnac_profiles_utils_reset_value_check(GtkWidget *widget)
+{
+ CheckValues *values = g_object_get_data(G_OBJECT(widget), "check-values");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), values->default_value);
+}
- values = g_list_next(values);
- index++;
- }
+
+static void
+gnac_profiles_utils_reset_value_slider(GtkWidget *widget)
+{
+ SliderValues *values = g_object_get_data(G_OBJECT(widget), "slider-values");
+ gtk_range_set_value(GTK_RANGE(widget), values->default_value);
}
void
-gnac_profiles_utils_set_values_combo(BasicFormatInfo *bfi, ...)
+gnac_profiles_utils_reset_values(BasicFormatInfo *bfi, ...)
{
- va_list ap;
- const gchar *name;
- const gchar *value;
+ va_list ap;
va_start(ap, bfi);
- name = va_arg(ap, const gchar *);
+ const gchar *name = va_arg(ap, const gchar *);
while (name) {
- value = va_arg(ap, const gchar *);
- gnac_profiles_utils_set_value_combo(bfi, name, value);
+ GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, name);
+
+ if (GTK_IS_COMBO_BOX(widget)) {
+ gnac_profiles_utils_reset_value_combo(widget);
+ } else if (GTK_IS_CHECK_BUTTON(widget)) {
+ gnac_profiles_utils_reset_value_check(widget);
+ } else if (GTK_IS_RANGE(widget)) {
+ gnac_profiles_utils_reset_value_slider(widget);
+ } else {
+ libgnac_debug("Unhandled widget type: %s",
+ g_type_name(G_OBJECT_TYPE(widget)));
+ }
+
name = va_arg(ap, const gchar *);
}
@@ -245,7 +299,8 @@ gnac_profiles_utils_set_values_checked_combo(BasicFormatInfo *bfi, ...)
value = va_arg(ap, const gchar *);
if (value) {
- gnac_profiles_utils_set_value_combo(bfi, name_combo, value);
+ GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, name_combo);
+ gnac_profiles_utils_set_value_combo(widget, value);
}
GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, name_checkbox);
@@ -318,55 +373,6 @@ gnac_profiles_utils_get_values_checked_combo_and_set(BasicFormatInfo *bfi, ...)
}
-static void
-gnac_profiles_utils_reset_value_slider(BasicFormatInfo *bfi,
- const gchar *slider_name)
-{
- GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, slider_name);
- SliderValues *values = g_object_get_data(G_OBJECT(widget), "slider-values");
- gtk_range_set_value(GTK_RANGE(widget), values->default_value);
-}
-
-
-void
-gnac_profiles_utils_reset_values_slider(BasicFormatInfo *bfi, ...)
-{
- va_list ap;
-
- va_start(ap, bfi);
- const gchar *slider_name = va_arg(ap, const gchar *);
-
- while (slider_name) {
- gnac_profiles_utils_reset_value_slider(bfi, slider_name);
- slider_name = va_arg(ap, const gchar *);
- }
-
- va_end(ap);
-}
-
-
-void
-gnac_profiles_utils_set_values_slider(BasicFormatInfo *bfi, ...)
-{
- GtkWidget *widget;
- va_list ap;
- const gchar *name;
- gdouble value;
-
- va_start(ap, bfi);
- name = va_arg(ap, const gchar *);
-
- while (name) {
- value = va_arg(ap, gdouble);
- widget = gnac_profiles_utils_get_widget(bfi, name);
- gtk_range_set_value(GTK_RANGE(widget), value);
- name = va_arg(ap, const gchar *);
- }
-
- va_end(ap);
-}
-
-
void
gnac_profiles_utils_set_values_checked_slider(BasicFormatInfo *bfi, ...)
{
@@ -449,62 +455,6 @@ gnac_profiles_utils_get_values_checked_slider_and_set(BasicFormatInfo *bfi, ...)
}
-static void
-gnac_profiles_utils_reset_value_check(BasicFormatInfo *bfi,
- const gchar *check_name)
-{
- GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, check_name);
- CheckValues *values = g_object_get_data(G_OBJECT(widget), "check-values");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), values->default_value);
-}
-
-
-void
-gnac_profiles_utils_reset_values_check(BasicFormatInfo *bfi, ...)
-{
- va_list ap;
-
- va_start(ap, bfi);
- const gchar *check_name = va_arg(ap, const gchar *);
-
- while (check_name) {
- gnac_profiles_utils_reset_value_check(bfi, check_name);
- check_name = va_arg(ap, gpointer);
- }
-
- va_end(ap);
-}
-
-
-static void
-gnac_profiles_utils_set_value_check(BasicFormatInfo *bfi,
- const gchar *name,
- const gchar *value)
-{
- GtkWidget *widget = gnac_profiles_utils_get_widget(bfi, name);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
- gnac_utils_str_equal(value, "true"));
-}
-
-
-void
-gnac_profiles_utils_set_values_check(BasicFormatInfo *bfi, ...)
-{
- va_list ap;
-
- va_start(ap, bfi);
- const gchar *name = va_arg(ap, const gchar *);
-
- while (name) {
- const gchar *value = va_arg(ap, const gchar *);
- gnac_profiles_utils_set_value_check(bfi, name, value);
- name = va_arg(ap, const gchar *);
- }
-
- va_end(ap);
-}
-
-
void
gnac_profiles_utils_get_values_check_and_set(BasicFormatInfo *bfi, ...)
{
diff --git a/src/profiles/gnac-profiles-utils.h b/src/profiles/gnac-profiles-utils.h
index 2267349..df0a434 100755
--- a/src/profiles/gnac-profiles-utils.h
+++ b/src/profiles/gnac-profiles-utils.h
@@ -88,15 +88,10 @@ gnac_profiles_utils_init_widget(BasicFormatInfo *bfi,
const gchar *xpath_query);
void
-gnac_profiles_utils_reset_values_combo(BasicFormatInfo *bfi, ...);
+gnac_profiles_utils_reset_values(BasicFormatInfo *bfi, ...);
void
-gnac_profiles_utils_set_value_combo(BasicFormatInfo *bfi,
- const gchar *combo_name,
- const gchar *value);
-
-void
-gnac_profiles_utils_set_values_combo(BasicFormatInfo *bfi, ...);
+gnac_profiles_utils_set_values(BasicFormatInfo *bfi, ...);
void
gnac_profiles_utils_set_values_checked_combo(BasicFormatInfo *bfi, ...);
@@ -111,12 +106,6 @@ void
gnac_profiles_utils_get_values_checked_combo_and_set(BasicFormatInfo *bfi, ...);
void
-gnac_profiles_utils_reset_values_slider(BasicFormatInfo *bfi, ...);
-
-void
-gnac_profiles_utils_set_values_slider(BasicFormatInfo *bfi, ...);
-
-void
gnac_profiles_utils_set_values_checked_slider(BasicFormatInfo *bfi, ...);
void
@@ -126,12 +115,6 @@ void
gnac_profiles_utils_get_values_checked_slider_and_set(BasicFormatInfo *bfi, ...);
void
-gnac_profiles_utils_reset_values_check(BasicFormatInfo *bfi, ...);
-
-void
-gnac_profiles_utils_set_values_check(BasicFormatInfo *bfi, ...);
-
-void
gnac_profiles_utils_get_values_check_and_set(BasicFormatInfo *bfi, ...);
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]