diff options
author | Rodrigo Moya <rodrigo@src.gnome.org> | 2005-05-16 19:43:23 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2005-05-16 19:43:23 +0800 |
commit | 3c3d116d6ca48861fd9d7efd89d82d7f1d33db3d (patch) | |
tree | 758aa010a507d1e1e24843edc345f54473e6d639 /calendar/gui | |
parent | 903becfede2bbdc739de5da88ca1341cac3ababf (diff) | |
download | gsoc2013-evolution-3c3d116d6ca48861fd9d7efd89d82d7f1d33db3d.tar.gz gsoc2013-evolution-3c3d116d6ca48861fd9d7efd89d82d7f1d33db3d.tar.zst gsoc2013-evolution-3c3d116d6ca48861fd9d7efd89d82d7f1d33db3d.zip |
Reverted Marcus Baines patch
svn path=/trunk/; revision=29374
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/apps_evolution_calendar.schemas.in.in | 36 | ||||
-rw-r--r-- | calendar/gui/calendar-config-keys.h | 3 | ||||
-rw-r--r-- | calendar/gui/calendar-config.c | 28 | ||||
-rw-r--r-- | calendar/gui/calendar-config.h | 4 | ||||
-rw-r--r-- | calendar/gui/e-day-view-config.c | 32 | ||||
-rw-r--r-- | calendar/gui/e-day-view-main-item.c | 39 | ||||
-rw-r--r-- | calendar/gui/e-day-view-time-item.c | 29 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 58 | ||||
-rw-r--r-- | calendar/gui/e-day-view.h | 16 | ||||
-rw-r--r-- | calendar/gui/e-meeting-store.c | 2 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 24 |
11 files changed, 4 insertions, 267 deletions
diff --git a/calendar/gui/apps_evolution_calendar.schemas.in.in b/calendar/gui/apps_evolution_calendar.schemas.in.in index 8348e47aab..6fbb4cfa60 100644 --- a/calendar/gui/apps_evolution_calendar.schemas.in.in +++ b/calendar/gui/apps_evolution_calendar.schemas.in.in @@ -195,42 +195,6 @@ </locale> </schema> - <schema> - <key>/schemas/apps/evolution/calendar/display/marcus_bains_line</key> - <applyto>/apps/evolution/calendar/display/marcus_bains_line</applyto> - <owner>evolution-calendar</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Marcus Bains Line</short> - <long>Whether to draw the Marcus Bains Line (line at current time) in the calendar.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/calendar/display/marcus_bains_color_dayview</key> - <applyto>/apps/evolution/calendar/display/marcus_bains_color_dayview</applyto> - <owner>evolution-calendar</owner> - <type>string</type> - <default>#ff0000</default> - <locale name="C"> - <short>Marcus Bains Line Color - Day View</short> - <long>Color to draw the Marcus Bains line in the Day View.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/evolution/calendar/display/marcus_bains_color_timebar</key> - <applyto>/apps/evolution/calendar/display/marcus_bains_color_timebar</applyto> - <owner>evolution-calendar</owner> - <type>string</type> - <default>#ff0000</default> - <locale name="C"> - <short>Marcus Bains Line Color - Time bar</short> - <long>Color to draw the Marcus Bains Line in the Time bar (empty for default).</long> - </locale> - </schema> - <!-- Tasks --> <schema> diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h index bb07640b2f..d3be9673e5 100644 --- a/calendar/gui/calendar-config-keys.h +++ b/calendar/gui/calendar-config-keys.h @@ -39,9 +39,6 @@ G_BEGIN_DECLS #define CALENDAR_CONFIG_DAY_END_MINUTE CALENDAR_CONFIG_PREFIX "/display/day_end_minute" #define CALENDAR_CONFIG_TIME_DIVISIONS CALENDAR_CONFIG_PREFIX "/display/time_divisions" #define CALENDAR_CONFIG_TIME_DIVISIONS CALENDAR_CONFIG_PREFIX "/display/time_divisions" -#define CALENDAR_CONFIG_MARCUS_BAINS_LINE CALENDAR_CONFIG_PREFIX "/display/marcus_bains_line" -#define CALENDAR_CONFIG_MARCUS_BAINS_COLOR_DAYVIEW CALENDAR_CONFIG_PREFIX "/display/marcus_bains_color_dayview" -#define CALENDAR_CONFIG_MARCUS_BAINS_COLOR_TIMEBAR CALENDAR_CONFIG_PREFIX "/display/marcus_bains_color_timebar" #define CALENDAR_CONFIG_DEFAULT_VIEW CALENDAR_CONFIG_PREFIX "/display/default_view" #define CALENDAR_CONFIG_HPANE_POS CALENDAR_CONFIG_PREFIX "/display/hpane_position" #define CALENDAR_CONFIG_VPANE_POS CALENDAR_CONFIG_PREFIX "/display/vpane_position" diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index cab9ee58ff..c31bdca261 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -444,34 +444,6 @@ calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpo return id; } -/* Whether we show the Marcus Bains Line (current time), and in what colors. */ -void -calendar_config_get_marcus_bains (gboolean *show_line, const char **dayview_color, const char **timebar_color) -{ - static char *dcolor = NULL, *tcolor = NULL; - - if (dcolor) - g_free (dcolor); - if (tcolor) - g_free (tcolor); - - dcolor = gconf_client_get_string (config, CALENDAR_CONFIG_MARCUS_BAINS_COLOR_DAYVIEW, NULL); - tcolor = gconf_client_get_string (config, CALENDAR_CONFIG_MARCUS_BAINS_COLOR_TIMEBAR, NULL); - - *show_line = gconf_client_get_bool (config, CALENDAR_CONFIG_MARCUS_BAINS_LINE, NULL); - *dayview_color = dcolor; - *timebar_color = tcolor; -} - - -void -calendar_config_add_notification_marcus_bains (GConfClientNotifyFunc func, gpointer data, gint *not_show, gint *not_dcolor, gint *not_tcolor) -{ - *not_show = gconf_client_notify_add (config, CALENDAR_CONFIG_MARCUS_BAINS_LINE, func, data, NULL, NULL); - *not_dcolor = gconf_client_notify_add (config, CALENDAR_CONFIG_MARCUS_BAINS_COLOR_DAYVIEW, func, data, NULL, NULL); - *not_tcolor = gconf_client_notify_add (config, CALENDAR_CONFIG_MARCUS_BAINS_COLOR_TIMEBAR, func, data, NULL, NULL); -} - /* Whether we show week numbers in the Date Navigator. */ gboolean calendar_config_get_dnav_show_week_no (void) diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index 3d3840a911..414e52b14f 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -117,10 +117,6 @@ gint calendar_config_get_time_divisions (void); void calendar_config_set_time_divisions (gint divisions); guint calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpointer data); -/* Whether we show the Marcus Bains Line, and in what colors. */ -void calendar_config_get_marcus_bains (gboolean *show_line, const char **dayview_color, const char **timebar_color); -void calendar_config_add_notification_marcus_bains (GConfClientNotifyFunc func, gpointer data, gint *not_show, gint *not_dcolor, gint *not_tcolor); - /* Whether we show event end times. */ gboolean calendar_config_get_show_event_end (void); void calendar_config_set_show_event_end (gboolean show_end); diff --git a/calendar/gui/e-day-view-config.c b/calendar/gui/e-day-view-config.c index b65d236bd1..50d4d8eeea 100644 --- a/calendar/gui/e-day-view-config.c +++ b/calendar/gui/e-day-view-config.c @@ -355,28 +355,6 @@ time_divisions_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo } static void -set_marcus_bains (EDayView *day_view) -{ - gboolean show_marcus_bains_line; - const char *dayview_color, *timebar_color; - - calendar_config_get_marcus_bains (&show_marcus_bains_line, &dayview_color, &timebar_color); - - e_day_view_set_marcus_bains (day_view, show_marcus_bains_line, dayview_color, timebar_color); -} - -static void -marcus_bains_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) -{ - EDayViewConfig *view_config = data; - EDayViewConfigPrivate *priv; - - priv = view_config->priv; - - set_marcus_bains (priv->view); -} - -static void set_show_event_end (EDayView *day_view) { gboolean show_event_end; @@ -401,7 +379,7 @@ void e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view) { EDayViewConfigPrivate *priv; - guint not, not_1, not_2; + guint not; GList *l; g_return_if_fail (view_config != NULL); @@ -480,14 +458,6 @@ e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view) not = calendar_config_add_notification_time_divisions (time_divisions_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - /* Showing Marcus Bains Line */ - set_marcus_bains (day_view); - - calendar_config_add_notification_marcus_bains (marcus_bains_changed_cb, view_config, ¬, ¬_1, ¬_2); - priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not_1)); - priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not_2)); - /* Showing event end */ set_show_event_end (day_view); diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 6203e264e8..c936342f74 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -35,7 +35,6 @@ #include "e-day-view-layout.h" #include "e-day-view-main-item.h" #include "ea-calendar.h" -#include <libecal/e-cal-time-util.h> static void e_day_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -300,44 +299,6 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, x, y, width, height, day); } - - - if (e_day_view_get_show_marcus_bains (day_view)) { - icaltimezone *zone; - struct icaltimetype time_now, day_start; - int marcus_bains_y; - GdkColor mb_color; - - gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); - - if (day_view->marcus_bains_day_view_color && gdk_color_parse (day_view->marcus_bains_day_view_color, &mb_color)) { - GdkColormap *colormap; - - colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); - if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) { - gdk_gc_set_foreground (gc, &mb_color); - } - } - - zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)); - time_now = icaltime_current_time_with_zone (zone); - - for (day = 0; day < day_view->days_shown; day++) { - day_start = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, zone); - - if ((day_start.year == time_now.year) && - (day_start.month == time_now.month) && - (day_start.day == time_now.day)) { - - grid_x1 = day_view->day_offsets[day] - x + E_DAY_VIEW_BAR_WIDTH; - grid_x2 = day_view->day_offsets[day + 1] - x - 1; - marcus_bains_y = (time_now.hour * 60 + time_now.minute) * day_view->row_height / day_view->mins_per_row - y; - gdk_draw_line (drawable, gc, grid_x1, marcus_bains_y, grid_x2, marcus_bains_y); - } - } - } - - } diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index ae57439a10..db4b66e54b 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -40,7 +40,6 @@ #include <gal/widgets/e-gui-utils.h> #include "e-day-view-time-item.h" #include "calendar-config.h" -#include <libecal/e-cal-time-util.h> /* The spacing between items in the time column. GRID_X_PAD is the space down @@ -253,7 +252,7 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, EDayView *day_view; EDayViewTimeItem *dvtmitem; GtkStyle *style; - GdkGC *gc, *fg_gc, *dark_gc; + GdkGC *fg_gc, *dark_gc; gchar buffer[64], *suffix; gint hour, display_hour, minute, row; gint row_y, start_y, large_hour_y_offset, small_font_y_offset; @@ -279,7 +278,6 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, small_font_metrics = pango_context_get_metrics (context, small_font_desc, pango_context_get_language (context)); - gc = day_view->main_gc; fg_gc = style->fg_gc[GTK_STATE_NORMAL]; dark_gc = style->dark_gc[GTK_STATE_NORMAL]; @@ -333,30 +331,6 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, pango_font_metrics_get_descent (large_font_metrics)) / PANGO_SCALE + E_DVTMI_LARGE_HOUR_Y_PAD); - /* Draw the Marcus Bains Line first, so it appears under other elements. */ - if (e_day_view_get_show_marcus_bains (day_view)) { - struct icaltimetype time_now; - int marcus_bains_y; - GdkColor mb_color; - - gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); - - if (day_view->marcus_bains_time_bar_color && gdk_color_parse (day_view->marcus_bains_time_bar_color, &mb_color)) { - GdkColormap *colormap; - - colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); - if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) { - gdk_gc_set_foreground (gc, &mb_color); - } - } - - time_now = icaltime_current_time_with_zone (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - marcus_bains_y = (time_now.hour * 60 + time_now.minute) * day_view->row_height / day_view->mins_per_row - y; - gdk_draw_line (drawable, gc, - long_line_x1, marcus_bains_y, - long_line_x2, marcus_bains_y); - } - /* Step through each row, drawing the times and the horizontal lines between them. */ for (row = 0, row_y = 0 - y; @@ -640,6 +614,7 @@ e_day_view_time_item_on_button_release (EDayViewTimeItem *dvtmitem, dvtmitem->dragging_selection = FALSE; } + static void e_day_view_time_item_on_motion_notify (EDayViewTimeItem *dvtmitem, GdkEvent *event) diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 1bee23f573..e7c924fb01 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -716,10 +716,6 @@ e_day_view_init (EDayView *day_view) day_view->week_start_day = 0; day_view->scroll_to_work_day = TRUE; - day_view->show_marcus_bains_line = TRUE; - day_view->marcus_bains_day_view_color = NULL; - day_view->marcus_bains_time_bar_color = NULL; - day_view->editing_event_day = -1; day_view->editing_event_num = -1; @@ -1165,7 +1161,6 @@ e_day_view_set_colors(EDayView *day_view, GtkWidget *widget) day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL]; day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND] = widget->style->bg[GTK_STATE_ACTIVE]; day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BORDER] = widget->style->dark[GTK_STATE_NORMAL]; - day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE] = widget->style->dark[GTK_STATE_PRELIGHT]; } static void @@ -2473,59 +2468,6 @@ e_day_view_set_working_day (EDayView *day_view, gtk_widget_queue_draw (day_view->main_canvas); } - -/* Whether we display the Marcus Bains Line in the main canvas and time canvas. */ -gboolean -e_day_view_get_show_marcus_bains (EDayView *day_view) -{ - g_return_val_if_fail (E_IS_DAY_VIEW (day_view), TRUE); - return day_view->show_marcus_bains_line; -} - -/* Force a redraw of the Marcus Bains Lines */ -void -e_day_view_update_marcus_bains (EDayView *day_view) -{ - g_return_if_fail (E_IS_DAY_VIEW (day_view)); - gtk_widget_queue_draw (day_view->main_canvas); - gtk_widget_queue_draw (day_view->time_canvas); -} - - -/* Update the variables controlling the Marcus Bains Line (display toggle, and colors). */ -void -e_day_view_set_marcus_bains (EDayView *day_view, - gboolean show_line, - const char *dayview_color, - const char *timebar_color) -{ - g_return_if_fail (E_IS_DAY_VIEW (day_view)); - - if ((day_view->show_marcus_bains_line != show_line) | - (day_view->marcus_bains_day_view_color != dayview_color) | - (day_view->marcus_bains_time_bar_color != timebar_color)) { - - if (day_view->marcus_bains_day_view_color) - g_free (day_view->marcus_bains_day_view_color); - if (day_view->marcus_bains_time_bar_color) - g_free (day_view->marcus_bains_time_bar_color); - - day_view->show_marcus_bains_line = show_line; - if (dayview_color) - day_view->marcus_bains_day_view_color = g_strdup (dayview_color); - else - day_view->marcus_bains_day_view_color = NULL; - - if (timebar_color) - day_view->marcus_bains_time_bar_color = g_strdup (timebar_color); - else - day_view->marcus_bains_time_bar_color = NULL; - - e_day_view_update_marcus_bains (day_view); - } -} - - /* Whether we display event end times in the main canvas. */ gboolean e_day_view_get_show_event_end_times (EDayView *day_view) diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h index d137332a88..4c563e4dbd 100644 --- a/calendar/gui/e-day-view.h +++ b/calendar/gui/e-day-view.h @@ -153,8 +153,6 @@ typedef enum E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND, E_DAY_VIEW_COLOR_LONG_EVENT_BORDER, - E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE, - E_DAY_VIEW_COLOR_LAST } EDayViewColors; @@ -280,11 +278,6 @@ struct _EDayView gint work_day_end_hour; gint work_day_end_minute; - /* Whether we show the Marcus Bains Line in the main canvas and time canvas. */ - gboolean show_marcus_bains_line; - char *marcus_bains_day_view_color; - char *marcus_bains_time_bar_color; - /* Whether we use show event end times in the main canvas. */ gboolean show_event_end_times; @@ -500,13 +493,6 @@ void e_day_view_set_working_day (EDayView *day_view, gint end_hour, gint end_minute); -/* Whether we display the Marcus Bains Line in the main canvas and time canvas. */ -gboolean e_day_view_get_show_marcus_bains (EDayView *day_view); -void e_day_view_set_marcus_bains (EDayView *day_view, - gboolean show_line, - const char *dayview_color, - const char *timebar_color); - /* Whether we display event end times in the main canvas. */ gboolean e_day_view_get_show_event_end_times (EDayView *day_view); void e_day_view_set_show_event_end_times (EDayView *day_view, @@ -587,8 +573,6 @@ void e_day_view_ensure_rows_visible (EDayView *day_view, gint end_row); -void e_day_view_update_marcus_bains (EDayView *day_view); - G_END_DECLS #endif /* _E_DAY_VIEW_H_ */ diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 22242755b2..7cbfbe2b79 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1046,7 +1046,7 @@ process_free_busy_comp (EMeetingAttendee *attendee, icalcomponent *tz_top_level) { icalproperty *ip; - + ip = icalcomponent_get_first_property (fb_comp, ICAL_DTSTART_PROPERTY); if (ip != NULL) { struct icaltimetype dtstart; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 0a038e4539..a5e95b2a9d 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -138,7 +138,6 @@ struct _GnomeCalendarPrivate { char *sexp; char *todo_sexp; guint update_timeout; - guint update_marcus_bains_line_timeout; /* This is the view currently shown. We use it to keep track of the positions of the panes. range_selected is TRUE if a range of dates @@ -1088,21 +1087,6 @@ update_todo_view_cb (GnomeCalendar *gcal) return TRUE; } -static gboolean -update_marcus_bains_line_cb (GnomeCalendar *gcal) -{ - GnomeCalendarPrivate *priv; - - priv = gcal->priv; - - if ((priv->current_view_type == GNOME_CAL_DAY_VIEW) || - (priv->current_view_type == GNOME_CAL_WORK_WEEK_VIEW)) { - e_day_view_update_marcus_bains (E_DAY_VIEW (gnome_calendar_get_current_view_widget (gcal))); - } - - return TRUE; -} - static void config_hide_completed_tasks_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { @@ -1335,9 +1319,6 @@ setup_widgets (GnomeCalendar *gcal) e_calendar_view_set_timezone (E_CALENDAR_VIEW (priv->work_week_view), priv->zone); connect_day_view_focus (gcal, E_DAY_VIEW (priv->work_week_view)); - /* The Marcus Bains line */ - priv->update_marcus_bains_line_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_marcus_bains_line_cb, gcal, NULL); - /* The Week View. */ priv->week_view = e_week_view_new (); e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->week_view), gcal); @@ -1539,11 +1520,6 @@ gnome_calendar_destroy (GtkObject *object) priv->view_instance = NULL; } - if (priv->update_marcus_bains_line_timeout) { - g_source_remove (priv->update_marcus_bains_line_timeout); - priv->update_marcus_bains_line_timeout = 0; - } - if (priv->view_menus) { g_object_unref (priv->view_menus); priv->view_menus = NULL; |