pass comments on trust list subscriptions

This commit is contained in:
Zlatin Balevsky
2019-11-08 07:37:51 +00:00
parent 6e2b3f4f33
commit 2017b53a43
6 changed files with 117 additions and 44 deletions

View File

@@ -27,7 +27,7 @@ class TrustListController {
if (selectedRow < 0)
return
String reason = JOptionPane.showInputDialog("Enter reason (optional)")
Persona p = model.trusted[selectedRow]
Persona p = model.trusted[selectedRow].persona
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.TRUSTED, reason : reason))
view.fireUpdate("trusted-table")
}
@@ -38,7 +38,7 @@ class TrustListController {
if (selectedRow < 0)
return
String reason = JOptionPane.showInputDialog("Enter reason (optional)")
Persona p = model.distrusted[selectedRow]
Persona p = model.distrusted[selectedRow].persona
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.TRUSTED, reason : reason))
view.fireUpdate("distrusted-table")
}
@@ -49,7 +49,7 @@ class TrustListController {
if (selectedRow < 0)
return
String reason = JOptionPane.showInputDialog("Enter reason (optional)")
Persona p = model.trusted[selectedRow]
Persona p = model.trusted[selectedRow].persona
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED, reason : reason))
view.fireUpdate("trusted-table")
}
@@ -60,7 +60,7 @@ class TrustListController {
if (selectedRow < 0)
return
String reason = JOptionPane.showInputDialog("Enter reason (optional)")
Persona p = model.distrusted[selectedRow]
Persona p = model.distrusted[selectedRow].persona
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED, reason : reason))
view.fireUpdate("distrusted-table")
}

View File

@@ -49,8 +49,9 @@ class TrustListView {
scrollPane (constraints : BorderLayout.CENTER){
table(id : "trusted-table", autoCreateRowSorter : true, rowHeight : rowHeight) {
tableModel(list : model.trusted) {
closureColumn(header: "Trusted Users", type : String, read : {it.getHumanReadableName()})
closureColumn(header: "Your Trust", type : String, read : {model.trustService.getLevel(it.destination).toString()})
closureColumn(header: "Trusted Users", type : String, read : {it.persona.getHumanReadableName()})
closureColumn(header: "Reason", type : String, read : {it.reason})
closureColumn(header: "Your Trust", type : String, read : {model.trustService.getLevel(it.persona.destination).toString()})
}
}
}
@@ -65,8 +66,9 @@ class TrustListView {
scrollPane (constraints : BorderLayout.CENTER ){
table(id : "distrusted-table", autoCreateRowSorter : true, rowHeight : rowHeight) {
tableModel(list : model.distrusted) {
closureColumn(header: "Distrusted Users", type : String, read : {it.getHumanReadableName()})
closureColumn(header: "Your Trust", type : String, read : {model.trustService.getLevel(it.destination).toString()})
closureColumn(header: "Distrusted Users", type : String, read : {it.persona.getHumanReadableName()})
closureColumn(header: "Reason", type:String, read : {it.reason})
closureColumn(header: "Your Trust", type : String, read : {model.trustService.getLevel(it.persona.destination).toString()})
}
}
}