diff options
author | Radek Doulik <rodo@ximian.com> | 2004-07-24 00:58:02 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2004-07-24 00:58:02 +0800 |
commit | 1b01e8ccc0ff8044768843159db437a942e86e5c (patch) | |
tree | 2ca41f07ba256179aa1e00e0c2a7267d220af5e7 /widgets/menus/gal-define-views-dialog.c | |
parent | cbfa4ef50c6e5a376d0208e499e30f5e3f0fedc1 (diff) | |
download | gsoc2013-evolution-1b01e8ccc0ff8044768843159db437a942e86e5c.tar.gz gsoc2013-evolution-1b01e8ccc0ff8044768843159db437a942e86e5c.tar.zst gsoc2013-evolution-1b01e8ccc0ff8044768843159db437a942e86e5c.zip |
watch for selection changes and set Delete button sensitivity according to
2004-07-23 Radek Doulik <rodo@ximian.com>
* gal-define-views-dialog.c: watch for selection changes and set
Delete button sensitivity according to view collection item
built-in flag
Fixes #57914
svn path=/trunk/; revision=26717
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); } |