diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2005-12-15 12:51:41 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2005-12-15 12:51:41 +0800 |
commit | 37837176219e147d3ee06930415b9fc431c20787 (patch) | |
tree | e4851ddb0a5ccd8b773623a3d8c86d3dfa3ff00d /calendar/gui | |
parent | cbb8fc85f7deadc99b04ff98f18eb3216e5fe26f (diff) | |
download | gsoc2013-evolution-37837176219e147d3ee06930415b9fc431c20787.tar.gz gsoc2013-evolution-37837176219e147d3ee06930415b9fc431c20787.tar.zst gsoc2013-evolution-37837176219e147d3ee06930415b9fc431c20787.zip |
Added code to make the tooltips strings translatable. Also picked up the
2005-12-15 Srinivasa Ragavan <sragavan@novell.com>
* gui/e-calendar-view.c: (e_calendar_view_get_tooltips): Added
code to make the tooltips strings translatable. Also picked up
the color from the theme for the tooltip instead of hardcoded
colors.
svn path=/trunk/; revision=30778
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-calendar-view.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 0fae38bdf9..16e1fba33c 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1913,16 +1913,13 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) icalcomponent *clone_comp; time_t t_start, t_end; ECalendarViewEvent *pevent; + GtkStyle *style = gtk_widget_get_default_style (); pevent = data->get_view_event (data->cal_view, data->day, data->event_num); g_free (data); ECalComponent *newcomp = e_cal_component_new (); icaltimezone *zone; - GdkColor color, outer_color; - - gdk_color_parse ("PeachPuff2", &color); - gdk_color_parse ("antique white", &outer_color); clone_comp = icalcomponent_new_clone (pevent->comp_data->icalcomp); if (!e_cal_component_set_icalcomponent (newcomp, clone_comp)) @@ -1931,7 +1928,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) box = gtk_vbox_new (FALSE, 0); str = icalcomponent_get_summary (pevent->comp_data->icalcomp); - tmp = g_strdup_printf ("<b>%s</b>", str); + tmp = g_strdup_printf (_("<b>%s</b>"), str); label = gtk_label_new (NULL); gtk_label_set_line_wrap ((GtkLabel *)label, TRUE); gtk_label_set_markup ((GtkLabel *)label, tmp); @@ -1940,10 +1937,8 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) gtk_box_pack_start ((GtkBox *)hbox, label, FALSE, FALSE, 0); ebox = gtk_event_box_new (); gtk_container_add ((GtkContainer *)ebox, hbox); - gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &color); - gtk_widget_modify_bg (ebox, GTK_STATE_ACTIVE, &color); - gtk_widget_modify_bg (ebox, GTK_STATE_SELECTED, &color); - gtk_widget_modify_bg (ebox, GTK_STATE_PRELIGHT, &color); + gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_SELECTED])); + gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED])); gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); g_free (tmp); @@ -1954,15 +1949,11 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) GtkWidget *hbox = gtk_hbox_new (FALSE, 0); ptr = strchr(organiser.value, ':'); ptr++; - tmp = g_strdup_printf ("Organiser: %s <%s>", organiser.cn, ptr); + tmp = g_strdup_printf (_("Organizer: %s <%s>"), organiser.cn, ptr); label = gtk_label_new (tmp); gtk_box_pack_start ((GtkBox *)hbox, label, FALSE, FALSE, 0); ebox = gtk_event_box_new (); gtk_container_add ((GtkContainer *)ebox, hbox); - gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_ACTIVE, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_SELECTED, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_PRELIGHT, &outer_color); gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); g_free (tmp); @@ -1971,17 +1962,13 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) e_cal_component_get_location (newcomp, &str); if (str) { - tmp = g_strdup_printf ("Location: %s", str); + tmp = g_strdup_printf (_("Location: %s"), str); label = gtk_label_new (NULL); gtk_label_set_markup ((GtkLabel *)label, tmp); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)hbox, label, FALSE, FALSE, 0); ebox = gtk_event_box_new (); gtk_container_add ((GtkContainer *)ebox, hbox); - gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_ACTIVE, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_SELECTED, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_PRELIGHT, &outer_color); gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); g_free (tmp); } @@ -2005,15 +1992,11 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) tmp1 = get_label(dtstart.value); tmp = calculate_time (t_start, t_end); - tmp2 = g_strdup_printf("Time: %s %s", tmp1, tmp); + tmp2 = g_strdup_printf(_("Time: %s %s"), tmp1, tmp); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)hbox, gtk_label_new_with_mnemonic (tmp2), FALSE, FALSE, 0); ebox = gtk_event_box_new (); gtk_container_add ((GtkContainer *)ebox, hbox); - gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_ACTIVE, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_SELECTED, &outer_color); - gtk_widget_modify_bg (ebox, GTK_STATE_PRELIGHT, &outer_color); gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); g_free (tmp); |