aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-dateedit.c28
-rw-r--r--widgets/misc/e-dateedit.h7
3 files changed, 43 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index a9c6d0eacd..7647180d75 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2001-11-05 JP Rosevear <jpr@ximian.com>
+
+ * e-dateedit.c (e_date_edit_set_date_and_time_of_day): set both
+ the date and the time of day in one call, creating only a single
+ changed signal
+
+ * e-dateedit.h: add proto
+
2001-11-05 Christopher James Lahey <clahey@ximian.com>
Based on a patch by Damon Chaplin <damon@ximian.com>
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index f865a25c34..09ba1ad2d9 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -798,6 +798,34 @@ e_date_edit_set_time_of_day (EDateEdit *dedit,
date_edit_signals [CHANGED]);
}
+void
+e_date_edit_set_date_and_time_of_day (EDateEdit *dedit,
+ gint year,
+ gint month,
+ gint day,
+ gint hour,
+ gint minute)
+{
+ EDateEditPrivate *priv;
+ gboolean date_changed, time_changed;
+
+ g_return_if_fail (E_IS_DATE_EDIT (dedit));
+
+ priv = dedit->priv;
+
+ date_changed = e_date_edit_set_date_internal (dedit, TRUE, FALSE,
+ year - 1900, month - 1, day);
+ time_changed = e_date_edit_set_time_internal (dedit, TRUE, FALSE,
+ hour, minute);
+
+ e_date_edit_update_date_entry (dedit);
+ e_date_edit_update_time_entry (dedit);
+ e_date_edit_update_time_combo_state (dedit);
+
+ if (date_changed || time_changed)
+ gtk_signal_emit (GTK_OBJECT (dedit),
+ date_edit_signals [CHANGED]);
+}
/**
* e_date_edit_get_show_date:
diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h
index 49ea443235..8e307c5d45 100644
--- a/widgets/misc/e-dateedit.h
+++ b/widgets/misc/e-dateedit.h
@@ -119,6 +119,13 @@ void e_date_edit_set_time_of_day (EDateEdit *dedit,
gint hour,
gint minute);
+void e_date_edit_set_date_and_time_of_day (EDateEdit *dedit,
+ gint year,
+ gint month,
+ gint day,
+ gint hour,
+ gint minute);
+
/* Whether we show the date field. */
gboolean e_date_edit_get_show_date (EDateEdit *dedit);
void e_date_edit_set_show_date (EDateEdit *dedit,