diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-12-08 06:20:49 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-12-08 14:55:28 +0800 |
commit | dd65b18ddf2f4e7fdc108b0ed147658c36103eea (patch) | |
tree | 063b83f2bd337c34bcb573cbae4b6d60ec34eab6 /modules/calendar | |
parent | eb60a4e448fff45d0db5a5856cb19e3abb90a9e0 (diff) | |
download | gsoc2013-evolution-dd65b18ddf2f4e7fdc108b0ed147658c36103eea.tar.gz gsoc2013-evolution-dd65b18ddf2f4e7fdc108b0ed147658c36103eea.tar.zst gsoc2013-evolution-dd65b18ddf2f4e7fdc108b0ed147658c36103eea.zip |
Kill ETableScrolled.
ETableScrolled is nothing but a GtkScrolledWindow containing an ETable.
It adds nothing of value and actually makes customizing ETable harder.
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-content.c | 46 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 8 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-memopad.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 12 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-taskpad.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-content.c | 53 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 16 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-private.c | 26 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-content.c | 53 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-actions.c | 16 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-private.c | 26 |
11 files changed, 134 insertions, 130 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 39834d07ab..0627f74dd6 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -92,15 +92,13 @@ cal_shell_content_display_view_cb (ECalShellContent *cal_shell_content, if (GAL_IS_VIEW_ETABLE (gal_view)) { ECalendarView *calendar_view; - ETable *table; view_type = GNOME_CAL_LIST_VIEW; calendar_view = gnome_calendar_get_calendar_view ( calendar, view_type); - table = e_table_scrolled_get_table ( - E_CAL_LIST_VIEW (calendar_view)->table_scrolled); gal_view_etable_attach_table ( - GAL_VIEW_ETABLE (gal_view), table); + GAL_VIEW_ETABLE (gal_view), + E_CAL_LIST_VIEW (calendar_view)->table); } else { view_type = calendar_view_get_view_type ( CALENDAR_VIEW (gal_view)); @@ -163,11 +161,11 @@ cal_shell_content_get_focus_location (ECalShellContent *cal_shell_content) memo_table = E_MEMO_TABLE (cal_shell_content->priv->memo_table); task_table = E_CALENDAR_TABLE (cal_shell_content->priv->task_table); - table = e_memo_table_get_table (memo_table); + table = E_TABLE (memo_table); if (gtk_widget_is_focus (GTK_WIDGET (table->table_canvas))) return FOCUS_MEMO_TABLE; - table = e_calendar_table_get_table (task_table); + table = E_TABLE (task_table); if (gtk_widget_is_focus (GTK_WIDGET (table->table_canvas))) return FOCUS_TASK_TABLE; @@ -204,12 +202,10 @@ cal_shell_content_get_focus_location (ECalShellContent *cal_shell_content) } else if (E_IS_CAL_LIST_VIEW (calendar_view)) { ECalListView *list_view = E_CAL_LIST_VIEW (calendar_view); - table = e_table_scrolled_get_table (list_view->table_scrolled); - - if (gtk_widget_is_focus (GTK_WIDGET (table))) + if (gtk_widget_is_focus (GTK_WIDGET (list_view->table))) return FOCUS_CALENDAR; - if (gtk_widget_is_focus (GTK_WIDGET (table->table_canvas))) + if (gtk_widget_is_focus (GTK_WIDGET (list_view->table->table_canvas))) return FOCUS_CALENDAR; if (gtk_widget_is_focus (GTK_WIDGET (list_view))) @@ -435,13 +431,24 @@ cal_shell_content_constructed (GObject *object) gtk_widget_show (widget); g_free (markup); - widget = e_calendar_table_new (shell_view, task_model); + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + gtk_widget_show (widget); + + container = widget; + + widget = e_calendar_table_new (shell_view, task_model); + gtk_container_add (GTK_CONTAINER (container), widget); priv->task_table = g_object_ref (widget); gtk_widget_show (widget); filename = g_build_filename (config_dir, "TaskPad", NULL); - e_calendar_table_load_state (E_CALENDAR_TABLE (widget), filename); + e_table_load_state (E_TABLE (widget), filename); g_free (filename); g_signal_connect_swapped ( @@ -464,13 +471,24 @@ cal_shell_content_constructed (GObject *object) gtk_widget_show (widget); g_free (markup); - widget = e_memo_table_new (shell_view, memo_model); + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + gtk_widget_show (widget); + + container = widget; + + widget = e_memo_table_new (shell_view, memo_model); + gtk_container_add (GTK_CONTAINER (container), widget); priv->memo_table = g_object_ref (widget); gtk_widget_show (widget); filename = g_build_filename (config_dir, "MemoPad", NULL); - e_memo_table_load_state (E_MEMO_TABLE (widget), filename); + e_table_load_state (E_TABLE (widget), filename); g_free (filename); g_signal_connect_swapped ( diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 3b25d0b763..b5fd49bb83 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -207,11 +207,9 @@ action_calendar_print_cb (GtkAction *action, print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG; if (E_IS_CAL_LIST_VIEW (view)) { - ECalListView *list_view; ETable *table; - list_view = E_CAL_LIST_VIEW (view); - table = e_table_scrolled_get_table (list_view->table_scrolled); + table = E_CAL_LIST_VIEW (view)->table; print_table (table, _("Print"), _("Calendar"), print_action); } else { time_t start; @@ -238,11 +236,9 @@ action_calendar_print_preview_cb (GtkAction *action, print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW; if (E_IS_CAL_LIST_VIEW (view)) { - ECalListView *list_view; ETable *table; - list_view = E_CAL_LIST_VIEW (view); - table = e_table_scrolled_get_table (list_view->table_scrolled); + table = E_CAL_LIST_VIEW (view)->table; print_table (table, _("Print"), _("Calendar"), print_action); } else { time_t start; diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c index d786f4701a..5f1ed972dd 100644 --- a/modules/calendar/e-cal-shell-view-memopad.c +++ b/modules/calendar/e-cal-shell-view-memopad.c @@ -393,7 +393,6 @@ e_cal_shell_view_memopad_actions_update (ECalShellView *cal_shell_view) EShellWindow *shell_window; EShellView *shell_view; EMemoTable *memo_table; - ETable *table; GtkAction *action; GSList *list, *iter; const gchar *label; @@ -408,8 +407,7 @@ e_cal_shell_view_memopad_actions_update (ECalShellView *cal_shell_view) cal_shell_content = cal_shell_view->priv->cal_shell_content; memo_table = e_cal_shell_content_get_memo_table (cal_shell_content); - table = e_memo_table_get_table (memo_table); - n_selected = e_table_selected_count (table); + n_selected = e_table_selected_count (E_TABLE (memo_table)); list = e_memo_table_get_selected (memo_table); for (iter = list; iter != NULL; iter = iter->next) { diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index ddee1d9544..4aa9d00436 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -557,6 +557,11 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) cal_shell_view); g_signal_connect_swapped ( + memo_table, "selection-change", + G_CALLBACK (e_cal_shell_view_memopad_actions_update), + cal_shell_view); + + g_signal_connect_swapped ( memo_table, "status-message", G_CALLBACK (e_cal_shell_view_memopad_set_status_message), cal_shell_view); @@ -572,12 +577,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) cal_shell_view); g_signal_connect_swapped ( - e_memo_table_get_table (memo_table), "selection-change", - G_CALLBACK (e_cal_shell_view_memopad_actions_update), - cal_shell_view); - - g_signal_connect_swapped ( - e_calendar_table_get_table (task_table), "selection-change", + task_table, "selection-change", G_CALLBACK (e_cal_shell_view_taskpad_actions_update), cal_shell_view); diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c index a00474a572..e011568117 100644 --- a/modules/calendar/e-cal-shell-view-taskpad.c +++ b/modules/calendar/e-cal-shell-view-taskpad.c @@ -481,7 +481,6 @@ e_cal_shell_view_taskpad_actions_update (ECalShellView *cal_shell_view) EShellWindow *shell_window; EShellView *shell_view; ECalendarTable *task_table; - ETable *table; GtkAction *action; GSList *list, *iter; const gchar *label; @@ -499,8 +498,7 @@ e_cal_shell_view_taskpad_actions_update (ECalShellView *cal_shell_view) cal_shell_content = cal_shell_view->priv->cal_shell_content; task_table = e_cal_shell_content_get_task_table (cal_shell_content); - table = e_calendar_table_get_table (task_table); - n_selected = e_table_selected_count (table); + n_selected = e_table_selected_count (E_TABLE (task_table)); list = e_calendar_table_get_selected (task_table); for (iter = list; iter != NULL; iter = iter->next) { diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 21ab63e789..d3fe10f20b 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -85,15 +85,14 @@ memo_shell_content_display_view_cb (EMemoShellContent *memo_shell_content, GalView *gal_view) { EMemoTable *memo_table; - ETable *table; if (!GAL_IS_VIEW_ETABLE (gal_view)) return; memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - table = e_memo_table_get_table (memo_table); - gal_view_etable_attach_table (GAL_VIEW_ETABLE (gal_view), table); + gal_view_etable_attach_table ( + GAL_VIEW_ETABLE (gal_view), E_TABLE (memo_table)); } static void @@ -145,7 +144,6 @@ memo_shell_content_table_drag_data_get_cb (EMemoShellContent *memo_shell_content guint time) { EMemoTable *memo_table; - ETable *table; struct { ECalModel *model; @@ -156,13 +154,13 @@ memo_shell_content_table_drag_data_get_cb (EMemoShellContent *memo_shell_content return; memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - table = e_memo_table_get_table (memo_table); foreach_data.model = e_memo_table_get_model (memo_table); foreach_data.list = NULL; e_table_selected_row_foreach ( - table, memo_shell_content_table_foreach_cb, + E_TABLE (memo_table), + memo_shell_content_table_foreach_cb, &foreach_data); if (foreach_data.list != NULL) { @@ -243,7 +241,6 @@ memo_shell_content_model_row_changed_cb (EMemoShellContent *memo_shell_content, { ECalModelComponent *comp_data; EMemoTable *memo_table; - ETable *table; const gchar *current_uid; const gchar *uid; @@ -260,9 +257,9 @@ memo_shell_content_model_row_changed_cb (EMemoShellContent *memo_shell_content, return; memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - table = e_memo_table_get_table (memo_table); - memo_shell_content_cursor_change_cb (memo_shell_content, 0, table); + memo_shell_content_cursor_change_cb ( + memo_shell_content, 0, E_TABLE (memo_table)); } static GtkOrientation @@ -396,7 +393,6 @@ memo_shell_content_constructed (GObject *object) EShellTaskbar *shell_taskbar; GalViewInstance *view_instance; icaltimezone *timezone; - ETable *table; GConfBridge *bridge; GtkWidget *container; GtkWidget *widget; @@ -431,13 +427,26 @@ memo_shell_content_constructed (GObject *object) e_binding_new (object, "orientation", widget, "orientation"); + container = priv->paned; + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); + gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE); + gtk_widget_show (widget); + container = widget; widget = e_memo_table_new (shell_view, priv->memo_model); - gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE); + gtk_container_add (GTK_CONTAINER (container), widget); priv->memo_table = g_object_ref (widget); gtk_widget_show (widget); + container = priv->paned; + widget = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (widget), @@ -466,33 +475,31 @@ memo_shell_content_constructed (GObject *object) /* Configure the memo table. */ - widget = E_MEMO_TABLE (priv->memo_table)->etable; - table = e_table_scrolled_get_table (E_TABLE_SCROLLED (widget)); - - e_table_set_state (table, E_MEMO_TABLE_DEFAULT_STATE); + e_table_set_state ( + E_TABLE (priv->memo_table), E_MEMO_TABLE_DEFAULT_STATE); e_table_drag_source_set ( - table, GDK_BUTTON1_MASK, - drag_types, G_N_ELEMENTS (drag_types), + E_TABLE (priv->memo_table), + GDK_BUTTON1_MASK, drag_types, G_N_ELEMENTS (drag_types), GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_ASK); g_signal_connect_swapped ( - table, "table-drag-data-get", + priv->memo_table, "table-drag-data-get", G_CALLBACK (memo_shell_content_table_drag_data_get_cb), object); g_signal_connect_swapped ( - table, "table-drag-data-delete", + priv->memo_table, "table-drag-data-delete", G_CALLBACK (memo_shell_content_table_drag_data_delete_cb), object); g_signal_connect_swapped ( - table, "cursor-change", + priv->memo_table, "cursor-change", G_CALLBACK (memo_shell_content_cursor_change_cb), object); g_signal_connect_swapped ( - table, "selection-change", + priv->memo_table, "selection-change", G_CALLBACK (memo_shell_content_selection_change_cb), object); @@ -529,7 +536,6 @@ memo_shell_content_check_state (EShellContent *shell_content) { EMemoShellContent *memo_shell_content; EMemoTable *memo_table; - ETable *table; GSList *list, *iter; GtkClipboard *clipboard; gboolean editable = TRUE; @@ -540,8 +546,7 @@ memo_shell_content_check_state (EShellContent *shell_content) memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content); memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - table = e_memo_table_get_table (memo_table); - n_selected = e_table_selected_count (table); + n_selected = e_table_selected_count (E_TABLE (memo_table)); list = e_memo_table_get_selected (memo_table); for (iter = list; iter != NULL; iter = iter->next) { diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index f5fb6284b4..78531fc8ba 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -243,15 +243,13 @@ action_memo_list_print_cb (GtkAction *action, { EMemoShellContent *memo_shell_content; EMemoTable *memo_table; - ETable *table; - GtkPrintOperationAction print_action; memo_shell_content = memo_shell_view->priv->memo_shell_content; memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - table = e_memo_table_get_table (memo_table); - print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG; - print_table (table, _("Print Memos"), _("Memos"), print_action); + print_table ( + E_TABLE (memo_table), _("Print Memos"), _("Memos"), + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); } static void @@ -260,15 +258,13 @@ action_memo_list_print_preview_cb (GtkAction *action, { EMemoShellContent *memo_shell_content; EMemoTable *memo_table; - ETable *table; - GtkPrintOperationAction print_action; memo_shell_content = memo_shell_view->priv->memo_shell_content; memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - table = e_memo_table_get_table (memo_table); - print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW; - print_table (table, _("Print Memos"), _("Memos"), print_action); + print_table ( + E_TABLE (memo_table), _("Print Memos"), _("Memos"), + GTK_PRINT_OPERATION_ACTION_PREVIEW); } static void diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c index 9ae26c7767..583af2af17 100644 --- a/modules/calendar/e-memo-shell-view-private.c +++ b/modules/calendar/e-memo-shell-view-private.c @@ -173,7 +173,6 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) EShellWindow *shell_window; EMemoTable *memo_table; ECalModel *model; - ETable *table; ESourceSelector *selector; shell_view = E_SHELL_VIEW (memo_shell_view); @@ -193,7 +192,6 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content); memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); model = e_memo_table_get_model (memo_table); - table = e_memo_table_get_table (memo_table); memo_shell_sidebar = E_MEMO_SHELL_SIDEBAR (shell_sidebar); selector = e_memo_shell_sidebar_get_selector (memo_shell_sidebar); @@ -214,6 +212,16 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) memo_shell_view); g_signal_connect_swapped ( + memo_table, "selection-change", + G_CALLBACK (e_memo_shell_view_update_sidebar), + memo_shell_view); + + g_signal_connect_swapped ( + memo_table, "selection-change", + G_CALLBACK (e_shell_view_update_actions), + memo_shell_view); + + g_signal_connect_swapped ( memo_table, "status-message", G_CALLBACK (e_memo_shell_view_set_status_message), memo_shell_view); @@ -239,16 +247,6 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) memo_shell_view); g_signal_connect_swapped ( - table, "selection-change", - G_CALLBACK (e_memo_shell_view_update_sidebar), - memo_shell_view); - - g_signal_connect_swapped ( - table, "selection-change", - G_CALLBACK (e_shell_view_update_actions), - memo_shell_view); - - g_signal_connect_swapped ( memo_shell_sidebar, "client-added", G_CALLBACK (memo_shell_view_selector_client_added_cb), memo_shell_view); @@ -394,7 +392,6 @@ e_memo_shell_view_update_sidebar (EMemoShellView *memo_shell_view) EShellSidebar *shell_sidebar; EMemoTable *memo_table; ECalModel *model; - ETable *table; GString *string; const gchar *format; gint n_rows; @@ -407,10 +404,9 @@ e_memo_shell_view_update_sidebar (EMemoShellView *memo_shell_view) memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); model = e_memo_table_get_model (memo_table); - table = e_memo_table_get_table (memo_table); n_rows = e_table_model_row_count (E_TABLE_MODEL (model)); - n_selected = e_table_selected_count (table); + n_selected = e_table_selected_count (E_TABLE (memo_table)); string = g_string_sized_new (64); diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index ca17cdbd5c..c033d6e489 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -86,15 +86,14 @@ task_shell_content_display_view_cb (ETaskShellContent *task_shell_content, GalView *gal_view) { ECalendarTable *task_table; - ETable *table; if (!GAL_IS_VIEW_ETABLE (gal_view)) return; task_table = e_task_shell_content_get_task_table (task_shell_content); - table = e_calendar_table_get_table (task_table); - gal_view_etable_attach_table (GAL_VIEW_ETABLE (gal_view), table); + gal_view_etable_attach_table ( + GAL_VIEW_ETABLE (gal_view), E_TABLE (task_table)); } static void @@ -146,7 +145,6 @@ task_shell_content_table_drag_data_get_cb (ETaskShellContent *task_shell_content guint time) { ECalendarTable *task_table; - ETable *table; struct { ECalModel *model; @@ -157,13 +155,13 @@ task_shell_content_table_drag_data_get_cb (ETaskShellContent *task_shell_content return; task_table = e_task_shell_content_get_task_table (task_shell_content); - table = e_calendar_table_get_table (task_table); foreach_data.model = e_calendar_table_get_model (task_table); foreach_data.list = NULL; e_table_selected_row_foreach ( - table, task_shell_content_table_foreach_cb, + E_TABLE (task_table), + task_shell_content_table_foreach_cb, &foreach_data); if (foreach_data.list != NULL) { @@ -242,7 +240,6 @@ task_shell_content_model_row_changed_cb (ETaskShellContent *task_shell_content, { ECalModelComponent *comp_data; ECalendarTable *task_table; - ETable *table; const gchar *current_uid; const gchar *uid; @@ -259,9 +256,9 @@ task_shell_content_model_row_changed_cb (ETaskShellContent *task_shell_content, return; task_table = e_task_shell_content_get_task_table (task_shell_content); - table = e_calendar_table_get_table (task_table); - task_shell_content_cursor_change_cb (task_shell_content, 0, table); + task_shell_content_cursor_change_cb ( + task_shell_content, 0, E_TABLE (task_table)); } static GtkOrientation @@ -395,7 +392,6 @@ task_shell_content_constructed (GObject *object) EShellView *shell_view; GalViewInstance *view_instance; icaltimezone *timezone; - ETable *table; GConfBridge *bridge; GtkWidget *container; GtkWidget *widget; @@ -429,13 +425,26 @@ task_shell_content_constructed (GObject *object) e_binding_new (object, "orientation", widget, "orientation"); + container = priv->paned; + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); + gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE); + gtk_widget_show (widget); + container = widget; widget = e_calendar_table_new (shell_view, priv->task_model); - gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE); + gtk_container_add (GTK_CONTAINER (container), widget); priv->task_table = g_object_ref (widget); gtk_widget_show (widget); + container = priv->paned; + widget = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (widget), @@ -464,33 +473,31 @@ task_shell_content_constructed (GObject *object) /* Configure the task table. */ - widget = E_CALENDAR_TABLE (priv->task_table)->etable; - table = e_table_scrolled_get_table (E_TABLE_SCROLLED (widget)); - - e_table_set_state (table, E_CALENDAR_TABLE_DEFAULT_STATE); + e_table_set_state ( + E_TABLE (priv->task_table), E_CALENDAR_TABLE_DEFAULT_STATE); e_table_drag_source_set ( - table, GDK_BUTTON1_MASK, - drag_types, G_N_ELEMENTS (drag_types), + E_TABLE (priv->task_table), + GDK_BUTTON1_MASK, drag_types, G_N_ELEMENTS (drag_types), GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_ASK); g_signal_connect_swapped ( - table, "table-drag-data-get", + priv->task_table, "table-drag-data-get", G_CALLBACK (task_shell_content_table_drag_data_get_cb), object); g_signal_connect_swapped ( - table, "table-drag-data-delete", + priv->task_table, "table-drag-data-delete", G_CALLBACK (task_shell_content_table_drag_data_delete_cb), object); g_signal_connect_swapped ( - table, "cursor-change", + priv->task_table, "cursor-change", G_CALLBACK (task_shell_content_cursor_change_cb), object); g_signal_connect_swapped ( - table, "selection-change", + priv->task_table, "selection-change", G_CALLBACK (task_shell_content_selection_change_cb), object); @@ -527,7 +534,6 @@ task_shell_content_check_state (EShellContent *shell_content) { ETaskShellContent *task_shell_content; ECalendarTable *task_table; - ETable *table; GSList *list, *iter; GtkClipboard *clipboard; gboolean assignable = TRUE; @@ -541,8 +547,7 @@ task_shell_content_check_state (EShellContent *shell_content) task_shell_content = E_TASK_SHELL_CONTENT (shell_content); task_table = e_task_shell_content_get_task_table (task_shell_content); - table = e_calendar_table_get_table (task_table); - n_selected = e_table_selected_count (table); + n_selected = e_table_selected_count (E_TABLE (task_table)); list = e_calendar_table_get_selected (task_table); for (iter = list; iter != NULL; iter = iter->next) { diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index f1285a714b..f923a03f2b 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -274,15 +274,13 @@ action_task_list_print_cb (GtkAction *action, { ETaskShellContent *task_shell_content; ECalendarTable *task_table; - ETable *table; - GtkPrintOperationAction print_action; task_shell_content = task_shell_view->priv->task_shell_content; task_table = e_task_shell_content_get_task_table (task_shell_content); - table = e_calendar_table_get_table (task_table); - print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG; - print_table (table, _("Print Tasks"), _("Tasks"), print_action); + print_table ( + E_TABLE (task_table), _("Print Tasks"), _("Tasks"), + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); } static void @@ -291,15 +289,13 @@ action_task_list_print_preview_cb (GtkAction *action, { ETaskShellContent *task_shell_content; ECalendarTable *task_table; - ETable *table; - GtkPrintOperationAction print_action; task_shell_content = task_shell_view->priv->task_shell_content; task_table = e_task_shell_content_get_task_table (task_shell_content); - table = e_calendar_table_get_table (task_table); - print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW; - print_table (table, _("Print Tasks"), _("Tasks"), print_action); + print_table ( + E_TABLE (task_table), _("Print Tasks"), _("Tasks"), + GTK_PRINT_OPERATION_ACTION_PREVIEW); } static void diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index bbe0a1035d..4337f19a79 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -223,7 +223,6 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) EShellWindow *shell_window; ECalendarTable *task_table; ECalModel *model; - ETable *table; ESourceSelector *selector; shell_view = E_SHELL_VIEW (task_shell_view); @@ -247,7 +246,6 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_content = E_TASK_SHELL_CONTENT (shell_content); task_table = e_task_shell_content_get_task_table (task_shell_content); model = e_calendar_table_get_model (task_table); - table = e_calendar_table_get_table (task_table); task_shell_sidebar = E_TASK_SHELL_SIDEBAR (shell_sidebar); selector = e_task_shell_sidebar_get_selector (task_shell_sidebar); @@ -268,6 +266,16 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_view); g_signal_connect_swapped ( + task_table, "selection-change", + G_CALLBACK (e_task_shell_view_update_sidebar), + task_shell_view); + + g_signal_connect_swapped ( + task_table, "selection-change", + G_CALLBACK (e_shell_view_update_actions), + task_shell_view); + + g_signal_connect_swapped ( task_table, "status-message", G_CALLBACK (e_task_shell_view_set_status_message), task_shell_view); @@ -293,16 +301,6 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_view); g_signal_connect_swapped ( - table, "selection-change", - G_CALLBACK (e_task_shell_view_update_sidebar), - task_shell_view); - - g_signal_connect_swapped ( - table, "selection-change", - G_CALLBACK (e_shell_view_update_actions), - task_shell_view); - - g_signal_connect_swapped ( task_shell_sidebar, "client-added", G_CALLBACK (task_shell_view_selector_client_added_cb), task_shell_view); @@ -545,7 +543,6 @@ e_task_shell_view_update_sidebar (ETaskShellView *task_shell_view) EShellSidebar *shell_sidebar; ECalendarTable *task_table; ECalModel *model; - ETable *table; GString *string; const gchar *format; gint n_rows; @@ -558,10 +555,9 @@ e_task_shell_view_update_sidebar (ETaskShellView *task_shell_view) task_table = e_task_shell_content_get_task_table (task_shell_content); model = e_calendar_table_get_model (task_table); - table = e_calendar_table_get_table (task_table); n_rows = e_table_model_row_count (E_TABLE_MODEL (model)); - n_selected = e_table_selected_count (table); + n_selected = e_table_selected_count (E_TABLE (task_table)); string = g_string_sized_new (64); |