+To dos migrated to Maemo Garage:
+https://garage.maemo.org/tracker/?group_id=1757 . Old to dos below are kept as
+historical artifacts.
+
To Do
-----
-2010-05-29 Submit to extras-devel
2010-06-09 Table of contents
2010-06-09 Symbian installable package
2010-06-12 Smooth transitions to fullscreen and back
2010-06-19 Notes
2010-06-20 Improve bookmark manager: Delete bookmarks
2010-06-24 Add support for Project Gutenberg chapter navigation
-2010-06-24 Sort bookmarks by chapter/percent
2010-06-28 Mac installable package
2010-06-28 Mac icon, application menu
2010-07-09 Direct access to Project Gutenberg and epubbooks.com library
Done
----
+0.0.9
+
+2010-07013 2010-06-24 Sort bookmarks by chapter/percent
+
+0.0.6
+
+2010-07-11 2010-05-29 Submit to extras-devel
+
0.0.5
2010-07-10 2010-07-10 Show navigation arrows only when needed
#include <qtextdocument.h> // Qt::escape is currently defined here...
#include <QDirIterator>
#include <QFileInfo>
+#include <QtAlgorithms>
#include "book.h"
#include "opshandler.h"
void Book::addBookmark(int chapter, qreal position)
{
mBookmarks.append(Bookmark(chapter, position));
+ qSort(mBookmarks.begin(), mBookmarks.end());
save();
}
QString type;
};
- /** Bookmark: a chapter index and a relative position in chapter. */
+ /** Bookmark: a volume index and a relative position in volume. */
struct Bookmark
{
Bookmark(int chapter_, qreal pos_): chapter(chapter_), pos(pos_) {}
Bookmark() {chapter = pos = 0;}
int chapter;
qreal pos;
+ bool operator<(const Bookmark&other) const {
+ if (chapter != other.chapter) {
+ return chapter < other.chapter;
+ } else {
+ return pos < other.pos;
+ }
+ }
};
/** Construct a book from an EPUB file in path. */
list = new QListWidget(this);
list->setSelectionMode(QAbstractItemView::SingleSelection);
foreach (Book::Bookmark bookmark, book_->bookmarks()) {
- list->addItem("Chapter " + QString::number(bookmark.chapter) + ", at " +
+ list->addItem("Volume " + QString::number(bookmark.chapter + 1) + ", at " +
QString::number((int)(bookmark.pos * 100)) + "%");
}
class QListWidget;
class QListWidgetItem;
+/** Dialog box managing bookmarks. */
class BookmarksDialog: public QDialog
{
Q_OBJECT
#endif
BookView::BookView(QWidget *parent):
- QWebView(parent), contentIndex(0), mBook(0), restore(true), restorePos(0),
+ QWebView(parent), contentIndex(-1), mBook(0), restore(true), restorePos(0),
loadFinished(false)
{
settings()->setAttribute(QWebSettings::AutoLoadImages, true);
if (book != mBook) {
mBook = book;
if (book) {
+ contentIndex = -1;
book->open();
goToBookmark(book->lastBookmark());
}
else {
+ contentIndex = 0;
setHtml(tr("No book"));
}
}
if (mBook) {
restore = true;
restorePos = bookmark.pos;
- loadContent(bookmark.chapter);
+ if (bookmark.chapter != contentIndex) {
+ loadContent(bookmark.chapter);
+ } else {
+ onLoadFinished(true);
+ }
}
}
#include "book.h"
+/** Visual representation of a book. */
class BookView: public QWebView
{
Q_OBJECT
* Optify Maemo package
* Better dialogs on Mac
* Make returning from full screen mode more obvious
+ * Keep bookmarks sorted
+ * Don't reload volume if the bookmark is in the same volume
-- Akos Polster <akos@pipacs.com> Fri, 16 Jul 2010 20:00:00 +0200