mirror of https://github.com/zlatinb/muwire
enable/disable download button correctly
parent
6b74fc5956
commit
cd072b9f76
|
@ -96,11 +96,12 @@ class SearchTabView {
|
||||||
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
|
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
|
||||||
selectionModel.addListSelectionListener( {
|
selectionModel.addListSelectionListener( {
|
||||||
int row = resultsTable.getSelectedRow()
|
int row = resultsTable.getSelectedRow()
|
||||||
if (row < 0)
|
if (row < 0) {
|
||||||
|
model.downloadActionEnabled = false
|
||||||
return
|
return
|
||||||
|
}
|
||||||
if (lastSortEvent != null)
|
if (lastSortEvent != null)
|
||||||
row = resultsTable.rowSorter.convertRowIndexToModel(row)
|
row = resultsTable.rowSorter.convertRowIndexToModel(row)
|
||||||
model.trustButtonsEnabled = true
|
|
||||||
model.downloadActionEnabled = mvcGroup.parentGroup.model.canDownload(model.results[row].infohash)
|
model.downloadActionEnabled = mvcGroup.parentGroup.model.canDownload(model.results[row].infohash)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue