import be.nikiroo.fanfix.output.BasicOutput.OutputType;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.Version;
+import be.nikiroo.utils.ui.UIUtils;
class LocalReader extends BasicReader {
- private Library lib;
+ static private boolean nativeLookLoaded;
+
+ private Library localLibrary;
public LocalReader() throws IOException {
+ if (!nativeLookLoaded) {
+ UIUtils.setLookAndFeel();
+ nativeLookLoaded = true;
+ }
+
File dir = Instance.getReaderDir();
dir.mkdirs();
if (!dir.exists()) {
key, value), e);
}
- lib = new Library(dir, text, images);
+ localLibrary = new Library(dir, text, images);
}
@Override
try {
Story story = Instance.getLibrary().getStory(luid, pgGetStory);
if (story != null) {
- story = lib.save(story, luid, pgSave);
+ story = localLibrary.save(story, luid, pgSave);
} else {
throw new IOException("Cannot find story in Library: " + luid);
}
* @return TRUE if it is
*/
public boolean isCached(String luid) {
- return lib.getInfo(luid) != null;
+ return localLibrary.getInfo(luid) != null;
}
@Override
- public void start(String type) {
+ public void browse(String type) {
// TODO: improve presentation of update message
final VersionCheck updates = VersionCheck.check();
StringBuilder builder = new StringBuilder();
// delete from local reader library
void clearLocalReaderCache(String luid) {
- lib.delete(luid);
+ localLibrary.delete(luid);
}
// delete from main library
void delete(String luid) {
- lib.delete(luid);
+ localLibrary.delete(luid);
Instance.getLibrary().delete(luid);
}
// open the given book
void open(String luid, Progress pg) throws IOException {
- File file = lib.getFile(luid);
+ File file = localLibrary.getFile(luid);
if (file == null) {
imprt(luid, pg);
- file = lib.getFile(luid);
+ file = localLibrary.getFile(luid);
}
- open(Instance.getLibrary().getInfo(luid), file);
+ open(getLibrary().getInfo(luid), file);
}
void changeType(String luid, String newType) {
- lib.changeType(luid, newType);
+ localLibrary.changeType(luid, newType);
Instance.getLibrary().changeType(luid, newType);
}
}