diff options
Diffstat (limited to 'calendar/gui/dialogs/alarm-page.c')
-rw-r--r-- | calendar/gui/dialogs/alarm-page.c | 16 |
1 files changed, 10 insertions, 6 deletions
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 */ |