fetch group by name,add sequential download checkbox to browse view

pull/34/head
Zlatin Balevsky 2019-11-14 12:40:40 +00:00
parent 9f6a7eb368
commit 35322d2c15
2 changed files with 10 additions and 3 deletions

View File

@ -64,8 +64,11 @@ class BrowseController {
def selectedResults = view.selectedResults()
if (selectedResults == null || selectedResults.isEmpty())
return
def group = application.mvcGroupManager.getGroups()['MainFrame']
selectedResults.removeAll {
!mvcGroup.parentGroup.parentGroup.model.canDownload(it.infohash)
!group.model.canDownload(it.infohash)
}
selectedResults.each { result ->
@ -74,11 +77,11 @@ class BrowseController {
result : [result],
sources : [model.host.destination],
target : file,
sequential : mvcGroup.parentGroup.view.sequentialDownloadCheckbox.model.isSelected()
sequential : view.sequentialDownloadCheckbox.model.isSelected()
))
}
mvcGroup.parentGroup.parentGroup.view.showDownloadsWindow.call()
group.view.showDownloadsWindow.call()
dismiss()
}

View File

@ -39,6 +39,8 @@ class BrowseView {
def p
def resultsTable
def lastSortEvent
def sequentialDownloadCheckbox
void initUI() {
int rowHeight = application.context.get("row-height")
mainFrame = application.windowManager.findWindow("main-frame")
@ -67,6 +69,8 @@ class BrowseView {
button(text : "View Comment", enabled : bind{model.viewCommentActionEnabled}, viewCommentAction)
button(text : "View Certificates", enabled : bind{model.viewCertificatesActionEnabled}, viewCertificatesAction)
button(text : "Dismiss", dismissAction)
label(text : "Download sequentially")
sequentialDownloadCheckbox = checkBox()
}
}