refresh downloads every second
This commit is contained in:
@@ -32,6 +32,12 @@ class MainFrameModel {
|
|||||||
core = e.getNewValue()
|
core = e.getNewValue()
|
||||||
core.eventBus.register(UIResultEvent.class, this)
|
core.eventBus.register(UIResultEvent.class, this)
|
||||||
})
|
})
|
||||||
|
Timer timer = new Timer("download-pumper", true)
|
||||||
|
timer.schedule({
|
||||||
|
runInsideUIAsync {
|
||||||
|
builder.getVariable("downloads-table").model.fireTableDataChanged()
|
||||||
|
}
|
||||||
|
}, 1000, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUIResultEvent(UIResultEvent e) {
|
void onUIResultEvent(UIResultEvent e) {
|
||||||
|
@@ -81,7 +81,7 @@ class MainFrameView {
|
|||||||
panel (constraints : JSplitPane.BOTTOM) {
|
panel (constraints : JSplitPane.BOTTOM) {
|
||||||
borderLayout()
|
borderLayout()
|
||||||
scrollPane (constraints : BorderLayout.CENTER) {
|
scrollPane (constraints : BorderLayout.CENTER) {
|
||||||
table() {
|
table(id : "downloads-table") {
|
||||||
tableModel(list: model.downloads) {
|
tableModel(list: model.downloads) {
|
||||||
closureColumn(header: "Name", type: String, read : {row -> row.downloader.file.getName()})
|
closureColumn(header: "Name", type: String, read : {row -> row.downloader.file.getName()})
|
||||||
closureColumn(header: "Status", type: String, read : {row -> row.downloader.getCurrentState()})
|
closureColumn(header: "Status", type: String, read : {row -> row.downloader.getCurrentState()})
|
||||||
|
Reference in New Issue
Block a user