diff options
Diffstat (limited to 'widgets/menus/gal-define-views-dialog.c')
-rw-r--r-- | widgets/menus/gal-define-views-dialog.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index e8afb8efac..531807ed7b 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -207,6 +207,24 @@ gdvd_connect_signal(GalDefineViewsDialog *dialog, char *widget_name, char *signa } static void +etable_selection_change_forall_cb (int row, GalDefineViewsDialog *dialog) +{ + if (row != -1) { + GalViewCollectionItem *item = gal_view_collection_get_view_item (dialog->collection, row); + + if (item) + gtk_widget_set_sensitive (glade_xml_get_widget (dialog->gui, "button-delete"), + !item->built_in); + } +} + +static void +etable_selection_change (ETable *etable, GalDefineViewsDialog *dialog) +{ + e_table_selected_row_foreach (etable, (EForeachFunc) etable_selection_change_forall_cb, dialog); +} + +static void gal_define_views_dialog_init (GalDefineViewsDialog *dialog) { GladeXML *gui; @@ -247,6 +265,9 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) g_object_set(dialog->model, "collection", dialog->collection, NULL); + g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (etable)), + "selection_change", + G_CALLBACK (etable_selection_change), dialog); gtk_widget_show_all (etable); } |