hook up cancel button
This commit is contained in:
@@ -54,6 +54,11 @@ class MainFrameController {
|
||||
group.model.results[row]
|
||||
}
|
||||
|
||||
private def selectedDownload() {
|
||||
def selected = builder.getVariable("downloads-table").getSelectedRow()
|
||||
model.downloads[selected].downloader
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void download() {
|
||||
def result = selectedResult()
|
||||
@@ -79,6 +84,12 @@ class MainFrameController {
|
||||
core.eventBus.publish( new TrustEvent(destination : result.sender.destination, level : TrustLevel.DISTRUSTED))
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void cancel() {
|
||||
def downloader = selectedDownload()
|
||||
downloader.cancel()
|
||||
}
|
||||
|
||||
void mvcGroupInit(Map<String, String> args) {
|
||||
application.addPropertyChangeListener("core", {e->
|
||||
core = e.getNewValue()
|
||||
|
@@ -98,7 +98,7 @@ class MainFrameView {
|
||||
}
|
||||
}
|
||||
panel (constraints : BorderLayout.SOUTH) {
|
||||
button("Cancel", enabled : bind {model.cancelButtonEnabled } )
|
||||
button(text: "Cancel", enabled : bind {model.cancelButtonEnabled }, cancelAction )
|
||||
button("Retry", enabled : bind {model.retryButtonEnabled})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user