diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-27 05:19:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-27 05:19:41 +0800 |
commit | 0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110 (patch) | |
tree | d282033033e0fd8bb3c1632084d4c09f90dbbb2b /calendar/gui | |
parent | 3f213cfbef9142d117fbd9219cf12cbecc39f59e (diff) | |
download | gsoc2013-evolution-0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110.tar.gz gsoc2013-evolution-0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110.tar.zst gsoc2013-evolution-0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 21 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 9 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 8 | ||||
-rw-r--r-- | calendar/gui/e-week-view-event-item.c | 18 |
4 files changed, 36 insertions, 20 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 010dd1cbf6..7c6454df49 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -1590,11 +1590,14 @@ comp_editor_init (CompEditor *editor) GtkWindow *window; GtkWidget *scroll = NULL; EShell *shell; + gboolean express_mode; gint n_targets; GError *error = NULL; - /* FIXME Shell should be passed in. */ + /* FIXME We already have a 'shell' property. Move stuff + * that depends on it to a constructed() method. */ shell = e_shell_get_default (); + express_mode = e_shell_get_express_mode (shell); editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor); @@ -1619,8 +1622,8 @@ comp_editor_init (CompEditor *editor) priv->is_group_item = FALSE; priv->ui_manager = e_ui_manager_new (); - e_ui_manager_set_express_mode (E_UI_MANAGER (priv->ui_manager), - e_shell_get_express_mode (shell)); + e_ui_manager_set_express_mode ( + E_UI_MANAGER (priv->ui_manager), express_mode); gtk_window_add_accel_group ( GTK_WINDOW (editor), @@ -1719,7 +1722,7 @@ comp_editor_init (CompEditor *editor) container = widget; - if (!e_shell_get_express_mode (shell)) { + if (!express_mode) { widget = comp_editor_get_managed_widget (editor, "/main-menu"); gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_set_visible (widget, !e_shell_get_meego_mode (shell)); @@ -1735,7 +1738,7 @@ comp_editor_init (CompEditor *editor) priv->attachment_view = g_object_ref (widget); gtk_widget_show (widget); - if (e_shell_get_express_mode (shell)) { + if (express_mode) { /*GtkWidget *tmp, *tmp1, *tmp_box, */ GtkWidget *cont; GtkWidget *combo; @@ -1773,7 +1776,7 @@ comp_editor_init (CompEditor *editor) container = e_attachment_paned_get_content_area ( E_ATTACHMENT_PANED (priv->attachment_view)); - if (e_shell_get_express_mode (shell)) { + if (express_mode) { scroll = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy ((GtkScrolledWindow *)scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_widget_show(scroll); @@ -1781,14 +1784,14 @@ comp_editor_init (CompEditor *editor) } widget = gtk_notebook_new (); - gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), e_shell_get_express_mode (shell)); - if (!e_shell_get_express_mode (shell)) + gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), express_mode); + if (!express_mode) gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); else gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) scroll, widget); priv->notebook = GTK_NOTEBOOK (widget); gtk_widget_show (widget); - if (e_shell_get_express_mode (shell)) + if (express_mode) gtk_widget_set_size_request (scroll, 300, -1); comp_editor_setup_recent_menu (editor); diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 262751fa86..697dd74ec8 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -287,6 +287,7 @@ event_editor_constructor (GType type, EventEditorPrivate *priv; GtkActionGroup *action_group; GtkWidget *content_area; + EShell *shell; ECal *client; gboolean is_meeting; GtkWidget *alarm_page; @@ -299,6 +300,8 @@ event_editor_constructor (GType type, editor = COMP_EDITOR (object); priv = EVENT_EDITOR_GET_PRIVATE (object); + shell = comp_editor_get_shell (editor); + client = comp_editor_get_client (editor); flags = comp_editor_get_flags (editor); action_group = comp_editor_get_action_group (editor, "coordinated"); @@ -327,7 +330,7 @@ event_editor_constructor (GType type, priv->recur_page = recurrence_page_new (editor); page = COMP_EDITOR_PAGE (priv->recur_page); - if (!e_shell_get_express_mode(e_shell_get_default())) { + if (!e_shell_get_express_mode (shell)) { gtk_container_add ( GTK_CONTAINER ((GTK_DIALOG (priv->recur_window)->vbox)), comp_editor_page_get_widget (page)); @@ -337,7 +340,7 @@ event_editor_constructor (GType type, comp_editor_append_page (editor, page, _("_Recurrence"), TRUE); } - if (e_shell_get_express_mode(e_shell_get_default())) { + if (e_shell_get_express_mode (shell)) { ENameSelector *name_selector; priv->sched_page = schedule_page_new (priv->model, editor); @@ -372,7 +375,7 @@ event_editor_constructor (GType type, event_page_set_meeting (priv->event_page, TRUE); priv->meeting_shown=TRUE; - if (e_shell_get_express_mode(e_shell_get_default())) { + if (e_shell_get_express_mode (shell)) { attendee_page = event_page_get_attendee_page (priv->event_page); comp_editor_append_widget (editor, attendee_page, _("Attendee_s"), TRUE); g_object_unref(attendee_page); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 1dfabb7597..361451efb8 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -724,6 +724,7 @@ static void sensitize_widgets (EventPage *epage) { ECal *client; + EShell *shell; CompEditor *editor; CompEditorFlags flags; GtkActionGroup *action_group; @@ -735,6 +736,7 @@ sensitize_widgets (EventPage *epage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage)); client = comp_editor_get_client (editor); flags = comp_editor_get_flags (editor); + shell = comp_editor_get_shell (editor); priv = epage->priv; if (flags & COMP_EDITOR_MEETING) @@ -828,7 +830,7 @@ sensitize_widgets (EventPage *epage) } else { gtk_widget_show (priv->calendar_label); gtk_widget_show (priv->list_box); - if (!e_shell_get_express_mode(e_shell_get_default())) + if (!e_shell_get_express_mode (shell)) gtk_widget_show (priv->attendee_box); gtk_widget_show (priv->organizer); gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:")); @@ -2131,6 +2133,7 @@ event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *ms static gboolean get_widgets (EventPage *epage) { + EShell *shell; CompEditor *editor; CompEditorPage *page = COMP_EDITOR_PAGE (epage); GtkEntryCompletion *completion; @@ -2146,6 +2149,7 @@ get_widgets (EventPage *epage) #define GW(name) e_builder_get_widget (priv->builder, name) editor = comp_editor_page_get_editor (page); + shell = comp_editor_get_shell (editor); priv->main = GW ("event-page"); if (!priv->main) @@ -2200,7 +2204,7 @@ get_widgets (EventPage *epage) priv->invite = GW ("invite"); priv->invite_label = GW ("invite-label"); - if (e_shell_get_express_mode (e_shell_get_default ())) + if (e_shell_get_express_mode (shell)) gtk_widget_hide (priv->invite); else gtk_widget_hide (priv->invite_label); diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index ba44b7a24a..ae3fadfd59 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -195,10 +195,13 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, if (!is_array_index_in_bounds (week_view->events, event_item->priv->event_num)) return FALSE; - event = &g_array_index (week_view->events, EWeekViewEvent, - event_item->priv->event_num); + event = &g_array_index ( + week_view->events, EWeekViewEvent, + event_item->priv->event_num); - if (!is_array_index_in_bounds (week_view->spans, event->spans_index + event_item->priv->span_num)) + if (!is_array_index_in_bounds ( + week_view->spans, event->spans_index + + event_item->priv->span_num)) return FALSE; span = &g_array_index (week_view->spans, EWeekViewEventSpan, @@ -759,11 +762,14 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, event->spans_index + event_item->priv->span_num < week_view->spans->len); - if (!is_array_index_in_bounds (week_view->spans, event->spans_index + event_item->priv->span_num)) + if (!is_array_index_in_bounds ( + week_view->spans, event->spans_index + + event_item->priv->span_num)) return; - span = &g_array_index (week_view->spans, EWeekViewEventSpan, - event->spans_index + event_item->priv->span_num); + span = &g_array_index ( + week_view->spans, EWeekViewEventSpan, + event->spans_index + event_item->priv->span_num); gc = week_view->main_gc; |