Example #1
0
void FBReader::initWindow() {
	ZLApplication::initWindow();
	trackStylus(true);

	MigrationRunnable migration;
	if (migration.shouldMigrate()) {
		ZLDialogManager::instance().wait(ZLResourceKey("migrate"), migration);
	}

	if (!myBookAlreadyOpen) {
		BookDescriptionPtr description;
		if (!myBookToOpen.empty()) {
			createDescription(myBookToOpen, description);
		}
		if (description.isNull()) {
			ZLStringOption bookName(ZLCategoryKey::STATE, STATE, BOOK, "");
			description = BookDescription::getDescription(bookName.value());
		}
		if (description.isNull()) {
			description = BookDescription::getDescription(helpFileName(ZLibrary::Language()));
		}
		if (description.isNull()) {
			description = BookDescription::getDescription(helpFileName("en"));
		}
		openBook(description);
	}
	refreshWindow();

//	ZLTimeManager::instance().addTask(new TimeUpdater(*this), 1000);
}
Example #2
0
void FBReader::initWindow() {
	ZLApplication::initWindow();
	trackStylus(true);

	MigrationRunnable migration;
	if (migration.shouldMigrate()) {
		ZLDialogManager::Instance().wait(ZLResourceKey("migrate"), migration);
	}

	if (!myBookAlreadyOpen) {
		shared_ptr<Book> book;
		if (!myBookToOpen.empty()) {
			createBook(ZLFile(myBookToOpen), book);
		}
		if (book.isNull()) {
			const BookList &books = Library::Instance().recentBooks();
			if (!books.empty()) {
				book = books[0];
			}
		}
		if (book.isNull()) {
			book = BooksDBUtil::getBook(helpFileName(ZLibrary::Language()));
		}
		if (book.isNull()) {
			book = BooksDBUtil::getBook(helpFileName("en"));
		}
		openBook(book);
	}
	refreshWindow();

	ZLTimeManager::Instance().addTask(new TimeUpdater(), 1000);
}