Skip to content
  • Dan Winship's avatar
    tui: fix selection bugs after deleting a connection · bbc6434e
    Dan Winship authored
    nmt_newt_listbox_clear() did not reset active and active_key, which in
    the case of NmtEditConnectionList meant that after the connection list
    was rebuilt, the selection would appear to be in the same place, but
    active_key would still point to the connection that used to be in that
    row, rather than the one currently in that row, so if you immediately
    hit Edit or Delete, you'd get unexpected results. (It also meant that
    it was possible for the selection to land on a header row instead of a
    connection row.)
    
    This was particularly bad in the case of the Delete button, since
    active_key would be left pointing to a freed NMConnection in that
    case.
    
    Fix NmtNewtListbox, and then add code to NmtEditConnectionList to
    preserve the selection itself when rebuilding the list.
    bbc6434e