if no row is selected do not enable buttons

pull/5/head
Zlatin Balevsky 2019-06-17 12:26:28 +01:00
parent 546eb4e9d3
commit 5c16335969
1 changed files with 3 additions and 1 deletions

View File

@ -66,10 +66,12 @@ class SearchTabView {
def selectionModel = resultsTable.getSelectionModel()
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
selectionModel.addListSelectionListener( {
mvcGroup.parentGroup.model.trustButtonsEnabled = true
int row = resultsTable.getSelectedRow()
if (row < 0)
return
if (lastSortEvent != null)
row = resultsTable.rowSorter.convertRowIndexToModel(row)
mvcGroup.parentGroup.model.trustButtonsEnabled = true
mvcGroup.parentGroup.model.downloadActionEnabled = mvcGroup.parentGroup.model.canDownload(model.results[row].infohash)
})
}