diff --git a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy index c91ca934..74ccb88d 100644 --- a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy @@ -177,7 +177,8 @@ class MainFrameModel { topPanel.getLayout().show(topPanel, "top-search-panel") } - connectionList.add(e.endpoint.destination) + UIConnection con = new UIConnection(destination : e.endpoint.destination, incoming : e.incoming) + connectionList.add(con) JTable table = builder.getVariable("connections-table") table.model.fireTableDataChanged() } @@ -192,7 +193,8 @@ class MainFrameModel { topPanel.getLayout().show(topPanel, "top-connect-panel") } - connectionList.remove(e.destination) + UIConnection con = new UIConnection(destination : e.destination) + connectionList.remove(con) JTable table = builder.getVariable("connections-table") table.model.fireTableDataChanged() } @@ -303,4 +305,22 @@ class MainFrameModel { table.model.fireTableDataChanged() } } + + private static class UIConnection { + Destination destination + boolean incoming + + @Override + public int hashCode() { + destination.hashCode() + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof UIConnection)) + return false + UIConnection other = (UIConnection) o + return destination == other.destination + } + } } \ No newline at end of file diff --git a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy index a05b16ed..e1d27ea6 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -187,7 +187,13 @@ class MainFrameView { scrollPane(constraints : BorderLayout.CENTER) { table(id : "connections-table") { tableModel(list : model.connectionList) { - closureColumn(header : "Destination", type: String, read : { row -> row.toBase32() }) + closureColumn(header : "Destination", preferredWidth: 250, type: String, read : { row -> row.destination.toBase32() }) + closureColumn(header : "Direction", preferredWidth: 20, type: String, read : { row -> + if (row.incoming) + return "In" + else + return "Out" + }) } } }