Skip to content

Commit

Permalink
修复新创建的任务不能刷新下载速度的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dipoo committed Mar 22, 2016
1 parent bbdef58 commit d24cf91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/org/arong/egdownloader/ui/table/TaskingTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ public void run() {
}
}, 1000, 1000);
}
public void propertyChange(Task task){
final TaskingTable table = this;
task.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
table.setRefresh(true);
}
});
}
/**
* 添加排队等待的任务
* @param task
Expand Down
1 change: 1 addition & 0 deletions src/org/arong/egdownloader/ui/work/CreateWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ protected Void doInBackground() throws Exception {
//保存到内存
final TaskingTable taskTable = (TaskingTable)window.runningTable;
taskTable.getTasks().add(0, task);//将任务添加到列表最前面
taskTable.propertyChange(task);//开始观察者模式,显示下载速度
if(addFormWindow != null){
addFormWindow.emptyField();//清空下载地址
//关闭form,刷新table
Expand Down

0 comments on commit d24cf91

Please sign in to comment.