gui: better refresh for changeSTA
[fanfix.git] / src / be / nikiroo / fanfix / reader / ui / GuiReaderGroup.java
index 8d766f22c0a5366028753e5f92382d76ed11c3e4..45c7a8fcf7a4321091c5063341b0a5c66a6b920b 100644 (file)
@@ -83,14 +83,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<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>();
@@ -98,15 +109,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);
                                }