From 7620cd9a166f9ac66041f7ac2e315d1de43f7360 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 2 Jun 2008 17:44:26 +0000 Subject: [PATCH] (gtk) when editing the tracker list of an existing torrent, don't let the user delete the last tracker. --- gtk/tracker-list.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/tracker-list.c b/gtk/tracker-list.c index ae1fd98e6..a7f4f783e 100644 --- a/gtk/tracker-list.c +++ b/gtk/tracker-list.c @@ -101,7 +101,8 @@ onTrackerSelectionChanged( GtkTreeSelection * sel, { struct tracker_page * page = gpage; gboolean has_selection = gtk_tree_selection_get_selected( sel, NULL, NULL ); - gtk_widget_set_sensitive( page->remove_button, has_selection ); + gboolean ok_to_remove = !page->gtor || gtk_tree_model_iter_n_children( GTK_TREE_MODEL( page->store ), NULL ) > 1; + gtk_widget_set_sensitive( page->remove_button, has_selection && ok_to_remove ); } static void