[gnome-calendar] time-selector: update label when hour or minute changes
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] time-selector: update label when hour or minute changes
- Date: Thu, 18 Dec 2014 14:59:20 +0000 (UTC)
commit 1c76779143012df0b445cdfab558f93ac90e8fa2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Dec 17 16:28:26 2014 -0200
time-selector: update label when hour or minute changes
src/gcal-time-selector.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-time-selector.c b/src/gcal-time-selector.c
index 04f6ecc..1eadfc4 100644
--- a/src/gcal-time-selector.c
+++ b/src/gcal-time-selector.c
@@ -56,6 +56,9 @@ static gboolean on_output (GtkSpinButton
static void period_changed (GtkComboBox *combo,
gpointer user_data);
+static void time_changed (GtkAdjustment *adjustment,
+ gpointer user_data);
+
static void gcal_time_selector_constructed (GObject *object);
G_DEFINE_TYPE_WITH_PRIVATE (GcalTimeSelector, gcal_time_selector, GTK_TYPE_TOGGLE_BUTTON);
@@ -125,6 +128,13 @@ period_changed (GtkComboBox *combo,
}
static void
+time_changed (GtkAdjustment *adjustment,
+ gpointer user_data)
+{
+ format_date_label (GCAL_TIME_SELECTOR (user_data));
+}
+
+static void
gcal_time_selector_class_init (GcalTimeSelectorClass *klass)
{
GObjectClass *object_class;
@@ -223,6 +233,12 @@ gcal_time_selector_constructed (GObject *object)
}
/* signals */
+ adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->hour_spin));
+ g_signal_connect (adj, "value-changed", G_CALLBACK (time_changed), object);
+
+ adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->minute_spin));
+ g_signal_connect (adj, "value-changed", G_CALLBACK (time_changed), object);
+
g_signal_connect (priv->period_combo, "changed", G_CALLBACK (period_changed), object);
g_signal_connect (priv->hour_spin, "output", G_CALLBACK (on_output), object);
g_signal_connect (priv->minute_spin, "output", G_CALLBACK (on_output), object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]