[rhythmbox] query-creator: set initial value for year criteria to the current year



commit 632885a4b5b9e0ce83a368462941bf0e26f523a4
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Sep 6 20:49:03 2009 +1000

    query-creator: set initial value for year criteria to the current year

 widgets/rb-query-creator-properties.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/widgets/rb-query-creator-properties.c b/widgets/rb-query-creator-properties.c
index 6e8a604..648cf44 100644
--- a/widgets/rb-query-creator-properties.c
+++ b/widgets/rb-query-creator-properties.c
@@ -367,7 +367,14 @@ integerCriteriaGetWidgetData (GtkWidget *widget, GValue *val)
 static GtkWidget *
 yearCriteriaCreateWidget (gboolean *constrain)
 {
-	return gtk_spin_button_new_with_range (0.0, (double)G_MAXINT, 1.0);
+	GtkWidget *spin;
+	GDate date = {0, };
+	spin = gtk_spin_button_new_with_range (0.0, (double)G_MAXINT, 1.0);
+
+	/* set it to the current year */
+	g_date_set_time_t (&date, time (NULL));
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), g_date_get_year (&date));
+	return spin;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]