From 9e0d52d548f121c6aa0e114a7d592368f4c3cd22 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Mon, 3 Jun 2019 07:43:28 +0100 Subject: [PATCH] show source in incoming searches --- .../models/com/muwire/gui/MainFrameModel.groovy | 7 ++++++- gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy index e21f32fd..22689d13 100644 --- a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy @@ -228,11 +228,16 @@ class MainFrameModel { if (search.trim().size() == 0) return runInsideUIAsync { - searches.addFirst(search) + searches.addFirst(new IncomingSearch(search : search, replyTo : e.replyTo)) while(searches.size() > 200) searches.removeLast() JTable table = builder.getVariable("searches-table") table.model.fireTableDataChanged() } } + + class IncomingSearch { + String search + Destination replyTo + } } \ 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 1a1f1788..ad4c4a94 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -177,7 +177,8 @@ class MainFrameView { scrollPane(constraints : BorderLayout.CENTER) { table(id : "searches-table") { tableModel(list : model.searches) { - closureColumn(header : "Keywords", type : String, read : { it }) + closureColumn(header : "Keywords", type : String, read : { it.search }) + closureColumn(header : "From", type : String, read : {it.replyTo.toBase32()}) } } }