Add --version and also display it in UI
[fanfix.git] / src / be / nikiroo / fanfix / reader / LocalReaderFrame.java
index 7ce16cc48a8bc487c9ccfa7e5c37479b850f010d..e15ee8d17bb4889ac31061fc8313ad1bab6cb618 100644 (file)
@@ -38,6 +38,7 @@ import be.nikiroo.fanfix.data.Story;
 import be.nikiroo.fanfix.output.BasicOutput.OutputType;
 import be.nikiroo.fanfix.reader.LocalReaderBook.BookActionListener;
 import be.nikiroo.utils.Progress;
+import be.nikiroo.utils.Version;
 import be.nikiroo.utils.ui.ProgressBar;
 import be.nikiroo.utils.ui.WrapLayout;
 
@@ -71,7 +72,7 @@ class LocalReaderFrame extends JFrame {
         *            the type of {@link Story} to load, or NULL for all types
         */
        public LocalReaderFrame(LocalReader reader, String type) {
-               super("Fanfix Library");
+               super(String.format("Fanfix %s Library", Version.getCurrentVersion()));
 
                this.reader = reader;
 
@@ -450,15 +451,11 @@ class LocalReaderFrame extends JFrame {
        private void outOfUi(final Progress pg, final Runnable run) {
                pgBar.setProgress(pg);
 
-               SwingUtilities.invokeLater(new Runnable() {
-                       public void run() {
-                               setEnabled(false);
-                               pgBar.addActioListener(new ActionListener() {
-                                       public void actionPerformed(ActionEvent e) {
-                                               pgBar.setProgress(null);
-                                               setEnabled(true);
-                                       }
-                               });
+               setEnabled(false);
+               pgBar.addActioListener(new ActionListener() {
+                       public void actionPerformed(ActionEvent e) {
+                               pgBar.setProgress(null);
+                               setEnabled(true);
                        }
                });
 
@@ -532,6 +529,7 @@ class LocalReaderFrame extends JFrame {
                                SwingUtilities.invokeLater(new Runnable() {
                                        public void run() {
                                                if (!ok) {
+                                                       Instance.syserr(e);
                                                        JOptionPane.showMessageDialog(
                                                                        LocalReaderFrame.this, "Cannot import: "
                                                                                        + url, e.getMessage(),