show trust in ui

This commit is contained in:
Zlatin Balevsky
2019-05-31 16:39:13 +01:00
parent e7c463a3be
commit 8e196a5777
2 changed files with 13 additions and 0 deletions

View File

@@ -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()
}
}
}

View File

@@ -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)
})
}
}
}