From e581bb8a2d391b5ce12b7a82134640d01d9c4843 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Wed, 17 Apr 2019 19:02:15 +0200 Subject: [PATCH] GUI: search: stories with tags --- .../fanfix/reader/ui/GuiReaderSearch.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java index c421ba6b..f0285d78 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java @@ -311,7 +311,22 @@ public class GuiReaderSearch extends JFrame { addTagBar(tag, new Runnable() { @Override public void run() { - // TODO: stories if needed + // TODO: slow ui + SearchableTag tag = ((SearchableTag) combo + .getSelectedItem()); + if (tag != null && tag.isLeaf()) { + BasicSearchable searchable = BasicSearchable + .getSearchable(supportType); + List metas = new ArrayList(); + try { + metas = searchable.search(tag, 1); + search(metas, 1, + searchable.searchPages(tag), 0); + } catch (IOException e) { + error(e); + } + } + setWaitingScreen(false); } }); @@ -319,6 +334,7 @@ public class GuiReaderSearch extends JFrame { } }); + combos.add(combo); tagBars.add(combo); } @@ -349,7 +365,6 @@ public class GuiReaderSearch extends JFrame { children = tag.getChildren(); } else { children = null; - // TODO: stories } } -- 2.27.0