From 9282011dcf5168a8ad7a7a1b70d7afef8e5edf0b Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sat, 26 Feb 2022 07:10:15 +0000 Subject: [PATCH] fix retrying regex searches --- .../controllers/com/muwire/gui/MainFrameController.groovy | 5 ++++- gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy | 1 + gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy b/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy index 33f5ed52..70bece5c 100644 --- a/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy +++ b/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy @@ -88,7 +88,9 @@ class MainFrameController { performSearch(search, null) } - void repeatSearch(String terms, Integer tab) { + void repeatSearch(String terms, Integer tab, Boolean regex) { + if (regex) + terms = "/$terms/" performSearch(terms, tab) } @@ -145,6 +147,7 @@ class MainFrameController { params["core"] = core params["settings"] = view.settings params["tab"] = tab + params["regex"] = regexSearch def group = mvcGroup.createMVCGroup("SearchTab", uuid.toString(), params) model.results[uuid.toString()] = group diff --git a/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy b/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy index ea0c0a79..98813866 100644 --- a/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/SearchTabModel.groovy @@ -40,6 +40,7 @@ class SearchTabModel { UISettings uiSettings String uuid Integer tab + Boolean regex boolean visible private boolean dirty diff --git a/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy b/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy index 86f8083d..72806500 100644 --- a/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy @@ -492,9 +492,10 @@ class SearchTabView { def repeatSearch = { int tab = parent.indexOfComponent(pane) + Boolean regex = model.regex def parentGroup = mvcGroup.parentGroup closeTab.call() - parentGroup.controller.repeatSearch(searchTerms, tab) + parentGroup.controller.repeatSearch(searchTerms, tab, regex) } def showPopupMenu(MouseEvent e) {