diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-10-28 11:57:24 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-10-28 11:57:24 +0800 |
commit | 85cc391f1a403157837f5d9aa8e681f57a32afc0 (patch) | |
tree | cb49587dfcc317f6f759001445d838272873c87d /calendar/gui/event-editor.c | |
parent | 88116cf2ea5d12b4d9e954fa004a6f72474d72ec (diff) | |
download | gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.tar gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.tar.gz gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.tar.bz2 gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.tar.lz gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.tar.xz gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.tar.zst gsoc2013-evolution-85cc391f1a403157837f5d9aa8e681f57a32afc0.zip |
New function. (general_summary_changed_cb): Sync the general summary to
2000-10-27 Federico Mena Quintero <federico@helixcode.com>
* gui/event-editor.c (sync_entries): New function.
(general_summary_changed_cb): Sync the general summary to the
recurrence summary widget.
(recurrence_summary_changed_cb): Vice-versa.
(init_widgets): Hook to the summaries.
* event-editor-dialog.glade: Do not expand/fill the start and end
date so that the "all day event" button is not pushed all the way
to the right.
Decrease the spacing between the recurrence sentence widgets.
Remove a spurious empty label that was lurking around the
recurrence widgets.
Make the alarm widgets expand the right way.
Delete old recurrence widgets.
svn path=/trunk/; revision=6246
Diffstat (limited to 'calendar/gui/event-editor.c')
-rw-r--r-- | calendar/gui/event-editor.c | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c index 92eb6816e1..df6e978c08 100644 --- a/calendar/gui/event-editor.c +++ b/calendar/gui/event-editor.c @@ -336,7 +336,7 @@ make_recur_weekly_special (EventEditor *ee) /* Create the widgets */ - hbox = gtk_hbox_new (FALSE, 4); + hbox = gtk_hbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (priv->recurrence_special), hbox); label = gtk_label_new (_("on")); @@ -460,7 +460,7 @@ make_recur_ending_count_special (EventEditor *ee) /* Create the widgets */ - hbox = gtk_hbox_new (FALSE, 4); + hbox = gtk_hbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (priv->recurrence_ending_special), hbox); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 10000, 1, 10, 10)); @@ -726,6 +726,53 @@ get_widgets (EventEditor *ee) && priv->recurrence_exception_delete); } +/* Syncs the contents of two entry widgets, while blocking signals on the + * specified data. + */ +static void +sync_entries (GtkWidget *source, GtkWidget *dest, gpointer data) +{ + char *str; + + gtk_signal_handler_block_by_data (GTK_OBJECT (dest), data); + + str = gtk_editable_get_chars (GTK_EDITABLE (source), 0, -1); + gtk_entry_set_text (GTK_ENTRY (dest), str); + g_free (str); + + gtk_signal_handler_unblock_by_data (GTK_OBJECT (dest), data); +} + +/* Callback used when the general summary changes; we sync the recurrence + * summary to it. + */ +static void +general_summary_changed_cb (GtkEditable *editable, gpointer data) +{ + EventEditor *ee; + EventEditorPrivate *priv; + + ee = EVENT_EDITOR (data); + priv = ee->priv; + + sync_entries (priv->general_summary, priv->recurrence_summary, ee); +} + +/* Callback used when the recurrence summary changes; we sync the general + * summary to it. + */ +static void +recurrence_summary_changed_cb (GtkEditable *editable, gpointer data) +{ + EventEditor *ee; + EventEditorPrivate *priv; + + ee = EVENT_EDITOR (data); + priv = ee->priv; + + sync_entries (priv->recurrence_summary, priv->general_summary, ee); +} + /* Hooks the widget signals */ static void init_widgets (EventEditor *ee) @@ -735,6 +782,13 @@ init_widgets (EventEditor *ee) priv = ee->priv; + /* 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_connect (GTK_OBJECT (priv->recurrence_summary), "changed", + GTK_SIGNAL_FUNC (recurrence_summary_changed_cb), ee); + /* Start and end times */ gtk_signal_connect (GTK_OBJECT (priv->start_time), "date_changed", @@ -840,7 +894,7 @@ clear_widgets (EventEditor *ee) /* Summary, description */ - e_dialog_editable_set (priv->general_summary, NULL); + e_dialog_editable_set (priv->general_summary, NULL); /* will also change recur summary */ e_dialog_editable_set (priv->description, NULL); /* Start and end times */ @@ -1161,7 +1215,7 @@ fill_widgets (EventEditor *ee) /* Summary, description(s) */ cal_component_get_summary (priv->comp, &text); - e_dialog_editable_set (priv->general_summary, text.value); + e_dialog_editable_set (priv->general_summary, text.value); /* will also set recur summary */ cal_component_get_description_list (priv->comp, &l); if (l) { |