diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-06-07 04:08:47 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-06-07 08:09:08 +0800 |
commit | ffc019e36fd4703e5342030ca6779032d91c7611 (patch) | |
tree | 511ec7fb99746b600e2c176511d8e056831371bf /calendar | |
parent | 3fc28cd410369d299f080e44a71797f00c522eec (diff) | |
download | gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.tar gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.tar.gz gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.tar.bz2 gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.tar.lz gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.tar.xz gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.tar.zst gsoc2013-evolution-ffc019e36fd4703e5342030ca6779032d91c7611.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 178 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 181 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.h | 192 | ||||
-rw-r--r-- | calendar/gui/ea-week-view.c | 13 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 121 |
5 files changed, 375 insertions, 310 deletions
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 7cd177e410..b98987618c 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -65,94 +65,11 @@ struct _SchedulePagePrivate { icaltimezone *zone; }; -static GtkWidget *schedule_page_get_widget (CompEditorPage *page); -static void schedule_page_focus_main_widget (CompEditorPage *page); -static gboolean schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp); -static gboolean schedule_page_fill_component (CompEditorPage *page, ECalComponent *comp); -static void schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); - static void times_changed_cb (GtkWidget *widget, SchedulePage *spage); G_DEFINE_TYPE (SchedulePage, schedule_page, TYPE_COMP_EDITOR_PAGE) static void -schedule_page_dispose (GObject *object) -{ - SchedulePagePrivate *priv; - - priv = SCHEDULE_PAGE_GET_PRIVATE (object); - - if (priv->main != NULL) { - g_object_unref (priv->main); - priv->main = NULL; - } - - if (priv->builder != NULL) { - g_object_unref (priv->builder); - priv->builder = NULL; - } - - if (priv->model != NULL) { - g_object_unref (priv->model); - priv->model = NULL; - } - - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (schedule_page_parent_class)->dispose (object); -} - -static void -schedule_page_class_init (SchedulePageClass *class) -{ - GObjectClass *object_class; - CompEditorPageClass *editor_page_class; - - g_type_class_add_private (class, sizeof (SchedulePagePrivate)); - - object_class = G_OBJECT_CLASS (class); - object_class->dispose = schedule_page_dispose; - - editor_page_class = COMP_EDITOR_PAGE_CLASS (class); - editor_page_class->get_widget = schedule_page_get_widget; - editor_page_class->focus_main_widget = schedule_page_focus_main_widget; - editor_page_class->fill_widgets = schedule_page_fill_widgets; - editor_page_class->fill_component = schedule_page_fill_component; - editor_page_class->set_dates = schedule_page_set_dates; -} - -static void -schedule_page_init (SchedulePage *spage) -{ - spage->priv = SCHEDULE_PAGE_GET_PRIVATE (spage); -} - -/* get_widget handler for the schedule page */ -static GtkWidget * -schedule_page_get_widget (CompEditorPage *page) -{ - SchedulePage *spage; - SchedulePagePrivate *priv; - - spage = SCHEDULE_PAGE (page); - priv = spage->priv; - - return priv->main; -} - -/* focus_main_widget handler for the schedule page */ -static void -schedule_page_focus_main_widget (CompEditorPage *page) -{ - SchedulePage *spage; - SchedulePagePrivate *priv; - - spage = SCHEDULE_PAGE (page); - priv = spage->priv; - - gtk_widget_grab_focus (GTK_WIDGET (priv->sel)); -} - -static void sensitize_widgets (SchedulePage *spage) { SchedulePagePrivate *priv = spage->priv; @@ -171,7 +88,9 @@ sensitize_widgets (SchedulePage *spage) /* Set date/time */ static void -update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalComponentDateTime *end_date) +update_time (SchedulePage *spage, + ECalComponentDateTime *start_date, + ECalComponentDateTime *end_date) { SchedulePagePrivate *priv = spage->priv; CompEditor *editor; @@ -241,13 +160,56 @@ update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalCompone } -/* Fills the widgets with default values */ static void -clear_widgets (SchedulePage *spage) +schedule_page_dispose (GObject *object) { + SchedulePagePrivate *priv; + + priv = SCHEDULE_PAGE_GET_PRIVATE (object); + + if (priv->main != NULL) { + g_object_unref (priv->main); + priv->main = NULL; + } + + if (priv->builder != NULL) { + g_object_unref (priv->builder); + priv->builder = NULL; + } + + if (priv->model != NULL) { + g_object_unref (priv->model); + priv->model = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (schedule_page_parent_class)->dispose (object); +} + +static GtkWidget * +schedule_page_get_widget (CompEditorPage *page) +{ + SchedulePage *spage; + SchedulePagePrivate *priv; + + spage = SCHEDULE_PAGE (page); + priv = spage->priv; + + return priv->main; +} + +static void +schedule_page_focus_main_widget (CompEditorPage *page) +{ + SchedulePage *spage; + SchedulePagePrivate *priv; + + spage = SCHEDULE_PAGE (page); + priv = spage->priv; + + gtk_widget_grab_focus (GTK_WIDGET (priv->sel)); } -/* fill_widgets handler for the schedule page */ static gboolean schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) { @@ -257,9 +219,6 @@ schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) spage = SCHEDULE_PAGE (page); - /* Clean the screen */ - clear_widgets (spage); - /* Start and end times */ e_cal_component_get_dtstart (comp, &start_date); e_cal_component_get_dtend (comp, &end_date); @@ -278,7 +237,6 @@ schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) return validated; } -/* fill_component handler for the schedule page */ static gboolean schedule_page_fill_component (CompEditorPage *page, ECalComponent *comp) { @@ -297,7 +255,30 @@ schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) comp_editor_page_set_updating (page, FALSE); } - +static void +schedule_page_class_init (SchedulePageClass *class) +{ + GObjectClass *object_class; + CompEditorPageClass *editor_page_class; + + g_type_class_add_private (class, sizeof (SchedulePagePrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->dispose = schedule_page_dispose; + + editor_page_class = COMP_EDITOR_PAGE_CLASS (class); + editor_page_class->get_widget = schedule_page_get_widget; + editor_page_class->focus_main_widget = schedule_page_focus_main_widget; + editor_page_class->fill_widgets = schedule_page_fill_widgets; + editor_page_class->fill_component = schedule_page_fill_component; + editor_page_class->set_dates = schedule_page_set_dates; +} + +static void +schedule_page_init (SchedulePage *spage) +{ + spage->priv = SCHEDULE_PAGE_GET_PRIVATE (spage); +} /* Gets the widgets from the XML file and returns if they are all available. */ static gboolean @@ -345,9 +326,10 @@ init_widgets (SchedulePage *spage) return TRUE; } - void -schedule_page_set_meeting_time (SchedulePage *spage, icaltimetype *start_tt, icaltimetype *end_tt) +schedule_page_set_meeting_time (SchedulePage *spage, + icaltimetype *start_tt, + icaltimetype *end_tt) { SchedulePagePrivate *priv; gboolean all_day; @@ -362,9 +344,11 @@ schedule_page_set_meeting_time (SchedulePage *spage, icaltimetype *start_tt, ica } } - e_meeting_time_selector_set_meeting_time (priv->sel, start_tt->year, start_tt->month, start_tt->day, - start_tt->hour, start_tt->minute, end_tt->year, end_tt->month, end_tt->day, end_tt->hour, - end_tt->minute); + e_meeting_time_selector_set_meeting_time ( + priv->sel, start_tt->year, start_tt->month, + start_tt->day, start_tt->hour, start_tt->minute, + end_tt->year, end_tt->month, end_tt->day, + end_tt->hour, end_tt->minute); e_meeting_time_selector_set_all_day (priv->sel, all_day); } diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index f84b07ecd3..35ec225c19 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -88,86 +88,8 @@ static const gint priority_map[] = { -1 }; -static GtkWidget *task_details_page_get_widget (CompEditorPage *page); -static void task_details_page_focus_main_widget (CompEditorPage *page); -static gboolean task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp); -static gboolean task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp); -static gboolean task_details_page_fill_timezones (CompEditorPage *page, GHashTable *timezones); - G_DEFINE_TYPE (TaskDetailsPage, task_details_page, TYPE_COMP_EDITOR_PAGE) -static void -task_details_page_dispose (GObject *object) -{ - TaskDetailsPagePrivate *priv; - - priv = TASK_DETAILS_PAGE_GET_PRIVATE (object); - - if (priv->main != NULL) { - g_object_unref (priv->main); - priv->main = NULL; - } - - if (priv->builder != NULL) { - g_object_unref (priv->builder); - priv->builder = NULL; - } - - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (task_details_page_parent_class)->dispose (object); -} - -static void -task_details_page_class_init (TaskDetailsPageClass *class) -{ - GObjectClass *object_class; - CompEditorPageClass *editor_page_class; - - g_type_class_add_private (class, sizeof (TaskDetailsPagePrivate)); - - object_class = G_OBJECT_CLASS (class); - object_class->dispose = task_details_page_dispose; - - editor_page_class = COMP_EDITOR_PAGE_CLASS (class); - editor_page_class->get_widget = task_details_page_get_widget; - editor_page_class->focus_main_widget = task_details_page_focus_main_widget; - editor_page_class->fill_widgets = task_details_page_fill_widgets; - editor_page_class->fill_component = task_details_page_fill_component; - editor_page_class->fill_timezones = task_details_page_fill_timezones; -} - -static void -task_details_page_init (TaskDetailsPage *tdpage) -{ - tdpage->priv = TASK_DETAILS_PAGE_GET_PRIVATE (tdpage); -} - -/* get_widget handler for the task page */ -static GtkWidget * -task_details_page_get_widget (CompEditorPage *page) -{ - TaskDetailsPage *tdpage; - TaskDetailsPagePrivate *priv; - - tdpage = TASK_DETAILS_PAGE (page); - priv = tdpage->priv; - - return priv->main; -} - -/* focus_main_widget handler for the task page */ -static void -task_details_page_focus_main_widget (CompEditorPage *page) -{ - TaskDetailsPage *tdpage; - TaskDetailsPagePrivate *priv; - - tdpage = TASK_DETAILS_PAGE (page); - priv = tdpage->priv; - - gtk_widget_grab_focus (priv->status_combo); -} - static TaskEditorPriority priority_value_to_index (gint priority_value) { @@ -231,6 +153,7 @@ sensitize_widgets (TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv = tdpage->priv; CompEditor *editor; + GtkWidget *entry; ECal *client; gboolean read_only; @@ -245,12 +168,59 @@ sensitize_widgets (TaskDetailsPage *tdpage) gtk_widget_set_sensitive (priv->percent_complete, !read_only); gtk_widget_set_sensitive (priv->completed_date, !read_only); gtk_widget_set_sensitive (priv->url_label, !read_only); - gtk_editable_set_editable (GTK_EDITABLE (e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry))), !read_only); + + entry = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry)); + gtk_editable_set_editable (GTK_EDITABLE (entry), !read_only); +} + +static void +task_details_page_dispose (GObject *object) +{ + TaskDetailsPagePrivate *priv; + + priv = TASK_DETAILS_PAGE_GET_PRIVATE (object); + + if (priv->main != NULL) { + g_object_unref (priv->main); + priv->main = NULL; + } + + if (priv->builder != NULL) { + g_object_unref (priv->builder); + priv->builder = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (task_details_page_parent_class)->dispose (object); +} + +static GtkWidget * +task_details_page_get_widget (CompEditorPage *page) +{ + TaskDetailsPage *tdpage; + TaskDetailsPagePrivate *priv; + + tdpage = TASK_DETAILS_PAGE (page); + priv = tdpage->priv; + + return priv->main; +} + +static void +task_details_page_focus_main_widget (CompEditorPage *page) +{ + TaskDetailsPage *tdpage; + TaskDetailsPagePrivate *priv; + + tdpage = TASK_DETAILS_PAGE (page); + priv = tdpage->priv; + + gtk_widget_grab_focus (priv->status_combo); } -/* fill_widgets handler for the task page */ static gboolean -task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) +task_details_page_fill_widgets (CompEditorPage *page, + ECalComponent *comp) { TaskDetailsPage *tdpage; TaskDetailsPagePrivate *priv; @@ -337,9 +307,9 @@ task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) return TRUE; } -/* fill_component handler for the task page */ static gboolean -task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) +task_details_page_fill_component (CompEditorPage *page, + ECalComponent *comp) { TaskDetailsPage *tdpage; TaskDetailsPagePrivate *priv; @@ -376,7 +346,9 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) /* Completed Date. */ if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->completed_date)) || !e_date_edit_time_is_valid (E_DATE_EDIT (priv->completed_date))) { - comp_editor_page_display_validation_error (page, _("Completed date is wrong"), priv->completed_date); + comp_editor_page_display_validation_error ( + page, _("Completed date is wrong"), + priv->completed_date); return FALSE; } @@ -396,7 +368,9 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) icaltimezone_get_utc_timezone()); if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) { - comp_editor_page_display_validation_error (page, _("Completed date is wrong"), priv->completed_date); + comp_editor_page_display_validation_error ( + page, _("Completed date is wrong"), + priv->completed_date); return FALSE; } @@ -422,9 +396,9 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) return TRUE; } -/* fill_timezones handler for the event page */ static gboolean -task_details_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) +task_details_page_fill_timezones (CompEditorPage *page, + GHashTable *timezones) { icaltimezone *zone; @@ -438,7 +412,30 @@ task_details_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) return TRUE; } - +static void +task_details_page_class_init (TaskDetailsPageClass *class) +{ + GObjectClass *object_class; + CompEditorPageClass *editor_page_class; + + g_type_class_add_private (class, sizeof (TaskDetailsPagePrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->dispose = task_details_page_dispose; + + editor_page_class = COMP_EDITOR_PAGE_CLASS (class); + editor_page_class->get_widget = task_details_page_get_widget; + editor_page_class->focus_main_widget = task_details_page_focus_main_widget; + editor_page_class->fill_widgets = task_details_page_fill_widgets; + editor_page_class->fill_component = task_details_page_fill_component; + editor_page_class->fill_timezones = task_details_page_fill_timezones; +} + +static void +task_details_page_init (TaskDetailsPage *tdpage) +{ + tdpage->priv = TASK_DETAILS_PAGE_GET_PRIVATE (tdpage); +} /* Gets the widgets from the XML file and returns if they are all available. */ static gboolean @@ -674,8 +671,12 @@ init_widgets (TaskDetailsPage *tdpage) tdpage, NULL); /* These are created by hand, so hook the mnemonics manually */ - gtk_label_set_mnemonic_widget (GTK_LABEL (priv->date_completed_label), priv->completed_date); - gtk_label_set_mnemonic_widget (GTK_LABEL (priv->url_label), priv->url_entry); + gtk_label_set_mnemonic_widget ( + GTK_LABEL (priv->date_completed_label), + priv->completed_date); + gtk_label_set_mnemonic_widget ( + GTK_LABEL (priv->url_label), + priv->url_entry); /* Connect signals. The Status, Percent Complete & Date Completed properties are closely related so whenever one changes we may need diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index 1c61353c7b..dc1f2c8eeb 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -307,71 +307,85 @@ void e_meeting_time_selector_set_week_start_day Note that months are 1-12 and days are 1-31. The start time is guaranteed to be before or equal to the end time. You may want to check if they are equal if that if it is a problem. */ -void e_meeting_time_selector_get_meeting_time (EMeetingTimeSelector *mts, - gint *start_year, - gint *start_month, - gint *start_day, - gint *start_hour, - gint *start_minute, - gint *end_year, - gint *end_month, - gint *end_day, - gint *end_hour, - gint *end_minute); +void e_meeting_time_selector_get_meeting_time + (EMeetingTimeSelector *mts, + gint *start_year, + gint *start_month, + gint *start_day, + gint *start_hour, + gint *start_minute, + gint *end_year, + gint *end_month, + gint *end_day, + gint *end_hour, + gint *end_minute); /* This sets the meeting time, returning TRUE if it is valid. */ -gboolean e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute); - -void e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, - gboolean all_day); -void e_meeting_time_selector_set_working_hours_only (EMeetingTimeSelector *mts, - gboolean working_hours_only); -void e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts, - gint day_start_hour, - gint day_start_minute, - gint day_end_hour, - gint day_end_minute); - -void e_meeting_time_selector_set_zoomed_out (EMeetingTimeSelector *mts, - gboolean zoomed_out); - -EMeetingTimeSelectorAutopickOption e_meeting_time_selector_get_autopick_option (EMeetingTimeSelector *mts); -void e_meeting_time_selector_set_autopick_option (EMeetingTimeSelector *mts, - EMeetingTimeSelectorAutopickOption autopick_option); - -void e_meeting_time_selector_attendee_set_send_meeting_to (EMeetingTimeSelector *mts, - gint row, - gboolean send_meeting_to); - -void e_meeting_time_selector_set_read_only (EMeetingTimeSelector *mts, gboolean read_only); +gboolean e_meeting_time_selector_set_meeting_time + (EMeetingTimeSelector *mts, + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute, + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute); + +void e_meeting_time_selector_set_all_day + (EMeetingTimeSelector *mts, + gboolean all_day); +void e_meeting_time_selector_set_working_hours_only + (EMeetingTimeSelector *mts, + gboolean working_hours_only); +void e_meeting_time_selector_set_working_hours + (EMeetingTimeSelector *mts, + gint day_start_hour, + gint day_start_minute, + gint day_end_hour, + gint day_end_minute); + +void e_meeting_time_selector_set_zoomed_out + (EMeetingTimeSelector *mts, + gboolean zoomed_out); + +EMeetingTimeSelectorAutopickOption + e_meeting_time_selector_get_autopick_option + (EMeetingTimeSelector *mts); +void e_meeting_time_selector_set_autopick_option + (EMeetingTimeSelector *mts, + EMeetingTimeSelectorAutopickOption autopick_option); + +void e_meeting_time_selector_attendee_set_send_meeting_to + (EMeetingTimeSelector *mts, + gint row, + gboolean send_meeting_to); + +void e_meeting_time_selector_set_read_only + (EMeetingTimeSelector *mts, + gboolean read_only); /* Clears all busy times for the given attendee. */ -void e_meeting_time_selector_attendee_clear_busy_periods (EMeetingTimeSelector *mts, - gint row); +void e_meeting_time_selector_attendee_clear_busy_periods + (EMeetingTimeSelector *mts, + gint row); /* Adds one busy time for the given attendee. */ -gboolean e_meeting_time_selector_attendee_add_busy_period (EMeetingTimeSelector *mts, - gint row, - gint start_year, - gint start_month, - gint start_day, - gint start_hour, - gint start_minute, - gint end_year, - gint end_month, - gint end_day, - gint end_hour, - gint end_minute, - EMeetingFreeBusyType busy_type); +gboolean e_meeting_time_selector_attendee_add_busy_period + (EMeetingTimeSelector *mts, + gint row, + gint start_year, + gint start_month, + gint start_day, + gint start_hour, + gint start_minute, + gint end_year, + gint end_month, + gint end_day, + gint end_hour, + gint end_minute, + EMeetingFreeBusyType busy_type); /* * INTERNAL ROUTINES - functions to communicate with the canvas items within @@ -381,34 +395,50 @@ gboolean e_meeting_time_selector_attendee_add_busy_period (EMeetingTimeSelector /* This returns the x pixel coordinates of the meeting start and end times, in the entire canvas scroll area. If it returns FALSE, then the meeting time isn't in the current scroll area (which shouldn't really happen). */ -gboolean e_meeting_time_selector_get_meeting_time_positions (EMeetingTimeSelector *mts, - gint *start_x, - gint *end_x); +gboolean e_meeting_time_selector_get_meeting_time_positions + (EMeetingTimeSelector *mts, + gint *start_x, + gint *end_x); -void e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, - gint x); +void e_meeting_time_selector_drag_meeting_time + (EMeetingTimeSelector *mts, + gint x); -void e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts); +void e_meeting_time_selector_remove_timeout + (EMeetingTimeSelector *mts); -void e_meeting_time_selector_fix_time_overflows (EMeetingTime*mtstime); +void e_meeting_time_selector_fix_time_overflows + (EMeetingTime*mtstime); -void e_meeting_time_selector_calculate_day_and_position (EMeetingTimeSelector *mts, - gint x, - GDate *date, - gint *day_position); -void e_meeting_time_selector_convert_day_position_to_hours_and_mins (EMeetingTimeSelector *mts, gint day_position, guint8 *hours, guint8 *minutes); -void e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, - gint x, - EMeetingTime*time); -gint e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, - EMeetingTime *mtstime); -void e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint row, gboolean all); +void e_meeting_time_selector_calculate_day_and_position + (EMeetingTimeSelector *mts, + gint x, + GDate *date, + gint *day_position); +void e_meeting_time_selector_convert_day_position_to_hours_and_mins + (EMeetingTimeSelector *mts, + gint day_position, + guint8 *hours, + guint8 *minutes); +void e_meeting_time_selector_calculate_time + (EMeetingTimeSelector *mts, + gint x, + EMeetingTime*time); +gint e_meeting_time_selector_calculate_time_position + (EMeetingTimeSelector *mts, + EMeetingTime *mtstime); +void e_meeting_time_selector_refresh_free_busy + (EMeetingTimeSelector *mts, + gint row, + gboolean all); /* Debugging function to dump information on all attendees. */ #ifdef E_MEETING_TIME_SELECTOR_DEBUG -void e_meeting_time_selector_dump (EMeetingTimeSelector *mts); -gchar * e_meeting_time_selector_dump_time (EMeetingTime*mtstime); -gchar * e_meeting_time_selector_dump_date (GDate *date); +void e_meeting_time_selector_dump (EMeetingTimeSelector *mts); +gchar * e_meeting_time_selector_dump_time + (EMeetingTime *mtstime); +gchar * e_meeting_time_selector_dump_date + (GDate *date); #endif /* E_MEETING_TIME_SELECTOR_DEBUG */ G_END_DECLS diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index 14bb456219..fcbae83cb7 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -147,7 +147,9 @@ ea_week_view_get_name (AtkObject *accessible) /* the child main item is always there */ --n_events; if (n_events >= 1) - event_str = g_strdup_printf (ngettext ("It has %d event.", "It has %d events.", n_events), n_events); + event_str = g_strdup_printf ( + ngettext ("It has %d event.", "It has %d events.", + n_events), n_events); else event_str = g_strdup (_("It has no events.")); @@ -280,7 +282,8 @@ ea_week_view_ref_child (AtkObject *accessible, gint index) if (index == 0) { /* index == 0 is the main item */ - atk_object = atk_gobject_accessible_for_object (G_OBJECT (week_view->main_canvas_item)); + atk_object = atk_gobject_accessible_for_object ( + G_OBJECT (week_view->main_canvas_item)); g_object_ref (atk_object); } else for (event_index = 0; event_index < max_count; ++event_index) { @@ -318,7 +321,11 @@ ea_week_view_ref_child (AtkObject *accessible, gint index) atk_object = ea_calendar_helpers_get_accessible_for (span->text_item); } else { - atk_object = ea_calendar_helpers_get_accessible_for (week_view->jump_buttons[current_day == -1 ? 0 : current_day]); + gint index; + + index = (current_day != -1) ? current_day : 0; + atk_object = ea_calendar_helpers_get_accessible_for ( + week_view->jump_buttons[index]); } g_object_ref (atk_object); break; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 2f2bb4821d..38121c095c 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -127,8 +127,9 @@ struct _GnomeCalendarPrivate { time_t visible_end; gboolean updating; - /* If this is true list view uses range of showing the events as the dates selected in date navigator which is one month, else - it uses the date range set in search bar */ + /* If this is true, list view uses range of showing the events + * as the dates selected in date navigator which is one month, + * else it uses the date range set in search bar. */ gboolean lview_select_daten_range; /* used in update_todo_view, to prevent interleaving when called in separate thread */ @@ -162,7 +163,9 @@ static void gnome_calendar_goto_date (GnomeCalendar *gcal, static void gnome_calendar_update_date_navigator (GnomeCalendar *gcal); -static gboolean gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal); +static gboolean gnome_calendar_hpane_resized (GtkWidget *widget, + GdkEventButton *e, + GnomeCalendar *gcal); static void update_todo_view (GnomeCalendar *gcal); static void update_memo_view (GnomeCalendar *gcal); @@ -768,8 +771,10 @@ dn_e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer data) continue; } - tag_calendar_by_comp (priv->date_navigator, comp, e_cal_view_get_client (query), NULL, - FALSE, TRUE); + tag_calendar_by_comp ( + priv->date_navigator, comp, + e_cal_view_get_client (query), + NULL, FALSE, TRUE); g_object_unref (comp); } } @@ -820,7 +825,11 @@ gnome_calendar_get_calendar_view (GnomeCalendar *gcal, } static void -get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_t *start_time, time_t *end_time, time_t *select_time) +get_times_for_views (GnomeCalendar *gcal, + GnomeCalendarViewType view_type, + time_t *start_time, + time_t *end_time, + time_t *select_time) { GnomeCalendarPrivate *priv; ECalModel *model; @@ -918,7 +927,9 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ /* FIXME We should be using the same day of the week enum every where */ display_start = (E_WEEK_VIEW (priv->views[view_type])->display_start_day + 1) % 7; - if (!range_selected && (!E_WEEK_VIEW (priv->views[view_type])->multi_week_view || !E_WEEK_VIEW (priv->views[view_type])->month_scroll_by_week)) + if (!range_selected && ( + !E_WEEK_VIEW (priv->views[view_type])->multi_week_view || + !E_WEEK_VIEW (priv->views[view_type])->month_scroll_by_week)) *start_time = time_month_begin_with_zone (*start_time, timezone); *start_time = time_week_begin_with_zone (*start_time, display_start, timezone); *end_time = time_add_week_with_zone (*start_time, shown, timezone); @@ -1248,19 +1259,25 @@ update_todo_view_async (struct _mupdate_todo_msg *msg) static gboolean update_todo_view_done (struct _mupdate_todo_msg *msg) { + EMemoTable *memo_table; + ETaskTable *task_table; + EShellView *shell_view; GnomeCalendar *gcal; - GnomeCalendarPrivate *priv; g_return_val_if_fail (msg != NULL, FALSE); gcal = msg->gcal; - priv = gcal->priv; - g_return_val_if_fail (priv->task_table != NULL, FALSE); - g_return_val_if_fail (priv->memo_table != NULL, FALSE); + g_return_val_if_fail (gcal->priv->task_table != NULL, FALSE); + g_return_val_if_fail (gcal->priv->memo_table != NULL, FALSE); - e_shell_view_unblock_update_actions (e_task_table_get_shell_view (E_TASK_TABLE (priv->task_table))); - e_shell_view_unblock_update_actions (e_memo_table_get_shell_view (E_MEMO_TABLE (priv->memo_table))); + task_table = E_TASK_TABLE (gcal->priv->task_table); + shell_view = e_task_table_get_shell_view (task_table); + e_shell_view_unblock_update_actions (shell_view); + + memo_table = E_MEMO_TABLE (gcal->priv->memo_table); + shell_view = e_memo_table_get_shell_view (memo_table); + e_shell_view_unblock_update_actions (shell_view); g_object_unref (msg->gcal); g_slice_free (struct _mupdate_todo_msg, msg); @@ -1271,6 +1288,9 @@ update_todo_view_done (struct _mupdate_todo_msg *msg) static void update_todo_view (GnomeCalendar *gcal) { + EMemoTable *memo_table; + ETaskTable *task_table; + EShellView *shell_view; struct _mupdate_todo_msg *msg; /* they are both or none anyway */ @@ -1282,8 +1302,13 @@ update_todo_view (GnomeCalendar *gcal) msg->header.done = (GSourceFunc) update_todo_view_done; msg->gcal = g_object_ref (gcal); - e_shell_view_block_update_actions (e_task_table_get_shell_view (E_TASK_TABLE (gcal->priv->task_table))); - e_shell_view_block_update_actions (e_memo_table_get_shell_view (E_MEMO_TABLE (gcal->priv->memo_table))); + task_table = E_TASK_TABLE (gcal->priv->task_table); + shell_view = e_task_table_get_shell_view (task_table); + e_shell_view_block_update_actions (shell_view); + + memo_table = E_MEMO_TABLE (gcal->priv->memo_table); + shell_view = e_memo_table_get_shell_view (memo_table); + e_shell_view_block_update_actions (shell_view); message_push ((Message *) msg); } @@ -1309,15 +1334,14 @@ update_memo_view (GnomeCalendar *gcal) iso_start = isodate_from_time_t (start); iso_end = isodate_from_time_t (end); - if (priv->memo_sexp) { - g_free (priv->memo_sexp); - } + g_free (priv->memo_sexp); - priv->memo_sexp = g_strdup_printf ("(and (or (not (has-start?)) (occur-in-time-range? (make-time \"%s\")" - " (make-time \"%s\"))" - " ) %s)", - iso_start, iso_end, - priv->sexp ? priv->sexp : ""); + priv->memo_sexp = g_strdup_printf ( + "(and (or (not (has-start?)) " + "(occur-in-time-range? (make-time \"%s\")" + " (make-time \"%s\"))) %s)", + iso_start, iso_end, + priv->sexp ? priv->sexp : ""); e_cal_model_set_search_query (model, priv->memo_sexp); @@ -1336,7 +1360,10 @@ process_completed_tasks (GnomeCalendar *gcal, gboolean config_changed) priv = gcal->priv; - e_calendar_table_process_completed_tasks (E_CALENDAR_TABLE (priv->todo), priv->clients_list[E_CAL_SOURCE_TYPE_TODO], config_changed); + e_calendar_table_process_completed_tasks ( + E_CALENDAR_TABLE (priv->todo), + priv->clients_list[E_CAL_SOURCE_TYPE_TODO], + config_changed); #endif } @@ -1398,11 +1425,15 @@ setup_widgets (GnomeCalendar *gcal) /* Timeout check to hide completed items */ #if 0 /* KILL-BONOBO */ - priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_todo_view_cb, gcal, NULL); + priv->update_timeout = g_timeout_add_full ( + G_PRIORITY_LOW, 60000, (GSourceFunc) + update_todo_view_cb, gcal, NULL); #endif /* 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); + priv->update_marcus_bains_line_timeout = g_timeout_add_full ( + G_PRIORITY_LOW, 60000, (GSourceFunc) + update_marcus_bains_line_cb, gcal, NULL); /* update_memo_view (gcal); */ } @@ -1417,10 +1448,8 @@ gnome_calendar_init (GnomeCalendar *gcal) gcal->priv = priv; if (non_intrusive_error_table == NULL) - non_intrusive_error_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - - if (non_intrusive_error_table == NULL) - non_intrusive_error_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + non_intrusive_error_table = g_hash_table_new_full ( + g_str_hash, g_str_equal, g_free, g_object_unref); priv->todo_update_lock = g_mutex_new (); priv->dn_query_lock = g_mutex_new (); @@ -1637,7 +1666,9 @@ gnome_calendar_update_view_times (GnomeCalendar *gcal, model = gnome_calendar_get_model (gcal); - get_times_for_views (gcal, priv->current_view_type, &real_start_time, &end_time, &select_time); + get_times_for_views ( + gcal, priv->current_view_type, + &real_start_time, &end_time, &select_time); if (priv->current_view_type == GNOME_CAL_LIST_VIEW && !priv->lview_select_daten_range) return; @@ -1645,7 +1676,9 @@ gnome_calendar_update_view_times (GnomeCalendar *gcal, e_cal_model_set_time_range (model, real_start_time, end_time); if (select_time != 0 && select_time >= real_start_time && select_time <= end_time) - e_calendar_view_set_selected_time_range (priv->views[priv->current_view_type], select_time, select_time); + e_calendar_view_set_selected_time_range ( + priv->views[priv->current_view_type], + select_time, select_time); } static void @@ -2033,12 +2066,14 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) dt.tzid = icaltimezone_get_tzid (e_cal_model_get_timezone (model)); if (dtstart) { - itt = icaltime_from_timet_with_zone (*dtstart, FALSE, e_cal_model_get_timezone (model)); + itt = icaltime_from_timet_with_zone ( + *dtstart, FALSE, e_cal_model_get_timezone (model)); e_cal_component_set_dtstart (comp, &dt); } if (dtend) { - itt = icaltime_from_timet_with_zone (*dtend, FALSE, e_cal_model_get_timezone (model)); + itt = icaltime_from_timet_with_zone ( + *dtend, FALSE, e_cal_model_get_timezone (model)); e_cal_component_set_due (comp, &dt); /* task uses 'due' not 'dtend' */ } @@ -2115,7 +2150,9 @@ gnome_calendar_update_date_navigator (GnomeCalendar *gcal) } static gboolean -gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal) +gnome_calendar_hpane_resized (GtkWidget *widget, + GdkEventButton *event, + GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; ECalendarView *view; @@ -2139,9 +2176,13 @@ gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gc times_width = e_day_view_time_item_get_column_width ( E_DAY_VIEW_TIME_ITEM (E_DAY_VIEW (view)->time_canvas_item)); if (times_width < priv->hpane_pos - 20) - gtk_widget_set_size_request (E_DAY_VIEW (view)->time_canvas, times_width, -1); + gtk_widget_set_size_request ( + E_DAY_VIEW (view)->time_canvas, + times_width, -1); else - gtk_widget_set_size_request (E_DAY_VIEW (view)->time_canvas, priv->hpane_pos - 20, -1); + gtk_widget_set_size_request ( + E_DAY_VIEW (view)->time_canvas, + priv->hpane_pos - 20, -1); return FALSE; } @@ -2260,7 +2301,8 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) /* FIXME write occur-before and occur-after * sexp funcs so we don't have to use the max * gint */ - if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) { + if (!e_cal_get_static_capability ( + client, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) { struct purge_data pd; pd.remove = TRUE; @@ -2279,7 +2321,8 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) const gchar *uid = icalcomponent_get_uid (m->data); GError *error = NULL; - if (e_cal_util_component_is_instance (m->data) || e_cal_util_component_has_recurrences (m->data)) { + if (e_cal_util_component_is_instance (m->data) || + e_cal_util_component_has_recurrences (m->data)) { gchar *rid = NULL; struct icaltimetype recur_id = icalcomponent_get_recurrenceid (m->data); |