From 2d126d6634af26d7a4db216fe8c9922932b8f1f2 Mon Sep 17 00:00:00 2001 From: Jason Tackaberry Date: Sat, 30 Jan 1999 22:18:25 +0000 Subject: if the user clicks on an event that is an occurance, the menu will allow 1999-01-29 Jason Tackaberry * gncal-full-day.c (child_popup_menu): if the user clicks on an event that is an occurance, the menu will allow the user to delete all occurances of this event, or just the selected occurance. (delete_occurance): added. * eventedit.c (append_exception): force the clist to select the new exception. (fixes segfault) (delete_exception): if the last exception in the clist is deleted, move the selection index up. (fixes segfault) svn path=/trunk/; revision=636 --- calendar/eventedit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'calendar/eventedit.c') diff --git a/calendar/eventedit.c b/calendar/eventedit.c index 0f94a87a5d..05b9f1e126 100644 --- a/calendar/eventedit.c +++ b/calendar/eventedit.c @@ -1287,6 +1287,7 @@ append_exception (EventEditor *ee, time_t t) i = gtk_clist_append (GTK_CLIST (ee->recur_ex_clist), c); gtk_clist_set_row_data (GTK_CLIST (ee->recur_ex_clist), i, tt); + gtk_clist_select_row (GTK_CLIST (ee->recur_ex_clist), i, 0); gtk_widget_set_sensitive (ee->recur_ex_vbox, TRUE); } @@ -1329,7 +1330,7 @@ static void delete_exception (GtkWidget *widget, EventEditor *ee) { GtkCList *clist; - int sel; + int sel, length; clist = GTK_CLIST (ee->recur_ex_clist); sel = GPOINTER_TO_INT(clist->selection->data); @@ -1337,6 +1338,10 @@ delete_exception (GtkWidget *widget, EventEditor *ee) g_free (gtk_clist_get_row_data (clist, sel)); /* free the time_t stored there */ gtk_clist_remove (clist, sel); + length = g_list_length(clist->row_list); + if (sel >= length) + sel--; + gtk_clist_select_row (GTK_CLIST (ee->recur_ex_clist), sel, 0); if (clist->rows == 0) gtk_widget_set_sensitive (ee->recur_ex_vbox, FALSE); -- cgit v1.2.3