aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-10-31 00:02:52 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-10-31 00:02:52 +0800
commit8c5b8895b6a6482849a0f5cd3e0c78026f0e6f22 (patch)
tree8fefc19030a9cea97ad66a186178825dbde81f20 /calendar/gui
parentbf081d102ca3d9b154f5af26437e11e7e1badcf1 (diff)
downloadgsoc2013-evolution-8c5b8895b6a6482849a0f5cd3e0c78026f0e6f22.tar.gz
gsoc2013-evolution-8c5b8895b6a6482849a0f5cd3e0c78026f0e6f22.tar.zst
gsoc2013-evolution-8c5b8895b6a6482849a0f5cd3e0c78026f0e6f22.zip
Do not take in an extra data pointer. (summary_changed_cb): Use a single
2000-10-30 Federico Mena Quintero <federico@helixcode.com> * gui/event-editor.c (sync_entries): Do not take in an extra data pointer. (summary_changed_cb): Use a single call back to sync both entries. (sync_date_edits): New function to sync two EDateEdit widgets. (init_widgets): Connect the general and recurrence starting date widgets. svn path=/trunk/; revision=6268
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/event-editor.c61
1 files changed, 36 insertions, 25 deletions
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index df6e978c08..f68bac0480 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -726,51 +726,55 @@ get_widgets (EventEditor *ee)
&& priv->recurrence_exception_delete);
}
-/* Syncs the contents of two entry widgets, while blocking signals on the
- * specified data.
+/* Syncs the contents of two entry widgets, while blocking signals from each
+ * other.
*/
static void
-sync_entries (GtkWidget *source, GtkWidget *dest, gpointer data)
+sync_entries (GtkEditable *source, GtkEditable *dest)
{
char *str;
- gtk_signal_handler_block_by_data (GTK_OBJECT (dest), data);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (dest), source);
- str = gtk_editable_get_chars (GTK_EDITABLE (source), 0, -1);
+ str = gtk_editable_get_chars (source, 0, -1);
gtk_entry_set_text (GTK_ENTRY (dest), str);
g_free (str);
- gtk_signal_handler_unblock_by_data (GTK_OBJECT (dest), data);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (dest), source);
}
-/* Callback used when the general summary changes; we sync the recurrence
- * summary to it.
+/* Syncs the contents of two date editor widgets, while blocking signals from
+ * each other.
*/
static void
-general_summary_changed_cb (GtkEditable *editable, gpointer data)
+sync_date_edits (EDateEdit *source, EDateEdit *dest)
{
- EventEditor *ee;
- EventEditorPrivate *priv;
+ time_t t;
- ee = EVENT_EDITOR (data);
- priv = ee->priv;
+ gtk_signal_handler_block_by_data (GTK_OBJECT (dest), source);
- sync_entries (priv->general_summary, priv->recurrence_summary, ee);
+ t = e_date_edit_get_time (source);
+ e_date_edit_set_time (dest, t);
+
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (dest), source);
}
-/* Callback used when the recurrence summary changes; we sync the general
- * summary to it.
+/* Callback used when one of the general or recurrence summary entries change;
+ * we sync the other entry to it.
*/
static void
-recurrence_summary_changed_cb (GtkEditable *editable, gpointer data)
+summary_changed_cb (GtkEditable *editable, gpointer data)
{
- EventEditor *ee;
- EventEditorPrivate *priv;
-
- ee = EVENT_EDITOR (data);
- priv = ee->priv;
+ sync_entries (editable, GTK_EDITABLE (data));
+}
- sync_entries (priv->recurrence_summary, priv->general_summary, ee);
+/* Callback used when one of the general or recurrence starting date widgets
+ * change; we sync the other date editor to it.
+ */
+static void
+start_date_changed_cb (EDateEdit *de, gpointer data)
+{
+ sync_date_edits (de, E_DATE_EDIT (data));
}
/* Hooks the widget signals */
@@ -785,9 +789,16 @@ init_widgets (EventEditor *ee)
/* Summary in the main and recurrence pages */
gtk_signal_connect (GTK_OBJECT (priv->general_summary), "changed",
- GTK_SIGNAL_FUNC (general_summary_changed_cb), ee);
+ GTK_SIGNAL_FUNC (summary_changed_cb), priv->recurrence_summary);
gtk_signal_connect (GTK_OBJECT (priv->recurrence_summary), "changed",
- GTK_SIGNAL_FUNC (recurrence_summary_changed_cb), ee);
+ GTK_SIGNAL_FUNC (summary_changed_cb), priv->general_summary);
+
+ /* Start dates in the main and recurrence pages */
+
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "date_changed",
+ GTK_SIGNAL_FUNC (start_date_changed_cb), priv->recurrence_starting_date);
+ gtk_signal_connect (GTK_OBJECT (priv->recurrence_starting_date), "date_changed",
+ GTK_SIGNAL_FUNC (start_date_changed_cb), priv->start_time);
/* Start and end times */