diff --git a/app/qml/BooksBookView.qml b/app/qml/BooksBookView.qml index 8262daf..caf5a27 100644 --- a/app/qml/BooksBookView.qml +++ b/app/qml/BooksBookView.qml @@ -52,6 +52,8 @@ SilicaFlickable { // NOTE: These have to match ResetReason in BooksBookModel readonly property var _loadingTextLabel: [ + //% "Formatting..." + qsTrId("book-view-formatting"), //% "Loading..." qsTrId("book-view-loading"), //% "Applying larger fonts..." @@ -217,8 +219,8 @@ SilicaFlickable { Label { anchors { - top: busyIndicator.bottom - topMargin: Theme.paddingLarge + bottom: busyIndicator.top + bottomMargin: Theme.paddingLarge horizontalCenter: busyIndicator.horizontalCenter } @@ -239,7 +241,7 @@ SilicaFlickable { horizontalCenter: parent.horizontalCenter } onClicked: root.closeBook() - enabled: _loading + enabled: _loading && bookModel.resetReason === BookModel.ReasonLoading visible: opacity > 0 opacity: enabled ? 1.0 : 0.0 Behavior on opacity { FadeAnimation { } } diff --git a/app/src/BooksBookModel.cpp b/app/src/BooksBookModel.cpp index 63f52ba..eabfdb0 100644 --- a/app/src/BooksBookModel.cpp +++ b/app/src/BooksBookModel.cpp @@ -245,7 +245,7 @@ void BooksBookModel::setBook(BooksBook* aBook) iTitle = QString(); HDEBUG(""); } - startReset(); + startReset(ReasonLoading, true); if (oldTitle != iTitle) { Q_EMIT titleChanged(); } @@ -461,6 +461,15 @@ void BooksBookModel::startReset(ResetReason aResetReason, bool aFullReset) BooksLoadingSignalBlocker block(this); const BooksPos thisPage = pageMark(iCurrentPage); const BooksPos nextPage = pageMark(iCurrentPage+1); + if (aResetReason == ReasonUnknown) { + if (iResetReason == ReasonUnknown) { + if (!iData && !iData2) { + aResetReason = ReasonLoading; + } + } else { + aResetReason = iResetReason; + } + } if (iTask) { iTask->release(this); iTask = NULL; @@ -541,6 +550,10 @@ void BooksBookModel::onResetDone() if (oldBookModel != bookModel()) { Q_EMIT bookModelChanged(); } + if (iResetReason != ReasonUnknown) { + iResetReason = ReasonUnknown; + Q_EMIT resetReasonChanged(); + } } QHash BooksBookModel::roleNames() const diff --git a/app/src/BooksBookModel.h b/app/src/BooksBookModel.h index c150659..15a4144 100644 --- a/app/src/BooksBookModel.h +++ b/app/src/BooksBookModel.h @@ -76,6 +76,7 @@ public: // NOTE: These have to match the labels in BooksBookView.qml enum ResetReason { ReasonUnknown, + ReasonLoading, ReasonIncreasingFontSize, ReasonDecreasingFontSize }; diff --git a/app/translations/harbour-books-fi.ts b/app/translations/harbour-books-fi.ts index 5ab6c21..8358c80 100644 --- a/app/translations/harbour-books-fi.ts +++ b/app/translations/harbour-books-fi.ts @@ -15,6 +15,10 @@ Loading... Latautuu... + + Formatting... + Alustetaan... + Applying larger fonts... Vaihdetaan isompiin fontteihin... diff --git a/app/translations/harbour-books-ru.ts b/app/translations/harbour-books-ru.ts index 5244aa7..0ea6e1e 100644 --- a/app/translations/harbour-books-ru.ts +++ b/app/translations/harbour-books-ru.ts @@ -15,6 +15,10 @@ Loading... Загрузка... + + Formatting... + Форматирование... + Applying larger fonts... Увеличиваем шрифты... diff --git a/app/translations/harbour-books-sv.ts b/app/translations/harbour-books-sv.ts index 71cc942..9230071 100644 --- a/app/translations/harbour-books-sv.ts +++ b/app/translations/harbour-books-sv.ts @@ -15,6 +15,10 @@ Loading... Läser in... + + Formatting... + Formatering... + Applying larger fonts... Tillämpar större teckensnitt... diff --git a/app/translations/harbour-books.ts b/app/translations/harbour-books.ts index 622101a..619f0d9 100644 --- a/app/translations/harbour-books.ts +++ b/app/translations/harbour-books.ts @@ -15,6 +15,10 @@ Loading... Loading... + + Formatting... + Formatting... + Applying larger fonts... Applying larger fonts...