use the same sorted row selection logic in downloads table

pull/5/head
Zlatin Balevsky 2019-06-15 09:57:12 +01:00
parent 0eb5870e9b
commit 8d3ce7aa8e
1 changed files with 3 additions and 2 deletions

View File

@ -95,10 +95,11 @@ class MainFrameController {
} }
private int selectedDownload() { private int selectedDownload() {
def selected = builder.getVariable("downloads-table").getSelectedRow() def downloadsTable = builder.getVariable("downloads-table")
def selected = downloadsTable.getSelectedRow()
def sortEvt = mvcGroup.view.lastDownloadSortEvent def sortEvt = mvcGroup.view.lastDownloadSortEvent
if (sortEvt != null) if (sortEvt != null)
selected = sortEvt.convertPreviousRowIndexToModel(selected) selected = downloadsTable.rowSorter.convertRowIndexToModel(selected)
selected selected
} }