Changeset 5999


Ignore:
Timestamp:
Jun 2, 2008, 5:44:26 PM (14 years ago)
Author:
charles
Message:

(gtk) when editing the tracker list of an existing torrent, don't let the user delete the last tracker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tracker-list.c

    r5996 r5999  
    102102    struct tracker_page * page = gpage;
    103103    gboolean has_selection = gtk_tree_selection_get_selected( sel, NULL, NULL );
    104     gtk_widget_set_sensitive( page->remove_button, has_selection );
     104    gboolean ok_to_remove = !page->gtor || gtk_tree_model_iter_n_children( GTK_TREE_MODEL( page->store ), NULL ) > 1;
     105    gtk_widget_set_sensitive( page->remove_button, has_selection && ok_to_remove );
    105106}
    106107
Note: See TracChangeset for help on using the changeset viewer.