From 13ef654ef7766db0bd74945607279ec56e49863d Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 7 Nov 2000 21:43:28 +0000 Subject: Added a "changed" signal to notify of changes to the set of selected days. 2000-11-07 Federico Mena Quintero * gui/weekday-picker.h (WeekdayPickerClass): Added a "changed" signal to notify of changes to the set of selected days. * gui/weekday-picker.c (weekday_picker_class_init): Create the "changed" signal. (weekday_picker_set_days): Emit the "changed" signal. svn path=/trunk/; revision=6487 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/weekday-picker.c | 23 ++++++++++++++++++++++- calendar/gui/weekday-picker.h | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index a7616b3728..8a79a0a802 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2000-11-07 Federico Mena Quintero + + * gui/weekday-picker.h (WeekdayPickerClass): Added a "changed" + signal to notify of changes to the set of selected days. + + * gui/weekday-picker.c (weekday_picker_class_init): Create the + "changed" signal. + (weekday_picker_set_days): Emit the "changed" signal. + 2000-11-06 Jesse Pavel *gui/e-itip-control.c, gui/e-itip-control.glade: changed to GUI to diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index a9a0d50c7c..8ebcf1d970 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -52,6 +52,12 @@ struct _WeekdayPickerPrivate { +/* Signal IDs */ +enum { + CHANGED, + LAST_SIGNAL +}; + static void weekday_picker_class_init (WeekdayPickerClass *class); static void weekday_picker_init (WeekdayPicker *wp); static void weekday_picker_finalize (GtkObject *object); @@ -63,6 +69,8 @@ static void weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_styl static GnomeCanvasClass *parent_class; +static guint wp_signals[LAST_SIGNAL]; + /** @@ -108,12 +116,24 @@ weekday_picker_class_init (WeekdayPickerClass *class) parent_class = gtk_type_class (GNOME_TYPE_CANVAS); + wp_signals[CHANGED] = + gtk_signal_new ("changed", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (WeekdayPickerClass, changed), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + + gtk_object_class_add_signals (object_class, wp_signals, LAST_SIGNAL); + object_class->finalize = weekday_picker_finalize; widget_class->realize = weekday_picker_realize; widget_class->size_request = weekday_picker_size_request; widget_class->size_allocate = weekday_picker_size_allocate; widget_class->style_set = weekday_picker_style_set; + + class->changed = NULL; } /* Event handler for the day items */ @@ -187,7 +207,6 @@ create_items (WeekdayPicker *wp) gtk_signal_connect (GTK_OBJECT (priv->labels[i]), "event", GTK_SIGNAL_FUNC (day_event_cb), wp); - } } @@ -470,6 +489,8 @@ weekday_picker_set_days (WeekdayPicker *wp, guint8 day_mask) priv->day_mask = day_mask; colorize_items (wp); + + gtk_signal_emit (GTK_OBJECT (wp), wp_signals[CHANGED]); } /** diff --git a/calendar/gui/weekday-picker.h b/calendar/gui/weekday-picker.h index df053a1f6f..cd24bb86e4 100644 --- a/calendar/gui/weekday-picker.h +++ b/calendar/gui/weekday-picker.h @@ -49,6 +49,8 @@ struct _WeekdayPicker { struct _WeekdayPickerClass { GnomeCanvasClass parent_class; + + void (* changed) (WeekdayPicker *wp); }; GtkType weekday_picker_get_type (void); -- cgit v1.2.3