add option for sequential download

This commit is contained in:
Zlatin Balevsky
2019-10-03 20:45:22 +01:00
parent e09c456a13
commit 91d771944b
7 changed files with 34 additions and 13 deletions

View File

@@ -46,7 +46,8 @@ class SearchTabController {
def resultsBucket = model.hashBucket[result.infohash]
def sources = model.sourcesBucket[result.infohash]
core.eventBus.publish(new UIDownloadEvent(result : resultsBucket, sources: sources, target : file))
core.eventBus.publish(new UIDownloadEvent(result : resultsBucket, sources: sources,
target : file, sequential : view.sequentialDownloadCheckbox.model.isSelected()))
mvcGroup.parentGroup.view.showDownloadsWindow.call()
}

View File

@@ -43,11 +43,13 @@ class SearchTabView {
def lastSendersSortEvent
def resultsTable
def lastSortEvent
def sequentialDownloadCheckbox
void initUI() {
builder.with {
def resultsTable
def sendersTable
def sequentialDownloadCheckbox
def pane = panel {
gridLayout(rows :1, cols : 1)
splitPane(orientation: JSplitPane.VERTICAL_SPLIT, continuousLayout : true, dividerLocation: 300 ) {
@@ -83,7 +85,14 @@ class SearchTabView {
}
}
panel(constraints : BorderLayout.SOUTH) {
button(text : "Download", enabled : bind {model.downloadActionEnabled}, downloadAction)
borderLayout()
panel(constraints: BorderLayout.CENTER) {
button(text : "Download", enabled : bind {model.downloadActionEnabled}, downloadAction)
}
panel(constraints: BorderLayout.EAST) {
sequentialDownloadCheckbox = checkBox(selected : false)
label(text : "Download sequentially")
}
}
}
}
@@ -95,6 +104,7 @@ class SearchTabView {
this.resultsTable = resultsTable
this.sendersTable = sendersTable
this.sequentialDownloadCheckbox = sequentialDownloadCheckbox
def selectionModel = resultsTable.getSelectionModel()
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)