diff --git a/resources/i18n/en.json b/resources/i18n/en.json index c4bc04e78..c6fcf6eda 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -171,5 +171,7 @@ "preview-book-in-web-browser": "Preview book in web browser", "file-not-found-title": "ZIM File Not Found", "file-not-found-text": "ZIM file doesn't exist or is not readable", - "zim-id": "ZIM Id" + "zim-id": "Zim Id", + "zim-name": "Zim Name", + "zim-path": "Zim File Path" } diff --git a/resources/i18n/qqq.json b/resources/i18n/qqq.json index 8b19e0ffb..6b670f09d 100644 --- a/resources/i18n/qqq.json +++ b/resources/i18n/qqq.json @@ -178,5 +178,7 @@ "path-was-copied": "Tooltip confirming that the download path from settings was copied.", "file-not-found-title": "Error title text displayed when the desktop application cannot find the Zim file needed to display the web page.", "file-not-found-text": "Error description text for when the desktop application cannot find the Zim file needed to display the web page.", - "zim-id": "The term for the unique identifier of a zim file." + "zim-id": "The term for the unique identifier of a zim file.", + "zim-name": "The term for the name of a Zim file", + "zim-path": "The term for the path of a Zim file" } diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 421b49d19..0cb1586c9 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -284,6 +284,15 @@ QStringList TabBar::getTabUrls() const { return idList; } +QStringList TabBar::getTabZimIds() const +{ + QStringList idList; + for (int index = 0; index <= mp_stackedWidget->count(); index++) + if (ZimView* zv = qobject_cast(mp_stackedWidget->widget(index))) + idList.push_back(zv->getWebView()->zimId()); + return idList; +} + void TabBar::closeTab(int index) { // The first and last tabs (i.e. the library tab and the + (new tab) button) diff --git a/src/tabbar.h b/src/tabbar.h index f8303519f..9310756bc 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -50,6 +50,7 @@ class TabBar : public QTabBar void openFindInPageBar(); void closeTabsByZimId(const QString &id); QStringList getTabUrls() const; + QStringList getTabZimIds() const; protected: void mousePressEvent(QMouseEvent *event); diff --git a/src/urlschemehandler.cpp b/src/urlschemehandler.cpp index b21b73432..aed0e2c0e 100644 --- a/src/urlschemehandler.cpp +++ b/src/urlschemehandler.cpp @@ -181,6 +181,9 @@ UrlSchemeHandler::replyZimNotFoundPage(QWebEngineUrlRequestJob *request, const QString &zimId) { QBuffer *buffer = new QBuffer; + auto& book = KiwixApp::instance()->getLibrary()->getBookById(zimId); + QString path = QString::fromStdString(book.getPath()); + QString name = QString::fromStdString(book.getName()); QString contentHtml = "
" "

" + gt("file-not-found-title") + @@ -191,6 +194,12 @@ UrlSchemeHandler::replyZimNotFoundPage(QWebEngineUrlRequestJob *request, "

" + gt("zim-id") + ": " + zimId + "

" + "

" + + gt("zim-name") + ": " + name + + "

" + "

" + + gt("zim-path") + ": " + path + + "

" "

"; buffer->open(QIODevice::WriteOnly);