From e4c6f61966479fbcb8da64ac49bb578c7f2d5017 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Tue, 18 Mar 2003 00:58:04 +0000 Subject: Fixes #39757 2003-03-17 Hans Petter Jansson Fixes #39757 * gui/dialogs/alarm-page.c (sensitize_buttons): Somehow this code reverted to thinking it was dealing with a GtkCList, when in reality it's a GtkTreeView. Fix that, so the buttons are sensitized correctly. svn path=/trunk/; revision=20328 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/dialogs/alarm-page.c | 16 ++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e23abebe3e..74009d71c8 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2003-03-17 Hans Petter Jansson + + Fixes #39757 + + * gui/dialogs/alarm-page.c (sensitize_buttons): Somehow this code + reverted to thinking it was dealing with a GtkCList, when in reality + it's a GtkTreeView. Fix that, so the buttons are sensitized correctly. + 2003-03-17 Hans Petter Jansson Fixes #39736 diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c index b28e0dd0b3..2008881ff3 100644 --- a/calendar/gui/dialogs/alarm-page.c +++ b/calendar/gui/dialogs/alarm-page.c @@ -313,15 +313,19 @@ sensitize_buttons (AlarmPage *apage) { AlarmPagePrivate *priv; CalClient *client; - GtkCList *clist; - + GtkTreeSelection *selection; + GtkTreeIter iter; + gboolean have_selected; + priv = apage->priv; - + client = COMP_EDITOR_PAGE (apage)->client; - clist = GTK_CLIST (priv->list); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list)); + have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter); - gtk_widget_set_sensitive (priv->add, cal_client_get_one_alarm_only (client) && clist->rows > 0 ? FALSE : TRUE); - gtk_widget_set_sensitive (priv->delete, clist->rows > 0 ? TRUE : FALSE); + gtk_widget_set_sensitive (priv->add, + cal_client_get_one_alarm_only (client) && have_selected ? FALSE : TRUE); + gtk_widget_set_sensitive (priv->delete, have_selected); } /* Appends an alarm to the list */ -- cgit