X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2Fui%2FGuiReaderGroup.java;h=3e09aeaf03efad3d2fac4ec00b1b8eced26549b6;hb=fee80815f000d7a4346b2da014eb029a4023dc51;hp=8d766f22c0a5366028753e5f92382d76ed11c3e4;hpb=79a9950614d3bea63b0daafb7b7365f6ae3cbeb9;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java index 8d766f2..3e09aea 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java @@ -10,6 +10,7 @@ import java.util.List; import javax.swing.JLabel; import javax.swing.JPanel; +import be.nikiroo.fanfix.bundles.StringIdGui; import be.nikiroo.fanfix.reader.ui.GuiReaderBook.BookActionListener; import be.nikiroo.utils.ui.WrapLayout; @@ -56,7 +57,7 @@ public class GuiReaderGroup extends JPanel { if (title != null) { if (title.isEmpty()) { - title = "[unknown]"; + title = GuiReader.trans(StringIdGui.MENU_AUTHORS_UNKNOWN); } JLabel label = new JLabel(); @@ -83,14 +84,25 @@ public class GuiReaderGroup extends JPanel { /** * Refresh the list of {@link GuiReaderBook}s displayed in the control. * - * @param stories - * the stories + * @param infos + * the new list of infos + * @param seeWordcount + * TRUE to see word counts, FALSE to see authors + */ + public void refreshBooks(List infos, boolean seeWordcount) { + this.infos = infos; + refreshBooks(seeWordcount); + } + + /** + * Refresh the list of {@link GuiReaderBook}s displayed in the control. + *

+ * Will not change the current stories. + * * @param seeWordcount * TRUE to see word counts, FALSE to see authors */ - public void refreshBooks(List stories, - boolean seeWordcount) { - this.infos = stories; + public void refreshBooks(boolean seeWordcount) { this.words = seeWordcount; books = new ArrayList(); @@ -98,15 +110,15 @@ public class GuiReaderGroup extends JPanel { pane.invalidate(); pane.removeAll(); - if (stories != null) { - for (GuiReaderBookInfo info : stories) { + if (infos != null) { + for (GuiReaderBookInfo info : infos) { boolean isCached = false; if (info.getMeta() != null) { isCached = reader.isCached(info.getMeta().getLuid()); } GuiReaderBook book = new GuiReaderBook(reader, info, isCached, - seeWordcount); + words); if (backgroundColor != null) { book.setBackground(backgroundColor); }