[gthumb] Add "int-max" property to define upper range limit of integer filter
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] Add "int-max" property to define upper range limit of integer filter
- Date: Thu, 4 Apr 2013 10:36:19 +0000 (UTC)
commit 91af377f6b42c27943bf1aabee7c0e349309ea31
Author: Louis-Marie Mouton <lm mouton gmail com>
Date: Wed Apr 3 19:21:10 2013 +0200
Add "int-max" property to define upper range limit of integer filter
For some reason, this doesn't seem to be working...
gthumb/gth-main-default-tests.c | 1 +
gthumb/gth-test-simple.c | 24 ++++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-main-default-tests.c b/gthumb/gth-main-default-tests.c
index a490c8a..e3c8834 100644
--- a/gthumb/gth-main-default-tests.c
+++ b/gthumb/gth-main-default-tests.c
@@ -344,6 +344,7 @@ gth_main_register_default_tests (void)
"display-name", _("Rating"),
"data-type", GTH_TEST_DATA_TYPE_INT,
"get-data-func", get_embedded_rating_for_test,
+ "int-max", 5,
NULL);
gth_main_register_object (GTH_TYPE_TEST,
"general::tags",
diff --git a/gthumb/gth-test-simple.c b/gthumb/gth-test-simple.c
index ffa936b..6ff9edb 100644
--- a/gthumb/gth-test-simple.c
+++ b/gthumb/gth-test-simple.c
@@ -86,7 +86,8 @@ enum {
PROP_DATA_AS_DATE,
PROP_GET_DATA,
PROP_OP,
- PROP_NEGATIVE
+ PROP_NEGATIVE,
+ PROP_INT_MAX
};
@@ -101,6 +102,7 @@ struct _GthTestSimplePrivate
GthTestGetData get_data;
GthTestOp op;
gboolean negative;
+ gint64 int_max;
GPatternSpec *pattern;
gboolean has_focus;
GtkWidget *text_entry;
@@ -270,7 +272,7 @@ create_control_for_integer (GthTestSimple *test)
/* spin button */
- test->priv->spinbutton = gtk_spin_button_new_with_range (0, 5, 1);
+ test->priv->spinbutton = gtk_spin_button_new_with_range (0, test->priv->int_max, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (test->priv->spinbutton), 0);
gtk_widget_show (test->priv->spinbutton);
@@ -1076,6 +1078,10 @@ gth_test_simple_set_property (GObject *object,
test->priv->negative = g_value_get_boolean (value);
break;
+ case PROP_INT_MAX:
+ test->priv->int_max = g_value_get_int (value);
+ break;
+
default:
break;
}
@@ -1121,6 +1127,10 @@ gth_test_simple_get_property (GObject *object,
g_value_set_boolean (value, test->priv->negative);
break;
+ case PROP_INT_MAX:
+ g_value_set_int (value, test->priv->int_max);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -1198,6 +1208,16 @@ gth_test_simple_class_init (GthTestSimpleClass *class)
"Whether to negate the test result",
FALSE,
G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_INT_MAX,
+ g_param_spec_int ("int-max",
+ "Integer Max",
+ "Max integer value",
+ G_MININT,
+ G_MAXINT,
+ 0,
+ G_PARAM_READWRITE));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]