show trust in ui
This commit is contained in:
@@ -14,6 +14,8 @@ import com.muwire.core.files.FileHashedEvent
|
||||
import com.muwire.core.files.FileLoadedEvent
|
||||
import com.muwire.core.files.FileSharedEvent
|
||||
import com.muwire.core.search.UIResultEvent
|
||||
import com.muwire.core.trust.TrustEvent
|
||||
import com.muwire.core.trust.TrustService
|
||||
import com.muwire.core.upload.UploadEvent
|
||||
import com.muwire.core.upload.UploadFinishedEvent
|
||||
|
||||
@@ -55,6 +57,7 @@ class MainFrameModel {
|
||||
core.eventBus.register(FileLoadedEvent.class, this)
|
||||
core.eventBus.register(UploadEvent.class, this)
|
||||
core.eventBus.register(UploadFinishedEvent.class, this)
|
||||
core.eventBus.register(TrustEvent.class, this)
|
||||
})
|
||||
Timer timer = new Timer("download-pumper", true)
|
||||
timer.schedule({
|
||||
@@ -130,4 +133,11 @@ class MainFrameModel {
|
||||
table.model.fireTableDataChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void onTrustEvent(TrustEvent e) {
|
||||
runInsideUIAsync {
|
||||
JTable table = builder.getVariable("results-table")
|
||||
table.model.fireTableDataChanged()
|
||||
}
|
||||
}
|
||||
}
|
@@ -70,6 +70,9 @@ class MainFrameView {
|
||||
closureColumn(header: "Name", type: String, read : {row -> row.name})
|
||||
closureColumn(header: "Size", preferredWidth: 150, type: Long, read : {row -> row.size})
|
||||
closureColumn(header: "Sender", type: String, read : {row -> row.sender.getHumanReadableName()})
|
||||
closureColumn(header: "Trust", type: String, read : {row ->
|
||||
model.core.trustService.getLevel(row.sender.destination)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user