From dd65b18ddf2f4e7fdc108b0ed147658c36103eea Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 7 Dec 2009 17:20:49 -0500 Subject: Kill ETableScrolled. ETableScrolled is nothing but a GtkScrolledWindow containing an ETable. It adds nothing of value and actually makes customizing ETable harder. --- widgets/menus/gal-define-views-dialog.c | 23 - widgets/menus/gal-view-new-dialog.c | 1 - widgets/table/Makefile.am | 2 - widgets/table/e-table-config.c | 50 +- widgets/table/e-table-config.ui | 1406 ++++++++++--------------------- widgets/table/e-table-item.c | 50 -- widgets/table/e-table-item.h | 5 - widgets/table/e-table-scrolled.c | 220 ----- widgets/table/e-table-scrolled.h | 76 -- 9 files changed, 456 insertions(+), 1377 deletions(-) delete mode 100644 widgets/table/e-table-scrolled.c delete mode 100644 widgets/table/e-table-scrolled.h (limited to 'widgets') diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index ade534bc02..c63456d620 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -178,26 +178,6 @@ gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) } } -#if 0 -static void -gdvd_button_copy_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) -{ - gint row; - GtkWidget *scrolled; - ETable *etable; - - scrolled = e_builder_get_widget(dialog->builder, "custom-table"); - etable = e_table_scrolled_get_table(E_TABLE_SCROLLED(scrolled)); - row = e_table_get_cursor_row (E_TABLE(etable)); - - if (row != -1) { - gal_define_views_model_copy_view(GAL_DEFINE_VIEWS_MODEL(dialog->model), - row); - } - -} -#endif - static void gdvd_cursor_changed_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) { @@ -271,9 +251,6 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) gdvd_connect_signal (dialog, "button-new", "clicked", G_CALLBACK (gdvd_button_new_callback)); gdvd_connect_signal (dialog, "button-modify", "clicked", G_CALLBACK (gdvd_button_modify_callback)); gdvd_connect_signal (dialog, "button-delete", "clicked", G_CALLBACK (gdvd_button_delete_callback)); -#if 0 - gdvd_connect_signal (dialog, "button-copy", "clicked", G_CALLBACK (gdvd_button_copy_callback)); -#endif gdvd_connect_signal (dialog, "treeview1", "cursor-changed", G_CALLBACK (gdvd_cursor_changed_callback)); g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL); diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 328cc5e35e..ba0ade0eef 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -23,7 +23,6 @@ #include -#include "table/e-table-scrolled.h" #include #include "e-util/e-util.h" #include "e-util/e-util-private.h" diff --git a/widgets/table/Makefile.am b/widgets/table/Makefile.am index ae21e57c1e..b43e1f0124 100644 --- a/widgets/table/Makefile.am +++ b/widgets/table/Makefile.am @@ -49,7 +49,6 @@ libetable_la_SOURCES = \ e-table-memory.c \ e-table-model.c \ e-table-one.c \ - e-table-scrolled.c \ e-table-search.c \ e-table-selection-model.c \ e-table-sort-info.c \ @@ -128,7 +127,6 @@ libetableinclude_HEADERS = \ e-table-memory.h \ e-table-model.h \ e-table-one.h \ - e-table-scrolled.h \ e-table-search.h \ e-table-selection-model.h \ e-table-sort-info.h \ diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 226b04cdb3..1bbfc6a8b3 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -41,7 +41,6 @@ #include "e-table-config.h" #include "e-table-memory-store.h" -#include "e-table-scrolled.h" #include "e-table-without.h" G_DEFINE_TYPE (ETableConfig, e_table_config, G_TYPE_OBJECT) @@ -629,13 +628,14 @@ e_table_proxy_etable_shown_new (ETableModel *store) { ETableModel *model = NULL; GtkWidget *widget; - ETableScrolled *ets; model = e_table_subset_variable_new (store); - widget = e_table_scrolled_new (model, NULL, spec, NULL); - ets = E_TABLE_SCROLLED (widget); - atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Show Fields")); + widget = e_table_new (model, NULL, spec, NULL); + + atk_object_set_name ( + gtk_widget_get_accessible (widget), + _("Show Fields")); return widget; } @@ -645,16 +645,17 @@ e_table_proxy_etable_available_new (ETableModel *store) { ETableModel *model; GtkWidget *widget; - ETableScrolled *ets; - model = e_table_without_new (store, - NULL, NULL, NULL, NULL, NULL, NULL, NULL); + model = e_table_without_new ( + store, NULL, NULL, NULL, NULL, NULL, NULL, NULL); e_table_without_show_all (E_TABLE_WITHOUT (model)); - widget = e_table_scrolled_new (model, NULL, spec, NULL); - ets = E_TABLE_SCROLLED (widget); - atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Available Fields")); + widget = e_table_new (model, NULL, spec, NULL); + + atk_object_set_name ( + gtk_widget_get_accessible (widget), + _("Available Fields")); return widget; } @@ -1153,29 +1154,32 @@ static void configure_fields_dialog (ETableConfig *config, GtkBuilder *builder) { GtkWidget *scrolled; + GtkWidget *etable; ETableModel *store = create_store (config); /* "custom-available" widget */ - scrolled = e_table_proxy_etable_available_new (store); - gtk_widget_show (scrolled); - gtk_box_pack_start (GTK_BOX (e_builder_get_widget (builder, "vbox4")), scrolled, TRUE, TRUE, 0); - config->available = e_table_scrolled_get_table (E_TABLE_SCROLLED (scrolled)); + etable = e_table_proxy_etable_available_new (store); + gtk_widget_show (etable); + scrolled = e_builder_get_widget (builder, "available-scrolled"); + gtk_container_add (GTK_CONTAINER (scrolled), etable); + config->available = E_TABLE (etable); g_object_get (config->available, "model", &config->available_model, NULL); - gtk_widget_show_all (scrolled); - gtk_label_set_mnemonic_widget (GTK_LABEL (e_builder_get_widget (builder, "label-available")), scrolled); + gtk_widget_show_all (etable); + gtk_label_set_mnemonic_widget (GTK_LABEL (e_builder_get_widget (builder, "label-available")), etable); /* "custom-shown" widget */ - scrolled = e_table_proxy_etable_shown_new (store); - gtk_widget_show (scrolled); - gtk_box_pack_start (GTK_BOX (e_builder_get_widget (builder, "vbox5")), scrolled, TRUE, TRUE, 0); - config->shown = e_table_scrolled_get_table (E_TABLE_SCROLLED (scrolled)); + etable = e_table_proxy_etable_shown_new (store); + gtk_widget_show (etable); + scrolled = e_builder_get_widget (builder, "shown-scrolled"); + gtk_container_add (GTK_CONTAINER (scrolled), etable); + config->shown = E_TABLE (etable); g_object_get (config->shown, "model", &config->shown_model, NULL); - gtk_widget_show_all (scrolled); - gtk_label_set_mnemonic_widget (GTK_LABEL (e_builder_get_widget (builder, "label-displayed")), scrolled); + gtk_widget_show_all (etable); + gtk_label_set_mnemonic_widget (GTK_LABEL (e_builder_get_widget (builder, "label-displayed")), etable); connect_button (config, builder, "button-add", G_CALLBACK (config_button_add)); connect_button (config, builder, "button-remove", G_CALLBACK (config_button_remove)); diff --git a/widgets/table/e-table-config.ui b/widgets/table/e-table-config.ui index 5e81172a29..cfc6cb57fc 100644 --- a/widgets/table/e-table-config.ui +++ b/widgets/table/e-table-config.ui @@ -1,191 +1,142 @@ - + + Show Fields - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True + dialog True - False + vertical 8 - - - True - GTK_BUTTONBOX_END - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - 0 - False - True - GTK_PACK_END - - True - False + vertical 6 True - 1 5 - True - 6 6 + 6 + True True + 0 A_vailable Fields: True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - 0 2 - 0 - 1 - fill + GTK_FILL True + 0 _Show these fields in order: True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 3 5 - 0 - 1 - fill + GTK_FILL + + + - 0 False - True + 0 True - 1 5 - True - 6 6 + 6 + True True - False + vertical 6 - + + + True + True + automatic + automatic + in + + + + + + 0 + + - 0 2 - 0 - 1 True - False + vertical 6 - + + + True + True + automatic + automatic + in + + + + + + 0 + + True - True 6 + True True True - GTK_RELIEF_NORMAL - True + True True - 0.5 - 0.5 0 0 - 0 - 0 - 0 - 0 True - False 2 True gtk-go-up - 4 - 0.5 - 0.5 - 0 - 0 - 0 False False + 0 @@ -193,23 +144,11 @@ True Move _Up True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - 0 False False + 1 @@ -218,47 +157,33 @@ - 0 False - True + 0 True True - GTK_RELIEF_NORMAL - True + True True - 0.5 - 0.5 0 0 - 0 - 0 - 0 - 0 True - False 2 True gtk-go-down - 4 - 0.5 - 0.5 - 0 - 0 - 0 False False + 0 @@ -266,23 +191,11 @@ True Move _Down True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - 0 False False + 1 @@ -291,91 +204,63 @@ - 0 False - True + 1 - 0 False - True + 1 3 5 - 0 - 1 True - False + vertical 6 True True - GTK_RELIEF_NORMAL - True + False True - 0.7 - 0.5 + 0.69999998807907104 0 0 - 0 - 0 - 0 - 0 True - False 2 True _Add True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - 0 False False + 0 True gtk-go-forward - 4 - 0.5 - 0.5 - 0 - 0 - 0 False False + 1 @@ -384,47 +269,34 @@ - 0 False False + 0 True True - GTK_RELIEF_NORMAL - True + False True - 0.5 - 0.5 0 0 - 0 - 0 - 0 - 0 True - False 2 True gtk-go-back - 4 - 0.5 - 0.5 - 0 - 0 - 0 False False + 0 @@ -432,23 +304,11 @@ True _Remove True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - 0 False False + 1 @@ -457,9 +317,9 @@ - 0 False False + 1 @@ -469,193 +329,154 @@ 2 3 - 0 - 1 - 0 - True - True + 1 - 0 - True - True + 2 - - - - button22 - button20 - - - - Group - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - - - True - False - 8 - + True - GTK_BUTTONBOX_END + end - + + gtk-cancel True - True True - Clear _All - True - GTK_RELIEF_NORMAL - True - - - - - True True - True - gtk-cancel + False True - GTK_RELIEF_NORMAL - True + + False + False + 0 + - + + gtk-ok True - True True - gtk-ok + True + False True - GTK_RELIEF_NORMAL - True + + False + False + 1 + - 0 False - True - GTK_PACK_END + end + 0 + + + + button22 + button20 + + + + Group + True + dialog + + + True + vertical + 8 True - False - 0 + vertical True - False 6 True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - False - 0 - + vertical + _Show field in View True True - _Show field in View + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-group-1 - 0 False False + 1 - 0 False - True + 1 @@ -664,205 +485,137 @@ True Group Items By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - True - True + 0 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 1 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 2 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 3 - 0 - True - True + 0 True - False 6 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 0 True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - False - 0 - + vertical + Show _field in View True True - Show _field in View + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-group-2 - 0 False False + 1 - 0 False - True + 1 @@ -871,205 +624,137 @@ True Then By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - True - True + 1 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 2 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 3 - 0 - True - True + 1 True - False 6 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 0 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 1 True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - False - 0 - + vertical + Show field i_n View True True - Show field i_n View + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-group-3 - 0 False False + 1 - 0 False - True + 1 @@ -1078,205 +763,137 @@ True Then By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - True - True + 2 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 3 - 0 - True - True + 2 True - False 6 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 0 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 1 True - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 + center - 0 False False + 2 True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - False - 0 - + vertical + Show field in _View True True - Show field in _View + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-group-4 - 0 False False + 1 - 0 False - True + 1 @@ -1285,195 +902,158 @@ True Then By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - True - True + 3 - 0 - True - True + 3 - 0 - True - True + 2 - - - - button39 - button42 - button41 - - - - Sort - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - - - True - False - 8 - + True - GTK_BUTTONBOX_END + end - + + Clear _All True - True True - Clear All + True + False True - GTK_RELIEF_NORMAL - True + + False + False + 0 + - + + gtk-cancel True - True True - gtk-cancel + True + False True - GTK_RELIEF_NORMAL - True + + False + False + 1 + - + + gtk-ok True - True - True True - gtk-ok + True + False True - GTK_RELIEF_NORMAL - True + + False + False + 2 + - 0 False - True - GTK_PACK_END + end + 0 + + + + button39 + button42 + button41 + + + + Sort + True + dialog + + + True + vertical + 8 True 4 - 1 - False - 6 6 + 6 True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - 0.5 - 0.5 - 1 0 - 0 - 0 - 0 - 0 - - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-sort-4 - 0 False False + 1 - 0 False - True + 1 @@ -1482,103 +1062,71 @@ True Then By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - 1 3 4 - fill + GTK_FILL True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - 0.5 - 0.5 - 1 0 - 0 - 0 - 0 - 0 - - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-sort-3 - 0 False False + 1 - 0 False - True + 1 @@ -1587,103 +1135,71 @@ True Then By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - 1 2 3 - fill + GTK_FILL True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - 0.5 - 0.5 - 1 0 - 0 - 0 - 0 - 0 - - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-sort-2 - 0 False False + 1 - 0 False - True + 1 @@ -1692,103 +1208,71 @@ True Then By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - 1 1 2 - fill + GTK_FILL True 0 - 0.5 - GTK_SHADOW_ETCHED_IN True - False 6 True - 0.5 - 0.5 - 1 0 - 0 - 0 - 0 - 0 - - 0 - True - True + 0 True - False - 0 + vertical + Ascending True True - Ascending + False True - GTK_RELIEF_NORMAL - True - False - False True - 0 False False + 0 + Descending True True - Descending + False True - GTK_RELIEF_NORMAL - True - False - False True radiobutton-ascending-sort-1 - 0 False False + 1 - 0 False - True + 1 @@ -1797,314 +1281,237 @@ True Sort Items By - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - 1 - 0 - 1 - fill + GTK_FILL - 0 - True - True + 2 - - - - button43 - button45 - button44 - - - - dialog1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - True - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - - - True - False - 0 - + True - GTK_BUTTONBOX_END + end - + + Clear All True - True True - gtk-cancel - True - GTK_RELIEF_NORMAL - True + True + False + True + + False + False + 0 + - + + gtk-cancel True - True True - gtk-apply + True + False True - GTK_RELIEF_NORMAL - True + + False + False + 1 + - + + gtk-ok True - True True - gtk-ok + True + True + False True - GTK_RELIEF_NORMAL - True + + False + False + 2 + - 0 False - True - GTK_PACK_END + end + 0 + + + + button43 + button45 + button44 + + + + dialog1 + False + True + center-on-parent + dialog + + + True + vertical - 2 True + 2 0 - 0.5 - GTK_SHADOW_ETCHED_IN - 2 True + 2 3 3 - False - 2 4 + 2 + _Sort... True - True True - _Sort... + True + False True - GTK_RELIEF_NORMAL - True - + - 0 - 1 2 3 - fill - + GTK_FILL + + _Group By... True - True True - _Group By... + True + False True - GTK_RELIEF_NORMAL - True - + - 0 - 1 1 2 - fill - + GTK_FILL + True - - False - False - GTK_JUSTIFY_LEFT - True - False 0 - 0.5 - 0 - 0 + True 1 2 2 3 - fill + GTK_FILL + _Fields Shown... True - True True - _Fields Shown... + True + False True - GTK_RELIEF_NORMAL - True - + - 0 - 1 - 0 - 1 - fill - + GTK_FILL + True - - False - False - GTK_JUSTIFY_LEFT - True - False 0 - 0.5 - 0 - 0 + True 1 2 - 0 - 1 - fill + GTK_FILL True - - False - False - GTK_JUSTIFY_CENTER - False - False 0 - 0.5 - 0 - 0 + center 2 3 1 2 - fill - fill + GTK_FILL + GTK_FILL True - - False - False - GTK_JUSTIFY_CENTER - False - False 0 - 0.5 - 0 - 0 + center 2 3 2 3 - fill - fill + GTK_FILL + GTK_FILL True - - False - False - GTK_JUSTIFY_CENTER - False - False 0 - 0.5 - 0 - 0 + center 2 3 - 0 - 1 - fill - fill + GTK_FILL + GTK_FILL True - - False - False - GTK_JUSTIFY_LEFT - True - False 0 - 0.5 - 0 - 0 + True 1 2 1 2 - fill - + GTK_FILL + @@ -2113,22 +1520,67 @@ True Description - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - 0 - True - True + 2 + + + + + True + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-apply + True + True + True + False + True + + + False + False + 1 + + + + + gtk-ok + True + True + True + False + True + + + False + False + 2 + + + + + False + end + 0 diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index c8809b6087..a534ef2924 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -929,24 +929,6 @@ eti_show_cursor (ETableItem *eti, gint delay) } } -static void -eti_check_cursor_on_screen (ETableItem *eti) -{ - if (eti->cursor_x1 == -1 || - eti->cursor_y1 == -1 || - eti->cursor_x2 == -1 || - eti->cursor_y2 == -1) - return; - - eti->cursor_on_screen = e_canvas_item_area_shown (GNOME_CANVAS_ITEM(eti), - eti->cursor_x1, - eti->cursor_y1, - eti->cursor_x2, - eti->cursor_y2); - - d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE")); -} - static void eti_check_cursor_bounds (ETableItem *eti) { @@ -1653,16 +1635,6 @@ eti_init (ETableItem *eti) static const gchar gray50_bits[] = { 0x02, 0x01, }; -static void -adjustment_changed (GtkAdjustment *adjustment, ETableItem *eti) -{ - /* FIXME: It is the ugliest of hack to set the focus to scroll. Fix this up when moving away from e-tree */ - if (g_object_get_data ((GObject *) ((GnomeCanvasItem *) eti)->canvas, "freeze-cursor")) - eti_maybe_show_cursor (eti, 0); - - eti_check_cursor_on_screen (eti); -} - static gboolean eti_tree_unfreeze (GtkWidget *widget, GdkEvent *event, ETableItem *eti) { @@ -1702,19 +1674,6 @@ eti_realize (GnomeCanvasItem *item) gdk_gc_set_stipple (eti->focus_gc, eti->stipple); gdk_gc_set_fill (eti->focus_gc, GDK_OPAQUE_STIPPLED); - eti->hadjustment_change_id = - g_signal_connect (gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), "changed", - G_CALLBACK (adjustment_changed), eti); - eti->hadjustment_value_change_id = - g_signal_connect (gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), "value_changed", - G_CALLBACK (adjustment_changed), eti); - eti->vadjustment_change_id = - g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "changed", - G_CALLBACK (adjustment_changed), eti); - eti->vadjustment_value_change_id = - g_signal_connect (gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), "value_changed", - G_CALLBACK (adjustment_changed), eti); - g_signal_connect (GTK_LAYOUT(item->canvas), "scroll_event", G_CALLBACK (eti_tree_unfreeze), eti); if (eti->cell_views == NULL) @@ -1795,15 +1754,6 @@ eti_unrealize (GnomeCanvasItem *item) eti->height = 0; - g_signal_handler_disconnect(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), - eti->hadjustment_change_id); - g_signal_handler_disconnect(gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas)), - eti->hadjustment_value_change_id); - g_signal_handler_disconnect(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), - eti->vadjustment_change_id); - g_signal_handler_disconnect(gtk_layout_get_vadjustment(GTK_LAYOUT(item->canvas)), - eti->vadjustment_value_change_id); - if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->unrealize) (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->unrealize)(item); } diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index cd3bf1d26b..8cc4b54161 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -80,11 +80,6 @@ typedef struct { /* View row, -1 means unknown */ gint old_cursor_row; - gint hadjustment_change_id; - gint hadjustment_value_change_id; - gint vadjustment_change_id; - gint vadjustment_value_change_id; - GdkGC *fill_gc; GdkGC *grid_gc; GdkGC *focus_gc; diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c deleted file mode 100644 index 3d937dd9cd..0000000000 --- a/widgets/table/e-table-scrolled.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Chris Lahey - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include "e-table.h" -#include "e-table-scrolled.h" - -#define COLUMN_HEADER_HEIGHT 16 - -G_DEFINE_TYPE (ETableScrolled, e_table_scrolled, GTK_TYPE_SCROLLED_WINDOW) - -enum { - PROP_0, - PROP_TABLE -}; - -static void -e_table_scrolled_init (ETableScrolled *ets) -{ - GtkScrolledWindow *scrolled_window; - - scrolled_window = GTK_SCROLLED_WINDOW (ets); - - GTK_WIDGET_SET_FLAGS (ets, GTK_CAN_FOCUS); - - ets->table = g_object_new (E_TABLE_TYPE, NULL); - - gtk_scrolled_window_set_policy (scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (scrolled_window, GTK_SHADOW_IN); -} - -static void -e_table_scrolled_real_construct (ETableScrolled *ets) -{ - gtk_container_add(GTK_CONTAINER(ets), GTK_WIDGET(ets->table)); - - gtk_widget_show(GTK_WIDGET(ets->table)); -} - -ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets, - ETableModel *etm, - ETableExtras *ete, - const gchar *spec, - const gchar *state) -{ - g_return_val_if_fail(ets != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_SCROLLED(ets), NULL); - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec != NULL, NULL); - - e_table_construct(ets->table, etm, ete, spec, state); - - e_table_scrolled_real_construct(ets); - - return ets; -} - -GtkWidget *e_table_scrolled_new (ETableModel *etm, - ETableExtras *ete, - const gchar *spec, - const gchar *state) -{ - ETableScrolled *ets; - - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec != NULL, NULL); - - ets = E_TABLE_SCROLLED (gtk_widget_new (e_table_scrolled_get_type (), - "hadjustment", NULL, - "vadjustment", NULL, - NULL)); - - ets = e_table_scrolled_construct (ets, etm, ete, spec, state); - - return GTK_WIDGET (ets); -} - -ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *ets, - ETableModel *etm, - ETableExtras *ete, - const gchar *spec_fn, - const gchar *state_fn) -{ - g_return_val_if_fail(ets != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_SCROLLED(ets), NULL); - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec_fn != NULL, NULL); - - e_table_construct_from_spec_file(ets->table, etm, ete, spec_fn, state_fn); - - e_table_scrolled_real_construct(ets); - - return ets; -} - -GtkWidget *e_table_scrolled_new_from_spec_file (ETableModel *etm, - ETableExtras *ete, - const gchar *spec_fn, - const gchar *state_fn) -{ - ETableScrolled *ets; - - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec_fn != NULL, NULL); - - ets = E_TABLE_SCROLLED (gtk_widget_new (e_table_scrolled_get_type (), - "hadjustment", NULL, - "vadjustment", NULL, - NULL)); - - ets = e_table_scrolled_construct_from_spec_file (ets, etm, ete, spec_fn, state_fn); - - return GTK_WIDGET (ets); -} - -ETable * -e_table_scrolled_get_table (ETableScrolled *ets) -{ - return ets->table; -} - -static void -ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) -{ - ETableScrolled *ets = E_TABLE_SCROLLED (object); - - switch (prop_id) { - case PROP_TABLE: - g_value_set_object (value, ets->table); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -/* Grab_focus handler for the scrolled ETable */ -static void -ets_grab_focus (GtkWidget *widget) -{ - ETableScrolled *ets; - - ets = E_TABLE_SCROLLED (widget); - - gtk_widget_grab_focus (GTK_WIDGET (ets->table)); -} - -/* Focus handler for the scrolled ETable */ -static gint -ets_focus (GtkWidget *container, GtkDirectionType direction) -{ - ETableScrolled *ets; - - ets = E_TABLE_SCROLLED (container); - - return gtk_widget_child_focus (GTK_WIDGET (ets->table), direction); -} - -static void -e_table_scrolled_class_init (ETableScrolledClass *class) -{ - GObjectClass *object_class; - GtkWidgetClass *widget_class; - - object_class = (GObjectClass *) class; - widget_class = (GtkWidgetClass *) class; - - object_class->get_property = ets_get_property; - - widget_class->grab_focus = ets_grab_focus; - - widget_class->focus = ets_focus; - - g_object_class_install_property (object_class, PROP_TABLE, - g_param_spec_object ("table", - _( "Table" ), - _( "Table" ), - E_TABLE_TYPE, - G_PARAM_READABLE)); -} - diff --git a/widgets/table/e-table-scrolled.h b/widgets/table/e-table-scrolled.h deleted file mode 100644 index 71e50b8cdd..0000000000 --- a/widgets/table/e-table-scrolled.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Chris Lahey - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef _E_TABLE_SCROLLED_H_ -#define _E_TABLE_SCROLLED_H_ - -#include -#include -#include
- -G_BEGIN_DECLS - -#define E_TABLE_SCROLLED_TYPE (e_table_scrolled_get_type ()) -#define E_TABLE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SCROLLED_TYPE, ETableScrolled)) -#define E_TABLE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SCROLLED_TYPE, ETableScrolledClass)) -#define E_IS_TABLE_SCROLLED(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SCROLLED_TYPE)) -#define E_IS_TABLE_SCROLLED_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SCROLLED_TYPE)) - -typedef struct { - GtkScrolledWindow parent; - - ETable *table; -} ETableScrolled; - -typedef struct { - GtkScrolledWindowClass parent_class; -} ETableScrolledClass; - -GType e_table_scrolled_get_type (void); - -ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets, - ETableModel *etm, - ETableExtras *ete, - const gchar *spec, - const gchar *state); -GtkWidget *e_table_scrolled_new (ETableModel *etm, - ETableExtras *ete, - const gchar *spec, - const gchar *state); - -ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *ets, - ETableModel *etm, - ETableExtras *ete, - const gchar *spec_fn, - const gchar *state_fn); -GtkWidget *e_table_scrolled_new_from_spec_file (ETableModel *etm, - ETableExtras *ete, - const gchar *spec_fn, - const gchar *state_fn); - -ETable *e_table_scrolled_get_table (ETableScrolled *ets); - -G_END_DECLS - -#endif /* _E_TABLE_SCROLLED_H_ */ - -- cgit v1.2.3