enable/disable download button correctly

This commit is contained in:
Zlatin Balevsky
2019-07-10 22:23:20 +01:00
parent 6b74fc5956
commit cd072b9f76

View File

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