diff options
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 17 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 56 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.glade | 15 |
3 files changed, 84 insertions, 4 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 86c8116bdb..290b25afa3 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -1169,6 +1169,22 @@ key_press_event(GtkWidget *widget, GdkEventKey *event) return FALSE; } +static gint +editor_key_press_event(GtkWidget *widget, GdkEventKey *event, CompEditor *editor) +{ + EAttachmentBar *bar = E_ATTACHMENT_BAR (widget); + + if (event->keyval == GDK_Escape) { + commit_all_fields (editor); + + if (prompt_to_save_changes (editor, TRUE)) + close_dialog (editor); + + return TRUE; + } + + return FALSE; +} /* Menu callbacks */ static void menu_file_save_cb (BonoboUIComponent *uic, @@ -1338,6 +1354,7 @@ setup_widgets (CompEditor *editor) gtk_notebook_set_show_tabs (priv->notebook, FALSE); g_signal_connect (editor, "delete_event", G_CALLBACK (delete_event_cb), editor); + g_signal_connect (editor, "key_press_event", G_CALLBACK (editor_key_press_event), editor); /*Attachments */ priv->attachment_scrolled_window = gtk_scrolled_window_new (NULL, NULL); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index b4aaa77930..f58fc61829 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -45,6 +45,7 @@ #include "../e-timezone-entry.h" #include <e-util/e-dialog-utils.h> #include <e-util/e-dialog-widgets.h> +#include <e-util/e-icon-factory.h> #include <e-util/e-util-private.h> #include "../e-meeting-attendee.h" @@ -64,7 +65,6 @@ struct _EventPagePrivate { /* Glade XML data */ GladeXML *xml; - /* Widgets from the Glade file */ GtkWidget *main; @@ -98,6 +98,9 @@ struct _EventPagePrivate { GtkWidget *end_timezone; GtkWidget *timezone_label; gboolean all_day_event; + GtkWidget *status_icons; + GtkWidget *alarm_icon; + GtkWidget *recur_icon; GtkWidget *description; @@ -214,6 +217,9 @@ event_page_init (EventPage *epage) priv->end_timezone = NULL; priv->timezone_label = NULL; priv->all_day_event = FALSE; + priv->status_icons = NULL; + priv->alarm_icon = NULL; + priv->recur_icon = NULL; priv->description = NULL; priv->classification = E_CAL_COMPONENT_CLASS_NONE; priv->show_time_as_busy = FALSE; @@ -752,6 +758,23 @@ event_page_set_classification (EventPage *epage, ECalComponentClassification cla epage->priv->classification = class; } +static GtkWidget * +create_image_event_box (const char *image_text, const char *tip_text) +{ + GtkWidget *image, *box; + GtkTooltips *tip; + + box = gtk_event_box_new (); + tip = gtk_tooltips_new (); + image = e_icon_factory_get_image (image_text, E_ICON_SIZE_MENU); + + gtk_container_add ((GtkContainer *) box, image); + gtk_widget_show_all (box); + gtk_tooltips_set_tip (tip, box, tip_text, NULL); + + return box; +} + static void sensitize_widgets (EventPage *epage) { @@ -772,6 +795,11 @@ sensitize_widgets (EventPage *epage) custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL); alarm = e_dialog_toggle_get (priv->alarm); + + if (alarm && !priv->alarm_icon) { + priv->alarm_icon = create_image_event_box ("stock_bell", "This event has alarms"); + gtk_box_pack_start ((GtkBox *)priv->status_icons, priv->alarm_icon, FALSE, FALSE, 3); + } gtk_entry_set_editable (GTK_ENTRY (priv->summary), sensitize); gtk_entry_set_editable (GTK_ENTRY (priv->location), sensitize); @@ -2027,6 +2055,9 @@ get_widgets (EventPage *epage) priv->timezone_label = GW ("timezone-label"); priv->start_timezone = GW ("start-timezone"); priv->end_timezone = priv->start_timezone; + priv->status_icons = GW ("status-icons"); + + gtk_widget_show (priv->status_icons); if (!calendar_config_get_show_timezone()) { gtk_widget_hide (priv->timezone_label); @@ -2502,8 +2533,17 @@ alarm_changed_cb (GtkWidget *widget, gpointer data) icalcomponent_add_property (icalcomp, icalprop); e_alarm_list_append (priv->alarm_list_store, NULL, ca); + + if (!priv->alarm_icon) { + priv->alarm_icon = create_image_event_box ("stock_bell", "This event has alarms"); + gtk_box_pack_start ((GtkBox *)priv->status_icons, priv->alarm_icon, FALSE, FALSE, 3); + } } else { e_alarm_list_clear (priv->alarm_list_store); + if (priv->alarm_icon) { + gtk_container_remove (priv->status_icons, priv->alarm_icon); + priv->alarm_icon = NULL; + } } sensitize_widgets (epage); @@ -2692,8 +2732,10 @@ init_widgets (EventPage *epage) } g_signal_connect (priv->alarm, - "toggled", G_CALLBACK (alarm_changed_cb), + "toggled", G_CALLBACK (field_changed_cb), epage); + g_signal_connect (priv->alarm_time, "changed", + G_CALLBACK (field_changed_cb), epage); g_signal_connect (priv->alarm_custom, "clicked", G_CALLBACK (alarm_custom_clicked_cb), epage); @@ -2715,8 +2757,6 @@ init_widgets (EventPage *epage) g_signal_connect (priv->alarm, "toggled", G_CALLBACK (alarm_changed_cb), epage); - g_signal_connect (priv->alarm_custom, "clicked", - G_CALLBACK (alarm_custom_clicked_cb), epage); /* Set the default timezone, so the timezone entry may be hidden. */ zone = calendar_config_get_icaltimezone (); @@ -2889,6 +2929,14 @@ event_page_create_source_option_menu (void) return menu; } +GtkWidget *make_status_icons (void); + +GtkWidget * +make_status_icons (void) +{ + return gtk_hbox_new (FALSE, 2); +} + static void set_attendees (ECalComponent *comp, const GPtrArray *attendees) { diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade index c86b8b5890..e55bfedbb8 100644 --- a/calendar/gui/dialogs/event-page.glade +++ b/calendar/gui/dialogs/event-page.glade @@ -689,6 +689,21 @@ <property name="fill">True</property> </packing> </child> + + <child> + <widget class="Custom" id="status-icons"> + <property name="visible">True</property> + <property name="creation_function">make_status_icons</property> + <property name="int1">0</property> + <property name="int2">0</property> + <property name="last_modification_time">Thu, 24 Nov 2005 07:10:06 GMT</property> + </widget> + <packing> + <property name="padding">4</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> |