+ return true;
+ case MENU_OPEN:
+ String openfile = null;
+ try {
+ openfile = fileOpenBox(".");
+ reader.setMeta(BasicReader.getUrl(openfile), null);
+ read();
+ } catch (IOException e) {
+ // TODO: i18n
+ error("Fail to open file"
+ + (openfile == null ? "" : ": " + openfile),
+ "Import error", e);
+ }
+
+ return true;
+ case MENU_DELETE:
+ String luid = null;
+ String story = null;
+ MetaData meta = null;
+ if (main != null) {
+ meta = main.getSelectedMeta();
+ }
+ if (meta != null) {
+ luid = meta.getLuid();
+ story = luid + ": " + meta.getTitle();
+ }
+
+ // TODO: i18n
+ TMessageBox mbox = messageBox("Delete story", "Delete story \""
+ + story + "\"", Type.OKCANCEL);
+ if (mbox.getResult() == Result.OK) {
+ try {
+ reader.getLibrary().delete(luid);
+ if (main != null) {
+ main.refreshStories();
+ }
+ } catch (IOException e) {
+ // TODO: i18n
+ error("Fail to delete the story: \"" + story + "\"",
+ "Error", e);
+ }
+ }
+