Automatically open last used book

This commit is contained in:
2018-09-11 23:29:22 +01:00
parent 3f42a13afd
commit 415b93931b
2 changed files with 17 additions and 2 deletions

View File

@@ -512,6 +512,18 @@ public class AudiobookRecorder extends JFrame {
pack();
setVisible(true);
String lastBook = Options.get("path.last-book");
if (lastBook != null && !lastBook.equals("")) {
File f = new File(Options.get("path.storage"), lastBook);
if (f.exists() && f.isDirectory()) {
File x = new File(f, "audiobook.abk");
if (x.exists()) {
loadBookStructure(x);
}
}
}
}
public static void main(String args[]) {
@@ -1037,6 +1049,9 @@ public class AudiobookRecorder extends JFrame {
}
loadBookStructure(f);
Options.set("path.last-book", book.getName());
Options.savePreferences();
}

View File

@@ -277,7 +277,7 @@ public class Options extends JDialog {
}
if (supported) {
KVPair p = new KVPair(i.getName(), i.getDescription());
KVPair p = new KVPair(i.getName(), i.getName()); //i.getDescription());
list.add(p);
}
}
@@ -316,7 +316,7 @@ public class Options extends JDialog {
if (supported) {
KVPair p = new KVPair(i.getName(), i.getDescription());
KVPair p = new KVPair(i.getName(), i.getName()); //i.getDescription());
list.add(p);
}
}