X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2Fui%2FGuiReader.java;h=9f2fd3dad1056c6ba4635a70856e2983f330fad0;hb=31e28683c108bb5903864c58b0cc06bfa258fbfc;hp=02f153cdf82d47dc8f2486f7e3a72cff94a75903;hpb=350bc060516184774f8116e61696a8c3c45ba85d;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReader.java b/src/be/nikiroo/fanfix/reader/ui/GuiReader.java index 02f153c..9f2fd3d 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReader.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReader.java @@ -168,14 +168,15 @@ class GuiReader extends BasicReader { try { GuiReaderFrame gui = new GuiReaderFrame(GuiReader.this, typeFinal); - gui.setVisible(true); gui.addWindowListener(new WindowAdapter() { @Override - public void windowClosed(WindowEvent e) { - super.windowClosed(e); + public void windowClosing(WindowEvent e) { + super.windowClosing(e); done[0] = true; } }); + + gui.setVisible(true); } catch (Exception e) { Instance.getTraceHandler().error(e); done[0] = true; @@ -292,4 +293,38 @@ class GuiReader extends BasicReader { Instance.getTraceHandler().error(e); } } + + /** + * Change the title of the given {@link Story}. + * + * @param luid + * the luid of the {@link Story} to change + * @param newTitle + * the new title + */ + void changeTitle(String luid, String newTitle) { + try { + cacheLib.changeTitle(luid, newTitle, null); + } catch (IOException e) { + Instance.getTraceHandler().error(e); + } + } + + /** + * Change the author of the given {@link Story}. + *

+ * The author can be a new one, it needs not exist before hand. + * + * @param luid + * the luid of the {@link Story} to change + * @param newAuthor + * the new author + */ + void changeAuthor(String luid, String newAuthor) { + try { + cacheLib.changeAuthor(luid, newAuthor, null); + } catch (IOException e) { + Instance.getTraceHandler().error(e); + } + } }