diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-08 12:26:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-08 12:26:12 +0800 |
commit | cea054cd54d84479352a43bbabc19c9ce9af5efb (patch) | |
tree | ba02763209ba0f22989024004f57689071603ec5 /calendar/gui | |
parent | 91a6b6899e5568ed34f913bedb538dd6c9e35b32 (diff) | |
download | gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.gz gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.zst gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.zip |
Merge revisions 35747:35930 from trunk.
svn path=/branches/kill-bonobo/; revision=35931
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/GNOME_Evolution_Calendar.server.in.in | 10 | ||||
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 17 | ||||
-rw-r--r-- | calendar/gui/calendar-component.c | 14 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-list-dialog.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/changed-comp.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/delete-error.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/select-source-dialog.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 209 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/memos-component.c | 8 | ||||
-rw-r--r-- | calendar/gui/memotypes.xml | 4 | ||||
-rw-r--r-- | calendar/gui/print.c | 171 | ||||
-rw-r--r-- | calendar/gui/tasks-component.c | 8 |
17 files changed, 374 insertions, 87 deletions
diff --git a/calendar/gui/GNOME_Evolution_Calendar.server.in.in b/calendar/gui/GNOME_Evolution_Calendar.server.in.in index 577efc4130..ad228ff451 100644 --- a/calendar/gui/GNOME_Evolution_Calendar.server.in.in +++ b/calendar/gui/GNOME_Evolution_Calendar.server.in.in @@ -47,7 +47,7 @@ <oaf_attribute name="evolution:menu_accelerator" type="string" value="*Control*3"/> <oaf_attribute name="evolution:button_label" type="string" _value="Calendars"/> <oaf_attribute name="evolution:button_tooltips" type="string" _value="Calendars"/> - <oaf_attribute name="evolution:button_icon" type="string" value="stock_calendar"/> + <oaf_attribute name="evolution:button_icon" type="string" value="x-office-calendar"/> <oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/> <!-- FIXME: See bug 407104: Write a interface to launch without shell. @@ -74,8 +74,8 @@ <oaf_attribute name="evolution:menu_accelerator" type="string" value="*Control*4"/> <oaf_attribute name="evolution:button_label" type="string" _value="Tasks"/> <oaf_attribute name="evolution:button_tooltips" type="string" _value="Tasks"/> - <oaf_attribute name="evolution:button_icon" type="string" value="stock_todo"/> - <oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/> + <oaf_attribute name="evolution:button_icon" type="string" value="evolution-tasks"/> + <oaf_attribute name="evolution:button_sort_order" type="string" value="-7"/> <oaf_attribute name="evolution:uri_schemas" type="stringv"> <item value="task"/> @@ -99,8 +99,8 @@ <oaf_attribute name="evolution:menu_accelerator" type="string" value="*Control*5"/> <oaf_attribute name="evolution:button_label" type="string" _value="Memos"/> <oaf_attribute name="evolution:button_tooltips" type="string" _value="Memos"/> - <oaf_attribute name="evolution:button_icon" type="string" value="stock_notes"/> - <oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/> + <oaf_attribute name="evolution:button_icon" type="string" value="evolution-memos"/> + <oaf_attribute name="evolution:button_sort_order" type="string" value="-6"/> </oaf_server> <oaf_server iid="OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:@VERSION@" diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 9bc19d4aad..219dfdc82d 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -79,7 +79,7 @@ static GList *tray_icons_list = NULL; /* Top Tray Image */ static GtkStatusIcon *tray_icon = NULL; static int tray_blink_id = -1; -static int tray_blink_state = FALSE; +static int tray_blink_countdown = 0; static AlarmNotify *an; /* Structure that stores a client we are monitoring */ @@ -1383,11 +1383,13 @@ popup_menu (GtkStatusIcon *icon, guint button, guint activate_time) static gboolean tray_icon_blink_cb (gpointer data) { + static gboolean tray_blink_state = FALSE; GdkPixbuf *pixbuf; - tray_blink_state = tray_blink_state == TRUE ? FALSE: TRUE; + tray_blink_countdown--; + tray_blink_state = !tray_blink_state; - pixbuf = e_icon_factory_get_icon (tray_blink_state == TRUE? + pixbuf = e_icon_factory_get_icon ((tray_blink_state || tray_blink_countdown <= 0)? "stock_appointment-reminder-excl" : "stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR); @@ -1396,7 +1398,10 @@ tray_icon_blink_cb (gpointer data) gtk_status_icon_set_from_pixbuf (tray_icon, pixbuf); g_object_unref (pixbuf); - return TRUE; + if (tray_blink_countdown <= 0) + tray_blink_id = -1; + + return tray_blink_countdown > 0; } @@ -1536,8 +1541,10 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, open_alarm_dialog (tray_data); gtk_window_stick (GTK_WINDOW (alarm_notifications_dialog->dialog)); } else { - if (tray_blink_id == -1) + if (tray_blink_id == -1) { + tray_blink_countdown = 30; tray_blink_id = g_timeout_add (500, tray_icon_blink_cb, tray_data); + } } } diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 5ec0c400dc..b30729c554 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -613,7 +613,7 @@ edit_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) } static EPopupItem ecc_source_popups[] = { - { E_POPUP_ITEM, "10.new", N_("_New Calendar"), new_calendar_cb, NULL, "stock_calendar", 0, 0 }, + { E_POPUP_ITEM, "10.new", N_("_New Calendar"), new_calendar_cb, NULL, "x-office-calendar", 0, 0 }, { E_POPUP_ITEM, "15.copy", N_("_Copy..."), copy_calendar_cb, NULL, "edit-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY }, { E_POPUP_BAR, "20.bar" }, @@ -1399,7 +1399,7 @@ create_component_view (CalendarComponent *calendar_component) GTK_SHADOW_IN); gtk_widget_show (selector_scrolled_window); - component_view->info_label = (EInfoLabel *)e_info_label_new("stock_calendar"); + component_view->info_label = (EInfoLabel *)e_info_label_new("x-office-calendar"); e_info_label_set_info (component_view->info_label, _("Calendars"), ""); gtk_widget_show (GTK_WIDGET (component_view->info_label)); @@ -1594,7 +1594,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[0].id = CREATE_EVENT_ID; list->_buffer[0].description = _("New appointment"); - list->_buffer[0].menuDescription = _("_Appointment"); + list->_buffer[0].menuDescription = (char *) C_("New", "_Appointment"); list->_buffer[0].tooltip = _("Create a new appointment"); list->_buffer[0].menuShortcut = 'a'; list->_buffer[0].iconName = "appointment-new"; @@ -1602,7 +1602,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[1].id = CREATE_MEETING_ID; list->_buffer[1].description = _("New meeting"); - list->_buffer[1].menuDescription = _("M_eeting"); + list->_buffer[1].menuDescription = (char *) C_("New", "M_eeting"); list->_buffer[1].tooltip = _("Create a new meeting request"); list->_buffer[1].menuShortcut = 'e'; list->_buffer[1].iconName = "stock_new-meeting"; @@ -1610,7 +1610,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[2].id = CREATE_ALLDAY_EVENT_ID; list->_buffer[2].description = _("New all day appointment"); - list->_buffer[2].menuDescription = _("All Day A_ppointment"); + list->_buffer[2].menuDescription = (char *) C_("New", "All Day A_ppointment"); list->_buffer[2].tooltip = _("Create a new all-day appointment"); list->_buffer[2].menuShortcut = '\0'; list->_buffer[2].iconName = "stock_new-24h-appointment"; @@ -1618,10 +1618,10 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[3].id = CREATE_CALENDAR_ID; list->_buffer[3].description = _("New calendar"); - list->_buffer[3].menuDescription = _("Cale_ndar"); + list->_buffer[3].menuDescription = (char *) C_("New", "Cale_ndar"); list->_buffer[3].tooltip = _("Create a new calendar"); list->_buffer[3].menuShortcut = '\0'; - list->_buffer[3].iconName = "stock_calendar"; + list->_buffer[3].iconName = "x-office-calendar"; list->_buffer[3].type = GNOME_Evolution_CREATABLE_FOLDER; return list; diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index 9a57a9c8e5..48402bbab3 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -1178,7 +1178,7 @@ alarm_dialog_run (GtkWidget *parent, ECal *ecal, ECalComponentAlarm *alarm) gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->vbox), 0); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->action_area), 12); - icon_list = e_icon_factory_get_icon_list ("stock_calendar"); + icon_list = e_icon_factory_get_icon_list ("x-office-calendar"); if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (dialog.toplevel), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index 99230f667e..8bce8f0eaa 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -293,7 +293,7 @@ alarm_list_dialog_run (GtkWidget *parent, ECal *ecal, EAlarmList *list_store) gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->vbox), 0); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->action_area), 12); - icon_list = e_icon_factory_get_icon_list ("stock_calendar"); + icon_list = e_icon_factory_get_icon_list ("x-office-calendar"); if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (dialog.toplevel), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c index c2d5f4e365..c994fb6303 100644 --- a/calendar/gui/dialogs/changed-comp.c +++ b/calendar/gui/dialogs/changed-comp.c @@ -105,7 +105,7 @@ changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean delet GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", str); - icon_list = e_icon_factory_get_icon_list ("stock_calendar"); + icon_list = e_icon_factory_get_icon_list ("x-office-calendar"); if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (dialog), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index ae56633d85..9a08009b6c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -927,7 +927,7 @@ update_window_border (CompEditor *editor, if (editor->priv->comp == NULL) { title = g_strdup (_("Edit Appointment")); - icon_name = "stock_calendar"; + icon_name = "x-office-calendar"; goto exit; } else switch (e_cal_component_get_vtype (editor->priv->comp)) { diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index 6c5462837d..d1280da16a 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -106,7 +106,7 @@ delete_error_dialog (GError *error, ECalComponentVType vtype) GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", str); if (vtype == E_CAL_COMPONENT_EVENT) - icon_list = e_icon_factory_get_icon_list ("stock_calendar"); + icon_list = e_icon_factory_get_icon_list ("x-office-calendar"); else if (vtype == E_CAL_COMPONENT_TODO) icon_list = e_icon_factory_get_icon_list ("stock_todo"); diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index 624cfe90fe..a669dfcafc 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -58,7 +58,7 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) dialog = e_source_selector_dialog_new (parent, source_list); if (obj_type == E_CAL_SOURCE_TYPE_EVENT) - icon_list = e_icon_factory_get_icon_list ("stock_calendar"); + icon_list = e_icon_factory_get_icon_list ("x-office-calendar"); else if (obj_type == E_CAL_SOURCE_TYPE_TODO) icon_list = e_icon_factory_get_icon_list ("stock_todo"); else if (obj_type == E_CAL_SOURCE_TYPE_JOURNAL) diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index bfc0a12e2d..487ed4e9c5 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -522,6 +522,9 @@ date_changed_cb (EDateEdit *dedit, icalproperty_status status; gboolean date_set; + tdpage = TASK_DETAILS_PAGE (data); + priv = tdpage->priv; + if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tdpage))) return; diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 7c5400568c..31c10b5dc2 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -1482,6 +1482,9 @@ date_changed_cb (EDateEdit *dedit, struct icaltimetype start_tt = icaltime_null_time(); struct icaltimetype due_tt = icaltime_null_time(); + tpage = TASK_PAGE (data); + priv = tpage->priv; + if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index e7c0efe417..4038c73c04 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -37,6 +37,7 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> #include <gnome.h> +#include <gtk/gtktooltip.h> #include <misc/e-gui-utils.h> #include <table/e-cell-checkbox.h> #include <table/e-cell-toggle.h> @@ -46,6 +47,8 @@ #include <e-util/e-util-private.h> #include <misc/e-cell-date-edit.h> #include <misc/e-cell-percent.h> +#include <libecal/e-cal-time-util.h> +#include <libedataserver/e-time-utils.h> #include "calendar-component.h" #include "calendar-config.h" @@ -54,6 +57,7 @@ #include "dialogs/task-editor.h" #include "e-cal-model-tasks.h" #include "e-calendar-table.h" +#include "e-calendar-view.h" #include "e-cell-date-edit-text.h" #include "e-comp-editor-registry.h" #include "print.h" @@ -260,6 +264,209 @@ row_appended_cb (ECalModel *model, ECalendarTable *cal_table) } static void +get_time_as_text (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone, char *buff, int buff_len) +{ + struct tm tmp_tm; + + buff [0] = 0; + + tmp_tm = icaltimetype_to_tm_with_zone (tt, f_zone, t_zone); + e_time_format_date_and_time (&tmp_tm, + calendar_config_get_24_hour_format (), + FALSE, FALSE, + buff, buff_len); +} + +static gboolean +query_tooltip_cb (GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +{ + ECalendarTable *cal_table; + ECalModelComponent *comp; + int row = -1, col = -1; + GtkWidget *box, *l, *w; + GtkStyle *style = gtk_widget_get_default_style (); + char *tmp; + const char *str; + GString *tmp2; + char buff[1001]; + gboolean free_text = FALSE; + ECalComponent *new_comp; + ECalComponentOrganizer organizer; + ECalComponentDateTime dtstart, dtdue; + icaltimezone *zone, *default_zone; + GSList *desc, *p; + int len; + ETable *etable; + ESelectionModel *esm; + + if (keyboard_mode) + return FALSE; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (E_IS_CALENDAR_TABLE (user_data), FALSE); + g_return_val_if_fail (tooltip != NULL, FALSE); + + cal_table = E_CALENDAR_TABLE (user_data); + + etable = e_calendar_table_get_table (cal_table); + e_table_get_mouse_over_cell (etable, x, y, &row, &col); + if (row == -1 || !etable) + return FALSE; + + /* respect sorting option, the 'e_table_get_mouse_over_cell' returns sorted row, not the model one */ + esm = e_table_get_selection_model (etable); + if (esm && esm->sorter && e_sorter_needs_sorting (esm->sorter)) + row = e_sorter_sorted_to_model (esm->sorter, row); + + comp = e_cal_model_get_component_at (cal_table->model, row); + if (!comp || !comp->icalcomp) + return FALSE; + + new_comp = e_cal_component_new (); + if (!e_cal_component_set_icalcomponent (new_comp, icalcomponent_new_clone (comp->icalcomp))) { + g_object_unref (new_comp); + return FALSE; + } + + box = gtk_vbox_new (FALSE, 0); + + str = e_calendar_view_get_icalcomponent_summary (comp->client, comp->icalcomp, &free_text); + if (!(str && *str)) { + if (free_text) + g_free ((char *)str); + free_text = FALSE; + str = _("* No Summary *"); + } + + l = gtk_label_new (NULL); + tmp = g_markup_printf_escaped ("<b>%s</b>", str); + gtk_label_set_line_wrap (GTK_LABEL (l), TRUE); + gtk_label_set_markup (GTK_LABEL (l), tmp); + gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5); + w = gtk_event_box_new (); + + gtk_widget_modify_bg (w, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_SELECTED])); + gtk_widget_modify_fg (l, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED])); + gtk_container_add (GTK_CONTAINER (w), l); + gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0); + g_free (tmp); + + if (free_text) + g_free ((char *)str); + free_text = FALSE; + + w = gtk_event_box_new (); + gtk_widget_modify_bg (w, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_NORMAL])); + + l = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (w), l); + gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0); + w = l; + + e_cal_component_get_organizer (new_comp, &organizer); + if (organizer.cn) { + char *ptr ; + ptr = strchr( organizer.value, ':'); + + if (ptr) { + ptr++; + /* To Translators: It will display "Organiser: NameOfTheUser <email@ofuser.com>" */ + tmp = g_strdup_printf (_("Organizer: %s <%s>"), organizer.cn, ptr); + } else { + /* With SunOne accounts, there may be no ':' in organiser.value */ + tmp = g_strdup_printf (_("Organizer: %s"), organizer.cn); + } + + l = gtk_label_new (tmp); + gtk_label_set_line_wrap (GTK_LABEL (l), FALSE); + gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0); + g_free (tmp); + } + + e_cal_component_get_dtstart (new_comp, &dtstart); + e_cal_component_get_due (new_comp, &dtdue); + + default_zone = e_cal_model_get_timezone (cal_table->model); + + if (dtstart.tzid) { + zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (new_comp), dtstart.tzid); + if (!zone) + e_cal_get_timezone (comp->client, dtstart.tzid, &zone, NULL); + if (!zone) + zone = default_zone; + } else { + zone = NULL; + } + + tmp2 = g_string_new (""); + + if (dtstart.value) { + get_time_as_text (dtstart.value, zone, default_zone, buff, 1000); + + if (buff [0]) { + g_string_append (tmp2, _("Start: ")); + g_string_append (tmp2, buff); + } + } + + if (dtdue.value) { + get_time_as_text (dtdue.value, zone, default_zone, buff, 1000); + + if (buff [0]) { + if (tmp2->len) + g_string_append (tmp2, "; "); + + g_string_append (tmp2, _("Due: ")); + g_string_append (tmp2, buff); + } + } + + if (tmp2->len) { + l = gtk_label_new (tmp2->str); + gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0); + } + + g_string_free (tmp2, TRUE); + + e_cal_component_free_datetime (&dtstart); + e_cal_component_free_datetime (&dtdue); + + tmp2 = g_string_new (""); + e_cal_component_get_description_list (new_comp, &desc); + for (len = 0, p = desc; p != NULL; p = p->next) { + ECalComponentText *text = p->data; + + if (text->value != NULL) { + len += strlen (text->value); + g_string_append (tmp2, text->value); + if (len > 1024) { + g_string_set_size (tmp2, 1020); + g_string_append (tmp2, "..."); + break; + } + } + } + e_cal_component_free_text_list (desc); + + if (tmp2->len) { + l = gtk_label_new (tmp2->str); + gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (box), l, FALSE, FALSE, 0); + } + + g_string_free (tmp2, TRUE); + + gtk_widget_show_all (box); + gtk_tooltip_set_custom (tooltip, box); + + g_object_unref (new_comp); + + return TRUE; +} + +static void e_calendar_table_init (ECalendarTable *cal_table) { GtkWidget *table; @@ -489,6 +696,8 @@ e_calendar_table_init (ECalendarTable *cal_table) g_signal_connect (e_table, "right_click", G_CALLBACK (e_calendar_table_on_right_click), cal_table); g_signal_connect (e_table, "key_press", G_CALLBACK (e_calendar_table_on_key_press), cal_table); g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_calendar_table_on_popup_menu), cal_table); + g_signal_connect (e_table, "query-tooltip", G_CALLBACK (query_tooltip_cb), cal_table); + gtk_widget_set_has_tooltip (GTK_WIDGET (e_table), TRUE); a11y = gtk_widget_get_accessible ((GtkWidget *)e_table); if (a11y) diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index b1ec9624c0..8fa9c61830 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -62,7 +62,7 @@ #include "misc.h" /* Used for the status bar messages */ -#define EVOLUTION_CALENDAR_PROGRESS_IMAGE "stock_calendar" +#define EVOLUTION_CALENDAR_PROGRESS_IMAGE "x-office-calendar" static GdkPixbuf *progress_icon = NULL; struct _ECalendarViewPrivate { diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index 0d95f2c2d8..d0d17b0945 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -1098,7 +1098,7 @@ create_component_view (MemosComponent *memos_component) GTK_SHADOW_IN); gtk_widget_show (selector_scrolled_window); - component_view->info_label = (EInfoLabel *)e_info_label_new("stock_insert-note"); + component_view->info_label = (EInfoLabel *)e_info_label_new("evolution-memos"); e_info_label_set_info(component_view->info_label, _("Memos"), ""); gtk_widget_show (GTK_WIDGET (component_view->info_label)); @@ -1258,7 +1258,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[0].id = CREATE_MEMO_ID; list->_buffer[0].description = _("New memo"); - list->_buffer[0].menuDescription = _("Mem_o"); + list->_buffer[0].menuDescription = (char *) C_("New", "Mem_o"); list->_buffer[0].tooltip = _("Create a new memo"); list->_buffer[0].menuShortcut = 'o'; list->_buffer[0].iconName = "stock_insert-note"; @@ -1266,7 +1266,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[1].id = CREATE_SHARED_MEMO_ID; list->_buffer[1].description = _("New shared memo"); - list->_buffer[1].menuDescription = _("_Shared memo"); + list->_buffer[1].menuDescription = (char *) C_("New", "_Shared memo"); list->_buffer[1].tooltip = _("Create a shared new memo"); list->_buffer[1].menuShortcut = 'h'; list->_buffer[1].iconName = "stock_insert-note"; @@ -1274,7 +1274,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[2].id = CREATE_MEMO_LIST_ID; list->_buffer[2].description = _("New memo list"); - list->_buffer[2].menuDescription = _("Memo li_st"); + list->_buffer[2].menuDescription = (char *) C_("New", "Memo li_st"); list->_buffer[2].tooltip = _("Create a new memo list"); list->_buffer[2].menuShortcut = '\0'; list->_buffer[2].iconName = "stock_notes"; diff --git a/calendar/gui/memotypes.xml b/calendar/gui/memotypes.xml index f27da759cf..3b9a560a96 100644 --- a/calendar/gui/memotypes.xml +++ b/calendar/gui/memotypes.xml @@ -121,7 +121,7 @@ <_title>International</_title> </option> <option value="Next 7 days"> - <_title>Next 7 Days'</_title> + <_title>Next 7 Days</_title> </option> <option value="Birthday"> <_title>Birthday</_title> @@ -139,7 +139,7 @@ <_title>Key Customer</_title> </option> <option value="Time & Expenses"> - <_title>Time & Expenses </_title> + <_title>Time & Expenses</_title> </option> <option value="Miscellaneous"> <_title>Miscellaneous</_title> diff --git a/calendar/gui/print.c b/calendar/gui/print.c index f208d62bde..9caf4fbdf9 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -710,9 +710,10 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, static double bound_text (GtkPrintContext *context, PangoFontDescription *font, - const gchar *text, + const gchar *text, gint len, gdouble x1, gdouble y1, - gdouble x2, gdouble y2) + gdouble x2, gdouble y2, + gboolean can_wrap, gdouble *last_page_start, gint *pages) { PangoLayout *layout; gint layout_width, layout_height; @@ -722,23 +723,38 @@ bound_text (GtkPrintContext *context, layout = gtk_print_context_create_pango_layout (context); pango_layout_set_font_description (layout, font); - pango_layout_set_text (layout, text, -1); + pango_layout_set_text (layout, text, len); pango_layout_set_width (layout, pango_units_from_double (x2 - x1)); + + if (can_wrap) + pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR); + pango_layout_get_size (layout, &layout_width, &layout_height); - cairo_save (cr); + if (last_page_start && y1 + pango_units_to_double (layout_height) > y2 + (*last_page_start)) { + /* draw this on new page */ + if (pages) + *pages = *pages + 1; - /* Set a clipping rectangle. */ - cairo_move_to (cr, x1, y1); - cairo_rectangle (cr, x1, y1, x2, y2); - cairo_clip (cr); - cairo_new_path (cr); + *last_page_start = *last_page_start + y2; + y1 = *last_page_start + 10.0; + } - cairo_move_to (cr, x1, y1); - pango_cairo_show_layout (cr, layout); - cairo_stroke (cr); + if (!last_page_start || (y1 >= 0.0 && y1 < y2)) { + cairo_save (cr); - cairo_restore (cr); + /* Set a clipping rectangle. */ + cairo_move_to (cr, x1, y1); + cairo_rectangle (cr, x1, y1, x2, y2); + cairo_clip (cr); + cairo_new_path (cr); + + cairo_move_to (cr, x1, y1); + pango_cairo_show_layout (cr, layout); + cairo_stroke (cr); + + cairo_restore (cr); + } g_object_unref (layout); @@ -992,7 +1008,7 @@ get_role_as_string (icalparameter_role role) static double print_attendees (GtkPrintContext *context, PangoFontDescription *font, cairo_t *cr, double left, double right, double top, double bottom, - ECalComponent *comp) + ECalComponent *comp, gint page_nr, gint *pages) { GSList *attendees = NULL, *l; @@ -1035,7 +1051,7 @@ print_attendees (GtkPrintContext *context, PangoFontDescription *font, cairo_t * cairo_show_page (cr); } - top = bound_text (context, font, text->str, left + 40.0, top, right, bottom); + top = bound_text (context, font, text->str, -1, left + 40.0, top, right, bottom, FALSE, NULL, pages); g_string_free (text, TRUE); } @@ -1213,7 +1229,7 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, g_free (t); } - bound_text (context, font, text, x1 + 2, y1, x2 - 2, y2); + bound_text (context, font, text, -1, x1 + 2, y1, x2 - 2, y2, FALSE, NULL, NULL); if (free_text) g_free (text); @@ -2014,8 +2030,8 @@ print_todo_details (GtkPrintContext *context, GnomeCalendar *gcal, cairo_stroke (cr); } - y = bound_text (context, font_summary, summary.value, - x + 14, y + 4, xend, yend); + y = bound_text (context, font_summary, summary.value, -1, + x + 14, y + 4, xend, yend, FALSE, NULL, NULL); y += get_font_size (font_summary)-5; @@ -2404,8 +2420,9 @@ print_calendar (GnomeCalendar *gcal, GtkPrintOperationAction action, g_object_unref (operation); } -static void -print_comp_draw_page (GtkPrintOperation *operation, +/* returns number of required pages, when page_nr is -1 */ +static gint +print_comp_draw_real (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, PrintCompItem *pci) @@ -2423,14 +2440,25 @@ print_comp_draw_page (GtkPrintOperation *operation, char *categories_string, *location_string, *summary_string; double header_size; cairo_t *cr; - gdouble width, height; + gdouble width, height, page_start; double top; + gint pages = 1; setup = gtk_print_context_get_page_setup (context); width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS); height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS); + top = 0.0; + + /* either draw only the right page or do not draw anything when calculating number of pages */ + if (page_nr != -1) + top = top - ((page_nr) * height); + else + top = height; + + page_start = top; + /* PrintCompItem structure contains elements to be used * with the Print Context , obtained in comp_draw_page */ @@ -2447,27 +2475,30 @@ print_comp_draw_page (GtkPrintOperation *operation, else if (vtype == E_CAL_COMPONENT_JOURNAL) title = _("Memo"); else - return; + return pages; cr = gtk_print_context_get_cairo_context (context); /* Print the title in a box at the top of the page. */ font = get_font_for_size (18, PANGO_WEIGHT_BOLD); header_size = 40; - print_border (context, 0.0, width, 0.0, header_size, - 1.0, 0.9); - print_text (context, font, title, PANGO_ALIGN_CENTER, 0.0, width, - 0.1, header_size - 0.1); - pango_font_description_free (font); - top = header_size + 30; + if (page_nr == 0) { + print_border (context, 0.0, width, 0.0, header_size, + 1.0, 0.9); + print_text (context, font, title, PANGO_ALIGN_CENTER, 0.0, width, + 0.1, header_size - 0.1); + pango_font_description_free (font); + } + + top += header_size + 30; /* Summary */ font = get_font_for_size (18, PANGO_WEIGHT_BOLD); e_cal_component_get_summary (comp, &text); summary_string = g_strdup_printf (_("Summary: %s"), text.value); - top = bound_text (context, font, summary_string, 0.0, top, width, - height); + top = bound_text (context, font, summary_string, -1, 0.0, top, width, + height, FALSE, &page_start, &pages); g_free (summary_string); @@ -2476,21 +2507,22 @@ print_comp_draw_page (GtkPrintOperation *operation, if (location && location[0]) { location_string = g_strdup_printf (_("Location: %s"), location); - top = bound_text (context, font, location_string, 0.0, - top + 3, width, height); + top = bound_text (context, font, location_string, -1, 0.0, + top + 3, width, height, FALSE, &page_start, &pages); g_free (location_string); } /* Date information */ - print_date_label (context, comp, client, 0.0, width, top + 3, top + 15); + if (page_nr == 0) + print_date_label (context, comp, client, 0.0, width, top + 3, top + 15); top += 20; /* Attendees */ if (e_cal_component_has_attendees (comp)) { - top = bound_text (context, font, _("Attendees: "), 0.0, top, width, height); + top = bound_text (context, font, _("Attendees: "), -1, 0.0, top, width, height, FALSE, &page_start, &pages); pango_font_description_free (font); font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); - top = print_attendees (context, font, cr, 0.0, width, top, height, comp); + top = print_attendees (context, font, cr, 0.0, width, top, height, comp, page_nr, &pages); top += get_font_size (font) - 6; } @@ -2529,8 +2561,8 @@ print_comp_draw_page (GtkPrintOperation *operation, if (status_string) { char *status_text = g_strdup_printf (_("Status: %s"), status_string); - top = bound_text (context, font, status_text, - 0.0, top, width, height); + top = bound_text (context, font, status_text, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; g_free (status_text); } @@ -2545,8 +2577,8 @@ print_comp_draw_page (GtkPrintOperation *operation, e_cal_component_free_priority (priority); pri_text = g_strdup_printf (_("Priority: %s"), priority_string); - top = bound_text (context, font, pri_text, - 0.0, top, width, height); + top = bound_text (context, font, pri_text, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; g_free (pri_text); } @@ -2559,8 +2591,8 @@ print_comp_draw_page (GtkPrintOperation *operation, percent_string = g_strdup_printf (_("Percent Complete: %i"), *percent); e_cal_component_free_percent (percent); - top = bound_text (context, font, percent_string, - 0.0, top, width, height); + top = bound_text (context, font, percent_string, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; } @@ -2571,8 +2603,8 @@ print_comp_draw_page (GtkPrintOperation *operation, char *url_string = g_strdup_printf (_("URL: %s"), url); - top = bound_text (context, font, url_string, - 0.0, top, width, height); + top = bound_text (context, font, url_string, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_free (url_string); } @@ -2583,8 +2615,8 @@ print_comp_draw_page (GtkPrintOperation *operation, if (categories && categories[0]) { categories_string = g_strdup_printf (_("Categories: %s"), categories); - top = bound_text (context, font, categories_string, - 0.0, top, width, height); + top = bound_text (context, font, categories_string, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6 ; g_free (categories_string); } @@ -2602,8 +2634,8 @@ print_comp_draw_page (GtkPrintOperation *operation, } e_cal_component_free_text_list (contact_list); - top = bound_text (context, font, contacts->str, - 0.0, top, width, height); + top = bound_text (context, font, contacts->str, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_string_free (contacts, TRUE); } @@ -2612,19 +2644,48 @@ print_comp_draw_page (GtkPrintOperation *operation, /* Description */ e_cal_component_get_description_list (comp, &desc); for (l = desc; l != NULL; l = l->next) { - ECalComponentText *text = l->data; - if (top > height) { - top = 10; //FIXME - cairo_show_page (cr); + ECalComponentText *ptext = l->data; + const char *line, *next_line; + + for (line = ptext->value; line != NULL; line = next_line) { + next_line = strchr (line, '\n'); + + top = bound_text (context, font, line, next_line ? next_line - line : -1, 0.0, top + 3, width, height, TRUE, &page_start, &pages); + + if (next_line) { + next_line ++; + if (!*next_line) + next_line = NULL; + } } - if (text->value != NULL) - top = bound_text (context, font, text->value, 0.0, top + 3, width, height) + 30; } e_cal_component_free_text_list (desc); pango_font_description_free (font); + return pages; +} + +static void +print_comp_draw_page (GtkPrintOperation *operation, + GtkPrintContext *context, + gint page_nr, + PrintCompItem *pci) +{ + print_comp_draw_real (operation, context, page_nr, pci); +} + +static void +print_comp_begin_print (GtkPrintOperation *operation, + GtkPrintContext *context, + PrintCompItem *pci) +{ + gint pages; + + pages = print_comp_draw_real (operation, context, -1, pci); + + gtk_print_operation_set_n_pages (operation, pages); } void @@ -2642,6 +2703,10 @@ print_comp (ECalComponent *comp, ECal *client, GtkPrintOperationAction action) gtk_print_operation_set_n_pages (operation, 1); g_signal_connect ( + operation, "begin-print", + G_CALLBACK (print_comp_begin_print), &pci); + + g_signal_connect ( operation, "draw-page", G_CALLBACK (print_comp_draw_page), &pci); diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 3188b97d62..b7f6cc6ea2 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -1087,7 +1087,7 @@ create_component_view (TasksComponent *tasks_component) GTK_SHADOW_IN); gtk_widget_show (selector_scrolled_window); - component_view->info_label = (EInfoLabel *)e_info_label_new("stock_task"); + component_view->info_label = (EInfoLabel *)e_info_label_new("evolution-tasks"); e_info_label_set_info(component_view->info_label, _("Tasks"), ""); gtk_widget_show (GTK_WIDGET (component_view->info_label)); @@ -1323,7 +1323,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[0].id = CREATE_TASK_ID; list->_buffer[0].description = _("New task"); - list->_buffer[0].menuDescription = _("_Task"); + list->_buffer[0].menuDescription = (char *) C_("New", "_Task"); list->_buffer[0].tooltip = _("Create a new task"); list->_buffer[0].menuShortcut = 't'; list->_buffer[0].iconName = "stock_task"; @@ -1331,7 +1331,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[1].id = CREATE_TASK_ASSIGNED_ID; list->_buffer[1].description = _("New assigned task"); - list->_buffer[1].menuDescription = _("Assigne_d Task"); + list->_buffer[1].menuDescription = (char *) C_("New", "Assigne_d Task"); list->_buffer[1].tooltip = _("Create a new assigned task"); list->_buffer[1].menuShortcut = '\0'; list->_buffer[1].iconName = "stock_task"; @@ -1339,7 +1339,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[2].id = CREATE_TASK_LIST_ID; list->_buffer[2].description = _("New task list"); - list->_buffer[2].menuDescription = _("Tas_k list"); + list->_buffer[2].menuDescription = (char *) C_("New", "Tas_k list"); list->_buffer[2].tooltip = _("Create a new task list"); list->_buffer[2].menuShortcut = '\0'; list->_buffer[2].iconName = "stock_todo"; |