From: Niki Roo Date: Wed, 17 Apr 2019 17:02:15 +0000 (+0200) Subject: GUI: search: stories with tags X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=e581bb8a2d391b5ce12b7a82134640d01d9c4843;p=nikiroo-utils.git GUI: search: stories with tags --- diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderSearch.java index c421ba6..f0285d7 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 } }