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;
if (title != null) {
if (title.isEmpty()) {
- title = "[unknown]";
+ title = GuiReader.trans(StringIdGui.MENU_AUTHORS_UNKNOWN);
}
JLabel label = new JLabel();
/**
* 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<GuiReaderBookInfo> infos, boolean seeWordcount) {
+ this.infos = infos;
+ refreshBooks(seeWordcount);
+ }
+
+ /**
+ * Refresh the list of {@link GuiReaderBook}s displayed in the control.
+ * <p>
+ * Will not change the current stories.
+ *
* @param seeWordcount
* TRUE to see word counts, FALSE to see authors
*/
- public void refreshBooks(List<GuiReaderBookInfo> stories,
- boolean seeWordcount) {
- this.infos = stories;
+ public void refreshBooks(boolean seeWordcount) {
this.words = seeWordcount;
books = new ArrayList<GuiReaderBook>();
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);
}