- if (selectedBook != null) {
- mainPanel.outOfUi(null, new Runnable() {
- @Override
- public void run() {
- reader.delete(selectedBook.getInfo().getMeta()
- .getLuid());
- mainPanel.unsetSelectedBook();
- }
- });
+ if (selectedBook != null
+ && selectedBook.getInfo().getMeta() != null) {
+
+ final MetaData meta = selectedBook.getInfo().getMeta();
+ int rep = JOptionPane.showConfirmDialog(
+ GuiReaderFrame.this,
+ GuiReader.trans(StringIdGui.SUBTITLE_DELETE,
+ meta.getLuid(), meta.getTitle()),
+ GuiReader.trans(StringIdGui.TITLE_DELETE),
+ JOptionPane.OK_CANCEL_OPTION);
+
+ if (rep == JOptionPane.OK_OPTION) {
+ mainPanel.outOfUi(null, true, new Runnable() {
+ @Override
+ public void run() {
+ reader.delete(meta.getLuid());
+ mainPanel.unsetSelectedBook();
+ }
+ });
+ }