From 3600c4e0e80f0c72556534a15d9818e79f34e422 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Mon, 7 Sep 2026 16:53:34 +0800 Subject: [PATCH 01/63] feat(reader): add OFD document support via rofd C ABI Add a read-only OFD (GB/T 33190-2016) backend built on the rofd library's stable C ABI (librofd_ffi), following the XPS adapter integration pattern: - OfdDocument/OfdPage implement the Document/Page interfaces: open, page count, page size (mm to logical px via screen DPI), and page rendering through rofd_renderer_render_page_cairo into a QImage. Text extraction and search return empty until the rofd C ABI exposes text APIs. - New Dr::OFD file type detected by .ofd extension, factory branch, open-dialog filter, sidebar (thumbnail | bookmark), big-image rendering path, title widget enablement, save-as filter and format string. - CMake option OFD_SUPPORT (default ON) locates rofd.h and librofd_ffi via -DROFD_ROOT, degrading gracefully when absent; qmake gains a matching ofd_support CONFIG block. - Install application/ofd MIME definition and register it in the desktop file. - Add GTest coverage (open, page size, out-of-range, render content check, invalid size, missing/broken file) with tests/files/normal.ofd. Verified: full build with OFD on/off, 7 OFD unit tests pass, and the application opens and renders an OFD invoice end to end. --- CMakeLists.txt | 39 ++++ assets/mimetype/ofd.xml | 14 ++ reader/CMakeLists.txt | 22 +++ reader/app/Global.cpp | 6 + reader/app/Global.h | 5 +- reader/browser/BrowserPage.cpp | 3 + reader/deepin-reader.desktop | 2 +- reader/document/Model.cpp | 8 + reader/document/OfdModel.cpp | 294 ++++++++++++++++++++++++++++++ reader/document/OfdModel.h | 78 ++++++++ reader/document/document.pri | 7 + reader/uiframe/Central.cpp | 3 + reader/uiframe/CentralDocPage.cpp | 15 +- reader/uiframe/DocSheet.cpp | 13 ++ reader/uiframe/TitleWidget.cpp | 3 + tests/CMakeLists.txt | 13 ++ tests/document/ut_ofdmodel.cpp | 141 ++++++++++++++ tests/files/normal.ofd | Bin 0 -> 23064 bytes 18 files changed, 656 insertions(+), 10 deletions(-) create mode 100644 assets/mimetype/ofd.xml create mode 100644 reader/document/OfdModel.cpp create mode 100644 reader/document/OfdModel.h create mode 100644 tests/document/ut_ofdmodel.cpp create mode 100644 tests/files/normal.ofd diff --git a/CMakeLists.txt b/CMakeLists.txt index fd7fe65bf..16a1a75f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,45 @@ else() unset(XPS_DEPS_CFLAGS_OTHER) endif() +# OFD支持选项(根据 rofd C ABI 库检测自动启用) +option(OFD_SUPPORT "Enable OFD document format support" ON) +set(ROFD_ROOT "" CACHE PATH "Path to the rofd repository checkout or install prefix") + +set(OFD_SUPPORT_RESOLVED ${OFD_SUPPORT}) + +if (OFD_SUPPORT) + set(ROFD_ROOT_HINTS "") + if (ROFD_ROOT) + list(APPEND ROFD_ROOT_HINTS ${ROFD_ROOT}) + endif() + if (EXISTS "${CMAKE_SOURCE_DIR}/../rofd") + list(APPEND ROFD_ROOT_HINTS "${CMAKE_SOURCE_DIR}/../rofd") + endif() + + find_path(ROFD_INCLUDE_DIR rofd.h + HINTS ${ROFD_ROOT_HINTS} + PATH_SUFFIXES crates/rofd-ffi/include include + ) + find_library(ROFD_FFI_LIBRARY NAMES rofd_ffi + HINTS ${ROFD_ROOT_HINTS} + PATH_SUFFIXES target/release target/debug lib + ) + pkg_check_modules(OFD_CAIRO QUIET cairo) + + if (ROFD_INCLUDE_DIR AND ROFD_FFI_LIBRARY AND OFD_CAIRO_FOUND) + message(STATUS ">>> OFD support enabled (rofd_ffi: ${ROFD_FFI_LIBRARY})") + add_compile_definitions(OFD_SUPPORT_ENABLED) + set(OFD_SUPPORT_RESOLVED ON) + else() + message(WARNING ">>> OFD support disabled: set -DROFD_ROOT to the rofd checkout and build rofd-ffi first (cargo build -p rofd-ffi)") + set(OFD_SUPPORT_RESOLVED OFF) + endif() +else() + message(STATUS ">>> OFD support disabled by configuration") +endif() + +set(OFD_SUPPORT_ENABLED ${OFD_SUPPORT_RESOLVED}) + include(GNUInstallDirs) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) diff --git a/assets/mimetype/ofd.xml b/assets/mimetype/ofd.xml new file mode 100644 index 000000000..b82752654 --- /dev/null +++ b/assets/mimetype/ofd.xml @@ -0,0 +1,14 @@ + + + + + OFD document + OFD 版式文档 + OFD Document + OFD + Open Fixed-layout Document + + + + + diff --git a/reader/CMakeLists.txt b/reader/CMakeLists.txt index 0acef2ce2..1b801808b 100644 --- a/reader/CMakeLists.txt +++ b/reader/CMakeLists.txt @@ -12,6 +12,10 @@ if (XPS_SUPPORT_ENABLED) pkg_check_modules(XPS_DEPS REQUIRED libgxps cairo glib-2.0 gobject-2.0 freetype2) endif() +if (OFD_SUPPORT_ENABLED) + pkg_check_modules(OFD_CAIRO REQUIRED cairo) +endif() + # 添加位置无关代码编译标志 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE") @@ -91,6 +95,8 @@ target_include_directories(deepin-reader PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/eyeprotection ${PDFIUM_INCLUDE_DIRS} $<$:${XPS_DEPS_INCLUDE_DIRS}> + $<$:${ROFD_INCLUDE_DIR}> + $<$:${OFD_CAIRO_INCLUDE_DIRS}> ) # 使用DTK变量包含目录 @@ -116,6 +122,10 @@ if (XPS_SUPPORT_ENABLED) target_compile_options(deepin-reader PRIVATE ${XPS_DEPS_CFLAGS_OTHER}) endif() +if (OFD_SUPPORT_ENABLED) + target_compile_options(deepin-reader PRIVATE ${OFD_CAIRO_CFLAGS_OTHER}) +endif() + # 添加资源文件 set(READER_LINK_LIBS ${LINK_LIBS} @@ -127,6 +137,10 @@ if (XPS_SUPPORT_ENABLED) list(APPEND READER_LINK_LIBS ${XPS_DEPS_LIBRARIES}) endif() +if (OFD_SUPPORT_ENABLED) + list(APPEND READER_LINK_LIBS ${ROFD_FFI_LIBRARY} ${OFD_CAIRO_LIBRARIES}) +endif() + if (QT_VERSION_MAJOR MATCHES 6) target_link_libraries(deepin-reader PRIVATE ${READER_LINK_LIBS}) @@ -184,6 +198,14 @@ if (XPS_SUPPORT_ENABLED) message(STATUS ">>> Note: After installation, please run 'sudo update-mime-database ${CMAKE_INSTALL_DATADIR}/mime' to update MIME database") endif() +if (OFD_SUPPORT_ENABLED) + install(FILES + ${CMAKE_SOURCE_DIR}/assets/mimetype/ofd.xml + DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages + ) + message(STATUS ">>> OFD MIME type definition will be installed to ${CMAKE_INSTALL_DATADIR}/mime/packages") +endif() + # 安装帮助文件 install(DIRECTORY ${CMAKE_SOURCE_DIR}/assets/deepin-reader diff --git a/reader/app/Global.cpp b/reader/app/Global.cpp index 335200c23..b7463a1eb 100644 --- a/reader/app/Global.cpp +++ b/reader/app/Global.cpp @@ -40,6 +40,12 @@ FileType fileType(const QString &filePath) } else if (mimeType.name() == QLatin1String("application/vnd.ms-xpsdocument")) { qCDebug(appLog) << "Matched XPS file type by MIME type"; fileType = XPS; +#endif +#ifdef OFD_SUPPORT_ENABLED + } else if (filePath.right(4).toLower() == ".ofd") { + // OFD 是 ZIP 容器,按内容探测会得到 application/zip,统一按后缀判断 + qCDebug(appLog) << "Matched OFD file type by extension"; + fileType = OFD; #endif } else if (mimeType.name() == QLatin1String("application/zip") && filePath.right(4) == "pptx") { qCDebug(appLog) << "Matched PPTX file type"; diff --git a/reader/app/Global.h b/reader/app/Global.h index f34d8c3b1..603d506c0 100644 --- a/reader/app/Global.h +++ b/reader/app/Global.h @@ -42,7 +42,10 @@ enum FileType { DOC = 5, PPTX = 6, #ifdef XPS_SUPPORT_ENABLED - XPS = 7 + XPS = 7, +#endif +#ifdef OFD_SUPPORT_ENABLED + OFD = 8 #endif }; FileType fileType(const QString &filePath); diff --git a/reader/browser/BrowserPage.cpp b/reader/browser/BrowserPage.cpp index a72defc9e..2df1063f7 100644 --- a/reader/browser/BrowserPage.cpp +++ b/reader/browser/BrowserPage.cpp @@ -1326,6 +1326,9 @@ bool BrowserPage::isBigDoc() bool supportedType = (Dr::PDF == m_sheet->fileType()); #ifdef XPS_SUPPORT_ENABLED supportedType = supportedType || (Dr::XPS == m_sheet->fileType()); +#endif +#ifdef OFD_SUPPORT_ENABLED + supportedType = supportedType || (Dr::OFD == m_sheet->fileType()); #endif bool isBig = supportedType && boundingRect().width() > 1000 && boundingRect().height() > 1000; qCDebug(appLog) << "Checking if document is big:" << isBig; diff --git a/reader/deepin-reader.desktop b/reader/deepin-reader.desktop index 931ae5be4..e479ab30c 100644 --- a/reader/deepin-reader.desktop +++ b/reader/deepin-reader.desktop @@ -3,7 +3,7 @@ Categories=Office; Exec=deepin-reader %F GenericName=Document Viewer Icon=deepin-reader -MimeType=application/pdf;image/vnd.djvu;image/vnd.djvu+multipage;application/wps-office.docx;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-xpsdocument;application/oxps; +MimeType=application/pdf;image/vnd.djvu;image/vnd.djvu+multipage;application/wps-office.docx;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-xpsdocument;application/oxps;application/ofd; Name=Document Viewer StartupNotify=true TryExec=deepin-reader diff --git a/reader/document/Model.cpp b/reader/document/Model.cpp index b768b79af..6ed8e31fe 100644 --- a/reader/document/Model.cpp +++ b/reader/document/Model.cpp @@ -6,6 +6,9 @@ #ifdef XPS_SUPPORT_ENABLED #include "XpsDocumentAdapter.h" #endif +#ifdef OFD_SUPPORT_ENABLED +#include "OfdModel.h" +#endif #include "PDFModel.h" #include "DjVuModel.h" #include "dpdfannot.h" @@ -115,6 +118,11 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & } else if (Dr::XPS == fileType) { qCDebug(appLog) << "Handling XPS document"; document = deepin_reader::XpsDocumentAdapter::loadDocument(filePath, error); +#endif +#ifdef OFD_SUPPORT_ENABLED + } else if (Dr::OFD == fileType) { + qCDebug(appLog) << "Handling OFD document"; + document = deepin_reader::OfdDocument::loadDocument(filePath, error); #endif } else if (Dr::DOCX == fileType) { qCDebug(appLog) << "Starting DOCX document conversion process"; diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp new file mode 100644 index 000000000..13b55bc7a --- /dev/null +++ b/reader/document/OfdModel.cpp @@ -0,0 +1,294 @@ +// Copyright (C) 2019 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "OfdModel.h" + +#ifdef OFD_SUPPORT_ENABLED + +#include "ddlog.h" + +#include +#include +#include +#include + +namespace deepin_reader { + +static constexpr qreal kMillimetresPerInch = 25.4; + +OfdDocument *OfdDocument::loadDocument(const QString &filePath, Document::Error &error) +{ + qCInfo(appLog) << "Loading OFD document from:" << filePath; + + rofd_load_options_t loadOptions; + rofd_load_options_init(&loadOptions, sizeof(loadOptions)); + + rofd_document_t *document = nullptr; + rofd_error_t *rofdError = nullptr; + const QByteArray nativePath = QFile::encodeName(filePath); + + rofd_status_t status = rofd_document_open(nativePath.constData(), &loadOptions, &document, &rofdError); + if (status != ROFD_STATUS_OK || nullptr == document) { + qCWarning(appLog) << "Failed to open OFD document:" << filePath + << "status:" << status + << "message:" << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); + rofd_error_free(rofdError); + error = Document::FileError; + return nullptr; + } + + rofd_renderer_t *renderer = nullptr; + status = rofd_renderer_new(nullptr, &renderer, &rofdError); + if (status != ROFD_STATUS_OK || nullptr == renderer) { + qCWarning(appLog) << "Failed to create OFD renderer, status:" << status + << "message:" << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); + rofd_error_free(rofdError); + rofd_document_free(document); + error = Document::FileError; + return nullptr; + } + + error = Document::NoError; + return new OfdDocument(filePath, document, renderer); +} + +OfdDocument::OfdDocument(const QString &filePath, rofd_document_t *document, rofd_renderer_t *renderer) + : m_filePath(filePath) + , m_document(document) + , m_renderer(renderer) +{ + size_t count = 0; + if (ROFD_STATUS_OK != rofd_document_get_page_count(m_document, &count, nullptr)) { + qCWarning(appLog) << "Failed to query OFD page count:" << m_filePath; + count = 0; + } + m_pageCount = static_cast(count); + + QScreen *srn = QApplication::screens().value(0); + if (nullptr != srn) { + m_xRes = srn->logicalDotsPerInchX(); // 获取屏幕的横纵向逻辑dpi + m_yRes = srn->logicalDotsPerInchY(); + } + + qCInfo(appLog) << "OFD document loaded, pages:" << m_pageCount << "dpi:" << m_xRes << m_yRes; +} + +OfdDocument::~OfdDocument() +{ + qCDebug(appLog) << "Destroying OFD document:" << m_filePath; + rofd_renderer_free(m_renderer); + rofd_document_free(m_document); +} + +int OfdDocument::pageCount() const +{ + return m_pageCount; +} + +Page *OfdDocument::page(int index) const +{ + if (index < 0 || index >= m_pageCount) { + qCWarning(appLog) << "OFD page index out of range:" << index << "count:" << m_pageCount; + return nullptr; + } + + rofd_page_t *pageHandle = nullptr; + rofd_error_t *rofdError = nullptr; + rofd_status_t status = rofd_document_get_page(m_document, static_cast(index), &pageHandle, &rofdError); + if (status != ROFD_STATUS_OK || nullptr == pageHandle) { + qCWarning(appLog) << "Failed to load OFD page:" << index + << "message:" << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); + rofd_error_free(rofdError); + return nullptr; + } + + return new OfdPage(this, pageHandle, index); +} + +QStringList OfdDocument::saveFilter() const +{ + return QStringList() << QLatin1String("OFD (*.ofd)"); +} + +bool OfdDocument::save() const +{ + // OFD 后端为只读,文档不会产生需要落盘的修改 + return true; +} + +bool OfdDocument::saveAs(const QString &filePath) const +{ + qCInfo(appLog) << "Saving OFD document copy to:" << filePath; + + if (QFile::exists(filePath) && !QFile::remove(filePath)) { + qCWarning(appLog) << "Failed to remove existing target file:" << filePath; + return false; + } + + if (!QFile::copy(m_filePath, filePath)) { + qCWarning(appLog) << "Failed to copy OFD document to:" << filePath; + return false; + } + + return true; +} + +Properties OfdDocument::properties() const +{ + Properties props; + props["Format"] = QStringLiteral("OFD"); + props["FilePath"] = m_filePath; + return props; +} + +QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, const QRect &slice) const +{ + if (nullptr == pageHandle || width <= 0 || height <= 0) { + qCWarning(appLog) << "Invalid OFD render request, handle:" << pageHandle << "size:" << width << height; + return QImage(); + } + + rofd_rect_t pageRect = {0.0, 0.0, 0.0, 0.0}; + if (ROFD_STATUS_OK != rofd_page_get_size_mm(pageHandle, &pageRect, nullptr) || pageRect.width_mm <= 0.0) { + qCWarning(appLog) << "Failed to query OFD page size for rendering"; + return QImage(); + } + + // rofd 按 毫米 -> 像素 的单一比例渲染,目标整页宽度为 width 像素 + const double pixelsPerMm = static_cast(width) / pageRect.width_mm; + + rofd_render_options_t options; + rofd_render_options_init(&options, sizeof(options)); + options.dpi = pixelsPerMm * kMillimetresPerInch; + options.scale = 1.0; + + int32_t pixelWidth = 0; + int32_t pixelHeight = 0; + rofd_error_t *rofdError = nullptr; + if (ROFD_STATUS_OK != rofd_renderer_get_pixel_size(m_renderer, pageHandle, &options, &pixelWidth, &pixelHeight, &rofdError) + || pixelWidth <= 0 || pixelHeight <= 0) { + qCWarning(appLog) << "Failed to compute OFD pixel size:" + << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); + rofd_error_free(rofdError); + return QImage(); + } + + QImage image(pixelWidth, pixelHeight, QImage::Format_ARGB32_Premultiplied); + if (image.isNull()) { + qCWarning(appLog) << "Failed to allocate OFD render image:" << pixelWidth << pixelHeight; + return QImage(); + } + image.fill(Qt::white); + + cairo_surface_t *surface = cairo_image_surface_create_for_data(image.bits(), + CAIRO_FORMAT_ARGB32, + pixelWidth, + pixelHeight, + image.bytesPerLine()); + if (CAIRO_STATUS_SUCCESS != cairo_surface_status(surface)) { + qCWarning(appLog) << "Failed to create Cairo surface for OFD render"; + cairo_surface_destroy(surface); + return QImage(); + } + + cairo_t *cr = cairo_create(surface); + if (CAIRO_STATUS_SUCCESS != cairo_status(cr)) { + qCWarning(appLog) << "Failed to create Cairo context for OFD render"; + cairo_destroy(cr); + cairo_surface_destroy(surface); + return QImage(); + } + + rofd_render_report_t *report = nullptr; + rofd_status_t status = rofd_renderer_render_page_cairo(m_renderer, pageHandle, cr, &options, &report, &rofdError); + + if (nullptr != report) { + size_t diagnosticCount = 0; + if (ROFD_STATUS_OK == rofd_render_report_get_count(report, &diagnosticCount, nullptr) && diagnosticCount > 0) { + for (size_t i = 0; i < diagnosticCount; ++i) { + rofd_render_diagnostic_t diagnostic; + diagnostic.struct_size = sizeof(diagnostic); + if (ROFD_STATUS_OK == rofd_render_report_get_diagnostic(report, i, &diagnostic, nullptr)) { + qCWarning(appLog) << "OFD render diagnostic, kind:" << diagnostic.kind + << "object:" << diagnostic.object_id + << "message:" << (diagnostic.message ? diagnostic.message : ""); + } + } + } + rofd_render_report_free(report); + } + + cairo_destroy(cr); + cairo_surface_destroy(surface); + + if (status != ROFD_STATUS_OK) { + qCWarning(appLog) << "OFD page render failed, status:" << status + << "message:" << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); + rofd_error_free(rofdError); + return QImage(); + } + + // rofd 的 clip 只限制绘制范围、不改变坐标映射,切片通过整页渲染后裁剪实现 + if (slice.isValid()) { + const QRect bounded = slice.intersected(image.rect()); + if (bounded.isValid() && bounded.size() != image.size()) { + return image.copy(bounded); + } + } + + return image; +} + +OfdPage::OfdPage(const OfdDocument *document, rofd_page_t *pageHandle, int pageIndex) + : m_document(document) + , m_page(pageHandle) + , m_pageIndex(pageIndex) +{ + rofd_rect_t pageRect = {0.0, 0.0, 0.0, 0.0}; + if (ROFD_STATUS_OK == rofd_page_get_size_mm(m_page, &pageRect, nullptr)) { + m_sizePixel = QSizeF(pageRect.width_mm * m_document->xRes() / kMillimetresPerInch, + pageRect.height_mm * m_document->yRes() / kMillimetresPerInch); + } else { + qCWarning(appLog) << "Failed to query OFD page size, page:" << m_pageIndex; + } +} + +OfdPage::~OfdPage() +{ + rofd_page_free(m_page); +} + +QSizeF OfdPage::sizeF() const +{ + return m_sizePixel; +} + +QImage OfdPage::render(int width, int height, const QRect &slice) const +{ + if (nullptr == m_document || nullptr == m_page) { + return QImage(); + } + return m_document->renderPage(m_page, width, height, slice); +} + +QString OfdPage::text(const QRectF &rect) const +{ + // rofd C ABI 暂不提供文本提取接口 + Q_UNUSED(rect) + return QString(); +} + +QVector OfdPage::search(const QString &text, bool matchCase, bool wholeWords) const +{ + // rofd C ABI 暂不提供文本搜索接口 + Q_UNUSED(text) + Q_UNUSED(matchCase) + Q_UNUSED(wholeWords) + return QVector(); +} + +} // namespace deepin_reader + +#endif // OFD_SUPPORT_ENABLED diff --git a/reader/document/OfdModel.h b/reader/document/OfdModel.h new file mode 100644 index 000000000..6c54e0de5 --- /dev/null +++ b/reader/document/OfdModel.h @@ -0,0 +1,78 @@ +// Copyright (C) 2019 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef OFDMODEL_H +#define OFDMODEL_H + +#include "Model.h" + +#ifdef OFD_SUPPORT_ENABLED + +#include +#include + +#include + +namespace deepin_reader { + +class OfdPage; + +class OfdDocument : public Document +{ + Q_OBJECT +public: + static OfdDocument *loadDocument(const QString &filePath, Document::Error &error); + + ~OfdDocument() override; + + int pageCount() const override; + Page *page(int index) const override; + QStringList saveFilter() const override; + bool save() const override; + bool saveAs(const QString &filePath) const override; + Properties properties() const override; + + QString filePath() const { return m_filePath; } + qreal xRes() const { return m_xRes; } + qreal yRes() const { return m_yRes; } + + // 供 OfdPage 使用的渲染接口 + QImage renderPage(rofd_page_t *pageHandle, int width, int height, const QRect &slice) const; + +private: + OfdDocument(const QString &filePath, rofd_document_t *document, rofd_renderer_t *renderer); + + QString m_filePath; + rofd_document_t *m_document = nullptr; + rofd_renderer_t *m_renderer = nullptr; + int m_pageCount = 0; + qreal m_xRes = 96.0; + qreal m_yRes = 96.0; +}; + +class OfdPage : public Page +{ + Q_OBJECT +public: + OfdPage(const OfdDocument *document, rofd_page_t *pageHandle, int pageIndex); + ~OfdPage() override; + + QSizeF sizeF() const override; + QImage render(int width, int height, const QRect &slice = QRect()) const override; + QString text(const QRectF &rect) const override; + QVector search(const QString &text, bool matchCase, bool wholeWords) const override; + +private: + const OfdDocument *m_document; + rofd_page_t *m_page = nullptr; + int m_pageIndex = -1; + QSizeF m_sizePixel; +}; + +} // namespace deepin_reader + +#endif // OFD_SUPPORT_ENABLED + +#endif // OFDMODEL_H diff --git a/reader/document/document.pri b/reader/document/document.pri index 9b2041461..0066d411c 100644 --- a/reader/document/document.pri +++ b/reader/document/document.pri @@ -11,6 +11,13 @@ xps_support { SOURCES += $$PWD/XpsTextExtractor.cpp } +# OFD支持文件(条件包含,需要 rofd-ffi 头文件与库,见顶层 CMake 的 ROFD_ROOT) +ofd_support { + HEADERS += $$PWD/OfdModel.h + SOURCES += $$PWD/OfdModel.cpp + DEFINES += OFD_SUPPORT_ENABLED +} + SOURCES += \ $$PWD/PDFModel.cpp \ $$PWD/DjVuModel.cpp \ diff --git a/reader/uiframe/Central.cpp b/reader/uiframe/Central.cpp index 98984f159..47a314c96 100644 --- a/reader/uiframe/Central.cpp +++ b/reader/uiframe/Central.cpp @@ -177,6 +177,9 @@ void Central::addFilesWithDialog() QStringList filters = {"*.pdf", "*.djvu", "*.docx"}; #ifdef XPS_SUPPORT_ENABLED filters << "*.xps"; +#endif +#ifdef OFD_SUPPORT_ENABLED + filters << "*.ofd"; #endif dialog.setNameFilter(tr("Documents") + QStringLiteral(" (") + filters.join(' ') + QLatin1Char(')')); dialog.setDirectory(QDir::homePath()); diff --git a/reader/uiframe/CentralDocPage.cpp b/reader/uiframe/CentralDocPage.cpp index cf553f22a..4cd838bbb 100644 --- a/reader/uiframe/CentralDocPage.cpp +++ b/reader/uiframe/CentralDocPage.cpp @@ -234,21 +234,20 @@ void CentralDocPage::addFileAsync(const QString &filePath) } Dr::FileType fileType = Dr::fileType(filePath); + bool supported = Dr::PDF == fileType || Dr::DJVU == fileType || Dr::DOCX == fileType; #ifdef XPS_SUPPORT_ENABLED - if (Dr::PDF != fileType && Dr::DJVU != fileType && Dr::DOCX != fileType && Dr::XPS != fileType) { -#else - if (Dr::PDF != fileType && Dr::DJVU != fileType && Dr::DOCX != fileType) { + supported = supported || Dr::XPS == fileType; #endif +#ifdef OFD_SUPPORT_ENABLED + supported = supported || Dr::OFD == fileType; +#endif + if (!supported) { if (pathControl(filePath)) { qCInfo(appLog) << "没有权限读取该文件"; return; } showTips(m_stackedLayout->currentWidget(), tr("The format is not supported"), 1); -#ifdef XPS_SUPPORT_ENABLED - qCWarning(appLog) << "不支持该文件格式!(仅支持PDF、DJVU、DOCX、XPS)文件格式:" << fileType << "(Unknown = 0, PDF = 1, DJVU = 2, DOCX = 3, PS = 4, DOC = 5, PPTX = 6, XPS = 7)"; -#else - qCWarning(appLog) << "不支持该文件格式!(仅支持PDF、DJVU、DOCX)文件格式:" << fileType << "(Unknown = 0, PDF = 1, DJVU = 2, DOCX = 3, PS = 4, DOC = 5, PPTX = 6, XPS = 7)"; -#endif + qCWarning(appLog) << "不支持该文件格式!(仅支持PDF、DJVU、DOCX、XPS、OFD)文件格式:" << fileType << "(Unknown = 0, PDF = 1, DJVU = 2, DOCX = 3, PS = 4, DOC = 5, PPTX = 6, XPS = 7, OFD = 8)"; return; } diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index 6a4cdf584..7b9ced0cf 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -87,6 +87,10 @@ DocSheet::DocSheet(const Dr::FileType &fileType, const QString &filePath, QWidg #ifdef XPS_SUPPORT_ENABLED else if (Dr::XPS == fileType) m_sidebar = new SheetSidebar(this, PREVIEW_THUMBNAIL | PREVIEW_CATALOG | PREVIEW_BOOKMARK); +#endif +#ifdef OFD_SUPPORT_ENABLED + else if (Dr::OFD == fileType) + m_sidebar = new SheetSidebar(this, PREVIEW_THUMBNAIL | PREVIEW_BOOKMARK); #endif else m_sidebar = new SheetSidebar(this); @@ -867,6 +871,10 @@ QString DocSheet::filter() return QStringLiteral("XPS Files (*.xps);;Pdf Files (*.pdf)"); } #endif +#ifdef OFD_SUPPORT_ENABLED + else if (Dr::OFD == m_fileType) + return "OFD Files (*.ofd)"; +#endif qCDebug(appLog) << "filter end, return:"; return ""; @@ -887,6 +895,11 @@ QString DocSheet::format() qCDebug(appLog) << "filter end, return:"; return QString("DJVU"); } +#ifdef OFD_SUPPORT_ENABLED + else if (Dr::OFD == m_fileType) { + return QString("OFD"); + } +#endif qCDebug(appLog) << "format end, return:"; return ""; } diff --git a/reader/uiframe/TitleWidget.cpp b/reader/uiframe/TitleWidget.cpp index 35d4c0465..dc5d0750d 100644 --- a/reader/uiframe/TitleWidget.cpp +++ b/reader/uiframe/TitleWidget.cpp @@ -141,6 +141,9 @@ void TitleWidget::onCurSheetChanged(DocSheet *sheet) || Dr::DOCX == m_curSheet->fileType() #ifdef XPS_SUPPORT_ENABLED || Dr::XPS == m_curSheet->fileType() +#endif +#ifdef OFD_SUPPORT_ENABLED + || Dr::OFD == m_curSheet->fileType() #endif ) { if (m_curSheet->opened()) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 892e928e6..dad235786 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -74,6 +74,11 @@ endif() set(XPS_SUPPORT_ENABLED ${XPS_SUPPORT_RESOLVED}) +# OFD 支持(检测结果继承自顶层 CMakeLists.txt 的 OFD_SUPPORT_ENABLED / ROFD_*) +if (OFD_SUPPORT_ENABLED) + pkg_check_modules(OFD_CAIRO REQUIRED cairo) +endif() + # ====== 收集 reader 源文件 ====== # 递归收集 reader/ 下所有源文件,排除 main.cpp # 新增子模块时无需修改此文件 @@ -126,6 +131,8 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/gtest ${PDFIUM_INCLUDE_DIRS} $<$:${XPS_DEPS_INCLUDE_DIRS}> + $<$:${ROFD_INCLUDE_DIR}> + $<$:${OFD_CAIRO_INCLUDE_DIRS}> ) # DTK 包含目录(Qt5 使用变量,Qt6 使用目标) @@ -155,6 +162,7 @@ target_compile_options(${PROJECT_NAME} PRIVATE -fprofile-arcs -ftest-coverage -fstack-protector-strong -D_FORTIFY_SOURCE=1 -fPIC $<$:${XPS_DEPS_CFLAGS_OTHER}> + $<$:${OFD_CAIRO_CFLAGS_OTHER}> ) target_link_options(${PROJECT_NAME} PRIVATE @@ -212,6 +220,11 @@ if (XPS_SUPPORT_ENABLED) list(APPEND TEST_LINK_LIBS ${XPS_DEPS_LIBRARIES}) endif() +# OFD 链接 +if (OFD_SUPPORT_ENABLED) + list(APPEND TEST_LINK_LIBS ${ROFD_FFI_LIBRARY} ${OFD_CAIRO_LIBRARIES}) +endif() + # PDFium 链接 if (USE_PDFIUM_BUNDLE) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp new file mode 100644 index 000000000..c89fec1ea --- /dev/null +++ b/tests/document/ut_ofdmodel.cpp @@ -0,0 +1,141 @@ +// Copyright (C) 2019 - 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "OfdModel.h" + +#ifdef OFD_SUPPORT_ENABLED + +#include "Model.h" +#include "ut_defines.h" + +#include +#include +#include + +#include + +using namespace deepin_reader; + +namespace { + +QString ofdFilePath() +{ + QString path = QString(UTSOURCEDIR) + "/files/normal.ofd"; + if (QFile(path).exists()) + return path; + + path = QCoreApplication::applicationDirPath() + "/files/normal.ofd"; + return path; +} + +bool hasOfdFile() +{ + return QFile(ofdFilePath()).exists(); +} + +} // namespace + +class TestOfdModel : public ::testing::Test +{ +public: + void SetUp() override + { + if (!hasOfdFile()) + GTEST_SKIP() << "normal.ofd not available, skipping OFD model tests"; + + Document::Error error = Document::NoError; + m_doc.reset(OfdDocument::loadDocument(ofdFilePath(), error)); + ASSERT_NE(m_doc, nullptr); + EXPECT_EQ(error, Document::NoError); + } + + void TearDown() override {} + + QString m_path; + std::unique_ptr m_doc; +}; + +TEST_F(TestOfdModel, loadDocument) +{ + EXPECT_GT(m_doc->pageCount(), 0); +} + +TEST_F(TestOfdModel, pageSize) +{ + Page *page = m_doc->page(0); + ASSERT_NE(page, nullptr); + + const QSizeF size = page->sizeF(); + EXPECT_GT(size.width(), 0.0); + EXPECT_GT(size.height(), 0.0); + + delete page; +} + +TEST_F(TestOfdModel, pageOutOfRange) +{ + EXPECT_EQ(m_doc->page(-1), nullptr); + EXPECT_EQ(m_doc->page(m_doc->pageCount()), nullptr); +} + +TEST_F(TestOfdModel, renderPage) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + + const QImage image = page->render(400, 400); + ASSERT_FALSE(image.isNull()); + EXPECT_GT(image.width(), 0); + EXPECT_GT(image.height(), 0); + + // 渲染结果不应是纯白页面 + bool hasContentPixel = false; + for (int y = 0; y < image.height() && !hasContentPixel; ++y) { + for (int x = 0; x < image.width(); ++x) { + const QRgb pixel = image.pixel(x, y); + if (qRed(pixel) < 240 || qGreen(pixel) < 240 || qBlue(pixel) < 240) { + hasContentPixel = true; + break; + } + } + } + EXPECT_TRUE(hasContentPixel); +} + +TEST_F(TestOfdModel, renderInvalidSize) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + + EXPECT_TRUE(page->render(0, 0).isNull()); + EXPECT_TRUE(page->render(-10, 100).isNull()); +} + +TEST_F(TestOfdModel, loadMissingFile) +{ + Document::Error error = Document::NoError; + std::unique_ptr doc(OfdDocument::loadDocument(QStringLiteral("/nonexistent/path/to.ofd"), error)); + EXPECT_EQ(doc, nullptr); + EXPECT_EQ(error, Document::FileError); +} + +TEST_F(TestOfdModel, loadBrokenFile) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + + const QString brokenPath = dir.filePath(QStringLiteral("broken.ofd")); + QFile file(brokenPath); + ASSERT_TRUE(file.open(QIODevice::WriteOnly)); + file.write("this is not an ofd zip archive"); + file.close(); + + Document::Error error = Document::NoError; + std::unique_ptr doc(OfdDocument::loadDocument(brokenPath, error)); + EXPECT_EQ(doc, nullptr); + EXPECT_EQ(error, Document::FileError); +} + +#endif // OFD_SUPPORT_ENABLED diff --git a/tests/files/normal.ofd b/tests/files/normal.ofd new file mode 100644 index 0000000000000000000000000000000000000000..e5e35522866743f7d69a39fa732284dd0ce8173e GIT binary patch literal 23064 zcmb5UW3VW^)}^~_+qSirZQHhO+qP}n_FlGa+g|;i)7@Wn-&^0QdsCH4e&k2SQ*&g_ zR3a}041xjx0RaJESWKn~@P9O%f9Aq=MtThN0=Bkx&QAYxFmSf8vvs0#x3O+&s2iJB zppc@anwgqyQej$RmRA&?mYR_ppOR`*fr52dY>{tlJ8T@6lWK6Bnw+GUpaG1+Y5Csc0m2}mQ0gO1WfFc-N1T_a$o}*-r=bn4eT*{@f6_9rI9a42jmL;G=T|6Qq4Lp>5l%LAR=ktlK#lrP24Z`7iQ<0Z0$8N}V#? z>hKF&izaal=sjInTH5_Fe;NoG&J9#-Fv;-VcF?0Exj*vsfqX~qf4xc$!2bm=P@`k* z?jJPTfd2^|#(%+6HZXId7jkiOwzK(X`Y&oJN!zl)3^lMoENOf35k%NNsj0STdzG;&1--z9!h)6v+#52<=<@APl~@1RWi*rOcq~e&CR6Re{!T*Dn>n2*RKBTwO(mB>WFXL1 zhd0AL88X7MOkrNSOBhVoRA;ndpY(LA9DddBd)t|s8Ug%#cb<=<{|jptHFy-_KS-~D z{}Wcs{|4*-ADr^d8mhv*cW=M0W)n>UKPD>G`E1b(!uoGk$8r4>GMM`HFpWCtm z%n8hx-qN?Sv$T)G;iMnX#fi4uB-;Gkk01ok!?>t1a*V#a($l+6qe2lv0G7>2EcB!d z1x&HB*naJ3QBlxSB{yt_vtwos*yB3nPyZb)*UKK0c>hF8FwlRZi~9eft7!7?NJ)tw zunJVk1+MImwZRZ$ z0d}Ou>zC z8+j^Q!&SZ0Zi!;bGQpHO%#jo^p+uEHWCVGd{OE$^G^&WNA(s3=<2lj+54M=Pf4nq^ zsvD>yA?4wSTDw@2uxK&t2l(~!6&7{OSF5V`FMGkA>O0;1gJb+Zo?6KN1x((>(AvW2 zf8qN7mcW|+mA{}QX;lHJX8uWB57sG6l9Eu>PtTK+lh6KN2Z2k*Jzs^+KE%L6%%q@Y z!w1TFU&dOb`DCPAbfBR1khbq0q$31)NO}XbjBLzh3-pX^%c|$+oj2rO}tSx7C>|(=;7Iyou6xdgi@EB%?wE%D3Wpj4U4_D4H=0!>B0k2pwe-O=g&N1WV$lrQpM^8XP|Z^&k3Y-Ga9$iT|V%)-RZY`|i~{)f@PgwceVnT3sw zk&TVx4-*?R^Phi~a4;}3vavGgnYh`|+1r}MsCuaAXSUa6g%pAUF*KLm1iPPJL_CeYD8#`d1}#LY>$ z=VhPepZLrW5Qzl!&5>=yYM{8ghlS7=(7!dR%Ks9oGE7agHoJD+M!!Rfj(pkXwuk2+ z_|xKZtZ4B}0CmgsxIW|(*lr+iTY><~T4@^A9gbd`wq4wUAk~#1FA@*>#<27?4m5q} z>@9&72sIS=qm!P*JhcbNK+jx`wTg|6+q+jXv0zw;827gGzS(wDlJ%wBD>)#s{0Rb8jpW)QAAtl^8X0VT3C5kNN( zB+_B4@@13r!@j%z)%FXDR@uI?5CoE5iN?l<6|?lsT0Ul4LW@H~e;MbzI$LnP5A zIxQr2Yx6c-v}*wpm_ZD^2hXL+WzE`fFo9UR6&7JuLfud?F;t?Z-7QDsR~U+i%Fvs} zvU5-8-LBf|5lp$*Y-HH1ipD>Ukr4MnLFL{pA%62KlYi^nvpPBAy;Z+3Dqk}2N?Q*h zb5}V^PoOLPW!YJ6B?m{zVMbR{=>$f^+xbStxFCvM+5zG&5$Bm%GIxRsYBL}bJfzVd9$11BAVt00SSapODxTk zRp=#}gKA?sNk`FvA*9rGNW7wt1UYxObIJ4Dg9R^FG>ayUtS1EJ8Qw-=CbyS>|@4WnY-kSGofDjPfYEz$}A)2=)&L8TVC%S+R^IeYRbx(BjGsEbCWwkBSg+ z9VN5=43ZPD4S;o4AcxMNQ_~D3z|HVhjQI$oMIqzk{-^d(K_rN1hp%Cnrm|M*L1{m8G}V+GiaG6ke6ipO zHhPMSzAmYE3Gi`;$(crA`c2M^*AkgHhnSIG3tZxDrGbxW-4%U9tey*fzO9IlsIgwb=^#+D9W#Y4i~fp@RV zw>7PqjE>-G3A~o<5s1(QfgY-9sB+wRc!NOIyJt&xV+9XF6NMM6l zPLf{%h_7gkPqzd!+3a)KQ5yDf9J|Kf>`zmyoi#?)Ewn=M-Ic~JDVJ^bB_wDlI{noz z+adQxY^>+RJ7d_@&6WC^t>N!bT7^Z;IXodPhj}|Mnpr&uQ+D>r3&VDhDXlJ1W`WX* zQaSZ%sfigByvx~%7cn=@mv&WWvLxoPZ6;X=4ve^C^L!SRzrWsQ+0kMd1kzg$G8fc3oC3^Bxxo~Y?p2n{U_w1GSt1N#v2hVmRNXfu+IMS7VKr?`&@fvfejhd z;j2?=`tNtY^S9;tl!du%VVPAU^Ft9L3`GU*(n7r3uO43Ap%Y*LZYXWJyoysI5q0mV zY-}~E#u);EJai9atC3jpzNxO6AT(4q*_2v5Pok)m){SGAs&4c%&ubWU4;?@|xhmRO z32Vczr?IElrUBimuoF8rr6SO?q5h8dm5hu`0Q$Rn@t_bJQ zQ>Jt9_BO51hnlYj-nh6-dvNP_P}qipY5aav5!J0?j$4Bx8J$vIu@oz#WShM5kMaf)9KG;vG3?|aQ z$?;T=rloJ{W;HLmj3HWs#Ok*Q9?X5enGCBNhVX>17qc6*Z=i@giK&Y~T%@=kQ>vfC z424$O_j^)=<0=9WYh@T#$gwqBj@ox5i}iS@x5WE^}??(IE! zE))msRIim^UiT9vYe$-=p%K$i8|A~WAI3!w%3?J^00jMqk9=EJ9UQ!>{r)tBRs!Mm zKk0^b)RSuN+dJh|-`J@vVDF6l<-e_QNZh^M85kHyEGQXG7#Qp;{GO)m;(x1? znT)!Az3;S#|7a^;O>1w#=130&%Us1s11_|No|I0MhLYvR9+rCR>&LUC^24ITdT`(w zd1-+S`59nvTjTcska`E=!G(^ll+pnZD>+GV`8HnG@-q3CK=Ng9c5x?l2bEWZlq9Dm zRYax%&8MXepr!`G?iSld(@8X5xGJ2I!IXEtIvIx;o<0Ms)y)H5(SFfuvKGdtbYGvC)U z0scsh{jAT84@Zk>NFVgIe*QfmZ?boA*fTJ8c5^ecH#4bsV=^;7IXN*kHZ(9cDEI{z zxV^GCH9QlrJC**qg)l6g8I?_iqf32p_4iv36@96t`!Y8E-~ z7XlYG1tS~%#h2Ip`Gsp~`L=6rifXJ_|HZwAd2(hjQD${%b#r0*DRVPD`X%DJ3+K$h z>RjUjyuP;i(GeGc_CohEgZ2UkfTjlK@)zBiTU)r%%f0;-NJu+PXmxUBY-VOnK|3V> z{5zy?VKGQdMnyL|K1w@7G(b5xMMFn7NJ2+9HAOlzGC)T|H8}8MSDW6`P*qcrGuhWc z_KUA};CJ+6Mevhkb76dLYDu(jYzO@or}U`)ljmrFn!0CbX84om^e$IB{!5wmd(`+9 zr#M?v>&0byJ z{zieZ@8;%qKcNpVkC&eA7E%5tVV;kzt+)0k(3inyd&^fx*XO&ZS4_~0fXu6(@U7F& zy`R*(fAqJr_uUhKXAhA_f8U3OF2LNkn~lXMSFal$#`kC4`}WE=In|4R(64{kr=Q%H zprl*uZ?D*Z`@(_`0l_;rj~7asCuH2$*18WtnXjVq`_{$}H}}WZrk|@bV1q-C=m>Yb zg3ry3Pi~GM4J{uf;O+yIuF(NM3=M&1Xk5lRIMKrE&CcrCniotqI{j{2XQ&z1-?-(L z)%M`Dxx3Y)C2-5mRlV_9x*PmMWO#tc*OL`9r6}~i{kBI0WbzKi?iVtnA->tXDgY(BR>Ng6)?_#UF z%-nZXg=Y`vFA5qk!&6_#D0e0%A8Jakg*jilOLtdSV2AsF_IJHQWW7Zu-9SOS65~AD zYP~?AUGT6Ss;ayiYrXDo-jkDE$w`6g>^LBzS=N`lOKf^V1G_&i1aP^pD=%V<$V!Q=y8y{_7gJKF1W=>UNg!AM)L+JRwt5;jA!Fu?}N%)V@1b6|j zKf89%F>?IRW?Erl9eMagMsZ(*1Z1sd%#*J#Gq1h7a#WV|0RwUunzu5vvt%c?ec-xD zin-T0xlb{0W9JU(_Jq;X6S z@F*;HAtQ2`oOULt^tQS5y@0c$rt~+uZu;_idU{6Vget#V2zqoAP*i%qa?t7PUddz_ z7@H~0=?rs5hl=Q`z(zP`;HWxB&8HOz{7nSW6(F+cCM1;*!^KWr!w_W`}JyQcI8E3MW9NEVuT-rHfN(^GMq>X)TG*A{qh$dfXuEw}fSdEVVrY@YAq zB8=WXXJtlFNnX_6i`ykAI$)Jr&Y%*xjCrhm2M*_W-t+ulbimT@aiFpFGV9yPk#ID! z_riA8uA3ynzVQi=o|9UKGe~%nk?noMq;)iFoOKxcQK+f-qGwT(5APbL#Ko<@Ta`jI z$#l6!?vvL#B+<6U2IIMxFibt%|MJ{ZSe0~m^nra}o{8vO@6q?uyz zWCAHr!q^8xfRS0#t}Y9^I!z0x-Ak_*_IXR#DbciiO-hmRPX||(?${uDr}i>v%)Lv6 z_>YgCxp?!cC5M$0$M8n%8*ld~bWB{-RG5Yhn2ySX(8S@H{S8y*22Tt>fJ5(Uryn0` zWM&Pnv~yNGic0YKa^+W#D(wBE1%3ADE}u>n6eMa@8)Tv36skW0S6ed{Nfp$7j2auQFRT}1`^<2w8yJP zLHf6?y@fU41a6q7aJ{3+nYRvp2G4$x>ZRJq#oI3%ZE)SWaNZm$@DnS(}_5Y6`T-PcmSY-Ku_g7i(^7 zIpg>=(0L~7XWS6?;VHAP(n8rdf0KF14eE_LsGELiRQ*;Zm!V#dOdM94DzH{uSJZma zdo__J0N_rvKuljLo0Aif?inN-S(lFRoM#iJ>aO`eGdXP@cf^dt-vY?ImCONLM>6Js z3_0lpxqbUH%M31%vq=5`-s)X~({SCG3}yTEr?XyKAiWr-k!`RYHvt={Acii#74=GR zWKNcj^={~x=!G;MimVgn^<}J_-)##w8Bv+gQjO_oQ#QvGjjJ>OiE!E;Ko4N)9I5b8 zt)OCaH?Dn|x~ynb%`A4qQ}h<~Grxk}?d_H3ou!n+y57y{JRX~FT@khq25N^J-r#K1;v)PNW>J43-0^L`f zayJ{(T@1FwI<(UVJCfZyqDk^|6bcvgc^35emHh*p;r#0iC*7cK+Z?bhvI6ai3W3&9 zgdvZst%waso83PXtj$1;T=LA4R*Xvg9CuS=I$4#1;Mz%|WDX2bXLe-#xfkkSl;h)f zt%(x)z5(Riwa3xvwFY;>GhZn+T7o8#CxoKG!xDMtRPsuq;zyEw1@!q4YWZEISkRr&F;sC)qk*NA%O)m!GgjM!6hLnE9E%Y@f0~~bxw3}({riIks zUV*QVI1i~oLg{Jw3^BbWEo*SWBf*XoWkJyEHYn3(Ul8c`>Q_;*9B8HDh@QPQB zj_VjGo8`7mT@g1pg8FSw^fr$A<<|BbYaZ#MIsHz%*rEK${&DK~W_==b_X;?URy}bY z&odBlh~VfXvg6mA)Yj)RGR|UHe*pmd*VsmslGPX%#!LGN)AAsfJc)RqROS|luuIF{ zGIu+|SF21?5{LXZfn;NiGF<%c`Y*W9GGJrl#8j(OgkqJ_s`^3WI~Z|}Xd~!&@sMlb zNe5{ky%HSNKnjzHd$UUF#o2J1rh?;b*z{hOLg%GSU)i+~*)Z9~>3mu+X7x_Y6}_E$ z(@%J0L=In4tD@VHH3Rn*Q=wJAosg@q)2R3(DO+eR@E#ANQ6Bjc>W-Unp^= zREyj_iTt#`IH^tM0vsh<8L<5364r0=23ldxg`QifEcM*P1P)HXeIZI3*gkb}JLZVF zN___2cS6YKM|@(8;191sJa^S1&>A7WaY zQ`iU-Cm}IC8B9M>*6BaPm&P9=vgao_voPQ@TGT(bLl|19t{;_lc)h?ITOxPtd{ZJ& zCJ#rYH*mdC8r*x<3-bg9$SI&hhH}^X$R(^%<-ufUkMQnlnb874fqn>1dINA&n*1r<(MGEc&O_5dP8!8Jq$#Lz0a1V6x zplzPr+^FK>y^5fEe>DljD1wz3`hGBT=Rot^gqPVZa*wDcD%l2gJ>eeCLZL@L>D8qN z87H#Aq(7F)1`G)@q&srRC*i<<@!&nnT**U8zDkUfk>K}7-%iQ7lnsspH45IgHy&6m znZl{*UE5TwW370V8U`f6G72O?rkE>ck>##rh^P2n?+jK>-QJ;~yeLH62wl6!R;jg0 zH^X=nJvYZ=Bb^2fXN#r$NX`;~nX)c`p1FSsg|&nOeVqtdSthZVrU5)^Dd1o328pPn zIcu>_h7bks$R{ThoC)?}CN#o?!;flq9}O1|Cjpc2bI=l@sGzlTCz)n(^$}Jk+5m34 zrqYB~J!_)0k_3Hzvk_>%875Z{jyQB;;OA*akw~C7PJ0WQ=GU&O2}GaCxb(bKn7_2m zck`r@+T;t`jl57?9dWI4SB#*1L6!hrY4Ef_Q|G_G@XuSLtM1xCaU*w%5zs9_LR=Rl zO90tNn+1dQ?4J2`2)aXDz#aa?1jx06ZZy~r42`&s0tEQ2@xZx@>1$oj2PxQ2rOeK7 zvtY%Bwwz=TkJB8zn*Ev4UbF8e@(KslTurFirGl!W@Vouk6S|y^tcS6}O5b?&(#6r@6Lny%u3Sf1M%n)Z}38@vMQ}0gQ3B_yNg`Vi9-RhbMdWpodf*CamzZ$%MGj9LACb4uowJ%1WFT~29FnKb* zj{mN}7+|bR&*0aGTD=B*aIN~4`3^@~UJFm$<4R=7rDsMtJ{!#7ec|u3Z`!LJ#<5m4 z;Z?HdIIqD>24t0v@3PAkH{tN`3?H9Dp9e)DUP-kG=2asod^KJwTX{TPuV9YjN${a~ z(`CSHc`Yhcj|+`Kbcl7mvc_6iX^G3iT1I>GgmV~5`wP){)S>Ezz!B|iBiabZo8>9l z$u5uw$MQpE3nb)yG^Y`W@29pcg1mAaeb&wdiPp0Ik(SE2MzQOj4zP6+}_WgebRj*%5l?r`y}o>tzUMBYI7t&XNRg?C5W-cD-yd+WrLUL3t}D2Uy5mR z4y@1AS?4d!ews7Jtf)9_a=7pik9^Y!V+b{7wD=##et#Jkh*wDOSuEjFjK+Z&T8#wg zEz?_u1BLK?uf!WY&y`1KrV_h9XDSVfQ#MRG!IAeD$`Hf1jP6b4u64LfNc@ihK%yZ7 zMUm(Ico9c$AT%7ec0bal)w-XfKs8c1v;3t;sXonj}iXNbJID`Ncx7 z21+s{7*}$_`~KZH7x!9>^Ti)zfC>~6u?xnK*<9lp%tO)U&^VYs3WK>6!)?CBpRv2p$G6%QJE0}`~QVF40gGpObzM+M&-DqjmQG7nX z0Cnn^zb%WFK8frHOV5J*pv>eaZ?6b!&YUPUOIXaZ!zc7d!J0fuzB9q0@u20V@op3f zq{a7hS22+8fcrmMtG7&XRj-45-G-+)PB>wC z6fF2JVBX|7<3WYW1>H^mV2b*G9Dwv!rsmRgMl#kWKBmskTm^28iVQgI4g~9iMIu|46 zbQ5EUfi{ahN+K_2P*p0Ryxur^dazNToI7LG(+UQ{4Lh4+k`TNy{m6C{(Qry^%pY$~ z?2(vsz&s8Nho+g#jb9H(FgRW9w9y)d&L0X0$RBH${!0QY^nIR-36VZvEY+#c( zu~J5La1jHF;z{6!6Rs6NvWjNf2puW;(~uBWX_Nj6|^O9)l#6D zi?>l%juLloa&~zYK}e9VYybjfXIr<9`{o7{I^KrWLQo7!5kdU3R97Y&K(_y|ZIJpH*%OfRs@xvbJ5u*6{Z zsbV?CP^OD=-SG)};zyK~Y;oFf!5w+RlXMEIUvLAYF9Ah}1&1U_PaoZQj57z zop`uM+1qoZHZpa3vrCFAtRI%gr+cGKWCleijIYior=z=;{)2=51_)52A`iwaqbX!$ zIv{Fvv(D*q4M)1klT=O-CGVZU{L*Zjcr!c$2G8vSev1m~xeqETLHYnV^ZC(aA8T@$s-i0R213Zp& zlnK0?1>Ms16;$RY&b(cE-cdM3LH3@UwZk5s<&7Io`bN)sF)&g?C=vc01x$+O};noQ;}gEJGO$V`Qood({LJr zeQ%cqC(c5kWw_7%k>(pmJtkt;?Lx#eq|#Y8o{%V5J;_Erw|f31VS)*N+u9n^M8`oJ zW9#cHdCjI^wI-bMaa;%u4uxG>0@t><7(*nUk#aB@kvqStPYq=!fIBbYgdWQE`?s9L zB|*2=vXiZW+=<#b)XEPVEjtTfE0Jp7J|At0;v@HLZd{%Zf)N=t?cd$@rgS$Ps{F=T zbtpuQ1A-kq%BLKySJNW6qaI+<$qZClukIsCcVaxYy2F9t7~U1y$9j9fOA}{!($T$D zmcY$D99yB4OmE;|V1|l5=X6~bT$eMcDbqyjxz)I^-1Aepn+uL(mL^7DnvrQ}o24e4 zZ~GPsg&T0l`0Slz`qU4n!Ner_x)Xz#${W^U<=>vG(Z82FU&68Tt_Q}!PzV7_%57Zv z#IEng)0f$&?2L>>cK&P?Xbk1<| z4jPEWeMRlOR`*g9Ly67_Ys{IG1=0TTa*%7HQuwI@Mx{s(%)qZxEea5dOHMt3Co`LK zvdHKt*}hOth1c8ZI2%X|n@UkY*lv|0%+i!4(COG~nu{IZJkDqik-(w0lf?^xrIo;T zg`##4xrnIY>&8qnUpG>2LC;W~@yext&_qyj=q<;|Q zuB2}`>F z-;czyWguq+r3R@3#nH~Y(J+W$gErsrp}`1cw=m7@sU3Ffo3Vp>+~8@7lg7JYnEm$E zON?&FDY)PJSSb6{`X09{mGtY`-Y#FLUlkew|&R7YDRfUb8S2iM*{^Qw^c7bI73* z0%-v141|i9z!ZY`$O)ZS5xfn(lYv+oYQ67h?B((Cl{OBk9`y9w{&Q~vwyJ>##9Pb~ zP_Pq4YF&}*u*k2&%Y*qjgf4Tpp=MM<~`pEz#X9b*&RfQaZ2A{Cm< zSUl2-YCn$#U}+T_t!&-MK** zvlKK3suR?M>`JnkNU6`HaLfchHXKHQ9u45Q3c}Gc@Ll%ot<4b~a3(x{-(7;y+*C&} z2mgiKsqO~%K{W$p>-+Slzz}tv(&+iGCX9hnEDD+wX21r>ELakx>d(P)gPKdl!qc|= z(he3MGkhYYheOfor|g3s(M)294n+#l2xSoK-&moXmcK%x*M{4GUvMC?$})st64ICU zY{oq791ul4P|X}CwhI*eh=FDDH!M;19pjjTi6Dqt@Ijug!_s=;2U(Z|Ol_xAqAdEg zU9zAi@Wbp3cgcPEY3d>#83PN5QoF=n$Rl2U-e(H?7p81I+odzq%{D)=sn`ApDTaG+ z=Tj%>%-OB{2Ca`X&;33`$I;JjU8Zu!o5U{ZeWAFs%cc@?x}j6ImZaJ1vpR$tSiv@O zXDfKXJ`}hv86ju-S%(7cFOaUXN z$m-4(wXHOnf=#Y?8u^Yzu+%=%&n56Cl&<5l+0;?~Yn#r2a^ZqW7O$zUK#+n;TQS2# z5M^7h*YpBfg*5T506z5ZU@MP$q2~#Q8EswbmmAeV!p04mxP4}(l!$^D8+0Yb z^y!U1gfD{r?VIpcu5mj0EzD;N;|OIOa8&wVxB`{FzLem<5MAJgTQ+qJt&`*+M=IsF zc`>+*0?)yCvzC&T!mgub!-{ZY8~$b$mv#-h=kpL5-7K!cxVK|uL`k=@6B@F@Hk$-N zbRfPf`V&NU9Eq-QiOU2V2C*@K?fC_h$Cl6AkSx`bmYih_h{tp*W8NhQT!{4d31=d6 z_eOhz!7KY#K{9tP&EiCD9!MKpJz?(Dk79;(9gyPHxwElz{bYH#K#~(8ZQr)Z{=s}@ zYB%+8Blal(-*M|_uMTmxtu}@9fsNU02uG~`hziMA!+l@!ZQeTK=CmBO+E*d-lm8?y zKZ6|(T0TkWqcy`;JSc9Z1aqDYY2X*`s?T`7^M(7eW~WQA#z42Q;PrOcylzUg@6XP4VDvhws8i**S5@+>cT1cu1b-iqyb*mg^< zo@@w%)Qf1xgR8nz<6`}}N)$AJo_&0e+=hu@yyq(K|ZHfe^6bB$3n zWf&vt#~23aklGmK4*R?lvKWJxg!(3}j`*|GBLk#)Ga;N*vyLGQjo|S+B38F9UXRSF zqbfFGm9&r#D7t;b)kS|NO;u z9dbJ)8y#G*!1T4-s7EWPp=!`iNa3MW-5ujr#5U(7PdLvChBFNwDA9;=3F0&Y-YjDX znjTCYK6-u}K<5DRYN09bK%elp_KV=TegBAlO1kssJ#WqfeYX5tx3B#T*PFxR;yG4j z)C{q(coE~58KnZ|tJf;d&T$Gi-^Zi# z*asTb(&L1YC;rqNEU#5pFTqS3Lo;eoTa_4azNgYZeMl~u;gakeTzt6J)i!#|;Zzqs z{jfiCONKb>GBMw@M5?;uJRI0=Y$#<13c?aYoMa~qRb(e(s?wI_T~X3pBZDD6V=>6< z_GA(Tl7RyhB zKFLk>S3KD(~ zj;LC)CI3opH^N_O{v?;UzQ;0+Fsyj5rWCe2W%EODLO(O~f`s^k*wQ^4RwH`OWH15y zy2R|RGAB?1(Yk-wBGeqyO-&i@%uF6RXPlVQOGj#XHrGH?4{kFxptTjCTB@)FTdf7` zP{6}aa?Gq92O_HdDE#NFFS!d^pLuc!(PQ;=+oca$P=tt7{ItmVgBLKu*Cf`6o7{Rn zsx;v94-p^lv8k*`fe${b9q?XH3>eZi+`O+shz}4wco+PXmn^|3_C|FK!i3S<;xexh z>Ywu#cj%nO3;faF(cljHNF|v4%Z!AM-nkiFOokj4<;x_CezosnX+k!fr=8?|i zXF?pQyKzE;$fYJJuI563SSQDfup;$Ut20c|dlfr)z5>5Gad(cQH%26cg~txwxX@%^ zyV$3^k|J=gSa1Fc1_(T%64o&S{FIWeh`r6QZ;S6pVuUp)sH2=PM;v7tIwPqt2%oP| zm^tAT(#0lHVk10Zm(3{ez*2SvMl+!KByX0L$f(vFXs(2#X0IX3Kkt5miZn4rpyFEl z6Sa!sigJ7zBOW|y%KgoPIe=v6jf6^@e^ej9Kt94eeSc&dqY=jXqyc?A6y@7qF3ri_Nc@MPw&a=LkmNN zZ|+iFkkE!77}gmNh_>2u!Lx_p4(9?af4O!7S~Y}xL~&r_n<$b>AtvGgQGIO+?H|2z z?k+7T2Qf4`V@1X+B5V!vn9#5$OteQ?H@=WZ9*t1xQYB0Et-hJ&-XcT-hTeBI_NEJ*rmwtY{{ReyFb4R35{%=WtfLc7 ze~jcI_Y(tjghC3LYkR$%j<&fuB`!RoNp|e+@moaTNGrJEN@*PGIIDQoPrTZZK@5@w z$40n$M$vGv`k_>EKX?KR7{dZdy%sm({QnmUg*TBpk7Do@&m-t7WTCm|RJjs_G#g0iNvm zqDk3hwIgV6Lc7~f{C<&*On*G78DI?KC7_Ip(x@y=g51Zln&%27qE7MvLCCJwMr=dm zgip@qoX*snbe%DhhxDRmd&y991TG-D5W0n_)buqy!-$}iG+mXYh8s3h9(>{qf0U^ZlwFqeVkPn9vCOGF=V&Zj1^;CEs(O{MEG`nc!3J4D43hcM68lVOel(pd|wjc>70ZdiKU@2QaO^CN+8>@ zS1Qra8I`g3{W<|e#L;MX6@mH;W#P5a6!n$b7N??pBBT27#%Gz4Fnonkek{nJZVyV~ zBG)!2`C8ds!~VO*N~@@32$(ZEd|ZMRK7mFuD*kAk44 zICEk>;-S5ZiIoMJad|_xFv*J#SY$n}w}0@!C`d_t+{PLwjchkZVb^MGac+0W-kd0+ZnQ@WYlSXC-H>YV5{I5sQ$*( zVAE;ulCo+#!=-%pW%t|QNhe|XcbC=w3)_E zq!}tP8BxgWAA}Ikm`|UvoT_2lGeV*gIN=Ns)G4< zx%3tXP-IU~q{fW*fKrsxV#to5x8TWZuL-P%rGP58h7i)M&x8DiEd}3&&+Z$lYX4+} zkb8TuvSfA3`n|BFU^H;+)Yw3m?OS@p%FeJ*WQfv0KF&E7FAa0Tl2s;)y>#Em)%zd8 zG^B8jc~{7?RkpfPv{sP1+XgF7rUrCYqyXb*Fb@1sq2;8<*p$hDJTx zaks=syTl>98O{O!duYsAP8!0G1Mu{oEc*%Fb2{>wI}$+5P5wD!ovNjK)O`tk32~!l z4zVU6eUarX%OrHVBS~^_^|5MG7`KwILBKLg= z3=~Dk?5el92n&^pY})F13As|yT}j?dq8hsnbZ2A}Ow3z&w!Xu1xu=eXGKlIbEUHKC z4V4v}i(g@{{>J5y6?2I{p=9_7w8oDKx$<(5^-R41Pjh~ejb3+W7)+G-KXogbkV9I) zzj+i7Nxk$kL{+SS20zgb!Ts%vZOO#l8EguIGz9vSLfHI-j*HoF!IO%Z2K|N9sYq~T z?lg@zmgjoG2CTS*(8IURURn4=PVD1~Ozu;aHoB-DLfNCPhme5R5hYAOO!#Cgfk3y= z5K%0;@H^L;$%@oUtD0`E|0wg4j{DqEhOVq+xp71ov;Cl)G`mQdg`*RaDG)fYMZ9E) zrbB^m?#TvGESM3@dDz&QyUX%7MXSNKe_lr=^)f{v$!=CAk+lu>c7vfpctl|+F2gyQ zGksH>`e2hy0O6t(nk<@wjGhEn-zIu90k>#Kxi>FGy*xN&1lM3dEkf?8GGrIE+Y--t z<+6jzmCzj~gtiP!$8`($PKLYY{H3QzW;B_05QH3=|FLu*eAEMAi= ziNYrZ@ru-~`VG^E)-riBCWK->XEGcWK?I$!8Ujpwi>$1;++SGP>`T}xDMwTbaAS4i z`?3EKE~YgP z6&iu>ndOmQ&@*nMqK`#S`Kv^Wf-hS`rLKIn0Q(A6kekLxwR$`H2vZj@74n$-I0nh| zu3iGSbZu+(a{-3SmH+=J<*vh;d>1}|qjV4HkrGl0g3>A7B_X4c97s0^(m7GO1_+D} z=>};=N{%j(?vfBVaL(^N`t!W+`RD!ax^``UJl|(~u4nhPd(ZAqPr}tS7hpv4Rad)+ zbsl+5x_eqt++gk_e4qAdDJFXeJmO$CmVc|NBhh=a%{=n3oQr%;d_#KZ)k9p#a=!5{ z{GZ^WjF+vv+6>Gj=*$l%6O1Uv_GZQ!m=g-zHfy~1v(9~k^vN~zqje7nNcGKk4G3yR z`**U6w!;1a^@3{FE$_W-_FuJ?b;~f{{Tinm=w<`H8WLmwGXh_;J2EnV~oKI04e5 zD07c;jK_u>Z5iYUq^LZ@yd@|1?w#qR<0fcT3<88zbv!2=#`O7R5L(}MhsG2l@jqQ2 zN1Qs{t`7)sek@(0GL%!S_-KuT)_xwuP_k{dM$(p8qneyWB%KHFAp)^k>2fv|zjVfF z#OJGX6Vdr$Jx8_k6u}TV)fV(7Q`~AM^!bzst?l~OsYQ^n1%JS-ZH=i{@c3~uJ{EpO zd||b?+*I&vG@8zj$$|!pu9|d@g4w8$_E0}R3k3Fehj9&YQ=69Whn;&)OD)>&AylQ5 zk@d=HPq%i(XIZl&lx_1N9vY-29*CkDC7D+Sb@Wo8BV9CmG4S4@yIDk1z#OjwLtwM& zakhgwb%wQJqSTu052Xj0ac0U4-SPU|1NQXP{)SFiBqNU{JPa)=&L3S-NHAouPgWn3sKOMdxlj6B5cHUuk!Y9^ z^L_HP?{$qEVj#Z5c;QspG6zK81U}?0FQ^2muS{e6Spq$9i5HO@OcX!!y@5vnZQ%Z` zhAWIBU_l0gNtYJiXM;lKX|mKC?PkRJHE;82i?HjyZpRj611c#*QSCh&QfGyW1hTQG z&}MLLU9}IkK+$?}sluD}X;*=|@#}zz_GhAeRPhzp&P{#c#?JTs@+>~J!NJrS16D;J zSiU+Jgk0KOzhT1s|Y#ITUnP-*CmICiq>(*krCJy?kuGsw#-g{pOn8qYU$M z)!{I1(6!{$tmWZK9?8;pD3YZT~8IN07z&6lH? z(3#4GI58`lso0Jy%)Rw-^I^aOk&;}&lE?aE1t%^WQ-l>>_Pm*U*2t4Pl$Wt@O;w1` z=|=#(vZ>8lelDMHM<{Xikh?pBZ$xTRC|>*ZDsk9pi1kIfrHmR@X2_K9yx&rS{87nH zdc&|zP}7iAj%RONX@nNnOozfnYoc7L6z<#M2eQ_QJtj=TMVpF0*ZAPv5Sh|xVxJ(-<#5@ z{`#xc{b*PH@g@`UQ3PktBTgNG=peOWG0y=$XUl(s zRF6z?xf)zU0AT*Au=71P?L%h1%&Nc$?eDn6w}LNLet$54zH z$40v4fb{{}U^pH{*~{CXR9W?H6X^Q9FO#vmz9jRK^_eRutuca>e zTwG#E!B%FMZq@3<9b@2lbzZe)GV_F9B1DZ(ZZwn3)X7ZKD~F`*B$KYryO39ll&(jTBwf^7 zbE&GNDF*5ivWu2KM+Uz&K08_i=US)(q;i7Ht^02BFJB~6CA~D7zpk8?kV5h$VHGy@ zBpa*naEpKLsn}2^n$p1?C8KO|msis-i>#1iN z+fwdpcoej;al4$=XNk+_OK}gC{Nbkzgw%J;i{`{G>qLiIuCjp9P?5S7bTn;jrL|OMU#yRWL^A{JbFftxd^yskX>VKY(h00+Z z0Jjy1ahoNOLnSH8L<~2JBc;l^L_1D+5ak4^inaulettHATRlPYb+N$=he(S+MrbBi%pWh;USJx?4SjpvHa%c&YO2aYxf{>-YB;Xc@cyCN10OJz zFFI^R8ox@lu^13yKCsGd}KXvBWr;~ae%4$i>m z=9|lU`cjfoUy&s65cwi{TB3~N?W<{BBJOGZ%A8R|S)XAU`fq>~(&|`R=u@9N4CzyP z8o@PHFZ90y_I?_X$NX&MS#a_!elH3x9$=9$0@U_5A5G*hsYS`}pFD4p*G}Cj5+E^Y zo|YRb;qD1krlp6QuDO)QgF|kBtAq<>yy-XoU8o9Dif=d0L|&hlE(F3li95hjIR4lF zY>VL0!y_2e(IR5ggB*?Cf^bq?j7;-XxO}PKb zJebnJ{}pz(^t&g^6YKRmBoS{_Z6;i`*~rVw!!B2jm-$l6p&82l*|rrMT@b$#DpCix zZ@MJwDlC%np1p?aICA>3cvfmakOQ!_l3A_&e9&z*buU%Td+BN`ow#*P%gmu!5BTu| z4x>?APT#X5*c8FW+RKDN@{!AP?C*v{sp*gVLGKLoK|(4jGTC)tmnCm@x1DM3q%;op zSEG(~Tq*4UEA?w(q*;83R?&UI0~MyVc#^eT?9PbqTOJs+UohY(_p{ru>-I09DiHR^ zL>q;g0-d$^!R*F0LoN#oR2D^g1t1t0(UX9!poQxFRD{kLQ}OoyTl6EHhyBqj`XkBC zp9Fr4vbB`u6fT;agROE@b$}l=GQ=|AKxkxZbVs_e#^q5& zm;7K~r#{G|-GNQ~qGZg^q;o%CJXC?0e^jF`BXdh$@Y@!a1Vka;CmybTuN6sxa=Dl6 zUE!%^`#@VZ1T(KAWIU=8LluTMb;Fmj|7FA^F+;;>6Gv0*-m;IWRNoaS02gto*rXJ@ z6tF3yjpEJ~j2>DGk46R?sc~wk_MZd%S{Fmm35a)wgQ59+dbmZb!98(UiT80d!`%UL z2U@Y=L>e-xm8!Vx%!^Nh1lrp=$D{JxZ!f!2hxV&t`lDNESISV>HemoO36pt^A&5J?wE#D4QHlkTwzP(zH1QuB?5kZS;AgxL#k$ zg3tk4^h~9`;0yl>FuB>|y`yu!UV-|-(olSG6#km80wk|TcCT6r@us`?83|cU_;{Pl zt_#{CCBr_!mJp%mH^bo>`Sa<*8OXQSYbm*dS982FQ6JHpxeZ9`^#BGOU7K9e-AKup zI2kXK$lCJSNTl_HjVlb2IY?rlEQ0_63}HQN_k9-@L&KYzrnd-#2JMAePp8UFp=m32 zQCsNzG6nqvks7+18X2Y=46R|iSvV7$*u4-eS)f${Qe#>-8(=JQgmj6;NSStKt0;q3 zIIVfPdo8U#@XO=8jb%b#tHp?$*dX|n`9(q*3Dc{2T4(OQu;IPktiA=SydQcq2A3t* z(KBur0$?K1A4!*shxBd&o_7b)cnk4}2ykC;K4R_qdXo#F zGLaQIXW-};iS!kI@4G{EE(*%|DTvPtg)l9jBc@toA$jQQ0iH-#db2u|FaV*KFFu{c zYho~wqpvp_vcS@y$nd!1Cv{hL#AkHRf( zmlm=tOwN!b9Y}Pwu|&dPm9dV!@dZ13=9VnnL9qT~TPfwKSAzjpI1t#0?PE-Z27NJTG3zlF#xnODuccNxJ9&EG0ZF9(N2wPz| z2S+Jb0TnCS1t+whhY{Hdgq=;(agt`Al{Bduz;gL1?} zA*6#{#j9Bjr!*~P2!k-$6_6bP>BEcyu_N#)bwW_QStW#RyB&SA)BKRJ5w&ak8eDh1 z?Xt7Z$(YgHtSR_2IUcL-qP6d0BB3fEpeusd>m4IAl`BY%tk^heX4|F~ zgcC6fLU(-mZt69?s+P7z?Wwmtdq+h;)rj3GUjh5HZT`Xq-gvvo9|k<>b8l>SC(-ex zn31!(X?M?GfrY`QFl-<^Q8Ia4x?m^V==HQH15eIPMHu%*HH)Kf z>zL_ykZDg~0JBxdL(E}0K2zK<$xq0mD2bo<^rUVtUZNX+=nvDORpLWwMc}n$IfQsJ zo^ zSEP9unvWjHYtpWZHn5N(E#3Q)bkE+v7PD{A`2x#rX0jh#>>d|+!&d$lXER0j9TtaQ zLw9%=Wy)I@p>p%Qb-4!1<=47LKV}9`5rge-K9(uI4gxrFJ!u2@n;>MdVOZ<*p=IaJ zE!PQDrPG9{N}8ar8hFpk3UehgbSKY3XuG_ zd^=Z%FSc{`p4mMo`rQ*J51NkE*#*=L4<{u(j%AeHXj5pbqWGxou zPetV#yS+w5j?o^`reXa_+KtXlBrz+#D^;th5W!PYm8+Pp`R1>OQcmB6C9L)XMa1Pk z#RWWr^pY+Jehsx@7O^UC4T!n8OyP8r5ha>Fda5(j4&_~P5eCSQpRU8tHYlj)3wLQm zjXB(NcUs<$SiM+XxTLuw-V7r|)241=5L)T~_9Y4ZPC=8FykiETu>;^4F+lg84_29* zT!VG7I=Pnw$k;OC>Vj>?GfcmLVb5M~qfAnFPqp^EUNt>xn=W zgRU(woGq~9r^RZGVBcUY!tm^gnMxp3pIiel{8U|XQQnSsGCzZ9M)L#@v}QJSEFV=+ zeZTcZE{Ybaa8#zN9HL>a1kE+~iJnrhpg?DbWcZW0ovZ3RT3PYlQK2+aBD1c5#DQS>moHvEl2@+aXCygFL{uhz2X;78*g!m#12C7K11C+*-V&q?HIrg7`NQ5YJxDd_ z)lk&1d9rRfVeBK8q~=Po*|2Q< z@=^FP1-04e!BPe?vzbcXj;d!Fn|Mdfa*1VC0oQTOcF0D_s@zSc85wsIIYu}=5C(h{ zSb{}CO${012o4eLqA{RTPI|$joKC0PPE-*WX6F^t7xgWIcT{EXU0%}44aO)!2D6m` zGz>~QI6~S4LeruK=d-4EfTyKT$)P8oF*gfp;o}Kg*EPd(zCvesFnxTqn9|bVrXhR# zP~AX)UPooMAKZK{v#6TY$J6_%P;(=$3a+JIq%}oX0BEifa`EO&^yJut9cVxQMdwl^ zo@;sEH`wK@s~Lk1ceO|8^(w~-0Ingcm`KyOk9~K}2+aP&pVvzqT`%iQA&z9eL z&O21}SFCRV(*LdHpK#=#HNQKQcb4a`2;Lsif7RUH|6BI_bNk;}#yhR@SCUZw-2N|& z@z09iX~R3e@mFrasJ~vq-!#WR3w{TM?gYeNf!_`m|9TJqPY?0WUH(3wyOWB3B^L1e zF8}5h{aNz+cy~AT`;}0I|0(&uCW3!<{r)+)8zFzCSmWR0rK$qz?GZ&n!oIydygf^n IwCz>% literal 0 HcmV?d00001 From 6ffe7b4458a655533c2945c612fbc99a26530f3c Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Wed, 9 Sep 2026 14:21:49 +0800 Subject: [PATCH 02/63] build: depend on distro librofd-ffi packages for OFD support OFD support now uses the Debian packages shipped by upstream rofd instead of a local rofd checkout: - debian/control Build-Depends on librofd-ffi-dev; the runtime dependency on librofd-ffi0 (>= 0.2.2) is derived automatically by dh_shlibdeps from the library's shlibs file. - CMake keeps locating rofd.h and librofd_ffi through find_path and find_library, now also looking in lib/ so a custom install prefix works, and still degrades gracefully (OFD disabled with a warning) when the dependency is absent; -DROFD_ROOT remains available for local development against a rofd checkout. - qmake CONFIG+=ofd_support links the system librofd_ffi. - Document librofd-ffi-dev in both README dependency lists. Verified with librofd-ffi-dev 0.2.2-1: full build, TestOfdModel 7/7, 1116 unit tests pass, the application opens and renders tests/files/normal.ofd, and dpkg-shlibdeps resolves librofd-ffi0 (>= 0.2.2). --- CMakeLists.txt | 14 ++++++++++---- README.md | 2 +- README.zh_CN.md | 2 +- debian/control | 1 + reader/document/document.pri | 2 +- reader/reader.pro | 6 ++++++ 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16a1a75f4..1604166d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,13 +62,14 @@ else() unset(XPS_DEPS_CFLAGS_OTHER) endif() -# OFD支持选项(根据 rofd C ABI 库检测自动启用) +# OFD支持选项(依赖发行版提供的 rofd C ABI 库,见 debian/control 的 librofd-ffi-dev) option(OFD_SUPPORT "Enable OFD document format support" ON) -set(ROFD_ROOT "" CACHE PATH "Path to the rofd repository checkout or install prefix") +set(ROFD_ROOT "" CACHE PATH "Path to the rofd repository checkout or install prefix, overrides the system install") set(OFD_SUPPORT_RESOLVED ${OFD_SUPPORT}) if (OFD_SUPPORT) + # 默认走系统路径:librofd-ffi-dev 提供 /usr/include/rofd.h 与 lib//librofd_ffi.so set(ROFD_ROOT_HINTS "") if (ROFD_ROOT) list(APPEND ROFD_ROOT_HINTS ${ROFD_ROOT}) @@ -77,13 +78,18 @@ if (OFD_SUPPORT) list(APPEND ROFD_ROOT_HINTS "${CMAKE_SOURCE_DIR}/../rofd") endif() + set(ROFD_LIB_SUFFIXES target/release target/debug lib) + if (CMAKE_LIBRARY_ARCHITECTURE) + list(APPEND ROFD_LIB_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}") + endif() + find_path(ROFD_INCLUDE_DIR rofd.h HINTS ${ROFD_ROOT_HINTS} PATH_SUFFIXES crates/rofd-ffi/include include ) find_library(ROFD_FFI_LIBRARY NAMES rofd_ffi HINTS ${ROFD_ROOT_HINTS} - PATH_SUFFIXES target/release target/debug lib + PATH_SUFFIXES ${ROFD_LIB_SUFFIXES} ) pkg_check_modules(OFD_CAIRO QUIET cairo) @@ -92,7 +98,7 @@ if (OFD_SUPPORT) add_compile_definitions(OFD_SUPPORT_ENABLED) set(OFD_SUPPORT_RESOLVED ON) else() - message(WARNING ">>> OFD support disabled: set -DROFD_ROOT to the rofd checkout and build rofd-ffi first (cargo build -p rofd-ffi)") + message(WARNING ">>> OFD support disabled: install librofd-ffi-dev, or pass -DROFD_ROOT=") set(OFD_SUPPORT_RESOLVED OFF) endif() else() diff --git a/README.md b/README.md index 21309b3d3..21a84febd 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ deepin-reader is a small, fast and full-featured tool for viewing documents,supp In debian, use below command to install compile dependencies: -`sudo apt install debhelper (>= 11),pkg-config,libspectre-dev, libdjvulibre-dev, qt5-qmake, qt5-default,libtiff-dev, libkf5archive-dev, libdtkwidget-dev,qttools5-dev-tools,qtbase5-private-dev,libjpeg-dev,libicu-dev,libpng-dev,zlib1g-dev` +`sudo apt install debhelper (>= 11),pkg-config,libspectre-dev, libdjvulibre-dev, qt5-qmake, qt5-default,libtiff-dev, libkf5archive-dev, libdtkwidget-dev,qttools5-dev-tools,qtbase5-private-dev,libjpeg-dev,libicu-dev,libpng-dev,zlib1g-dev,librofd-ffi-dev` ## Install diff --git a/README.zh_CN.md b/README.zh_CN.md index 91c74fae0..c3ea98da8 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -6,7 +6,7 @@ deepin-reader是一款小型、快速、功能齐全的工具,用于查看文 In debian, use below command to install compile dependencies: -`sudo apt install debhelper (>= 11),pkg-config,libspectre-dev, libdjvulibre-dev, qt5-qmake, qt5-default,libtiff-dev, libkf5archive-dev, libdtkwidget-dev,qttools5-dev-tools,qtbase5-private-dev,libjpeg-dev,libicu-dev,libpng-dev,zlib1g-dev` +`sudo apt install debhelper (>= 11),pkg-config,libspectre-dev, libdjvulibre-dev, qt5-qmake, qt5-default,libtiff-dev, libkf5archive-dev, libdtkwidget-dev,qttools5-dev-tools,qtbase5-private-dev,libjpeg-dev,libicu-dev,libpng-dev,zlib1g-dev,librofd-ffi-dev` ## 安装 diff --git a/debian/control b/debian/control index 786e1d7c8..f1eb2ab21 100644 --- a/debian/control +++ b/debian/control @@ -18,6 +18,7 @@ Build-Depends: libdtk6core-dev [!mipsel !mips64el] | libdtkcore-dev, libgxps-dev, libcairo2-dev, + librofd-ffi-dev, libglib2.0-dev, libdjvulibre-dev, libtiff-dev, diff --git a/reader/document/document.pri b/reader/document/document.pri index 0066d411c..acd8aff52 100644 --- a/reader/document/document.pri +++ b/reader/document/document.pri @@ -11,7 +11,7 @@ xps_support { SOURCES += $$PWD/XpsTextExtractor.cpp } -# OFD支持文件(条件包含,需要 rofd-ffi 头文件与库,见顶层 CMake 的 ROFD_ROOT) +# OFD支持文件(条件包含,需要系统安装的 librofd-ffi-dev,见 debian/control) ofd_support { HEADERS += $$PWD/OfdModel.h SOURCES += $$PWD/OfdModel.cpp diff --git a/reader/reader.pro b/reader/reader.pro index a1810e982..eb591b1db 100755 --- a/reader/reader.pro +++ b/reader/reader.pro @@ -67,6 +67,12 @@ if(contains(DEFINES, CMAKE_COVERAGE_ARG_ON)){ CONFIG += c++11 link_pkgconfig +# OFD支持(qmake CONFIG+=ofd_support),链接系统安装的 librofd-ffi(librofd-ffi-dev) +ofd_support { + message(">>> OFD support enabled (system librofd-ffi)") + LIBS += -lrofd_ffi +} + TARGET = deepin-reader TEMPLATE = app From b933a80f4c65a338cc867652392fe126c446d641 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Thu, 10 Sep 2026 05:08:06 +0800 Subject: [PATCH 03/63] fix(sidebar): align thumbnail appearance with eye protection mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The thumbnail delegate inverted the page pixmap whenever the system theme was dark, while BrowserPage only inverts in the night eye-protection mode. Under a dark system theme with eye protection off the main view kept white pages but the sidebar thumbnails turned black, so the two disagreed - most visible with white OFD/PDF pages. - ThumbnailDelegate now follows the EyeProtectionManager mode instead of the system theme and mirrors BrowserPage::paint exactly: night mode inverts luminance and dims with the page colour, classic/green multiply-tint with the page colour, off draws the original pixmap. - Extract the HSL luminance inversion into EyeProtectionManager::invertLuminance and let BrowserPage::applyNightMode delegate to it so both paths share one algorithm; the inverted thumbnail is cached by source pixmap key to avoid per-pixel work on every repaint. - SideBarImageListView refreshes visible thumbnails on modeChanged instead of themeTypeChanged. - Cover the inversion helper, the mode-driven delegate painting and the modeChanged refresh in unit tests. Verified under a dark system theme: thumbnails render white with eye protection off (matching the main view, previously black), dark in night mode and tinted in classic mode; targeted unit tests pass. Log: 修复深色主题下OFD/PDF侧边栏缩略图黑底与主视图白底不一致的问题 Influence: 侧边栏缩略图外观改为跟随护眼模式(夜间反色、经典/绿色染色),与主视图页面保持一致;深色系统主题且未开启护眼时缩略图恢复白底 --- reader/sidebar/SideBarImageListview.cpp | 6 +- reader/sidebar/ThumbnailDelegate.cpp | 89 ++++++++++++----------- reader/sidebar/ThumbnailDelegate.h | 12 +++ tests/sidebar-appearance/CMakeLists.txt | 24 ++++++ tests/sidebar-appearance/main.cc | 56 ++++++++++++++ tests/sidebar/ut_sidebarimagelistview.cpp | 6 +- tests/sidebar/ut_thumbnaildelegate.cpp | 51 +++++++++++++ 7 files changed, 200 insertions(+), 44 deletions(-) create mode 100644 tests/sidebar-appearance/CMakeLists.txt create mode 100644 tests/sidebar-appearance/main.cc diff --git a/reader/sidebar/SideBarImageListview.cpp b/reader/sidebar/SideBarImageListview.cpp index a09126617..464cb4cf9 100644 --- a/reader/sidebar/SideBarImageListview.cpp +++ b/reader/sidebar/SideBarImageListview.cpp @@ -7,6 +7,7 @@ #include "DocSheet.h" #include "SideBarImageViewModel.h" #include "Application.h" +#include "EyeProtectionManager.h" #include "MsgHeader.h" #include "ThumbnailWidget.h" #include "ddlog.h" @@ -46,7 +47,10 @@ SideBarImageListView::SideBarImageListView(DocSheet *sheet, QWidget *parent) connect(verticalScrollBar(), &QScrollBar::sliderReleased, this, &SideBarImageListView::onSetThumbnailListSlideGesture); qCDebug(appLog) << "Connected scrollbar signals"; - // 主题切换时刷新可见缩略图,使 ThumbnailDelegate 按新主题反色重绘 + // 护眼模式切换时刷新可见缩略图,使 ThumbnailDelegate 按新的页面外观重绘 + connect(EyeProtectionManager::instance(), &EyeProtectionManager::modeChanged, + this, [this]() { this->viewport()->update(); }); + // 页面内容跟随护眼模式,边框/文字等界面装饰仍跟随系统主题。 connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [this]() { this->viewport()->update(); }); } diff --git a/reader/sidebar/ThumbnailDelegate.cpp b/reader/sidebar/ThumbnailDelegate.cpp index b4fccc9f7..d5b199e3f 100644 --- a/reader/sidebar/ThumbnailDelegate.cpp +++ b/reader/sidebar/ThumbnailDelegate.cpp @@ -5,6 +5,8 @@ #include "ThumbnailDelegate.h" #include "SideBarImageViewModel.h" +#include "EyeProtectionManager.h" +#include "NightFilter.h" #include "Utils.h" #include "Application.h" #include "ddlog.h" @@ -41,7 +43,9 @@ void ThumbnailDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt transform.rotate(rotate); - const QPixmap &pixmap = index.data(ImageinfoType_e::IMAGE_PIXMAP).value().transformed(transform); + const QPixmap &rawPixmap = index.data(ImageinfoType_e::IMAGE_PIXMAP).value(); + + const QPixmap &pixmap = rawPixmap.transformed(transform); const int borderRadius = 6; @@ -63,47 +67,33 @@ void ThumbnailDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt QPainterPath clipPath; clipPath.addRoundedRect(rect, borderRadius, borderRadius); painter->setClipPath(clipPath); - // 深色系统主题下,缩略图卡片需与侧边栏深色背景协调:将文档原始白底黑字 - // 的缩略图反色为黑底白字;浅色主题保持原样。反色仅在绘制时进行, - // 不修改 DocSheet 中缓存的真实缩略图(始终为白底),避免主题切换时双重反色。 - // 采用与 BrowserPage::applyNightMode 相同的 HSL 亮度反转算法: - // 仅反转 Lightness 通道,保留 Hue/Saturation,避免图片色相偏移 180°。 - // 两端收敛:下限钳制 37(#252525),反转后 ≥192 提亮纯白 - // 白底黑字 → 黑底白字(文字/背景正确反色) - // 彩色图片/链接 → 仅变暗,色相保持 - if (DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->themeType() == DTK_NAMESPACE::Gui::DGuiApplicationHelper::DarkType) { - QImage img = pixmap.toImage(); - if (!img.isNull()) { - if (img.format() != QImage::Format_ARGB32) - img = img.convertToFormat(QImage::Format_ARGB32); - const int w = img.width(); - const int h = img.height(); - const int kMinLightAfterInvert = 37; // #252525 - const int kMaxLightBoostThreshold = 192; // 0xC0,提亮阈值 - for (int y = 0; y < h; ++y) { - QRgb *line = reinterpret_cast(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - const QRgb px = line[x]; - const int alpha = qAlpha(px); - QColor c = QColor::fromRgb(qRed(px), qGreen(px), qBlue(px)); - int hue, sat, light, dummy; - c.getHsl(&hue, &sat, &light, &dummy); - light = 255 - light; - if (light >= kMaxLightBoostThreshold) - light = 255; - light = qMax(light, kMinLightAfterInvert); - c.setHsl(hue, sat, light); - line[x] = qRgba(c.red(), c.green(), c.blue(), alpha); - } - } - QPixmap invertedPixmap = QPixmap::fromImage(img); - invertedPixmap.setDevicePixelRatio(pixmap.devicePixelRatio()); - painter->drawPixmap(rect.x(), rect.y(), rect.width(), rect.height(), invertedPixmap); - } else { - painter->drawPixmap(rect.x(), rect.y(), rect.width(), rect.height(), pixmap); - } - } else { - painter->drawPixmap(rect.x(), rect.y(), rect.width(), rect.height(), pixmap); + // 缩略图外观必须与主视图(BrowserPage::paint)保持一致,因此跟随护眼模式而非 + // 系统深浅主题:此前按系统深色主题反色,深色主题 + 无护眼时会出现主视图 + // 仍是白底、侧边栏缩略图却是黑底的不一致(尤其白底的 OFD/PDF 文档)。 + // 使用主干的夜间滤镜;缩略图尚无图片对象蒙版,采用其整页回退路径: + // Night → CIELAB 明度反转 + 深色压暗 + // Classic/Green → 正片叠底(Multiply)染色 + // Off → 原图 + EyeProtectionManager *epMgr = EyeProtectionManager::instance(); + const EyeProtectionManager::Mode mode = epMgr->mode(); + + // 反色结果按未旋转的原始缩略图缓存,再叠加旋转,避免每次重绘都逐像素反色 + const QPixmap displayPixmap = (mode == EyeProtectionManager::Night) + ? nightPixmap(rawPixmap).transformed(transform) + : pixmap; + + painter->drawPixmap(rect.x(), rect.y(), rect.width(), rect.height(), displayPixmap); + + if (mode == EyeProtectionManager::Night) { + // 与主视图一致:叠加轻微深色半透明层降低整体亮度 + QColor dark = epMgr->pageBackgroundColor(); + dark.setAlpha(60); + painter->fillRect(rect, dark); + } else if (mode != EyeProtectionManager::Off) { + // 与主视图一致:经典/绿色护眼用正片叠底染色 + painter->setCompositionMode(QPainter::CompositionMode_Multiply); + painter->fillRect(rect, epMgr->pageBackgroundColor()); + painter->setCompositionMode(QPainter::CompositionMode_SourceOver); } painter->restore(); } @@ -138,6 +128,21 @@ QSize ThumbnailDelegate::sizeHint(const QStyleOptionViewItem &option, const QMod return DStyledItemDelegate::sizeHint(option, index); } +QPixmap ThumbnailDelegate::nightPixmap(const QPixmap &src) const +{ + if (src.isNull()) + return src; + + // 滚动/选中时同一张缩略图会被反复重绘,缓存反色结果避免逐像素重复计算 + if (m_nightSourceCache.cacheKey() == src.cacheKey() && !m_nightPixmapCache.isNull()) + return m_nightPixmapCache; + + m_nightSourceCache = src; + m_nightPixmapCache = QPixmap::fromImage(NightFilter::applyPage(src.toImage(), {})); + m_nightPixmapCache.setDevicePixelRatio(src.devicePixelRatio()); + return m_nightPixmapCache; +} + void ThumbnailDelegate::drawBookMark(QPainter *painter, const QRect &rect, bool visible) const { // qCDebug(appLog) << "Drawing bookmark at:" << rect; diff --git a/reader/sidebar/ThumbnailDelegate.h b/reader/sidebar/ThumbnailDelegate.h index 258f79018..80f6bdd4c 100644 --- a/reader/sidebar/ThumbnailDelegate.h +++ b/reader/sidebar/ThumbnailDelegate.h @@ -7,6 +7,7 @@ #define IMAGEVIEWDELEGATE_H #include +#include DWIDGET_USE_NAMESPACE /** @@ -47,8 +48,19 @@ class ThumbnailDelegate : public DStyledItemDelegate */ void drawBookMark(QPainter *painter, const QRect &rect, bool visible) const; + /** + * @brief nightPixmap + * 夜间护眼模式下缩略图的智能反色结果(带缓存) + * @param src 原始缩略图 + * @return 反色后的缩略图 + */ + QPixmap nightPixmap(const QPixmap &src) const; + private: QAbstractItemView *m_parent = nullptr; + + mutable QPixmap m_nightSourceCache; // 反色缓存的源缩略图 + mutable QPixmap m_nightPixmapCache; // 反色后的缩略图 }; #endif // IMAGEVIEWDELEGATE_H diff --git a/tests/sidebar-appearance/CMakeLists.txt b/tests/sidebar-appearance/CMakeLists.txt new file mode 100644 index 000000000..a40a50e6f --- /dev/null +++ b/tests/sidebar-appearance/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.16) +project(reader-sidebar-appearance-tests LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_AUTOMOC ON) +find_package(Qt6 REQUIRED COMPONENTS Widgets) +find_package(PkgConfig REQUIRED) +pkg_check_modules(DTK REQUIRED IMPORTED_TARGET dtk6widget) + +set(READER_DIR "${CMAKE_CURRENT_LIST_DIR}/../../reader") +add_executable(test-sidebar-appearance + main.cc + ${READER_DIR}/sidebar/ThumbnailDelegate.cpp + ${READER_DIR}/eyeprotection/EyeProtectionManager.cpp + ${READER_DIR}/eyeprotection/EyeProtectionManager.h + ${READER_DIR}/browser/NightFilter.cpp) +target_include_directories(test-sidebar-appearance PRIVATE + ${READER_DIR} ${READER_DIR}/app ${READER_DIR}/sidebar + ${READER_DIR}/eyeprotection ${READER_DIR}/browser) +target_link_libraries(test-sidebar-appearance PRIVATE Qt6::Widgets PkgConfig::DTK) + +enable_testing() +add_test(NAME sidebar-appearance COMMAND test-sidebar-appearance) +set_tests_properties(sidebar-appearance PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen") diff --git a/tests/sidebar-appearance/main.cc b/tests/sidebar-appearance/main.cc new file mode 100644 index 000000000..2d9378f7e --- /dev/null +++ b/tests/sidebar-appearance/main.cc @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include +#include +#include +#include + +// Exercise the production thumbnail cache without linking the full reader. +#define private public +#include "ThumbnailDelegate.h" +#undef private +#include "NightFilter.h" + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + QListView view; + ThumbnailDelegate delegate(&view); + int failures = 0; + int checks = 0; + const auto check = [&](bool result, const char *message) { + ++checks; + if (!result) { + ++failures; + qCritical() << message; + } + }; + check(delegate.nightPixmap(QPixmap()).isNull(), "Null thumbnail must stay null"); + + for (qreal dpr : {1.0, 2.0}) { + for (const QColor &color : {QColor(Qt::white), QColor(Qt::black), + QColor(90, 140, 200), QColor(180, 80, 40, 128)}) { + QPixmap source(24, 32); + source.setDevicePixelRatio(dpr); + source.fill(color); + const QPixmap actual = delegate.nightPixmap(source); + // BrowserPage also converts the filter result back to a QPixmap; + // include Qt's premultiplied-alpha rounding in the comparison. + const QImage expected = QPixmap::fromImage(NightFilter::applyPage(source.toImage(), {})).toImage(); + check(actual.toImage() == expected, "Thumbnail must use master NightFilter pixels"); + check(actual.devicePixelRatio() == dpr, "Thumbnail must preserve device pixel ratio"); + check(delegate.nightPixmap(source).cacheKey() == actual.cacheKey(), + "Unchanged source must reuse cached night thumbnail"); + check(delegate.nightPixmap(source).transformed(QTransform().rotate(90)).toImage() + == QPixmap::fromImage(expected).transformed(QTransform().rotate(90)).toImage(), + "Rotation must be applied after filtering"); + source.fill(Qt::green); + check(delegate.nightPixmap(source).toImage() == NightFilter::applyPage(source.toImage(), {}), + "Changed source must invalidate night thumbnail cache"); + } + } + qInfo() << checks << "checks," << failures << "failures"; + return failures ? 1 : 0; +} diff --git a/tests/sidebar/ut_sidebarimagelistview.cpp b/tests/sidebar/ut_sidebarimagelistview.cpp index d7069523b..45459e814 100644 --- a/tests/sidebar/ut_sidebarimagelistview.cpp +++ b/tests/sidebar/ut_sidebarimagelistview.cpp @@ -5,6 +5,7 @@ #include "SideBarImageListview.h" #include "DocSheet.h" +#include "EyeProtectionManager.h" #include "SideBarImageViewModel.h" #include "stub.h" @@ -241,7 +242,10 @@ TEST_F(TestSideBarImageListView, testkeyPressEvent) TEST_F(TestSideBarImageListView, testThemeChanged_lambda) { - // 触发构造函数中注册的主题切换 lambda(刷新缩略图) emit DGuiApplicationHelper::instance()->themeTypeChanged(DGuiApplicationHelper::LightType); + const auto previousMode = EyeProtectionManager::instance()->mode(); + EyeProtectionManager::instance()->setMode(EyeProtectionManager::Night); + EyeProtectionManager::instance()->setMode(EyeProtectionManager::Off); + EyeProtectionManager::instance()->setMode(previousMode); SUCCEED(); } diff --git a/tests/sidebar/ut_thumbnaildelegate.cpp b/tests/sidebar/ut_thumbnaildelegate.cpp index b0f3be0d2..119fe170e 100644 --- a/tests/sidebar/ut_thumbnaildelegate.cpp +++ b/tests/sidebar/ut_thumbnaildelegate.cpp @@ -5,6 +5,7 @@ #include "ThumbnailDelegate.h" #include "DocSheet.h" +#include "EyeProtectionManager.h" #include "SideBarImageListview.h" #include "SideBarImageViewModel.h" @@ -15,6 +16,16 @@ #include #include +namespace { + +// 未打开文档时渲染器没有页面尺寸,桩掉以得到稳定的缩略图卡片区域 +QSizeF pageSizeByIndex_stub(DocSheet *, int) +{ + return QSizeF(210, 297); +} + +} // namespace + class UT_ThumbnailDelegate : public ::testing::Test { public: @@ -84,3 +95,43 @@ TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_sizeHint) QSize size = m_tester->sizeHint(option, index); EXPECT_FALSE(size.isEmpty()); } + +// 缩略图外观跟随护眼模式(而非系统深浅主题),与主视图保持一致: +// 无护眼时保持文档原始白底,夜间护眼时反转为深色底 +TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintFollowsEyeProtectionMode) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + m_pView->getImageModel()->insertPageIndex(0); + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + m_sheet->setThumbnail(0, whiteThumb); + + const QModelIndex index = m_pView->getImageModel()->index(0, 0); + ASSERT_TRUE(index.isValid()); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 240, 300); + + QImage canvas(240, 300, QImage::Format_ARGB32_Premultiplied); + + const auto previousMode = EyeProtectionManager::instance()->mode(); + EyeProtectionManager::instance()->setMode(EyeProtectionManager::Off); + canvas.fill(Qt::red); + QPainter offPainter(&canvas); + m_tester->paint(&offPainter, option, index); + offPainter.end(); + EXPECT_GT(canvas.pixelColor(120, 150).lightness(), 239); + + EyeProtectionManager::instance()->setMode(EyeProtectionManager::Night); + canvas.fill(Qt::red); + QPainter nightPainter(&canvas); + m_tester->paint(&nightPainter, option, index); + nightPainter.end(); + EXPECT_LT(canvas.pixelColor(120, 150).lightness(), 32); + + EyeProtectionManager::instance()->setMode(previousMode); +} From a4df2dcfb375bf7337c566f89b52badd19c91f45 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Thu, 10 Sep 2026 22:56:16 +0800 Subject: [PATCH 04/63] feat(ofd): integrate semantic text support --- debian/control | 2 +- reader/document/OfdModel.cpp | 227 +++++++++++++++++++++++++++++++-- reader/document/OfdModel.h | 5 + tests/document/ut_ofdmodel.cpp | 53 ++++++++ 4 files changed, 274 insertions(+), 13 deletions(-) diff --git a/debian/control b/debian/control index f1eb2ab21..40c6e0ead 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,7 @@ Build-Depends: libdtk6core-dev [!mipsel !mips64el] | libdtkcore-dev, libgxps-dev, libcairo2-dev, - librofd-ffi-dev, + librofd-ffi-dev (>= 0.3.0), libglib2.0-dev, libdjvulibre-dev, libtiff-dev, diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp index 13b55bc7a..275664bcd 100644 --- a/reader/document/OfdModel.cpp +++ b/reader/document/OfdModel.cpp @@ -14,10 +14,40 @@ #include #include +#include + namespace deepin_reader { static constexpr qreal kMillimetresPerInch = 25.4; +namespace { + +QString takeRofdString(rofd_string_t *text) +{ + if (nullptr == text) { + return QString(); + } + + const char *data = rofd_string_get_data(text); + const size_t length = rofd_string_get_length(text); + QString result; + if (nullptr != data && length <= static_cast(std::numeric_limits::max())) { + result = QString::fromUtf8(data, static_cast(length)); + } + rofd_string_free(text); + return result; +} + +void logSemanticError(const char *operation, int pageIndex, rofd_status_t status, rofd_error_t *error) +{ + qCWarning(appLog) << operation << "failed for OFD page:" << pageIndex + << "status:" << status + << "message:" << (error ? rofd_error_get_message(error) : "unknown"); + rofd_error_free(error); +} + +} // namespace + OfdDocument *OfdDocument::loadDocument(const QString &filePath, Document::Error &error) { qCInfo(appLog) << "Loading OFD document from:" << filePath; @@ -246,10 +276,9 @@ OfdPage::OfdPage(const OfdDocument *document, rofd_page_t *pageHandle, int pageI , m_page(pageHandle) , m_pageIndex(pageIndex) { - rofd_rect_t pageRect = {0.0, 0.0, 0.0, 0.0}; - if (ROFD_STATUS_OK == rofd_page_get_size_mm(m_page, &pageRect, nullptr)) { - m_sizePixel = QSizeF(pageRect.width_mm * m_document->xRes() / kMillimetresPerInch, - pageRect.height_mm * m_document->yRes() / kMillimetresPerInch); + if (ROFD_STATUS_OK == rofd_page_get_size_mm(m_page, &m_pageRectMm, nullptr)) { + m_sizePixel = QSizeF(m_pageRectMm.width_mm * m_document->xRes() / kMillimetresPerInch, + m_pageRectMm.height_mm * m_document->yRes() / kMillimetresPerInch); } else { qCWarning(appLog) << "Failed to query OFD page size, page:" << m_pageIndex; } @@ -275,18 +304,192 @@ QImage OfdPage::render(int width, int height, const QRect &slice) const QString OfdPage::text(const QRectF &rect) const { - // rofd C ABI 暂不提供文本提取接口 - Q_UNUSED(rect) - return QString(); + if (nullptr == m_page) { + return QString(); + } + + rofd_string_t *result = nullptr; + rofd_error_t *error = nullptr; + rofd_status_t status = ROFD_STATUS_OK; + if (rect.isNull()) { + status = rofd_page_get_text(m_page, &result, &error); + } else { + const rofd_rect_t area = toMillimetres(rect.normalized()); + status = rofd_page_get_text_for_area(m_page, &area, &result, &error); + } + + if (ROFD_STATUS_OK != status || nullptr == result) { + logSemanticError("Text extraction", m_pageIndex, status, error); + rofd_string_free(result); + return QString(); + } + + rofd_error_free(error); + return takeRofdString(result).simplified(); } QVector OfdPage::search(const QString &text, bool matchCase, bool wholeWords) const { - // rofd C ABI 暂不提供文本搜索接口 - Q_UNUSED(text) - Q_UNUSED(matchCase) - Q_UNUSED(wholeWords) - return QVector(); + QVector sections; + if (nullptr == m_page || text.isEmpty()) { + return sections; + } + + rofd_find_options_t options; + rofd_find_options_init(&options, sizeof(options)); + if (matchCase) { + options.flags |= ROFD_FIND_CASE_SENSITIVE; + } + if (wholeWords) { + options.flags |= ROFD_FIND_WHOLE_WORDS; + } + + const QByteArray query = text.toUtf8(); + rofd_text_search_t *searchResult = nullptr; + rofd_error_t *error = nullptr; + rofd_status_t status = rofd_page_find_text_with_options(m_page, + query.constData(), + &options, + &searchResult, + &error); + if (ROFD_STATUS_OK != status || nullptr == searchResult) { + logSemanticError("Text search", m_pageIndex, status, error); + rofd_text_search_free(searchResult); + return sections; + } + rofd_error_free(error); + + size_t matchCount = 0; + error = nullptr; + status = rofd_text_search_get_count(searchResult, &matchCount, &error); + if (ROFD_STATUS_OK != status) { + logSemanticError("Search result enumeration", m_pageIndex, status, error); + rofd_text_search_free(searchResult); + return sections; + } + rofd_error_free(error); + + sections.reserve(static_cast(qMin(matchCount, + static_cast(std::numeric_limits::max())))); + for (size_t index = 0; index < matchCount; ++index) { + rofd_text_match_t match; + match.struct_size = sizeof(match); + error = nullptr; + status = rofd_text_search_get_match(searchResult, index, &match, &error); + if (ROFD_STATUS_OK != status) { + logSemanticError("Search match extraction", m_pageIndex, status, error); + continue; + } + rofd_error_free(error); + + const QRectF matchRect = toPixels(match.rect_mm); + if (matchRect.isValid()) { + sections.append(PageSection{PageLine{QString(), matchRect}}); + } + } + + rofd_text_search_free(searchResult); + return sections; +} + +QList OfdPage::words() +{ + QList words; + if (nullptr == m_page) { + return words; + } + + rofd_string_t *pageText = nullptr; + rofd_error_t *error = nullptr; + rofd_status_t status = rofd_page_get_text(m_page, &pageText, &error); + if (ROFD_STATUS_OK != status || nullptr == pageText) { + logSemanticError("Page text extraction", m_pageIndex, status, error); + rofd_string_free(pageText); + return words; + } + rofd_error_free(error); + + rofd_text_layout_t *layout = nullptr; + error = nullptr; + status = rofd_page_get_text_layout(m_page, &layout, &error); + if (ROFD_STATUS_OK != status || nullptr == layout) { + logSemanticError("Text layout extraction", m_pageIndex, status, error); + rofd_string_free(pageText); + rofd_text_layout_free(layout); + return words; + } + rofd_error_free(error); + + size_t characterCount = 0; + error = nullptr; + status = rofd_text_layout_get_count(layout, &characterCount, &error); + if (ROFD_STATUS_OK != status) { + logSemanticError("Text layout enumeration", m_pageIndex, status, error); + rofd_string_free(pageText); + rofd_text_layout_free(layout); + return words; + } + rofd_error_free(error); + + const char *utf8 = rofd_string_get_data(pageText); + const size_t utf8Length = rofd_string_get_length(pageText); + for (size_t index = 0; index < characterCount; ++index) { + rofd_text_char_t character; + character.struct_size = sizeof(character); + error = nullptr; + status = rofd_text_layout_get_char(layout, index, &character, &error); + if (ROFD_STATUS_OK != status) { + logSemanticError("Text character extraction", m_pageIndex, status, error); + continue; + } + rofd_error_free(error); + + if (character.flags & ROFD_TEXT_CHAR_SYNTHESIZED_SEPARATOR) { + continue; + } + if (nullptr == utf8 + || 0 == character.utf8_length + || character.utf8_offset > utf8Length + || character.utf8_length > utf8Length - character.utf8_offset + || character.utf8_length > static_cast(std::numeric_limits::max())) { + qCWarning(appLog) << "Invalid OFD text character span, page:" << m_pageIndex + << "index:" << index; + continue; + } + + const QRectF boundingBox = toPixels(character.rect_mm); + if (!boundingBox.isValid()) { + continue; + } + + words.append(Word(QString::fromUtf8(utf8 + character.utf8_offset, + static_cast(character.utf8_length)), + boundingBox)); + } + + rofd_string_free(pageText); + rofd_text_layout_free(layout); + return words; +} + +rofd_rect_t OfdPage::toMillimetres(const QRectF &rect) const +{ + const qreal xScale = kMillimetresPerInch / m_document->xRes(); + const qreal yScale = kMillimetresPerInch / m_document->yRes(); + return rofd_rect_t{m_pageRectMm.x_mm + rect.x() * xScale, + m_pageRectMm.y_mm + rect.y() * yScale, + rect.width() * xScale, + rect.height() * yScale}; +} + +QRectF OfdPage::toPixels(const rofd_rect_t &rect) const +{ + const qreal xScale = m_document->xRes() / kMillimetresPerInch; + const qreal yScale = m_document->yRes() / kMillimetresPerInch; + return QRectF((rect.x_mm - m_pageRectMm.x_mm) * xScale, + (rect.y_mm - m_pageRectMm.y_mm) * yScale, + rect.width_mm * xScale, + rect.height_mm * yScale); } } // namespace deepin_reader diff --git a/reader/document/OfdModel.h b/reader/document/OfdModel.h index 6c54e0de5..dff0c73d9 100644 --- a/reader/document/OfdModel.h +++ b/reader/document/OfdModel.h @@ -63,11 +63,16 @@ class OfdPage : public Page QImage render(int width, int height, const QRect &slice = QRect()) const override; QString text(const QRectF &rect) const override; QVector search(const QString &text, bool matchCase, bool wholeWords) const override; + QList words() override; private: + rofd_rect_t toMillimetres(const QRectF &rect) const; + QRectF toPixels(const rofd_rect_t &rect) const; + const OfdDocument *m_document; rofd_page_t *m_page = nullptr; int m_pageIndex = -1; + rofd_rect_t m_pageRectMm = {0.0, 0.0, 0.0, 0.0}; QSizeF m_sizePixel; }; diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp index c89fec1ea..b6a1a28ee 100644 --- a/tests/document/ut_ofdmodel.cpp +++ b/tests/document/ut_ofdmodel.cpp @@ -14,6 +14,7 @@ #include #include +#include #include using namespace deepin_reader; @@ -113,6 +114,58 @@ TEST_F(TestOfdModel, renderInvalidSize) EXPECT_TRUE(page->render(-10, 100).isNull()); } +TEST_F(TestOfdModel, semanticFullText) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + + const QString text = page->text(QRectF()); + EXPECT_FALSE(text.isEmpty()); + EXPECT_TRUE(text.contains(QStringLiteral("电子发票"))); +} + +TEST_F(TestOfdModel, semanticSearch) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + + const QVector matches = page->search(QStringLiteral("电子发票"), true, false); + ASSERT_FALSE(matches.isEmpty()); + ASSERT_FALSE(matches.first().isEmpty()); + EXPECT_TRUE(matches.first().first().rect.isValid()); + + EXPECT_TRUE(page->search(QStringLiteral("不存在的文本"), false, false).isEmpty()); +} + +TEST_F(TestOfdModel, semanticWholeWordSearch) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + + EXPECT_FALSE(page->search(QStringLiteral("电子"), false, false).isEmpty()); + EXPECT_TRUE(page->search(QStringLiteral("电子"), false, true).isEmpty()); +} + +TEST_F(TestOfdModel, semanticWordsAndAreaText) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + + const QList words = page->words(); + ASSERT_FALSE(words.isEmpty()); + + const auto character = std::find_if(words.cbegin(), words.cend(), [](const Word &word) { + return word.text == QStringLiteral("电"); + }); + ASSERT_NE(character, words.cend()); + EXPECT_TRUE(character->boundingBox.isValid()); + EXPECT_GT(character->boundingBox.width(), 0.0); + EXPECT_GT(character->boundingBox.height(), 0.0); + + const QRectF selection = character->boundingBox.adjusted(-0.1, -0.1, 0.1, 0.1); + EXPECT_TRUE(page->text(selection).contains(character->text)); +} + TEST_F(TestOfdModel, loadMissingFile) { Document::Error error = Document::NoError; From cb6c64d3c8d165237ba108f6db96f36440e2e771 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Thu, 10 Sep 2026 22:56:40 +0800 Subject: [PATCH 05/63] fix(ofd): expose search in reader UI --- reader/Application.cpp | 4 +++- reader/app/Global.cpp | 18 ++++++++++++++++++ reader/app/Global.h | 1 + reader/browser/BrowserMenu.cpp | 14 +++----------- reader/browser/SheetBrowser.cpp | 9 ++------- reader/uiframe/CentralNavPage.cpp | 14 ++++++++------ reader/uiframe/TitleMenu.cpp | 8 ++------ tests/app/ut_global.cpp | 15 +++++++++++++++ 8 files changed, 52 insertions(+), 31 deletions(-) diff --git a/reader/Application.cpp b/reader/Application.cpp index 0d819fb12..faf628a23 100644 --- a/reader/Application.cpp +++ b/reader/Application.cpp @@ -35,6 +35,9 @@ Application::Application(int &argc, char **argv) QStringLiteral("DOCX") #ifdef XPS_SUPPORT_ENABLED , QStringLiteral("XPS") +#endif +#ifdef OFD_SUPPORT_ENABLED + , QStringLiteral("OFD") #endif }; setApplicationDescription(tr("Document Viewer is a tool for reading document files, supporting %1.") @@ -130,4 +133,3 @@ bool Application::notify(QObject *object, QEvent *event) return DApplication::notify(object, event); } - diff --git a/reader/app/Global.cpp b/reader/app/Global.cpp index b7463a1eb..01dcde1cd 100644 --- a/reader/app/Global.cpp +++ b/reader/app/Global.cpp @@ -64,6 +64,24 @@ FileType fileType(const QString &filePath) return fileType; } +bool supportsSearch(FileType fileType) +{ + if (fileType == PDF || fileType == DOCX) + return true; + +#ifdef XPS_SUPPORT_ENABLED + if (fileType == XPS) + return true; +#endif + +#ifdef OFD_SUPPORT_ENABLED + if (fileType == OFD) + return true; +#endif + + return false; +} + bool isNetworkPath(const QString &filePath) { // gvfs(smb/nfs 等用户态挂载)路径特征明确,先按字符串判断。 diff --git a/reader/app/Global.h b/reader/app/Global.h index 603d506c0..0ecf7ba3f 100644 --- a/reader/app/Global.h +++ b/reader/app/Global.h @@ -49,6 +49,7 @@ enum FileType { #endif }; FileType fileType(const QString &filePath); +bool supportsSearch(FileType fileType); bool isNetworkPath(const QString &filePath); /** diff --git a/reader/browser/BrowserMenu.cpp b/reader/browser/BrowserMenu.cpp index a81db40f8..549ce6895 100644 --- a/reader/browser/BrowserMenu.cpp +++ b/reader/browser/BrowserMenu.cpp @@ -92,11 +92,7 @@ void BrowserMenu::initActions(DocSheet *sheet, int index, SheetMenuType_e type, } } else if (type == DOC_MENU_KEY) { qCDebug(appLog) << "BrowserMenu::initActions() - Processing DOC_MENU_KEY"; - if (sheet->fileType() == Dr::FileType::PDF || sheet->fileType() == Dr::FileType::DOCX -#ifdef XPS_SUPPORT_ENABLED - || sheet->fileType() == Dr::FileType::XPS -#endif - ) { + if (Dr::supportsSearch(sheet->fileType())) { createAction(tr("Search"), "Search"); this->addSeparator(); } @@ -148,12 +144,8 @@ void BrowserMenu::initActions(DocSheet *sheet, int index, SheetMenuType_e type, createAction(tr("Document info"), "DocumentInfo"); } else { qCDebug(appLog) << "BrowserMenu::initActions() - Processing default menu type"; - if (sheet->fileType() == Dr::FileType::PDF || sheet->fileType() == Dr::FileType::DOCX -#ifdef XPS_SUPPORT_ENABLED - || sheet->fileType() == Dr::FileType::XPS -#endif - ) { - qCDebug(appLog) << "BrowserMenu::initActions() - Adding search action for PDF/DOCX/XPS"; + if (Dr::supportsSearch(sheet->fileType())) { + qCDebug(appLog) << "BrowserMenu::initActions() - Adding search action for searchable document"; createAction(tr("Search"), "Search"); this->addSeparator(); } diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index d61023445..bb764ba03 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -1915,13 +1915,8 @@ void SheetBrowser::showEvent(QShowEvent *event) void SheetBrowser::handlePrepareSearch() { qCDebug(appLog) << "Preparing search for file type:" << m_sheet->fileType(); - - //目前只有PDF、DOCX和XPS开放搜索功能 - if (m_sheet->fileType() != Dr::FileType::PDF && m_sheet->fileType() != Dr::FileType::DOCX -#ifdef XPS_SUPPORT_ENABLED - && m_sheet->fileType() != Dr::FileType::XPS -#endif - ) { + + if (!Dr::supportsSearch(m_sheet->fileType())) { qCDebug(appLog) << "Search not supported for current file type"; return; } diff --git a/reader/uiframe/CentralNavPage.cpp b/reader/uiframe/CentralNavPage.cpp index f3458ad09..4437d15fd 100644 --- a/reader/uiframe/CentralNavPage.cpp +++ b/reader/uiframe/CentralNavPage.cpp @@ -25,13 +25,16 @@ CentralNavPage::CentralNavPage(DWidget *parent) tipsLabel->setForegroundRole(DPalette::TextTips); DFontSizeManager::instance()->bind(tipsLabel, DFontSizeManager::T8); - constexpr auto kFormatsWithXps = "PDF,DJVU,DOCX,XPS"; - constexpr auto kFormatsWithoutXps = "PDF,DJVU,DOCX"; + QStringList formats = {QStringLiteral("PDF"), + QStringLiteral("DJVU"), + QStringLiteral("DOCX")}; #ifdef XPS_SUPPORT_ENABLED - auto supportedFormats = QString::fromLatin1(kFormatsWithXps); -#else - auto supportedFormats = QString::fromLatin1(kFormatsWithoutXps); + formats.append(QStringLiteral("XPS")); #endif +#ifdef OFD_SUPPORT_ENABLED + formats.append(QStringLiteral("OFD")); +#endif + const QString supportedFormats = formats.join(QLatin1Char(',')); auto formatLabel = new DLabel(tr("Format supported: %1").arg(supportedFormats), this); formatLabel->setAccessibleName(QString("Label_format supported: %1").arg(supportedFormats)); @@ -98,4 +101,3 @@ void CentralNavPage::onThemeChanged() l->setForegroundRole(DPalette::TextTips); } } - diff --git a/reader/uiframe/TitleMenu.cpp b/reader/uiframe/TitleMenu.cpp index 6b0ce5836..a3da277ba 100644 --- a/reader/uiframe/TitleMenu.cpp +++ b/reader/uiframe/TitleMenu.cpp @@ -71,12 +71,8 @@ void TitleMenu::onCurSheetChanged(DocSheet *sheet) QAction *searchAction = this->findChild("Search"); if (searchAction) { - if (sheet->fileType() == Dr::PDF || sheet->fileType() == Dr::DOCX -#ifdef XPS_SUPPORT_ENABLED - || sheet->fileType() == Dr::XPS -#endif - ) { - qCDebug(appLog) << "Enabling search for PDF/DOCX"; + if (Dr::supportsSearch(sheet->fileType())) { + qCDebug(appLog) << "Enabling search for searchable document"; searchAction->setVisible(true); } else { qCDebug(appLog) << "Disabling search for other formats"; diff --git a/tests/app/ut_global.cpp b/tests/app/ut_global.cpp index 5b3c3998e..02048fbe7 100644 --- a/tests/app/ut_global.cpp +++ b/tests/app/ut_global.cpp @@ -85,3 +85,18 @@ TEST_F(TestGlobal, UT_Global_fileType_006) EXPECT_TRUE(fileType("1.docx") == DOCX); } + +TEST_F(TestGlobal, UT_Global_supportsSearch) +{ + EXPECT_TRUE(supportsSearch(PDF)); + EXPECT_TRUE(supportsSearch(DOCX)); +#ifdef XPS_SUPPORT_ENABLED + EXPECT_TRUE(supportsSearch(XPS)); +#endif +#ifdef OFD_SUPPORT_ENABLED + EXPECT_TRUE(supportsSearch(OFD)); +#endif + + EXPECT_FALSE(supportsSearch(Unknown)); + EXPECT_FALSE(supportsSearch(DJVU)); +} From b46b28197cfbb5619bebcbc97b202449a4a186b4 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 07:50:55 +0800 Subject: [PATCH 06/63] feat(ofd): render page regions with bounded memory Use rofd pixel canvas and region rendering APIs instead of rendering and cropping a full page. Validate tile bounds and raster budgets before allocation, probe the required API at configure time, and add a lightweight OFD adapter test target. --- CMakeLists.txt | 23 ++++++++ reader/document/OfdModel.cpp | 57 ++++++++++++++----- tests/document/ut_ofdmodel.cpp | 100 +++++++++++++++++++++++++++++++++ tests/ofd-model/CMakeLists.txt | 43 ++++++++++++++ tests/ofd-model/README.md | 24 ++++++++ tests/ofd-model/main.cc | 12 ++++ 6 files changed, 244 insertions(+), 15 deletions(-) create mode 100644 tests/ofd-model/CMakeLists.txt create mode 100644 tests/ofd-model/README.md create mode 100644 tests/ofd-model/main.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 1604166d7..d86e8e8bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,29 @@ if (OFD_SUPPORT) pkg_check_modules(OFD_CAIRO QUIET cairo) if (ROFD_INCLUDE_DIR AND ROFD_FFI_LIBRARY AND OFD_CAIRO_FOUND) + # These APIs were added after 0.3.0 without a version bump. Probe both + # declarations and linked symbols instead of trusting the package version. + include(CheckCSourceCompiles) + include(CMakePushCheckState) + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_INCLUDES ${ROFD_INCLUDE_DIR} ${OFD_CAIRO_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${ROFD_FFI_LIBRARY} ${OFD_CAIRO_LIBRARIES}) + unset(ROFD_READER_APIS_AVAILABLE CACHE) + check_c_source_compiles([=[ + #include + int main(void) { + rofd_pixel_rect_t viewport; + int32_t w = 0, h = 0; + rofd_pixel_rect_init(&viewport, sizeof(viewport)); + rofd_renderer_get_pixel_canvas_size(0, 0, 0, &w, &h, 0); + rofd_renderer_render_page_region_cairo(0, 0, 0, 0, &viewport, 0, 0); + return 0; + } + ]=] ROFD_READER_APIS_AVAILABLE) + cmake_pop_check_state() + if (NOT ROFD_READER_APIS_AVAILABLE) + message(FATAL_ERROR "rofd headers/library lack the region rendering APIs. Use a matching rofd build containing commit 56da925 (0.3.0 alone is insufficient), and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") + endif() message(STATUS ">>> OFD support enabled (rofd_ffi: ${ROFD_FFI_LIBRARY})") add_compile_definitions(OFD_SUPPORT_ENABLED) set(OFD_SUPPORT_RESOLVED ON) diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp index 275664bcd..22c16b254 100644 --- a/reader/document/OfdModel.cpp +++ b/reader/document/OfdModel.cpp @@ -175,7 +175,8 @@ Properties OfdDocument::properties() const QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, const QRect &slice) const { - if (nullptr == pageHandle || width <= 0 || height <= 0) { + if (nullptr == pageHandle || width <= 0 || height <= 0 + || (!slice.isNull() && !slice.isValid())) { qCWarning(appLog) << "Invalid OFD render request, handle:" << pageHandle << "size:" << width << height; return QImage(); } @@ -197,7 +198,11 @@ QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, c int32_t pixelWidth = 0; int32_t pixelHeight = 0; rofd_error_t *rofdError = nullptr; - if (ROFD_STATUS_OK != rofd_renderer_get_pixel_size(m_renderer, pageHandle, &options, &pixelWidth, &pixelHeight, &rofdError) + // A tile only needs canvas geometry; the full-page query enforces a full + // raster budget and would reject high zoom even for a tiny visible region. + const auto sizeQuery = slice.isValid() ? rofd_renderer_get_pixel_canvas_size + : rofd_renderer_get_pixel_size; + if (ROFD_STATUS_OK != sizeQuery(m_renderer, pageHandle, &options, &pixelWidth, &pixelHeight, &rofdError) || pixelWidth <= 0 || pixelHeight <= 0) { qCWarning(appLog) << "Failed to compute OFD pixel size:" << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); @@ -205,17 +210,33 @@ QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, c return QImage(); } - QImage image(pixelWidth, pixelHeight, QImage::Format_ARGB32_Premultiplied); + const QRect canvas(0, 0, pixelWidth, pixelHeight); + const QRect target = slice.isValid() ? slice : canvas; + // Do not silently clamp: the caller places the result at the requested + // origin and expects exactly the requested dimensions. + if (!canvas.contains(target)) { + qCWarning(appLog) << "OFD render region outside canvas:" << target << canvas; + return QImage(); + } + const int argbStride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, target.width()); + const int maskStride = cairo_format_stride_for_width(CAIRO_FORMAT_A8, target.width()); + if (target.width() > 32767 || target.height() > 32767 || argbStride < 0 || maskStride < 0 + || (quint64(argbStride) * 2 + quint64(maskStride)) * quint64(target.height()) > options.max_raster_bytes) { + qCWarning(appLog) << "OFD render target exceeds raster limits:" << target.size(); + return QImage(); + } + + QImage image(target.size(), QImage::Format_ARGB32_Premultiplied); if (image.isNull()) { - qCWarning(appLog) << "Failed to allocate OFD render image:" << pixelWidth << pixelHeight; + qCWarning(appLog) << "Failed to allocate OFD render image:" << target.size(); return QImage(); } image.fill(Qt::white); cairo_surface_t *surface = cairo_image_surface_create_for_data(image.bits(), CAIRO_FORMAT_ARGB32, - pixelWidth, - pixelHeight, + image.width(), + image.height(), image.bytesPerLine()); if (CAIRO_STATUS_SUCCESS != cairo_surface_status(surface)) { qCWarning(appLog) << "Failed to create Cairo surface for OFD render"; @@ -232,7 +253,19 @@ QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, c } rofd_render_report_t *report = nullptr; - rofd_status_t status = rofd_renderer_render_page_cairo(m_renderer, pageHandle, cr, &options, &report, &rofdError); + rofd_status_t status; + if (slice.isValid()) { + rofd_pixel_rect_t viewport; + rofd_pixel_rect_init(&viewport, sizeof(viewport)); + viewport.x = target.x(); + viewport.y = target.y(); + viewport.width = target.width(); + viewport.height = target.height(); + status = rofd_renderer_render_page_region_cairo(m_renderer, pageHandle, cr, &options, + &viewport, &report, &rofdError); + } else { + status = rofd_renderer_render_page_cairo(m_renderer, pageHandle, cr, &options, &report, &rofdError); + } if (nullptr != report) { size_t diagnosticCount = 0; @@ -250,6 +283,7 @@ QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, c rofd_render_report_free(report); } + cairo_surface_flush(surface); cairo_destroy(cr); cairo_surface_destroy(surface); @@ -260,14 +294,7 @@ QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, c return QImage(); } - // rofd 的 clip 只限制绘制范围、不改变坐标映射,切片通过整页渲染后裁剪实现 - if (slice.isValid()) { - const QRect bounded = slice.intersected(image.rect()); - if (bounded.isValid() && bounded.size() != image.size()) { - return image.copy(bounded); - } - } - + rofd_error_free(rofdError); return image; } diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp index b6a1a28ee..83093bd58 100644 --- a/tests/document/ut_ofdmodel.cpp +++ b/tests/document/ut_ofdmodel.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -36,6 +37,35 @@ bool hasOfdFile() return QFile(ofdFilePath()).exists(); } +QString createOfdFixture(const QTemporaryDir &dir, const QByteArray &info, + const QByteArray &pageArea = QByteArray(), + const QByteArray &documentExtras = QByteArray()) +{ + const QMap entries = { + {"OFD.xml", "" + info + + "Document.xml"}, + {"Document.xml", "7 11 210 297" + "" + + documentExtras + ""}, + {"Page.xml", "" + pageArea + "" + "M 0 0 L 40 0 L 40 25 L 0 25 C" + ""} + }; + for (auto it = entries.cbegin(); it != entries.cend(); ++it) { + QFile file(dir.filePath(it.key())); + if (!file.open(QIODevice::WriteOnly) || file.write(it.value()) != it.value().size()) + return {}; + } + QProcess archive; + archive.setWorkingDirectory(dir.path()); + archive.start(QStringLiteral("cmake"), {"-E", "tar", "cf", "fixture.ofd", "--format=zip", + "OFD.xml", "Document.xml", "Page.xml"}); + if (!archive.waitForFinished() || archive.exitCode() != 0) + return {}; + return dir.filePath("fixture.ofd"); +} + } // namespace class TestOfdModel : public ::testing::Test @@ -114,6 +144,76 @@ TEST_F(TestOfdModel, renderInvalidSize) EXPECT_TRUE(page->render(-10, 100).isNull()); } +TEST_F(TestOfdModel, renderSmallRegionOnHugeCanvas) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + // A full 42300 x 28000 image exceeds 4 GiB; only a 64 x 48 tile is needed. + const QImage tile = page->render(42300, 28000, QRect(97, 42, 64, 48)); + ASSERT_FALSE(tile.isNull()); + EXPECT_EQ(tile.size(), QSize(64, 48)); +} + +TEST_F(TestOfdModel, rejectInvalidRegions) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + EXPECT_TRUE(page->render(423, 280, QRect(900, 0, 20, 20)).isNull()); + EXPECT_TRUE(page->render(423, 280, QRect(-1, 0, 20, 20)).isNull()); + EXPECT_TRUE(page->render(423, 280, QRect(420, 270, 20, 20)).isNull()); + EXPECT_TRUE(page->render(423, 280, QRect(1, 1, 0, 20)).isNull()); + EXPECT_TRUE(page->render(42300, 28000, QRect(0, 0, 16000, 16000)).isNull()); +} + +TEST(OfdApi, regionMatchesFullPageWithNonzeroPhysicalOrigin) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, "region"); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + const QImage full = page->render(420, 594); + ASSERT_FALSE(full.isNull()); + const QRect region(17, 19, 160, 150); + const QImage tile = page->render(420, 594, region); + ASSERT_FALSE(tile.isNull()); + EXPECT_EQ(tile, full.copy(region)); + EXPECT_EQ(tile.pixelColor(40, 40), QColor(Qt::red)); + + const QImage largeCanvasTile = page->render(42000, 59400, QRect(4000, 5000, 64, 48)); + ASSERT_EQ(largeCanvasTile.size(), QSize(64, 48)); + EXPECT_EQ(largeCanvasTile.pixelColor(32, 24), QColor(Qt::red)); +} + +TEST_F(TestOfdModel, realInvoiceRegionMatchesFullPage) +{ + std::unique_ptr page(m_doc->page(0)); + ASSERT_NE(page, nullptr); + const QImage full = page->render(423, 280); + const QRect region(97, 42, 129, 71); + const QImage tile = page->render(423, 280, region); + ASSERT_FALSE(full.isNull()); + ASSERT_EQ(tile.size(), region.size()); + int differingChannels = 0; + int largestDelta = 0; + for (int y = 0; y < tile.height(); ++y) { + const uchar *expected = full.constScanLine(region.y() + y) + region.x() * 4; + const uchar *actual = tile.constScanLine(y); + for (int x = 0; x < tile.width() * 4; ++x) { + const int delta = qAbs(int(expected[x]) - int(actual[x])); + differingChannels += delta != 0; + largestDelta = qMax(largestDelta, delta); + } + } + // Cairo glyph/curve antialiasing may differ slightly with target extents. + EXPECT_LE(largestDelta, 3); + EXPECT_LE(differingChannels, 100); +} + TEST_F(TestOfdModel, semanticFullText) { std::unique_ptr page(m_doc->page(0)); diff --git a/tests/ofd-model/CMakeLists.txt b/tests/ofd-model/CMakeLists.txt new file mode 100644 index 000000000..fa68f75f3 --- /dev/null +++ b/tests/ofd-model/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.16) +project(ofd-model-check LANGUAGES CXX) + +# Configure this directory directly to check OFD without linking all reader tests. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_AUTOMOC ON) +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) +find_package(PkgConfig REQUIRED) +pkg_check_modules(CAIRO REQUIRED IMPORTED_TARGET cairo) +if (QT_VERSION_MAJOR EQUAL 6) + pkg_check_modules(DTKCORE REQUIRED IMPORTED_TARGET dtk6core) +else() + pkg_check_modules(DTKCORE REQUIRED IMPORTED_TARGET dtkcore) +endif() +find_package(GTest REQUIRED) +find_path(ROFD_INCLUDE_DIR rofd.h) +find_library(ROFD_FFI_LIBRARY NAMES rofd_ffi) +if (NOT ROFD_INCLUDE_DIR OR NOT ROFD_FFI_LIBRARY) + message(FATAL_ERROR "Set ROFD_INCLUDE_DIR and ROFD_FFI_LIBRARY to the matching rofd build") +endif() + +get_filename_component(READER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../.." ABSOLUTE) +add_executable(ofd-model-check main.cc + ../document/ut_ofdmodel.cpp + ${READER_ROOT}/reader/document/OfdModel.cpp + ${READER_ROOT}/reader/document/OfdModel.h + ${READER_ROOT}/reader/document/Model.h) +target_compile_definitions(ofd-model-check PRIVATE + OFD_SUPPORT_ENABLED UTSOURCEDIR="${READER_ROOT}/tests") +target_include_directories(ofd-model-check PRIVATE + ${ROFD_INCLUDE_DIR} + ${READER_ROOT}/reader ${READER_ROOT}/reader/document ${READER_ROOT}/reader/app + ${READER_ROOT}/tests ${READER_ROOT}/3rdparty/deepin-pdfium/include) +target_link_libraries(ofd-model-check PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets PkgConfig::CAIRO PkgConfig::DTKCORE + GTest::gtest ${ROFD_FFI_LIBRARY}) + +enable_testing() +add_test(NAME ofd-model COMMAND ofd-model-check) +set_tests_properties(ofd-model PROPERTIES + ENVIRONMENT "QT_QPA_PLATFORM=offscreen;QT_LOGGING_RULES=org.deepin.reader=false") diff --git a/tests/ofd-model/README.md b/tests/ofd-model/README.md new file mode 100644 index 000000000..1dff6b520 --- /dev/null +++ b/tests/ofd-model/README.md @@ -0,0 +1,24 @@ +# Focused OFD adapter checks + +This independent CMake project runs `tests/document/ut_ofdmodel.cpp` against the +real reader adapter and a shared rofd library. It does not link PDFium or the +monolithic `test-deepin-reader` executable. The `.cc` entry point is intentionally +outside the main test project's `.cpp`/`.h` source glob. + +```sh +cmake -S tests/ofd-model -B build/ofd-model \ + -DROFD_INCLUDE_DIR=/path/to/rofd/crates/rofd-ffi/include \ + -DROFD_FFI_LIBRARY=/path/to/lib/librofd_ffi.so +cmake --build build/ofd-model -j1 +ctest --test-dir build/ofd-model --output-on-failure +``` + +The library must provide the region APIs added in rofd +commit `56da925`; the initial 0.3.0 release does not include them. +Its runtime SONAME (`librofd_ffi.so.0`) must resolve to the same library. +Qt Widgets, DTK Core, Cairo, Google Test and CMake are required. Fixtures are +created in temporary directories using `cmake -E tar --format=zip`. + +Coverage includes full and tiled rendering, nonzero physical page origins, +small tiles on canvases larger than 4 GiB, pre-allocation raster limits, +real-invoice pixel comparisons, and search/selection. diff --git a/tests/ofd-model/main.cc b/tests/ofd-model/main.cc new file mode 100644 index 000000000..ad3a4da43 --- /dev/null +++ b/tests/ofd-model/main.cc @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} From 2db5d6fc926759ebae53da9ea313f9b5d00eff21 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 07:51:36 +0800 Subject: [PATCH 07/63] feat(ofd): expose document metadata and identifiers Map rofd metadata snapshots to reader properties, preserve raw dates, and use valid document dates in file attributes. Add metadata and identifier coverage and extend the required API probe. --- CMakeLists.txt | 6 ++- reader/document/OfdModel.cpp | 71 ++++++++++++++++++++++++++++++++-- reader/document/OfdModel.h | 3 ++ reader/uiframe/DocSheet.cpp | 10 +++++ tests/document/ut_ofdmodel.cpp | 44 +++++++++++++++++++++ tests/ofd-model/README.md | 7 ++-- 6 files changed, 133 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d86e8e8bf..9336ced93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,16 +106,20 @@ if (OFD_SUPPORT) #include int main(void) { rofd_pixel_rect_t viewport; + rofd_metadata_t *metadata = 0; int32_t w = 0, h = 0; rofd_pixel_rect_init(&viewport, sizeof(viewport)); rofd_renderer_get_pixel_canvas_size(0, 0, 0, &w, &h, 0); rofd_renderer_render_page_region_cairo(0, 0, 0, 0, &viewport, 0, 0); + rofd_document_get_metadata(0, &metadata, 0); + rofd_metadata_get_document_id(metadata); + rofd_metadata_free(metadata); return 0; } ]=] ROFD_READER_APIS_AVAILABLE) cmake_pop_check_state() if (NOT ROFD_READER_APIS_AVAILABLE) - message(FATAL_ERROR "rofd headers/library lack the region rendering APIs. Use a matching rofd build containing commit 56da925 (0.3.0 alone is insufficient), and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") + message(FATAL_ERROR "rofd headers/library lack the region or metadata APIs. Use a matching rofd build containing commits 56da925 and 6db9bac (0.3.0 alone is insufficient), and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") endif() message(STATUS ">>> OFD support enabled (rofd_ffi: ${ROFD_FFI_LIBRARY})") add_compile_definitions(OFD_SUPPORT_ENABLED) diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp index 22c16b254..21fa1e29e 100644 --- a/reader/document/OfdModel.cpp +++ b/reader/document/OfdModel.cpp @@ -15,6 +15,7 @@ #include #include +#include namespace deepin_reader { @@ -102,6 +103,7 @@ OfdDocument::OfdDocument(const QString &filePath, rofd_document_t *document, rof m_yRes = srn->logicalDotsPerInchY(); } + loadMetadata(); qCInfo(appLog) << "OFD document loaded, pages:" << m_pageCount << "dpi:" << m_xRes << m_yRes; } @@ -167,10 +169,71 @@ bool OfdDocument::saveAs(const QString &filePath) const Properties OfdDocument::properties() const { - Properties props; - props["Format"] = QStringLiteral("OFD"); - props["FilePath"] = m_filePath; - return props; + return m_properties; +} + +QString OfdDocument::fileIdentifier() const +{ + return m_properties.value("DocumentId").toString(); +} + +void OfdDocument::loadMetadata() +{ + m_properties["Format"] = QStringLiteral("OFD"); + m_properties["FilePath"] = m_filePath; + m_properties["PageCount"] = m_pageCount; + + rofd_metadata_t *raw = nullptr; + rofd_error_t *error = nullptr; + const rofd_status_t status = rofd_document_get_metadata(m_document, &raw, &error); + const std::unique_ptr metadata(raw, rofd_metadata_free); + if (status != ROFD_STATUS_OK || !metadata) { + qCWarning(appLog) << "Failed to read OFD metadata:" << status + << (error ? rofd_error_get_message(error) : "unknown"); + rofd_error_free(error); + return; + } + rofd_error_free(error); + + const auto put = [this](const char *key, const char *value) { + if (value) + m_properties[QLatin1String(key)] = QString::fromUtf8(value); + }; + put("DocumentId", rofd_metadata_get_document_id(raw)); + put("Title", rofd_metadata_get_title(raw)); + put("Author", rofd_metadata_get_author(raw)); + put("Subject", rofd_metadata_get_subject(raw)); + put("Description", rofd_metadata_get_abstract(raw)); + put("Creator", rofd_metadata_get_creator(raw)); + put("CreatorVersion", rofd_metadata_get_creator_version(raw)); + // OFD identifies its producing application with Creator/CreatorVersion. + const QString creator = m_properties.value("Creator").toString(); + if (!creator.isEmpty()) { + const QString version = m_properties.value("CreatorVersion").toString(); + m_properties["Producer"] = version.isEmpty() ? creator : creator + QLatin1Char(' ') + version; + } + + const auto putDate = [this, &put](const char *key, const char *rawKey, const char *value) { + put(rawKey, value); + if (value) { + const QDateTime date = QDateTime::fromString(QString::fromUtf8(value), Qt::ISODate); + if (date.isValid()) + m_properties[QLatin1String(key)] = date; + } + }; + putDate("CreationDate", "CreationDateRaw", rofd_metadata_get_creation_date(raw)); + putDate("ModificationDate", "ModificationDateRaw", rofd_metadata_get_modification_date(raw)); + + size_t count = 0; + if (rofd_metadata_get_keyword_count(raw, &count, nullptr) == ROFD_STATUS_OK) { + QStringList keywords; + for (size_t i = 0; i < count; ++i) { + const char *keyword = nullptr; + if (rofd_metadata_get_keyword(raw, i, &keyword, nullptr) == ROFD_STATUS_OK && keyword) + keywords.append(QString::fromUtf8(keyword)); + } + m_properties["KeyWords"] = keywords.join(QStringLiteral("; ")); + } } QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, const QRect &slice) const diff --git a/reader/document/OfdModel.h b/reader/document/OfdModel.h index dff0c73d9..6f5609ee1 100644 --- a/reader/document/OfdModel.h +++ b/reader/document/OfdModel.h @@ -33,6 +33,7 @@ class OfdDocument : public Document bool save() const override; bool saveAs(const QString &filePath) const override; Properties properties() const override; + QString fileIdentifier() const override; QString filePath() const { return m_filePath; } qreal xRes() const { return m_xRes; } @@ -43,10 +44,12 @@ class OfdDocument : public Document private: OfdDocument(const QString &filePath, rofd_document_t *document, rofd_renderer_t *renderer); + void loadMetadata(); QString m_filePath; rofd_document_t *m_document = nullptr; rofd_renderer_t *m_renderer = nullptr; + Properties m_properties; int m_pageCount = 0; qreal m_xRes = 96.0; qreal m_yRes = 96.0; diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index 7b9ced0cf..a8f65d1ac 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -1492,6 +1492,16 @@ void DocSheet::docBasicInfo(deepin_reader::FileInfo &tFileInfo) const Properties &propertys = m_renderer->properties(); tFileInfo.format = format(); +#ifdef OFD_SUPPORT_ENABLED + if (m_fileType == Dr::OFD) { + const QDateTime created = propertys.value("CreationDate").toDateTime(); + const QDateTime modified = propertys.value("ModificationDate").toDateTime(); + if (created.isValid()) + tFileInfo.createTime = created; + if (modified.isValid()) + tFileInfo.changeTime = modified; + } +#endif tFileInfo.optimization = propertys.value("Linearized").toBool(); QString keywords = propertys.value("KeyWords").toString(); if (keywords.isEmpty()) { diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp index 83093bd58..fbc9d78c4 100644 --- a/tests/document/ut_ofdmodel.cpp +++ b/tests/document/ut_ofdmodel.cpp @@ -214,6 +214,50 @@ TEST_F(TestOfdModel, realInvoiceRegionMatchesFullPage) EXPECT_LE(differingChannels, 100); } +TEST(OfdApi, metadataAndIdentifier) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, QStringLiteral( + "文档-ID标题作者主题" + "摘要应用1.2" + "2026-09-092026-09-10T12:34:56+08:00" + "one二one").toUtf8()); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const Properties props = doc->properties(); + EXPECT_EQ(doc->fileIdentifier(), QStringLiteral("文档-ID")); + EXPECT_EQ(props.value("Title").toString(), QStringLiteral("标题")); + EXPECT_EQ(props.value("Author").toString(), QStringLiteral("作者")); + EXPECT_EQ(props.value("Subject").toString(), QStringLiteral("主题")); + EXPECT_EQ(props.value("Description").toString(), QStringLiteral("摘要")); + EXPECT_EQ(props.value("Creator").toString(), QStringLiteral("应用")); + EXPECT_EQ(props.value("CreatorVersion").toString(), QStringLiteral("1.2")); + EXPECT_EQ(props.value("KeyWords").toString(), QStringLiteral("one; 二; one")); + EXPECT_EQ(props.value("CreationDate").toDateTime().date(), QDate(2026, 9, 9)); + EXPECT_EQ(props.value("ModificationDate").toDateTime().offsetFromUtc(), 8 * 3600); + EXPECT_EQ(props.value("PageCount").toInt(), 1); + EXPECT_EQ(doc->fileIdentifier(), QStringLiteral("文档-ID")); +} + +TEST(OfdApi, missingMetadataAndInvalidDate) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, "not-a-date"); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const Properties props = doc->properties(); + EXPECT_TRUE(doc->fileIdentifier().isEmpty()); + EXPECT_FALSE(props.contains("Title")); + EXPECT_FALSE(props.value("CreationDate").toDateTime().isValid()); + EXPECT_EQ(props.value("CreationDateRaw").toString(), QStringLiteral("not-a-date")); +} + TEST_F(TestOfdModel, semanticFullText) { std::unique_ptr page(m_doc->page(0)); diff --git a/tests/ofd-model/README.md b/tests/ofd-model/README.md index 1dff6b520..3d5c9c692 100644 --- a/tests/ofd-model/README.md +++ b/tests/ofd-model/README.md @@ -13,12 +13,13 @@ cmake --build build/ofd-model -j1 ctest --test-dir build/ofd-model --output-on-failure ``` -The library must provide the region APIs added in rofd -commit `56da925`; the initial 0.3.0 release does not include them. +The library must provide the region and metadata APIs added in rofd +commits `56da925` and `6db9bac`; the initial 0.3.0 release does not include them. Its runtime SONAME (`librofd_ffi.so.0`) must resolve to the same library. Qt Widgets, DTK Core, Cairo, Google Test and CMake are required. Fixtures are created in temporary directories using `cmake -E tar --format=zip`. Coverage includes full and tiled rendering, nonzero physical page origins, small tiles on canvases larger than 4 GiB, pre-allocation raster limits, -real-invoice pixel comparisons, and search/selection. +real-invoice pixel comparisons, search/selection, metadata/DocID, missing or +invalid dates. From a62e17c824307fad9e02c47be017c289ce7d0b5c Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 07:52:08 +0800 Subject: [PATCH 08/63] feat(ofd): surface document parsing warnings Refresh owned warning snapshots after lazy page loads and rendering, log each warning once, and display warning details in file attributes. Add Chinese translations and lazy-load warning coverage. --- CMakeLists.txt | 5 +++- reader/document/OfdModel.cpp | 43 +++++++++++++++++++++++++++- reader/document/OfdModel.h | 4 +++ reader/widgets/AttrScrollWidget.cpp | 14 +++++++++ tests/document/ut_ofdmodel.cpp | 44 +++++++++++++++++++++++++++++ tests/ofd-model/README.md | 4 +-- translations/deepin-reader_zh_CN.ts | 6 +++- translations/deepin-reader_zh_HK.ts | 4 +++ translations/deepin-reader_zh_TW.ts | 4 +++ 9 files changed, 123 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9336ced93..0408ed649 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,7 @@ if (OFD_SUPPORT) int main(void) { rofd_pixel_rect_t viewport; rofd_metadata_t *metadata = 0; + rofd_warning_list_t *warnings = 0; int32_t w = 0, h = 0; rofd_pixel_rect_init(&viewport, sizeof(viewport)); rofd_renderer_get_pixel_canvas_size(0, 0, 0, &w, &h, 0); @@ -114,12 +115,14 @@ if (OFD_SUPPORT) rofd_document_get_metadata(0, &metadata, 0); rofd_metadata_get_document_id(metadata); rofd_metadata_free(metadata); + rofd_document_get_warnings(0, &warnings, 0); + rofd_warning_list_free(warnings); return 0; } ]=] ROFD_READER_APIS_AVAILABLE) cmake_pop_check_state() if (NOT ROFD_READER_APIS_AVAILABLE) - message(FATAL_ERROR "rofd headers/library lack the region or metadata APIs. Use a matching rofd build containing commits 56da925 and 6db9bac (0.3.0 alone is insufficient), and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") + message(FATAL_ERROR "rofd headers/library lack the region, metadata or warning APIs. Use a matching rofd build containing commits 56da925 and 6db9bac (0.3.0 alone is insufficient), and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") endif() message(STATUS ">>> OFD support enabled (rofd_ffi: ${ROFD_FFI_LIBRARY})") add_compile_definitions(OFD_SUPPORT_ENABLED) diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp index 21fa1e29e..3451230f8 100644 --- a/reader/document/OfdModel.cpp +++ b/reader/document/OfdModel.cpp @@ -104,6 +104,7 @@ OfdDocument::OfdDocument(const QString &filePath, rofd_document_t *document, rof } loadMetadata(); + warningDetails(); qCInfo(appLog) << "OFD document loaded, pages:" << m_pageCount << "dpi:" << m_xRes << m_yRes; } @@ -129,6 +130,7 @@ Page *OfdDocument::page(int index) const rofd_page_t *pageHandle = nullptr; rofd_error_t *rofdError = nullptr; rofd_status_t status = rofd_document_get_page(m_document, static_cast(index), &pageHandle, &rofdError); + warningDetails(); if (status != ROFD_STATUS_OK || nullptr == pageHandle) { qCWarning(appLog) << "Failed to load OFD page:" << index << "message:" << (rofdError ? rofd_error_get_message(rofdError) : "unknown"); @@ -169,7 +171,11 @@ bool OfdDocument::saveAs(const QString &filePath) const Properties OfdDocument::properties() const { - return m_properties; + Properties props = m_properties; + // Warnings grow during lazy page/content loading; never cache this snapshot + // together with the immutable metadata. Each entry owns Code/Path/Message. + props["Warnings"] = warningDetails(); + return props; } QString OfdDocument::fileIdentifier() const @@ -236,6 +242,40 @@ void OfdDocument::loadMetadata() } } +QVariantList OfdDocument::warningDetails() const +{ + QMutexLocker lock(&m_warningMutex); + rofd_warning_list_t *raw = nullptr; + rofd_error_t *error = nullptr; + const rofd_status_t status = rofd_document_get_warnings(m_document, &raw, &error); + const std::unique_ptr warnings(raw, rofd_warning_list_free); + if (status != ROFD_STATUS_OK || !warnings) { + qCWarning(appLog) << "Failed to read OFD warnings:" << status + << (error ? rofd_error_get_message(error) : "unknown"); + rofd_error_free(error); + return {}; + } + rofd_error_free(error); + + QVariantList result; + size_t count = 0; + if (rofd_warning_list_get_count(raw, &count, nullptr) != ROFD_STATUS_OK) + return result; + for (size_t i = 0; i < count; ++i) { + rofd_warning_t warning = {}; + warning.struct_size = sizeof(warning); + if (rofd_warning_list_get_warning(raw, i, &warning, nullptr) != ROFD_STATUS_OK) + continue; + const QString path = QString::fromUtf8(warning.path ? warning.path : ""); + const QString message = QString::fromUtf8(warning.message ? warning.message : ""); + result.append(QVariantMap{{"Code", warning.code}, {"Path", path}, {"Message", message}}); + if (i >= m_loggedWarningCount) + qCWarning(appLog) << "OFD parse warning:" << warning.code << path << message; + } + m_loggedWarningCount = count; + return result; +} + QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, const QRect &slice) const { if (nullptr == pageHandle || width <= 0 || height <= 0 @@ -329,6 +369,7 @@ QImage OfdDocument::renderPage(rofd_page_t *pageHandle, int width, int height, c } else { status = rofd_renderer_render_page_cairo(m_renderer, pageHandle, cr, &options, &report, &rofdError); } + warningDetails(); if (nullptr != report) { size_t diagnosticCount = 0; diff --git a/reader/document/OfdModel.h b/reader/document/OfdModel.h index 6f5609ee1..b9d232023 100644 --- a/reader/document/OfdModel.h +++ b/reader/document/OfdModel.h @@ -11,6 +11,7 @@ #ifdef OFD_SUPPORT_ENABLED #include +#include #include #include @@ -45,11 +46,14 @@ class OfdDocument : public Document private: OfdDocument(const QString &filePath, rofd_document_t *document, rofd_renderer_t *renderer); void loadMetadata(); + QVariantList warningDetails() const; QString m_filePath; rofd_document_t *m_document = nullptr; rofd_renderer_t *m_renderer = nullptr; Properties m_properties; + mutable QMutex m_warningMutex; + mutable size_t m_loggedWarningCount = 0; int m_pageCount = 0; qreal m_xRes = 96.0; qreal m_yRes = 96.0; diff --git a/reader/widgets/AttrScrollWidget.cpp b/reader/widgets/AttrScrollWidget.cpp index 9c11cf1e5..1d2d145d2 100644 --- a/reader/widgets/AttrScrollWidget.cpp +++ b/reader/widgets/AttrScrollWidget.cpp @@ -6,6 +6,7 @@ #include "AttrScrollWidget.h" #include "Utils.h" #include "DocSheet.h" +#include "SheetRenderer.h" #include "WordWrapLabel.h" #include "ddlog.h" #include @@ -47,6 +48,19 @@ AttrScrollWidget::AttrScrollWidget(DocSheet *sheet, DWidget *parent) createLabel(gridLayout, 12, tr("Page size"), sPaperSize); createLabel(gridLayout, 13, tr("File size"), Utils::getInputDataSize(static_cast(fileInfo.size))); + const auto properties = sheet->renderer()->properties(); + const QVariantList warnings = properties.value("Warnings").toList(); + if (!warnings.isEmpty()) { + QStringList messages; + for (const QVariant &value : warnings) { + const QVariantMap warning = value.toMap(); + const QString path = warning.value("Path").toString(); + const QString message = warning.value("Message").toString(); + messages.append(path.isEmpty() ? message : path + QStringLiteral(": ") + message); + } + createLabel(gridLayout, 14, tr("Warnings"), messages.join(QLatin1Char('\n'))); + } + auto vLayout = new QVBoxLayout; vLayout->setContentsMargins(10, 10, 10, 10); diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp index fbc9d78c4..4f90c8623 100644 --- a/tests/document/ut_ofdmodel.cpp +++ b/tests/document/ut_ofdmodel.cpp @@ -258,6 +258,50 @@ TEST(OfdApi, missingMetadataAndInvalidDate) EXPECT_EQ(props.value("CreationDateRaw").toString(), QStringLiteral("not-a-date")); } +TEST(OfdApi, warningSnapshotRefreshesAfterLazyPageLoad) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, "warnings"); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const QVariantList before = doc->properties().value("Warnings").toList(); + EXPECT_TRUE(before.isEmpty()); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + const QVariantList after = doc->properties().value("Warnings").toList(); + ASSERT_EQ(after.size(), 1); + EXPECT_EQ(after.first().toMap().value("Code").toUInt(), ROFD_WARNING_PAGE_AREA_FALLBACK); + EXPECT_EQ(after.first().toMap().value("Path").toString(), QStringLiteral("Page.xml")); + EXPECT_FALSE(after.first().toMap().value("Message").toString().isEmpty()); + EXPECT_TRUE(before.isEmpty()); + std::unique_ptr again(doc->page(0)); + EXPECT_EQ(doc->properties().value("Warnings").toList(), after); +} + +TEST(OfdApi, warningsRefreshAfterRenderingAnnotations) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, "annotation-warning", + "7 11 210 297", + "missing.xml"); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + EXPECT_TRUE(doc->properties().value("Warnings").toList().isEmpty()); + ASSERT_FALSE(page->render(420, 594, QRect(17, 19, 160, 150)).isNull()); + const QVariantList warnings = doc->properties().value("Warnings").toList(); + ASSERT_EQ(warnings.size(), 1); + EXPECT_EQ(warnings.first().toMap().value("Code").toUInt(), ROFD_WARNING_ANNOTATION_SKIPPED); + EXPECT_EQ(warnings.first().toMap().value("Path").toString(), QStringLiteral("missing.xml")); +} + TEST_F(TestOfdModel, semanticFullText) { std::unique_ptr page(m_doc->page(0)); diff --git a/tests/ofd-model/README.md b/tests/ofd-model/README.md index 3d5c9c692..0de5e7cff 100644 --- a/tests/ofd-model/README.md +++ b/tests/ofd-model/README.md @@ -13,7 +13,7 @@ cmake --build build/ofd-model -j1 ctest --test-dir build/ofd-model --output-on-failure ``` -The library must provide the region and metadata APIs added in rofd +The library must provide the region, metadata and warning APIs added in rofd commits `56da925` and `6db9bac`; the initial 0.3.0 release does not include them. Its runtime SONAME (`librofd_ffi.so.0`) must resolve to the same library. Qt Widgets, DTK Core, Cairo, Google Test and CMake are required. Fixtures are @@ -22,4 +22,4 @@ created in temporary directories using `cmake -E tar --format=zip`. Coverage includes full and tiled rendering, nonzero physical page origins, small tiles on canvases larger than 4 GiB, pre-allocation raster limits, real-invoice pixel comparisons, search/selection, metadata/DocID, missing or -invalid dates. +invalid dates, and fresh warning snapshots after lazy page and annotation loads. diff --git a/translations/deepin-reader_zh_CN.ts b/translations/deepin-reader_zh_CN.ts index fbf90658d..85b2adc90 100755 --- a/translations/deepin-reader_zh_CN.ts +++ b/translations/deepin-reader_zh_CN.ts @@ -85,6 +85,10 @@ File size 文件大小 + + Warnings + 文档警告 + Basic info @@ -945,4 +949,4 @@ 无界面批量打印文档。 - \ No newline at end of file + diff --git a/translations/deepin-reader_zh_HK.ts b/translations/deepin-reader_zh_HK.ts index 0f5ac29fe..913799c59 100755 --- a/translations/deepin-reader_zh_HK.ts +++ b/translations/deepin-reader_zh_HK.ts @@ -86,6 +86,10 @@ File size 文件大小 + + Warnings + 文件警告 + Basic info diff --git a/translations/deepin-reader_zh_TW.ts b/translations/deepin-reader_zh_TW.ts index fd44f2c35..24a783ab8 100755 --- a/translations/deepin-reader_zh_TW.ts +++ b/translations/deepin-reader_zh_TW.ts @@ -86,6 +86,10 @@ File size 檔案大小 + + Warnings + 文件警告 + Basic info From 43b1783dd2c1a8aefcc60239601ccf3b5e373494 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 08:00:37 +0800 Subject: [PATCH 09/63] docs(ofd): record semantic text integration design and plan --- .../plans/2026-09-10-ofd-semantic-text.md | 106 ++++++++++++++++++ .../2026-09-10-ofd-semantic-text-design.md | 62 ++++++++++ 2 files changed, 168 insertions(+) create mode 100644 docs/superpowers/plans/2026-09-10-ofd-semantic-text.md create mode 100644 docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md diff --git a/docs/superpowers/plans/2026-09-10-ofd-semantic-text.md b/docs/superpowers/plans/2026-09-10-ofd-semantic-text.md new file mode 100644 index 000000000..9ceaf16d4 --- /dev/null +++ b/docs/superpowers/plans/2026-09-10-ofd-semantic-text.md @@ -0,0 +1,106 @@ +# OFD Semantic Text Integration Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Make OFD documents participate in the reader's existing text extraction, search, selection, and copy workflows using the current `rofd` semantic C ABI. + +**Architecture:** Keep semantic adaptation inside `OfdPage`. Convert between physical-page millimetres and reader logical pixels at the boundary, use owned result handles per query, and expose character layout through the existing `Word` list. + +**Tech Stack:** C++17, Qt Core/Gui, GoogleTest, `rofd` stable C ABI + +--- + +### Task 1: Fixture-backed semantic behavior + +**Files:** +- Modify: `tests/document/ut_ofdmodel.cpp` + +- [ ] **Step 1: Add failing tests** + +Add tests that load `normal.ofd`, require non-empty full-page text, extract text +from the first returned word rectangle, verify case-sensitive and whole-word +search filtering, and require non-empty `words()` entries with valid geometry. + +- [ ] **Step 2: Run the focused tests and verify RED** + +Run: + +```bash +QT_QPA_PLATFORM=offscreen build-semantic/tests/test-deepin-reader \ + --gtest_filter='TestOfdModel.semantic*' +``` + +Expected: the text, search, and words assertions fail because `OfdPage` still +returns empty values. + +### Task 2: Coordinate-safe semantic adapter + +**Files:** +- Modify: `reader/document/OfdModel.h` +- Modify: `reader/document/OfdModel.cpp` +- Test: `tests/document/ut_ofdmodel.cpp` + +- [ ] **Step 1: Store physical page geometry and declare `words()`** + +Add `QList words() override`, store the page's complete `rofd_rect_t`, and +declare private `toMillimetres` and `toPixels` rectangle helpers. + +- [ ] **Step 2: Implement owned-string extraction** + +Use `rofd_page_get_text` for a null rectangle and +`rofd_page_get_text_for_area` otherwise. Convert the borrowed UTF-8 bytes with +an explicit length before freeing `rofd_string_t`. + +- [ ] **Step 3: Implement semantic search** + +Initialize `rofd_find_options_t`, set `ROFD_FIND_CASE_SENSITIVE` and +`ROFD_FIND_WHOLE_WORDS` as requested, enumerate matches, convert each match +rectangle, and append `PageSection{PageLine{QString(), rect}}`. + +- [ ] **Step 4: Implement selectable character layout** + +Acquire canonical text and a layout snapshot, skip synthesized separators and +zero-area geometry, validate every UTF-8 span, and append one `Word` per scalar +using the converted rectangle. + +- [ ] **Step 5: Run focused tests and verify GREEN** + +Run the semantic test filter and expect every new test to pass. + +### Task 3: Build contract and regression verification + +**Files:** +- Modify only if required by configure checks: `CMakeLists.txt` +- Modify: `debian/control` only after the semantic package version is known + +- [ ] **Step 1: Configure against local current `rofd main`** + +Build `rofd-ffi` into an isolated `/tmp` target, then configure a fresh reader +build using `-DROFD_ROOT=/home/hualet/projects/hualet/rofd` and the matching +library directory. + +- [ ] **Step 2: Build the reader and tests** + +Run the normal CMake build for `test-deepin-reader` and `deepin-reader`. + +- [ ] **Step 3: Run all OFD model tests** + +Run: + +```bash +QT_QPA_PLATFORM=offscreen build-semantic/tests/test-deepin-reader \ + --gtest_filter='TestOfdModel.*' +``` + +Expected: all OFD model tests pass. + +- [ ] **Step 4: Run the complete document-model test subset** + +Run the repository's document model test filters and report any unrelated +pre-existing failures separately. + +- [ ] **Step 5: Inspect the final diff** + +Confirm only the OFD adapter, OFD tests, and approved build-contract changes are +present. Leave implementation changes uncommitted until the user requests a +commit. diff --git a/docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md b/docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md new file mode 100644 index 000000000..240cbec98 --- /dev/null +++ b/docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md @@ -0,0 +1,62 @@ +# OFD Semantic Text Integration Design + +## Scope + +Connect the semantic text API already available in the current `rofd` C ABI to +the existing `deepin_reader::Page` abstraction. The change implements OFD page +text extraction, text search, and selectable character geometry. It does not +add OFD-specific UI or attempt metadata, outline, links, annotations, native +writing, or tiled rendering, because those still require new `rofd` APIs. + +## Architecture + +`OfdPage` remains the only adapter between `deepin-reader` page semantics and +`rofd`. It stores the physical page rectangle returned by +`rofd_page_get_size_mm`, then uses small private conversion helpers for physical +millimetres and the logical page-pixel coordinate system used by the reader. + +Each public query creates and frees its own immutable `rofd` result handle. No +mutable semantic cache is shared between render and search worker threads. +This follows the existing adapter structure and the C ABI's concurrent +read-only handle contract. + +## Data Flow + +- `text(rect)` converts the requested logical-pixel rectangle to physical-page + millimetres and calls `rofd_page_get_text_for_area`. A null rectangle requests + the full canonical page text through `rofd_page_get_text`. +- `search(query, matchCase, wholeWords)` initializes + `rofd_find_options_t`, maps the two reader flags to `ROFD_FIND_*`, and turns + every match rectangle into one `PageSection` containing one `PageLine`. +- `words()` gets canonical UTF-8 text plus its layout snapshot. Every + non-synthesized scalar with valid geometry becomes one `Word`; its text is + decoded from the canonical string using the layout's byte offset and length. + One scalar per `Word` matches the existing selection overlay contract. + +## Coordinates + +The reader expresses page text geometry in logical pixels at the document's X +and Y logical DPI. `rofd` expresses geometry in physical-page millimetres. +Conversions include the physical page rectangle's X/Y origin: + +``` +mm.x = physical.x + px.x * 25.4 / xDpi +px.x = (mm.x - physical.x) * xDpi / 25.4 +``` + +The same formula applies independently to Y, width, and height. + +## Error Handling + +Invalid handles, empty search input, invalid rectangles, invalid UTF-8 spans, +and failed C ABI queries return the empty result expected by `Page`. Owned +`rofd` handles are always freed. ABI failures are logged with page index, +status, and the optional error message. + +## Verification + +Fixture-backed tests prove full and area text extraction, case-sensitive and +whole-word search behavior, search rectangles, and selectable character text +and geometry. The tests are first run against the current stubs to demonstrate +the intended failures, then rerun against the implementation using a local +build of the latest `rofd main` semantic ABI. From dd71914217be14ce692553906d312cdf90a84a07 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 09:19:07 +0800 Subject: [PATCH 10/63] docs(ofd): define outline and page link integration --- .../specs/2026-09-11-ofd-navigation-design.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 docs/superpowers/specs/2026-09-11-ofd-navigation-design.md diff --git a/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md b/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md new file mode 100644 index 000000000..1ff769215 --- /dev/null +++ b/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md @@ -0,0 +1,146 @@ +# OFD 目录与页面链接接入设计 + +## 范围与基线 + +在现有 OFD 渲染、语义文本、元数据和警告支持上,接入 rofd 的目录树、 +跳转目标和页面链接,复用 reader 的侧栏、页面交互及安全确认界面。 + +本次核对的 rofd main 为 `2331199`,包含: + +- `56da925`:像素区域渲染,reader 已接入。 +- `6db9bac`:元数据和警告,reader 已接入。 +- `9e4a169`:目录、动作与目标,本次接入。 +- `2331199`:页面链接映射,本次接入。 + +不增加附件提取、附件执行、自动动作、脚本、注释编辑或文件写回。 +不重构 PDF/XPS 后端,也不把 rofd 的矩形链接范围描述为精确路径命中。 + +## 架构与兼容性 + +为公共模型增加可选的导航目标,由目录项和页面链接共同使用。目标区分 +页内跳转与外部 URI;页内目标保存零基页码、目标模式、可选坐标和缩放。 +可选值必须区分缺省与显式零,不能只靠浮点数是否为零判断字段存在。 + +`Section`、`Link` 保留原有字段和默认行为。PDF/XPS 等未提供新目标的 +对象继续走原路径;OFD 使用新路径,不复用目录跳转中 PDF 风格的 Y 轴翻转。 +目录项另保存可选的初始展开状态,避免改变其它格式的默认展开行为。 + +职责分配: + +- `OfdDocument`:获取目录快照、转换树和导航目标,缓存目标页尺寸。 +- `OfdPage`:获取并缓存页面链接,完成命中查询,不执行任何动作。 +- 公共导航转换/计算辅助代码:校验目标、转换坐标、计算缩放与滚动位置; + 将可独立验证的计算从大型浏览器类中分离。 +- `CatalogTreeView`:完整展示树,将目录用户操作交给导航入口。 +- `DocSheet` / `SheetBrowser`:执行目标,更新缩放、布局、滚动及当前页; + 外链复用 `SecurityDialog`,适配层不调用桌面服务。 + +## 目录树 + +实现 `OfdDocument::outline()`,并为 OFD 开启 `PREVIEW_CATALOG`。 +按 rofd 的父子关系与源顺序转换完整目录,不依赖源文件的建议子节点数量。 +校验关系索引,遍历必须有界,不因深层目录造成无限递归。 + +目录展示不再限制为三层。没有动作、目标失效、动作不支持的节点仍保留标题 +和子树,页码栏留空,不能把 `-1` 或 `ROFD_NO_INDEX` 显示或解释为第一页。 +这些节点可以展开和选择,但选择不触发跳转。 + +首次显示使用 OFD 的 `expanded` 值;已有阅读记录中的展开状态优先。 +刷新模型、恢复展开状态、随当前页同步选中项均不能执行动作。 +用户鼠标或键盘激活每次最多执行一次;外链不能因选中项变化而自动弹窗。 + +## 目标语义与坐标 + +rofd 已解析 PageID 和命名书签。仅在 `HAS_PAGE_INDEX` 存在、索引未越界 +且模式受支持时建立可执行的页内目标;未知模式与未解析目标不执行。 +零基页码仅在兼容旧 `Link.page` 等一基字段时加一。 + +坐标先转换为目标页未旋转、未缩放的逻辑像素: + +```text +x = (left_mm - physical_page.x) * xDpi / 25.4 +y = (top_mm - physical_page.y) * yDpi / 25.4 +``` + +使用目标页的物理原点,而不是源链接所在页的原点。右、下边界做同样转换。 +缺省坐标不参与换算,不能把缺省的零减去物理原点。旋转只在视图映射时处理, +通过页面到场景的变换定位,避免重复旋转或重复应用对象 CTM。 + +执行模式: + +- `XYZ`:应用明确指定的坐标;缺省轴保留激活前视口相对当前页的位置, + 映射到目标页后受页面和滚动范围限制。缩放缺省或为零时保持当前比例; + 正值作为倍率交给 reader 的比例限制逻辑,负值或非有限值拒绝。 +- `Fit`:按目标整页与可用视口计算比例,定位目标页。 +- `FitH`:按目标页宽度适配,应用可选 Top;Top 缺省时沿用上述缺省轴策略。 +- `FitV`:按目标页高度适配,应用可选 Left;Left 缺省时沿用上述缺省轴策略。 +- `FitR`:要求四条边界均存在、有限且形成正面积矩形;适配并定位该区域。 + 不完整或退化矩形不执行,不悄悄变成整页或第一页跳转。 + +所有模式遵守 reader 当前缩放上下限,不绕过大页面的安全比例限制。 +适配比例根据目标页/目标区域计算,不直接借用基于文档最大页尺寸的全局 +适配结果。旋转和双页布局纳入可用视口与场景变换计算。 + +## 页面链接与动作策略 + +实现 `OfdPage::getLinkAtPoint()`。首次查询生成 Qt 自有的不可变链接缓存, +包含命中范围和可执行目标;空列表也作为已加载状态缓存,鼠标移动不重复 +构造快照或解析页面。初始化同步保护,失败保留失败状态并记录诊断,避免 +每次悬停重复失败和刷日志。 + +仅考虑 `CLICK` 动作。按 rofd 返回的源顺序选择第一个命中且受支持的动作, +每次激活最多执行一个,不连带执行同区域的其它动作。目录中的动作使用相同 +筛选策略。文档打开、页面打开和未知事件始终不执行。 + +一个链接的多个矩形独立参与命中,不能合并成覆盖中间空白的大包围盒。 +矩形已经包含 rofd 应用的对象与祖先变换,只做页面原点和 DPI 换算。 +命中能力以 rofd 提供的保守矩形为界,不承诺裁剪、遮挡或曲线路径的精确命中。 + +URI 先使用显式 Base 解析,再校验最终地址。首轮只允许有效的绝对 +`http`、`https`、`mailto` 地址;没有可用 Base 的相对地址不猜测为本地文件。 +`file`、其它协议、附件 GotoA 和未知动作均不可执行。 +安全确认对话框显示最终将打开的地址;用户取消时不调用外部程序。 +此限制只作用于新 OFD 导航,不改变其它格式已有的外链策略。 + +## 资源、警告与错误 + +所有 rofd 输出记录初始化 `struct_size`,遵守 `HAS_*` 和 `ROFD_NO_INDEX`。 +快照用 RAII 释放;标题、URI 和其它借用字符串在释放前复制为 Qt 自有数据。 +文档/页面所有者销毁前结束相关查询,不跨线程共享可变输出槽。 + +目录、目标页尺寸和链接查询可能触发惰性解析。完成查询后刷新现有警告接口, +复用文档警告去重与属性展示。导航失败不影响已有渲染或文本查询。 +目录与页面链接分别缓存,目录失败不能阻止 rofd 本可独立提供的链接查询。 + +## 构建与交付边界 + +更新本地构建使用的配套 rofd 头文件和共享库;CMake 增加目录、目标与链接 +符号检查,避免旧库带着相同版本号通过配置后才在链接阶段失败。 +不在源码提交中加入生成的共享库。rofd 当前仍标为 0.3.0,不虚构软件包版本; +发行版依赖下限在上游正式抬升版本后再更新。 + +实现分两项审查与交付: + +1. 目录、公共导航目标与跳转执行,包括侧栏、完整树、坐标、模式及共享动作 + 安全策略;目录外链同样需要显式激活和确认。 +2. 页面链接与命中缓存,复用第一项的页内跳转及外链安全策略,并补充页面 + 点击和悬停场景的验证。 + +## 验收 + +先增加回归测试并确认未接入时失败,再实现;继续使用不链接 PDFium 的轻量 +OFD 测试目标。为目录模型和纯导航计算增加独立轻量覆盖,不构建或链接 +`test-deepin-reader` 聚合测试程序。 + +必须覆盖: + +- 空目录、无目标父节点、四层以上目录、初始展开状态和恢复状态优先级。 +- PageID 与命名书签、缺失目标、未知模式、缺省坐标、显式零、`Zoom=0`。 +- 非零物理原点、跨不同尺寸页面、五种目标模式、旋转与双页布局。 +- 单链接多个矩形、中间空白不命中、重叠链接的确定性选择、空/失败缓存。 +- 非 CLICK 事件、附件动作、URI/Base 解析、协议限制和用户取消外链确认。 +- 新增惰性导航警告,以及未设置新目标时 PDF/XPS 仍走原有路径。 + +最终只以 `cmake --build build --target deepin-reader -j1` 构建 reader 本体, +检查实际加载的 rofd 库,并用受控 OFD 做真实窗口的目录/链接交互验证。 +界面验证与后台测试分别报告,不把适配层测试通过当成用户交互已验证。 From 0a4db28641ece92cac4ea999195385eeba6662bd Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 09:31:21 +0800 Subject: [PATCH 11/63] docs(ofd): plan navigation and page link integration --- .../plans/2026-09-11-ofd-navigation.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 docs/superpowers/plans/2026-09-11-ofd-navigation.md diff --git a/docs/superpowers/plans/2026-09-11-ofd-navigation.md b/docs/superpowers/plans/2026-09-11-ofd-navigation.md new file mode 100644 index 000000000..046566ccd --- /dev/null +++ b/docs/superpowers/plans/2026-09-11-ofd-navigation.md @@ -0,0 +1,162 @@ +# OFD Navigation Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox syntax for tracking. + +**Goal:** Expose OFD outlines and clickable page links without losing destination semantics or enabling automatic actions. + +**Architecture:** Add optional typed navigation values to the existing model. A pure view calculator and URI validator are shared by outline and page-link activation; rofd remains behind the OFD adapter. Preserve legacy PDF/XPS navigation when the optional value is absent. + +**Tech Stack:** C++17, Qt Widgets, rofd 0.4.0 C ABI, GoogleTest, CMake. + +## Execution and build boundaries + +Use the approved design at `docs/superpowers/specs/2026-09-11-ofd-navigation-design.md`. +The isolated worktree is `/tmp/deepin-reader-ofd-nav.bx98sU/tree`; the baseline is +`e50708ff`. The paired rofd header/library are in the sibling `rofd/` directory. +Upstream advanced to `35cb164` / 0.4.0 after design approval, so update the package +minimum instead of retaining the design's historical 0.3.0 limitation. + +Run only focused tests and the reader target, with `-j1`. Never build the +`test-deepin-reader` aggregate. The clean baseline passes all 19 OFD tests. + +```sh +cmake -S tests/ofd-model -B build/ofd-model \ + -DROFD_INCLUDE_DIR=/tmp/deepin-reader-ofd-nav.bx98sU/rofd/include \ + -DROFD_FFI_LIBRARY=/tmp/deepin-reader-ofd-nav.bx98sU/rofd/librofd_ffi.so +cmake --build build/ofd-model -j1 +ctest --test-dir build/ofd-model --output-on-failure +``` + +### Task 1: Typed targets and pure navigation calculations + +**Files:** Create `reader/document/Navigation.h`, `Navigation.cpp`, +`tests/document/ut_navigation.cpp`; modify `reader/document/Model.h` and +`tests/ofd-model/CMakeLists.txt`. + +- [ ] Add tests first for missing/zero fields, all five modes, invalid rectangles, + scale limits, 90/180/270-degree rotation, double-page viewport allocation, + allowed URI resolution, rejected file/relative/unknown URI, and legacy defaults. +- [ ] Run the focused target and capture the missing-behavior failure before implementation. +- [ ] Implement this shared contract (namespace `deepin_reader`): + +```cpp +enum class DestinationMode { XYZ, Fit, FitH, FitV, FitR }; +struct NavigationDestination { + int pageIndex = -1; + DestinationMode mode = DestinationMode::XYZ; + std::optional left, top, right, bottom, zoom; + bool isValid() const; +}; +struct NavigationTarget { + std::optional destination; + QUrl uri; + bool isValid() const; +}; +struct NavigationView { + qreal scale = 1; + QRectF focusRect; // unscaled page coordinates; zero-size rectangle for a point +}; +QUrl resolveNavigationUri(const QString &uri, const QString &base = QString()); +std::optional navigationView( + const NavigationDestination &destination, const QSizeF &pageSize, + const QSizeF &viewportSize, const QPointF ¤tPosition, + qreal currentScale, qreal maximumScale, int rotationDegrees, bool twoPages); +``` + + `Section` and `Link` gain `std::optional navigation`; + `Section` additionally gains `std::optional expanded`. Register the + target metatype. Absent navigation retains old `Link::isValid()` behavior; + present navigation is checked on its own, never falling back to stale fields. + Calculate fit scale using rotated bounds and half viewport width for two pages, + clamp to `[0.1, maximumScale]`, reject non-finite inputs and invalid FitR. + XYZ defaults use currentPosition; zoom absent/zero preserves currentScale. + URI resolution accepts only absolute HTTP/HTTPS with host and nonempty mailto, + uses QUrl strict parsing and explicit Base, and never performs I/O. +- [ ] Verify all tests, including `Link legacy; legacy.page = 1; EXPECT_TRUE(legacy.isValid());`. +- [ ] Review the exact diff for spec compliance, then code quality, before consuming the contract. + +### Task 2: OFD outlines and destinations + +**Files:** Modify `reader/document/OfdModel.h`, `OfdModel.cpp`, +`tests/document/ut_ofdmodel.cpp`, `CMakeLists.txt`, `debian/control`. + +- [ ] Add controlled two-page OFD fixtures with page origins `(7,11)` and `(3,5)`, + nested titles four levels deep, a non-clickable parent, named and explicit + destinations, zero/omitted fields, invalid targets and non-CLICK actions. + First assertion against the current stub is `ASSERT_EQ(doc->outline().size(), 1);`. +- [ ] Run and observe the empty-outline failure. +- [ ] Implement `Outline outline() const override` with a mutex-protected cache, + including empty/failed results. Convert preorder nodes in reverse index order + into the tree after validating parent-before-child indices; retain invalid-target + nodes without a page number. Copy all strings before releasing the RAII snapshot. + A document helper maps rofd actions/destinations to Task 1's values and lazily + caches target-page physical rectangles. Only CLICK Goto or allowed URI actions + become targets; preserve optional coordinates and use target-page origins. +- [ ] Probe outline/destination functions at configure time and require + `librofd-ffi-dev (>= 0.4.0)`; refresh warnings after lazy navigation queries. +- [ ] Verify geometry with `EXPECT_NEAR(*target.destination->left, (13-3)*dpi/25.4, 1e-6);`, + unresolved page targets remain absent, and repeated outline calls are stable. +- [ ] Run spec review then quality review; checkpoint the scoped backend change. + +### Task 3: Complete catalog and view execution + +**Files:** Create `reader/sidebar/CatalogOutlineModel.h/.cpp` and +`tests/document/ut_catalogoutlinemodel.cpp`; modify `CatalogTreeView.h/.cpp`, +`reader/uiframe/DocSheet.h/.cpp`, `reader/browser/SheetBrowser.h/.cpp`, +`tests/ofd-model/CMakeLists.txt`. + +- [ ] Test model construction first: a targetless root with a four-level child + must remain present, have a blank page column, retain navigation/expansion roles, + and expose the leaf. Preserve legacy page and offset roles. +- [ ] Observe a failing model test, then implement reusable iterative tree-to-item + population. Bind both columns to the same target. CatalogTreeView uses it, + expands OFD defaults, and does not activate targets while populating or syncing. +- [ ] Add `bool navigateTo(const deepin_reader::NavigationTarget &)` to SheetBrowser + and a forwarding DocSheet method. Validate page count before changing state. + Compute currentPosition by mapping viewport origin to the current page and + dividing by current scale. Apply Task 1's view, call setScaleFactor, and map + focusRect at the actual resulting scale through the target item's scene transform + before setting scrollbars and notifying the current page. +- [ ] For a typed URI, revalidate, display the final URL in SecurityDialog, and + call QDesktopServices only after Accepted. Share this path with Task 4. +- [ ] Enable PREVIEW_CATALOG for OFD. Typed outline actions execute on explicit + click or keyboard activation exactly once, not currentChanged; legacy paths + remain unchanged. Stored expansion state, including all-collapsed state, wins + over defaults when the catalog is opened lazily. +- [ ] Verify model/calculator tests and reader compilation; exercise actual + outline activation, rotation and cancellation in a controlled app window. +- [ ] Spec review then quality review; checkpoint directory/navigation integration. + +### Task 4: Page link adapter and shared activation + +**Files:** Modify `reader/document/OfdModel.h/.cpp`, +`tests/document/ut_ofdmodel.cpp`, `reader/browser/SheetBrowser.cpp`, `CMakeLists.txt`. + +- [ ] Add links to controlled fixtures with separated regions, overlaps, + transformed bounds, CLICK/PO/DO events, URI/Base and GotoA actions. + First assertion against the stub is `EXPECT_TRUE(page->getLinkAtPoint(hit).isValid());`. +- [ ] Run and observe that missing-link failure. +- [ ] Implement a per-page immutable Qt-owned link cache guarded during init. + Preserve source order, use the first supported hit, and union independent + rectangles as paths without filling the gaps. Copy borrowed data before freeing + the snapshot. Empty/failed lists are cached. Reuse Task 2 conversion and refresh + warnings after rofd_page_get_links. No adapter action executes external code. +- [ ] `SheetBrowser::jump2Link` calls navigateTo when `link.navigation` exists; + otherwise preserves the old PDF/XPS path. Keep resolved URI text for hover tips. +- [ ] Extend CMake symbol checks and tests for gaps, deterministic overlap, + unsafe targets, failure isolation from outlines and repeated queries. +- [ ] Run spec review then quality review; checkpoint page-link integration. + +### Task 5: Integrated validation and delivery + +**Files:** Update `tests/ofd-model/README.md` and this checklist with actual results. + +- [ ] Run `git diff --check`, all focused tests, and inspect linked rofd SONAME. +- [ ] Build only `deepin-reader -j1`, reusing the existing PDFium build where possible. +- [ ] Verify real window catalog depth/activation, page link hover/click, rotation, + scale changes and external-link cancellation. Do not visit test URLs. +- [ ] Check legacy PDF/XPS targets keep their prior path and no new automatic actions + occur on opening a document, restoring state or selecting a catalog item. +- [ ] Review the entire diff after task reviews, report exact evidence and any + unverified conditions. Keep outline/navigation and page links separable in history; + do not push or merge to main without the user's request. From edf7931d9f027fc02e4106b037123cb5b97c96f9 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 09:56:51 +0800 Subject: [PATCH 12/63] feat(reader): add typed navigation targets and view calculations --- reader/document/Model.h | 6 + reader/document/Navigation.cpp | 153 +++++++++++ reader/document/Navigation.h | 57 ++++ tests/document/ut_navigation.cpp | 436 +++++++++++++++++++++++++++++++ tests/ofd-model/CMakeLists.txt | 3 + 5 files changed, 655 insertions(+) create mode 100644 reader/document/Navigation.cpp create mode 100644 reader/document/Navigation.h create mode 100644 tests/document/ut_navigation.cpp diff --git a/reader/document/Model.h b/reader/document/Model.h index 604ef74ba..e1681865c 100644 --- a/reader/document/Model.h +++ b/reader/document/Model.h @@ -7,6 +7,7 @@ #define DOCUMENTMODEL_H #include "Global.h" +#include "Navigation.h" #include "dpdfpage.h" #include @@ -40,6 +41,7 @@ struct Link { qreal left = 0; qreal top = 0; QString urlOrFileName; + std::optional navigation; Link() : boundary(), page(-1), left(0.0), top(0.0), urlOrFileName() {} Link(const QPainterPath &boundary, int page, qreal left = 0.0, qreal top = 0.0) : boundary(boundary), page(page), left(left), top(top), urlOrFileName() {} Link(const QRectF &boundingRect, int page, qreal left = 0.0, qreal top = 0.0) : boundary(), page(page), left(left), top(top), urlOrFileName() { boundary.addRect(boundingRect); } @@ -50,6 +52,8 @@ struct Link { bool isValid() const { + if (navigation) + return navigation->isValid(); return page >= 1 || !urlOrFileName.isEmpty(); } }; @@ -67,6 +71,8 @@ struct Section { QPointF offsetPointF; QString title; Outline children; + std::optional navigation; + std::optional expanded; }; struct Word { diff --git a/reader/document/Navigation.cpp b/reader/document/Navigation.cpp new file mode 100644 index 000000000..61d29de27 --- /dev/null +++ b/reader/document/Navigation.cpp @@ -0,0 +1,153 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "Navigation.h" + +#include +#include + +namespace deepin_reader { + +namespace { + +constexpr qreal minimumScale = 0.1; + +bool finiteOptional(const std::optional &value) +{ + return !value || std::isfinite(*value); +} + +bool positiveFiniteSize(const QSizeF &size) +{ + return std::isfinite(size.width()) && size.width() > 0 + && std::isfinite(size.height()) && size.height() > 0; +} + +bool allowedUri(const QUrl &uri) +{ + if (!uri.isValid() || uri.isEmpty() || uri.isRelative()) + return false; + + const QString scheme = uri.scheme(); + if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) + return !uri.host().isEmpty(); + if (scheme == QLatin1String("mailto")) + return !uri.path().trimmed().isEmpty(); + return false; +} + +} // namespace + +bool NavigationDestination::isValid() const +{ + if (pageIndex < 0 || !finiteOptional(left) || !finiteOptional(top) + || !finiteOptional(right) || !finiteOptional(bottom) || !finiteOptional(zoom) + || (zoom && *zoom < 0)) { + return false; + } + + switch (mode) { + case DestinationMode::XYZ: + case DestinationMode::Fit: + case DestinationMode::FitH: + case DestinationMode::FitV: + return true; + case DestinationMode::FitR: + return left && top && right && bottom && *right > *left && *bottom > *top + && std::isfinite(*right - *left) && std::isfinite(*bottom - *top); + } + return false; +} + +bool NavigationTarget::isValid() const +{ + if (destination) + return uri.isEmpty() && destination->isValid(); + return allowedUri(uri); +} + +QUrl resolveNavigationUri(const QString &uri, const QString &base) +{ + if (uri.isEmpty()) + return {}; + + QUrl resolved(uri, QUrl::StrictMode); + if (!resolved.isValid()) + return {}; + if (resolved.isRelative()) { + const QUrl baseUrl(base, QUrl::StrictMode); + if (!allowedUri(baseUrl) + || (baseUrl.scheme() != QLatin1String("http") + && baseUrl.scheme() != QLatin1String("https"))) { + return {}; + } + resolved = baseUrl.resolved(resolved); + } + return allowedUri(resolved) ? resolved : QUrl(); +} + +std::optional navigationView(const NavigationDestination &destination, + const QSizeF &pageSize, const QSizeF &viewportSize, + const QPointF ¤tPosition, qreal currentScale, + qreal maximumScale, int rotationDegrees, bool twoPages) +{ + if (!destination.isValid() || !positiveFiniteSize(pageSize) || !positiveFiniteSize(viewportSize) + || !std::isfinite(currentPosition.x()) || !std::isfinite(currentPosition.y()) + || !std::isfinite(currentScale) || currentScale <= 0 + || !std::isfinite(maximumScale) || maximumScale < minimumScale + || rotationDegrees % 90 != 0) { + return std::nullopt; + } + + const qreal availableWidth = viewportSize.width() / (twoPages ? 2 : 1); + if (availableWidth <= 0) + return std::nullopt; + + const bool quarterTurn = rotationDegrees % 180 != 0; + const qreal pageWidth = quarterTurn ? pageSize.height() : pageSize.width(); + const qreal pageHeight = quarterTurn ? pageSize.width() : pageSize.height(); + QPointF position(destination.left.value_or(currentPosition.x()), + destination.top.value_or(currentPosition.y())); + NavigationView result; + result.scale = currentScale; + + switch (destination.mode) { + case DestinationMode::XYZ: + if (destination.zoom && *destination.zoom > 0) + result.scale = *destination.zoom; + break; + case DestinationMode::Fit: + result.scale = std::min(availableWidth / pageWidth, viewportSize.height() / pageHeight); + result.focusRect = QRectF(QPointF(), pageSize); + break; + case DestinationMode::FitH: + result.scale = availableWidth / pageWidth; + position.setX(0); + break; + case DestinationMode::FitV: + result.scale = viewportSize.height() / pageHeight; + position.setY(0); + break; + case DestinationMode::FitR: { + const qreal width = *destination.right - *destination.left; + const qreal height = *destination.bottom - *destination.top; + result.scale = std::min(availableWidth / (quarterTurn ? height : width), + viewportSize.height() / (quarterTurn ? width : height)); + result.focusRect = QRectF(*destination.left, *destination.top, width, height); + break; + } + } + + if (destination.mode == DestinationMode::XYZ || destination.mode == DestinationMode::FitH + || destination.mode == DestinationMode::FitV) { + position.setX(std::clamp(position.x(), qreal(0), pageSize.width())); + position.setY(std::clamp(position.y(), qreal(0), pageSize.height())); + result.focusRect = QRectF(position, QSizeF(0, 0)); + } + // Finite positive inputs can still overflow a fitting ratio; the reader limit + // bounds that ratio before it reaches any caller or graphics transform. + result.scale = std::clamp(result.scale, minimumScale, maximumScale); + return result; +} + +} // namespace deepin_reader diff --git a/reader/document/Navigation.h b/reader/document/Navigation.h new file mode 100644 index 000000000..e71188f24 --- /dev/null +++ b/reader/document/Navigation.h @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef DOCUMENTNAVIGATION_H +#define DOCUMENTNAVIGATION_H + +#include +#include +#include +#include +#include +#include + +#include + +namespace deepin_reader { + +enum class DestinationMode { XYZ, Fit, FitH, FitV, FitR }; + +struct NavigationDestination { + // Zero-based page index and unscaled page coordinates. Missing fields retain + // their presence semantics; in XYZ, absent or zero zoom keeps the current scale. + int pageIndex = -1; + DestinationMode mode = DestinationMode::XYZ; + std::optional left, top, right, bottom, zoom; + + bool isValid() const; +}; + +struct NavigationTarget { + std::optional destination; + QUrl uri; + + bool isValid() const; +}; + +struct NavigationView { + qreal scale = 1; + // Unscaled page coordinates; a point is represented by a zero-size rectangle. + QRectF focusRect; +}; + +QUrl resolveNavigationUri(const QString &uri, const QString &base = QString()); + +// Fits use rotated page bounds and half the viewport width in two-page mode. +// The returned scale is bounded to [0.1, maximumScale], and focusRect remains in +// unscaled page coordinates for the caller to map through the actual scene item. +std::optional navigationView(const NavigationDestination &destination, + const QSizeF &pageSize, const QSizeF &viewportSize, + const QPointF ¤tPosition, qreal currentScale, + qreal maximumScale, int rotationDegrees, bool twoPages); + +} // namespace deepin_reader + +Q_DECLARE_METATYPE(deepin_reader::NavigationTarget) + +#endif // DOCUMENTNAVIGATION_H diff --git a/tests/document/ut_navigation.cpp b/tests/document/ut_navigation.cpp new file mode 100644 index 000000000..616e14cae --- /dev/null +++ b/tests/document/ut_navigation.cpp @@ -0,0 +1,436 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "Navigation.h" +#include "Model.h" + +#include +#include +#include + +using namespace deepin_reader; + +namespace { + +NavigationDestination destination(DestinationMode mode = DestinationMode::XYZ) +{ + NavigationDestination result; + result.pageIndex = 0; + result.mode = mode; + return result; +} + +std::optional view(const NavigationDestination &target, int rotation = 0, + bool twoPages = false) +{ + return navigationView(target, QSizeF(200, 400), QSizeF(800, 600), QPointF(31, 47), + 1.25, 10, rotation, twoPages); +} + +constexpr qreal infinity = std::numeric_limits::infinity(); +constexpr qreal notANumber = std::numeric_limits::quiet_NaN(); + +} // namespace + +TEST(NavigationValue, preservesMissingAndExplicitZeroFields) +{ + NavigationDestination target; + EXPECT_EQ(target.pageIndex, -1); + EXPECT_EQ(target.mode, DestinationMode::XYZ); + EXPECT_FALSE(target.isValid()); + EXPECT_FALSE(target.left.has_value()); + EXPECT_FALSE(target.top.has_value()); + EXPECT_FALSE(target.right.has_value()); + EXPECT_FALSE(target.bottom.has_value()); + EXPECT_FALSE(target.zoom.has_value()); + + target = destination(); + EXPECT_TRUE(target.isValid()); + target.left = target.top = target.zoom = 0; + EXPECT_TRUE(target.isValid()); + EXPECT_EQ(target.left, std::optional(0)); + EXPECT_EQ(target.top, std::optional(0)); + EXPECT_EQ(target.zoom, std::optional(0)); +} + +TEST(NavigationValue, validatesEveryModeAndRejectsUnknownMode) +{ + for (auto mode : {DestinationMode::XYZ, DestinationMode::Fit, + DestinationMode::FitH, DestinationMode::FitV}) { + EXPECT_TRUE(destination(mode).isValid()); + } + EXPECT_FALSE(destination(static_cast(999)).isValid()); + auto target = destination(); + target.pageIndex = -2; + EXPECT_FALSE(target.isValid()); +} + +TEST(NavigationValue, fitRectangleRequiresFourOrderedFiniteEdges) +{ + auto target = destination(DestinationMode::FitR); + target.left = 10; + target.top = 20; + target.right = 110; + target.bottom = 220; + ASSERT_TRUE(target.isValid()); + for (auto field : {&NavigationDestination::left, &NavigationDestination::top, + &NavigationDestination::right, &NavigationDestination::bottom}) { + auto incomplete = target; + (incomplete.*field).reset(); + EXPECT_FALSE(incomplete.isValid()); + } + auto invalid = target; + invalid.right = 10; + EXPECT_FALSE(invalid.isValid()); + invalid.right = 9; + EXPECT_FALSE(invalid.isValid()); + invalid = target; + invalid.bottom = 20; + EXPECT_FALSE(invalid.isValid()); + invalid.bottom = 19; + EXPECT_FALSE(invalid.isValid()); + invalid.left = -std::numeric_limits::max(); + invalid.right = std::numeric_limits::max(); + invalid.bottom = 220; + EXPECT_FALSE(invalid.isValid()); +} + +TEST(NavigationValue, rejectsNonfiniteFieldsAndNegativeZoom) +{ + for (auto mode : {DestinationMode::XYZ, DestinationMode::Fit, + DestinationMode::FitH, DestinationMode::FitV, DestinationMode::FitR}) { + auto target = destination(mode); + target.left = 0; + target.top = 0; + target.right = 100; + target.bottom = 200; + ASSERT_TRUE(target.isValid()); + for (auto field : {&NavigationDestination::left, &NavigationDestination::top, + &NavigationDestination::right, &NavigationDestination::bottom, + &NavigationDestination::zoom}) { + for (qreal value : {notANumber, infinity, -infinity}) { + auto invalid = target; + invalid.*field = value; + EXPECT_FALSE(invalid.isValid()); + } + } + target.zoom = -0.5; + EXPECT_FALSE(target.isValid()); + } +} + +TEST(NavigationValue, targetRequiresExactlyOneValidAction) +{ + NavigationTarget target; + EXPECT_FALSE(target.isValid()); + target.destination = destination(); + EXPECT_TRUE(target.isValid()); + target.uri = QUrl(QStringLiteral("https://example.org/document")); + EXPECT_FALSE(target.isValid()); + target.destination.reset(); + EXPECT_TRUE(target.isValid()); + target.uri = QUrl(QStringLiteral("file:///tmp/document.ofd")); + EXPECT_FALSE(target.isValid()); + target.uri = QUrl(QStringLiteral("next.html")); + EXPECT_FALSE(target.isValid()); + target.uri.clear(); + target.destination = NavigationDestination(); + EXPECT_FALSE(target.isValid()); +} + +TEST(NavigationValue, targetCanRoundTripThroughItemData) +{ + NavigationTarget target; + target.destination = destination(DestinationMode::FitH); + target.destination->top = 0; + const auto restored = QVariant::fromValue(target).value(); + ASSERT_TRUE(restored.destination.has_value()); + EXPECT_TRUE(restored.isValid()); + EXPECT_EQ(restored.destination->mode, DestinationMode::FitH); + EXPECT_EQ(restored.destination->top, std::optional(0)); + EXPECT_FALSE(restored.destination->left.has_value()); +} + +TEST(NavigationView, xyzRetainsOmittedPositionAndScale) +{ + const auto target = destination(); + const auto result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 1.25); + EXPECT_EQ(result->focusRect, QRectF(31, 47, 0, 0)); + EXPECT_FALSE(target.left.has_value()); + EXPECT_FALSE(target.top.has_value()); + EXPECT_FALSE(target.zoom.has_value()); +} + +TEST(NavigationView, xyzDistinguishesZeroPositionFromMissingPosition) +{ + auto target = destination(); + target.left = 0; + target.zoom = 0; + auto result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 1.25); + EXPECT_EQ(result->focusRect, QRectF(0, 47, 0, 0)); + target.left.reset(); + target.top = 0; + result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->focusRect, QRectF(31, 0, 0, 0)); + target.left = 0; + target.zoom = 2; + result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 2); + EXPECT_EQ(result->focusRect, QRectF(0, 0, 0, 0)); +} + +TEST(NavigationView, xyzClampsLogicalPointToPageBounds) +{ + auto target = destination(); + target.left = -12; + target.top = 450; + const auto result = view(target, 270); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->focusRect, QRectF(0, 400, 0, 0)); + const auto retained = navigationView(destination(), QSizeF(200, 400), QSizeF(800, 600), + QPointF(500, -1), 1, 10, 0, false); + ASSERT_TRUE(retained.has_value()); + EXPECT_EQ(retained->focusRect, QRectF(200, 0, 0, 0)); +} + +TEST(NavigationView, fitUsesEntireLogicalPageAndRotatedBounds) +{ + for (int rotation : {0, 90, 180, 270, -90, 450}) { + const auto result = view(destination(DestinationMode::Fit), rotation); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, rotation % 180 == 0 ? 1.5 : 2.0); + EXPECT_EQ(result->focusRect, QRectF(0, 0, 200, 400)); + } +} + +TEST(NavigationView, fitHUsesRotatedWidthAndOptionalTop) +{ + auto target = destination(DestinationMode::FitH); + for (int rotation : {0, 90, 180, 270}) { + const auto result = view(target, rotation); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, rotation % 180 == 0 ? 4.0 : 2.0); + EXPECT_EQ(result->focusRect, QRectF(0, 47, 0, 0)); + } + target.top = 0; + target.left = 91; + auto result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->focusRect, QRectF(0, 0, 0, 0)); + target.top = 999; + result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->focusRect, QRectF(0, 400, 0, 0)); +} + +TEST(NavigationView, fitVUsesRotatedHeightAndOptionalLeft) +{ + auto target = destination(DestinationMode::FitV); + for (int rotation : {0, 90, 180, 270}) { + const auto result = view(target, rotation); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, rotation % 180 == 0 ? 1.5 : 3.0); + EXPECT_EQ(result->focusRect, QRectF(31, 0, 0, 0)); + } + target.left = 0; + target.top = 91; + auto result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->focusRect, QRectF(0, 0, 0, 0)); + target.left = -5; + result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result->focusRect, QRectF(0, 0, 0, 0)); +} + +TEST(NavigationView, fitRUsesEntireLogicalRegionAndRotatedBounds) +{ + auto target = destination(DestinationMode::FitR); + target.left = 20; + target.top = 30; + target.right = 120; + target.bottom = 230; + for (int rotation : {0, 90, 180, 270}) { + const auto result = view(target, rotation); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, rotation % 180 == 0 ? 3.0 : 4.0); + EXPECT_EQ(result->focusRect, QRectF(20, 30, 100, 200)); + } + target.bottom.reset(); + EXPECT_FALSE(view(target).has_value()); + target.bottom = 30; + EXPECT_FALSE(view(target).has_value()); +} + +TEST(NavigationView, twoPagesAllocateHalfViewportWidth) +{ + auto result = view(destination(DestinationMode::Fit), 90, true); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 1); + result = view(destination(DestinationMode::FitH), 0, true); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 2); + result = view(destination(DestinationMode::FitV), 0, true); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 1.5); + auto target = destination(DestinationMode::FitR); + target.left = target.top = 0; + target.right = 200; + target.bottom = 100; + result = view(target, 0, true); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 2); + result = view(destination(), 0, true); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 1.25); +} + +TEST(NavigationView, clampsScalesToReaderLimits) +{ + auto target = destination(); + target.zoom = 0.001; + auto result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 0.1); + target.zoom = 100; + result = view(target); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 10); + result = navigationView(destination(DestinationMode::Fit), QSizeF(10000, 10000), + QSizeF(10, 10), QPointF(), 1, 10, 0, false); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 0.1); + result = navigationView(destination(DestinationMode::Fit), QSizeF(1, 1), + QSizeF(1000, 1000), QPointF(), 1, 2, 0, false); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 2); + result = navigationView(destination(), QSizeF(200, 400), QSizeF(800, 600), + QPointF(), 20, 0.1, 0, false); + ASSERT_TRUE(result.has_value()); + EXPECT_DOUBLE_EQ(result->scale, 0.1); +} + +TEST(NavigationView, rejectsInvalidPageAndViewportSizes) +{ + for (const auto &size : {QSizeF(), QSizeF(0, 1), QSizeF(1, 0), QSizeF(-1, 1), + QSizeF(1, -1), QSizeF(notANumber, 1), QSizeF(1, notANumber), + QSizeF(infinity, 1), QSizeF(1, infinity)}) { + EXPECT_FALSE(navigationView(destination(), size, QSizeF(800, 600), QPointF(), + 1, 10, 0, false).has_value()); + EXPECT_FALSE(navigationView(destination(), QSizeF(200, 400), size, QPointF(), + 1, 10, 0, false).has_value()); + } +} + +TEST(NavigationView, rejectsInvalidCurrentStateLimitsAndRotation) +{ + for (qreal value : {qreal(0), qreal(-1), notANumber, infinity}) { + EXPECT_FALSE(navigationView(destination(), QSizeF(200, 400), QSizeF(800, 600), + QPointF(), value, 10, 0, false).has_value()); + } + for (qreal value : {qreal(0.09), qreal(0), qreal(-1), notANumber, infinity}) { + EXPECT_FALSE(navigationView(destination(), QSizeF(200, 400), QSizeF(800, 600), + QPointF(), 1, value, 0, false).has_value()); + } + for (const auto &point : {QPointF(notANumber, 0), QPointF(0, notANumber), + QPointF(infinity, 0), QPointF(0, infinity)}) { + EXPECT_FALSE(navigationView(destination(), QSizeF(200, 400), QSizeF(800, 600), + point, 1, 10, 0, false).has_value()); + } + EXPECT_FALSE(view(destination(), 45).has_value()); + EXPECT_FALSE(view(destination(), -1).has_value()); + EXPECT_FALSE(view(NavigationDestination()).has_value()); + EXPECT_FALSE(view(destination(static_cast(999))).has_value()); +} + +TEST(NavigationUri, acceptsAllowedAbsoluteTargets) +{ + for (const auto &uri : {QStringLiteral("http://example.org/"), + QStringLiteral("https://example.org:443/a%20b?q=x#section"), + QStringLiteral("mailto:reader@example.org"), + QStringLiteral("mailto:reader@example.org?subject=Document")}) { + const QUrl result = resolveNavigationUri(uri); + EXPECT_EQ(result, QUrl(uri, QUrl::StrictMode)); + NavigationTarget target; + target.uri = result; + EXPECT_TRUE(target.isValid()); + } +} + +TEST(NavigationUri, resolvesRelativeTargetsOnlyWithUsableExplicitBase) +{ + EXPECT_EQ(resolveNavigationUri("../next.html#heading", "https://example.org/docs/book/"), + QUrl("https://example.org/docs/next.html#heading")); + EXPECT_EQ(resolveNavigationUri("/page", "http://example.org/docs/book"), + QUrl("http://example.org/page")); + EXPECT_EQ(resolveNavigationUri("#part", "https://example.org/document.html"), + QUrl("https://example.org/document.html#part")); + EXPECT_EQ(resolveNavigationUri("//cdn.example.org/image", "https://example.org/"), + QUrl("https://cdn.example.org/image")); + EXPECT_TRUE(resolveNavigationUri("next.html").isEmpty()); + EXPECT_TRUE(resolveNavigationUri("next.html", "docs/").isEmpty()); + EXPECT_TRUE(resolveNavigationUri("next.html", "file:///tmp/docs/").isEmpty()); + EXPECT_TRUE(resolveNavigationUri("next.html", "mailto:user@example.org").isEmpty()); + EXPECT_TRUE(resolveNavigationUri("next.html", "https://").isEmpty()); +} + +TEST(NavigationUri, rejectsUnsafeMalformedAndEmptyTargets) +{ + for (const auto &uri : {QString(), QStringLiteral("file:///tmp/document.ofd"), + QStringLiteral("javascript:alert(1)"), QStringLiteral("data:text/plain,hi"), + QStringLiteral("ftp://example.org/file"), QStringLiteral("custom:target"), + QStringLiteral("https://"), QStringLiteral("https:example.org"), + QStringLiteral("https:///path"), QStringLiteral("http://[bad]"), + QStringLiteral("http://example.org/%zz"), QStringLiteral("http://exa mple.org/"), + QStringLiteral("https://example.org/a b"), QStringLiteral("\nhttps://example.org/"), + QStringLiteral("mailto:"), QStringLiteral("mailto:?subject=Document"), + QStringLiteral("mailto:%20")}) { + EXPECT_TRUE(resolveNavigationUri(uri).isEmpty()) << uri.toStdString(); + EXPECT_TRUE(resolveNavigationUri(uri, "https://example.org/docs/").isEmpty()) + << uri.toStdString(); + } +} + +TEST(NavigationCompatibility, preservesLegacyLinkDefaultsAndValidity) +{ + const Link empty; + EXPECT_EQ(empty.page, -1); + EXPECT_DOUBLE_EQ(empty.left, 0); + EXPECT_DOUBLE_EQ(empty.top, 0); + EXPECT_TRUE(empty.urlOrFileName.isEmpty()); + EXPECT_FALSE(empty.navigation.has_value()); + EXPECT_FALSE(empty.isValid()); + EXPECT_FALSE(Link(QRectF(1, 2, 3, 4), 0).isValid()); + const Link page(QRectF(1, 2, 3, 4), 1); + EXPECT_TRUE(page.isValid()); + EXPECT_FALSE(page.navigation.has_value()); + EXPECT_TRUE(Link(QPainterPath(), QStringLiteral("legacy-local.pdf")).isValid()); + const Section section; + EXPECT_EQ(section.nIndex, -1); + EXPECT_EQ(section.offsetPointF, QPointF()); + EXPECT_FALSE(section.navigation.has_value()); + EXPECT_FALSE(section.expanded.has_value()); +} + +TEST(NavigationCompatibility, typedTargetTakesExclusivePrecedenceOverLegacyFields) +{ + Link link(QPainterPath(), QStringLiteral("https://legacy.example.org")); + link.page = 1; + link.navigation = NavigationTarget(); + EXPECT_FALSE(link.isValid()); + link.navigation->uri = QUrl(QStringLiteral("file:///tmp/document.ofd")); + EXPECT_FALSE(link.isValid()); + link.navigation->uri.clear(); + link.navigation->destination = destination(); + link.page = -1; + link.urlOrFileName.clear(); + EXPECT_TRUE(link.isValid()); + link.navigation.reset(); + EXPECT_FALSE(link.isValid()); +} diff --git a/tests/ofd-model/CMakeLists.txt b/tests/ofd-model/CMakeLists.txt index fa68f75f3..aacb7c800 100644 --- a/tests/ofd-model/CMakeLists.txt +++ b/tests/ofd-model/CMakeLists.txt @@ -24,6 +24,9 @@ endif() get_filename_component(READER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../.." ABSOLUTE) add_executable(ofd-model-check main.cc ../document/ut_ofdmodel.cpp + ../document/ut_navigation.cpp + ${READER_ROOT}/reader/document/Navigation.cpp + ${READER_ROOT}/reader/document/Navigation.h ${READER_ROOT}/reader/document/OfdModel.cpp ${READER_ROOT}/reader/document/OfdModel.h ${READER_ROOT}/reader/document/Model.h) From 73a4886d26ceea1a2b2dc54cf837e60347a399dd Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 10:10:41 +0800 Subject: [PATCH 13/63] feat(ofd): adapt outline trees and navigation destinations --- CMakeLists.txt | 15 +- debian/control | 2 +- reader/document/OfdModel.cpp | 171 ++++++++++++++++++++++ reader/document/OfdModel.h | 13 ++ tests/document/ut_ofdmodel.cpp | 254 ++++++++++++++++++++++++++++++++- 5 files changed, 446 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0408ed649..16b7cd959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,8 @@ if (OFD_SUPPORT) pkg_check_modules(OFD_CAIRO QUIET cairo) if (ROFD_INCLUDE_DIR AND ROFD_FFI_LIBRARY AND OFD_CAIRO_FOUND) - # These APIs were added after 0.3.0 without a version bump. Probe both - # declarations and linked symbols instead of trusting the package version. + # Require the reader APIs shipped in 0.4.0. Probe declarations and linked + # symbols as well, so mismatched headers and libraries fail at configure. include(CheckCSourceCompiles) include(CMakePushCheckState) cmake_push_check_state(RESET) @@ -108,6 +108,8 @@ if (OFD_SUPPORT) rofd_pixel_rect_t viewport; rofd_metadata_t *metadata = 0; rofd_warning_list_t *warnings = 0; + rofd_outline_t *outline = 0; + rofd_destination_t destination = {0}; int32_t w = 0, h = 0; rofd_pixel_rect_init(&viewport, sizeof(viewport)); rofd_renderer_get_pixel_canvas_size(0, 0, 0, &w, &h, 0); @@ -117,12 +119,19 @@ if (OFD_SUPPORT) rofd_metadata_free(metadata); rofd_document_get_warnings(0, &warnings, 0); rofd_warning_list_free(warnings); + (void)&rofd_document_get_outline; + (void)&rofd_outline_get_action_destination; + (void)&rofd_outline_free; + rofd_document_get_outline(0, &outline, 0); + destination.struct_size = sizeof(destination); + rofd_outline_get_action_destination(outline, 0, 0, &destination, 0); + rofd_outline_free(outline); return 0; } ]=] ROFD_READER_APIS_AVAILABLE) cmake_pop_check_state() if (NOT ROFD_READER_APIS_AVAILABLE) - message(FATAL_ERROR "rofd headers/library lack the region, metadata or warning APIs. Use a matching rofd build containing commits 56da925 and 6db9bac (0.3.0 alone is insufficient), and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") + message(FATAL_ERROR "rofd headers/library lack the required region, metadata, warning or outline APIs. Install matching rofd >= 0.4.0 headers and library, and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") endif() message(STATUS ">>> OFD support enabled (rofd_ffi: ${ROFD_FFI_LIBRARY})") add_compile_definitions(OFD_SUPPORT_ENABLED) diff --git a/debian/control b/debian/control index 40c6e0ead..9b5da795e 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,7 @@ Build-Depends: libdtk6core-dev [!mipsel !mips64el] | libdtkcore-dev, libgxps-dev, libcairo2-dev, - librofd-ffi-dev (>= 0.3.0), + librofd-ffi-dev (>= 0.4.0), libglib2.0-dev, libdjvulibre-dev, libtiff-dev, diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp index 3451230f8..4dfa76736 100644 --- a/reader/document/OfdModel.cpp +++ b/reader/document/OfdModel.cpp @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include @@ -169,6 +171,175 @@ bool OfdDocument::saveAs(const QString &filePath) const return true; } +Outline OfdDocument::outline() const +{ + QMutexLocker lock(&m_outlineMutex); + if (m_outlineLoaded) + return m_outline; + // Empty and failed snapshots are cached as well as populated ones. + m_outlineLoaded = true; + m_outline = [this]() -> Outline { + rofd_outline_t *raw = nullptr; + rofd_error_t *error = nullptr; + const rofd_status_t status = rofd_document_get_outline(m_document, &raw, &error); + const std::unique_ptr snapshot(raw, rofd_outline_free); + if (status != ROFD_STATUS_OK || !snapshot) { + logSemanticError("Outline loading", -1, status, error); + return {}; + } + rofd_error_free(error); + size_t count = 0; + if (rofd_outline_get_count(raw, &count, nullptr) != ROFD_STATUS_OK + || count > static_cast(std::numeric_limits::max())) { + qCWarning(appLog) << "Invalid OFD outline node count"; + return {}; + } + + Outline nodes(static_cast(count)); + QVector parents(static_cast(count), -1); + for (int i = 0; i < nodes.size(); ++i) { + rofd_outline_node_t node = {}; + node.struct_size = sizeof(node); + if (rofd_outline_get_node(raw, static_cast(i), &node, nullptr) != ROFD_STATUS_OK) + continue; + Section §ion = nodes[i]; + section.title = QString::fromUtf8(node.title ? node.title : ""); + section.expanded = node.expanded != 0; + // A preorder parent must precede its child. Invalid relations become + // inert roots, retaining the node and any valid descendants. + if (node.parent != ROFD_NO_INDEX) { + if (node.parent >= static_cast(i)) + continue; + parents[i] = static_cast(node.parent); + } + for (size_t actionIndex = 0; actionIndex < node.action_count; ++actionIndex) { + rofd_action_t action = {}; + action.struct_size = sizeof(action); + if (rofd_outline_get_action(raw, static_cast(i), actionIndex, &action, nullptr) != ROFD_STATUS_OK) + continue; + rofd_destination_t destination = {}; + destination.struct_size = sizeof(destination); + const rofd_destination_t *target = nullptr; + if (action.event == ROFD_ACTION_EVENT_CLICK && action.kind == ROFD_ACTION_GOTO + && rofd_outline_get_action_destination(raw, static_cast(i), actionIndex, + &destination, nullptr) == ROFD_STATUS_OK) { + target = &destination; + } + section.navigation = navigationTarget(action, target); + if (!section.navigation) + continue; + if (section.navigation->destination) { + const NavigationDestination &value = *section.navigation->destination; + section.nIndex = value.pageIndex; + section.offsetPointF = QPointF(value.left.value_or(0), value.top.value_or(0)); + } + break; + } + } + + // Each child is complete before its parent. Reverse each collected group + // once to restore the original preorder without recursive traversal or + // repeated insertion at the front of a wide sibling list. + Outline roots; + for (int i = nodes.size(); i-- > 0;) { + std::reverse(nodes[i].children.begin(), nodes[i].children.end()); + if (parents[i] >= 0) + nodes[parents[i]].children.append(std::move(nodes[i])); + else + roots.append(std::move(nodes[i])); + } + std::reverse(roots.begin(), roots.end()); + return roots; + }(); + const Outline result = m_outline; + lock.unlock(); + warningDetails(); + return result; +} + +std::optional OfdDocument::navigationTarget(const rofd_action_t &action, + const rofd_destination_t *destination) const +{ + if (action.event != ROFD_ACTION_EVENT_CLICK) + return std::nullopt; + if (action.kind == ROFD_ACTION_URI) { + NavigationTarget target; + target.uri = resolveNavigationUri(QString::fromUtf8(action.uri ? action.uri : ""), + QString::fromUtf8(action.uri_base ? action.uri_base : "")); + return target.isValid() ? std::make_optional(target) : std::nullopt; + } + if (action.kind != ROFD_ACTION_GOTO || !destination + || !(destination->flags & ROFD_DESTINATION_HAS_PAGE_INDEX) + || destination->page_index >= static_cast(m_pageCount) + || destination->page_index > static_cast(std::numeric_limits::max())) { + return std::nullopt; + } + + NavigationDestination value; + value.pageIndex = static_cast(destination->page_index); + switch (destination->kind) { + case ROFD_DESTINATION_XYZ: value.mode = DestinationMode::XYZ; break; + case ROFD_DESTINATION_FIT: value.mode = DestinationMode::Fit; break; + case ROFD_DESTINATION_FIT_H: value.mode = DestinationMode::FitH; break; + case ROFD_DESTINATION_FIT_V: value.mode = DestinationMode::FitV; break; + case ROFD_DESTINATION_FIT_R: value.mode = DestinationMode::FitR; break; + default: return std::nullopt; + } + const auto pageRect = navigationPageRect(value.pageIndex); + if (!pageRect) + return std::nullopt; + if (destination->flags & ROFD_DESTINATION_HAS_LEFT) + value.left = (destination->left_mm - pageRect->x_mm) * m_xRes / kMillimetresPerInch; + if (destination->flags & ROFD_DESTINATION_HAS_TOP) + value.top = (destination->top_mm - pageRect->y_mm) * m_yRes / kMillimetresPerInch; + if (destination->flags & ROFD_DESTINATION_HAS_RIGHT) + value.right = (destination->right_mm - pageRect->x_mm) * m_xRes / kMillimetresPerInch; + if (destination->flags & ROFD_DESTINATION_HAS_BOTTOM) + value.bottom = (destination->bottom_mm - pageRect->y_mm) * m_yRes / kMillimetresPerInch; + if (destination->flags & ROFD_DESTINATION_HAS_ZOOM) + value.zoom = destination->zoom; + if (!value.isValid()) + return std::nullopt; + NavigationTarget target; + target.destination = value; + return target; +} + +std::optional OfdDocument::navigationPageRect(int pageIndex) const +{ + QMutexLocker lock(&m_navigationGeometryMutex); + const auto cached = m_navigationPageRects.constFind(pageIndex); + if (cached != m_navigationPageRects.cend()) + return cached.value(); + + // Query a temporary rofd page directly: constructing OfdPage here would + // couple navigation conversion to page-link loading and risk recursion. + rofd_page_t *raw = nullptr; + rofd_error_t *error = nullptr; + rofd_status_t status = rofd_document_get_page(m_document, static_cast(pageIndex), &raw, &error); + const std::unique_ptr page(raw, rofd_page_free); + rofd_rect_t rect = {}; + if (status == ROFD_STATUS_OK && page) { + rofd_error_free(error); + error = nullptr; + status = rofd_page_get_size_mm(raw, &rect, &error); + } + std::optional result; + if (status == ROFD_STATUS_OK && page && std::isfinite(rect.x_mm) && std::isfinite(rect.y_mm) + && std::isfinite(rect.width_mm) && rect.width_mm > 0 + && std::isfinite(rect.height_mm) && rect.height_mm > 0) { + result = rect; + rofd_error_free(error); + } else { + logSemanticError("Navigation page geometry", pageIndex, status, error); + } + m_navigationPageRects.insert(pageIndex, result); + lock.unlock(); + // No warning-mutex holder acquires either navigation cache mutex. + warningDetails(); + return result; +} + Properties OfdDocument::properties() const { Properties props = m_properties; diff --git a/reader/document/OfdModel.h b/reader/document/OfdModel.h index b9d232023..227b79304 100644 --- a/reader/document/OfdModel.h +++ b/reader/document/OfdModel.h @@ -33,6 +33,7 @@ class OfdDocument : public Document QStringList saveFilter() const override; bool save() const override; bool saveAs(const QString &filePath) const override; + Outline outline() const override; Properties properties() const override; QString fileIdentifier() const override; @@ -44,9 +45,16 @@ class OfdDocument : public Document QImage renderPage(rofd_page_t *pageHandle, int width, int height, const QRect &slice) const; private: + friend class OfdPage; + OfdDocument(const QString &filePath, rofd_document_t *document, rofd_renderer_t *renderer); void loadMetadata(); QVariantList warningDetails() const; + // Shared by outline and page-link snapshots. All borrowed action strings + // are copied; GOTO callers supply their snapshot's destination record. + std::optional navigationTarget(const rofd_action_t &action, + const rofd_destination_t *destination = nullptr) const; + std::optional navigationPageRect(int pageIndex) const; QString m_filePath; rofd_document_t *m_document = nullptr; @@ -54,6 +62,11 @@ class OfdDocument : public Document Properties m_properties; mutable QMutex m_warningMutex; mutable size_t m_loggedWarningCount = 0; + mutable QMutex m_outlineMutex; + mutable bool m_outlineLoaded = false; + mutable Outline m_outline; + mutable QMutex m_navigationGeometryMutex; + mutable QMap> m_navigationPageRects; int m_pageCount = 0; qreal m_xRes = 96.0; qreal m_yRes = 96.0; diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp index 4f90c8623..2b57eaa71 100644 --- a/tests/document/ut_ofdmodel.cpp +++ b/tests/document/ut_ofdmodel.cpp @@ -16,6 +16,7 @@ #include #include +#include #include using namespace deepin_reader; @@ -39,19 +40,24 @@ bool hasOfdFile() QString createOfdFixture(const QTemporaryDir &dir, const QByteArray &info, const QByteArray &pageArea = QByteArray(), - const QByteArray &documentExtras = QByteArray()) + const QByteArray &documentExtras = QByteArray(), + const QByteArray &secondPage = QByteArray()) { - const QMap entries = { + QMap entries = { {"OFD.xml", "" + info + "Document.xml"}, {"Document.xml", "7 11 210 297" - "" + "" + + (secondPage.isEmpty() ? QByteArray() : QByteArray("")) + + "" + documentExtras + ""}, {"Page.xml", "" + pageArea + "" "M 0 0 L 40 0 L 40 25 L 0 25 C" ""} }; + if (!secondPage.isEmpty()) + entries.insert(QStringLiteral("Second.xml"), secondPage); for (auto it = entries.cbegin(); it != entries.cend(); ++it) { QFile file(dir.filePath(it.key())); if (!file.open(QIODevice::WriteOnly) || file.write(it.value()) != it.value().size()) @@ -59,13 +65,23 @@ QString createOfdFixture(const QTemporaryDir &dir, const QByteArray &info, } QProcess archive; archive.setWorkingDirectory(dir.path()); - archive.start(QStringLiteral("cmake"), {"-E", "tar", "cf", "fixture.ofd", "--format=zip", - "OFD.xml", "Document.xml", "Page.xml"}); + QStringList arguments = {"-E", "tar", "cf", "fixture.ofd", "--format=zip"}; + arguments.append(entries.keys()); + archive.start(QStringLiteral("cmake"), arguments); if (!archive.waitForFinished() || archive.exitCode() != 0) return {}; return dir.filePath("fixture.ofd"); } +const QByteArray explicitPageArea = "7 11 210 297"; +const QByteArray offsetSecondPage = "3 5 100 120"; + +QByteArray outlineNode(const QByteArray &title, const QByteArray &action) +{ + return "" + + action + ""; +} + } // namespace class TestOfdModel : public ::testing::Test @@ -88,6 +104,234 @@ class TestOfdModel : public ::testing::Test std::unique_ptr m_doc; }; +TEST(OfdApi, outlineKeepsNestedParentsAndCopiesNavigation) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, {}, explicitPageArea, R"xml( + + + + + + + + + + + + + + + + )xml", offsetSecondPage); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const Outline outline = doc->outline(); + ASSERT_EQ(outline.size(), 1); + const Section &root = outline.first(); + EXPECT_EQ(root.title, QStringLiteral("目录")); + EXPECT_EQ(root.nIndex, -1); + EXPECT_FALSE(root.navigation.has_value()); + ASSERT_TRUE(root.expanded.has_value()); + EXPECT_FALSE(*root.expanded); + ASSERT_EQ(root.children.size(), 2); + EXPECT_EQ(root.children.last().title, QStringLiteral("末尾")); + const Section &parent = root.children.first(); + EXPECT_EQ(parent.nIndex, -1); + EXPECT_FALSE(parent.navigation.has_value()); + ASSERT_TRUE(parent.expanded.has_value()); + EXPECT_TRUE(*parent.expanded); + ASSERT_EQ(parent.children.size(), 1); + const Section &bookmark = parent.children.first(); + ASSERT_TRUE(bookmark.navigation.has_value()); + ASSERT_TRUE(bookmark.navigation->destination.has_value()); + const NavigationDestination &destination = *bookmark.navigation->destination; + EXPECT_EQ(destination.pageIndex, 1); + EXPECT_EQ(bookmark.nIndex, 1); + EXPECT_EQ(destination.mode, DestinationMode::XYZ); + ASSERT_TRUE(destination.left.has_value()); + ASSERT_TRUE(destination.top.has_value()); + EXPECT_DOUBLE_EQ(*destination.left, (13.0 - 3.0) * doc->xRes() / 25.4); + EXPECT_DOUBLE_EQ(*destination.top, (25.0 - 5.0) * doc->yRes() / 25.4); + ASSERT_TRUE(destination.zoom.has_value()); + EXPECT_DOUBLE_EQ(*destination.zoom, 0.0); + ASSERT_EQ(bookmark.children.size(), 1); + const Section &uri = bookmark.children.first(); + ASSERT_TRUE(uri.navigation.has_value()); + EXPECT_EQ(uri.nIndex, -1); + EXPECT_EQ(uri.navigation->uri, QUrl("https://example.invalid/base/child?q=1&x=2")); + const QVariantList warnings = doc->properties().value("Warnings").toList(); + EXPECT_FALSE(warnings.isEmpty()); + EXPECT_EQ(doc->outline().first().children.first().children.first().title, bookmark.title); + EXPECT_EQ(doc->properties().value("Warnings").toList(), warnings); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + EXPECT_FALSE(page->render(210, 297).isNull()); + page.reset(); + doc.reset(); + EXPECT_EQ(root.title, QStringLiteral("目录")); + EXPECT_EQ(uri.navigation->uri.host(), QStringLiteral("example.invalid")); +} + +TEST(OfdApi, outlineDestinationModesKeepPresenceAndTargetOrigin) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + QByteArray nodes; + const auto destNode = [](const QByteArray &mode, const QByteArray &fields) { + return outlineNode(mode, ""); + }; + nodes += destNode("XYZ", ""); + nodes += destNode("XYZ", "Left=\"0\" Top=\"0\" Zoom=\"0\""); + nodes += destNode("Fit", ""); + nodes += destNode("FitH", "Top=\"15\""); + nodes += destNode("FitV", "Left=\"13\""); + nodes += destNode("FitR", "Left=\"13\" Top=\"15\" Right=\"23\" Bottom=\"35\""); + const QString path = createOfdFixture(dir, {}, explicitPageArea, + "" + nodes + "", offsetSecondPage); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const Outline outline = doc->outline(); + ASSERT_EQ(outline.size(), 6); + const DestinationMode modes[] = {DestinationMode::XYZ, DestinationMode::XYZ, DestinationMode::Fit, + DestinationMode::FitH, DestinationMode::FitV, DestinationMode::FitR}; + for (int i = 0; i < outline.size(); ++i) { + ASSERT_TRUE(outline[i].navigation.has_value()); + ASSERT_TRUE(outline[i].navigation->destination.has_value()); + EXPECT_EQ(outline[i].navigation->destination->mode, modes[i]); + EXPECT_EQ(outline[i].navigation->destination->pageIndex, 1); + EXPECT_TRUE(outline[i].navigation->isValid()); + } + const auto &absent = *outline[0].navigation->destination; + EXPECT_FALSE(absent.left.has_value()); + EXPECT_FALSE(absent.top.has_value()); + EXPECT_FALSE(absent.zoom.has_value()); + const auto &zero = *outline[1].navigation->destination; + ASSERT_TRUE(zero.left.has_value()); + ASSERT_TRUE(zero.top.has_value()); + ASSERT_TRUE(zero.zoom.has_value()); + EXPECT_DOUBLE_EQ(*zero.left, -3.0 * doc->xRes() / 25.4); + EXPECT_DOUBLE_EQ(*zero.top, -5.0 * doc->yRes() / 25.4); + EXPECT_DOUBLE_EQ(*zero.zoom, 0.0); + const auto &fitH = *outline[3].navigation->destination; + ASSERT_TRUE(fitH.top.has_value()); + EXPECT_DOUBLE_EQ(*fitH.top, 10.0 * doc->yRes() / 25.4); + EXPECT_FALSE(fitH.left.has_value()); + const auto &fitV = *outline[4].navigation->destination; + ASSERT_TRUE(fitV.left.has_value()); + EXPECT_DOUBLE_EQ(*fitV.left, 10.0 * doc->xRes() / 25.4); + EXPECT_FALSE(fitV.top.has_value()); + const auto &fitR = *outline[5].navigation->destination; + ASSERT_TRUE(fitR.right.has_value()); + ASSERT_TRUE(fitR.bottom.has_value()); + EXPECT_DOUBLE_EQ(*fitR.right, 20.0 * doc->xRes() / 25.4); + EXPECT_DOUBLE_EQ(*fitR.bottom, 30.0 * doc->yRes() / 25.4); +} + +TEST(OfdApi, outlineUnsafeAndInvalidActionsKeepNodesNonExecuting) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + QByteArray nodes; + const QList actions = { + "", + "", + "", + "", + "", + "", + "", + "", + "", "" + }; + for (const QByteArray &action : actions) + nodes += outlineNode("kept", action); + nodes += "" + "" + "" + ""; + const QString path = createOfdFixture(dir, {}, explicitPageArea, + "" + nodes + "", offsetSecondPage); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const Outline outline = doc->outline(); + ASSERT_EQ(outline.size(), actions.size() + 1); + for (const Section §ion : outline) { + EXPECT_EQ(section.nIndex, -1); + EXPECT_FALSE(section.navigation.has_value()); + } + ASSERT_EQ(outline.last().children.size(), 1); + EXPECT_EQ(outline.last().children.first().title, QStringLiteral("child")); +} + +TEST(OfdApi, outlineGeometryQueriesRefreshWarningsAndKeepGoodPagesUsable) +{ + for (const QByteArray &secondPage : {QByteArray(""), QByteArray("broken XML")}) { + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, {}, explicitPageArea, + "" + outlineNode("target", "") + + "", secondPage); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + const QVariantList before = doc->properties().value("Warnings").toList(); + EXPECT_TRUE(before.isEmpty()); + const Outline outline = doc->outline(); + ASSERT_EQ(outline.size(), 1); + if (secondPage.startsWith("")) { + ASSERT_TRUE(outline.first().navigation.has_value()); + ASSERT_TRUE(outline.first().navigation->destination->left.has_value()); + EXPECT_DOUBLE_EQ(*outline.first().navigation->destination->left, 10.0 * doc->xRes() / 25.4); + const QVariantList warnings = doc->properties().value("Warnings").toList(); + ASSERT_EQ(warnings.size(), 1); + EXPECT_EQ(warnings.first().toMap().value("Code").toUInt(), ROFD_WARNING_PAGE_AREA_FALLBACK); + EXPECT_EQ(warnings.first().toMap().value("Path").toString(), QStringLiteral("Second.xml")); + } else { + EXPECT_FALSE(outline.first().navigation.has_value()); + EXPECT_EQ(outline.first().nIndex, -1); + } + std::unique_ptr good(doc->page(0)); + ASSERT_NE(good, nullptr); + EXPECT_FALSE(good->render(210, 297).isNull()); + EXPECT_EQ(doc->outline().size(), 1); + } +} + +TEST(OfdApi, outlineConcurrentAndEmptyOrFailedSnapshotsStayStable) +{ + const QByteArray deepOutline = "" + QByteArray("").repeated(66) + + QByteArray("").repeated(66) + ""; + for (const QByteArray &extras : {QByteArray(), deepOutline, + QByteArray("")}) { + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, {}, explicitPageArea, extras); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::vector> queries; + for (int i = 0; i < 8; ++i) + queries.push_back(std::async(std::launch::async, [&doc] { return doc->outline(); })); + const int expected = extras.contains("Title=\"root\"") ? 1 : 0; + for (auto &query : queries) + EXPECT_EQ(query.get().size(), expected); + EXPECT_EQ(doc->outline().size(), expected); + std::unique_ptr good(doc->page(0)); + ASSERT_NE(good, nullptr); + EXPECT_FALSE(good->render(210, 297).isNull()); + } +} + TEST_F(TestOfdModel, loadDocument) { EXPECT_GT(m_doc->pageCount(), 0); From 480271a333b739ec2e2d92c673077b419f19fc8b Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 10:15:02 +0800 Subject: [PATCH 14/63] feat(reader): expose full OFD catalogs and typed navigation --- reader/browser/SheetBrowser.cpp | 54 ++++++ reader/browser/SheetBrowser.h | 1 + reader/sidebar/CatalogOutlineModel.cpp | 73 ++++++++ reader/sidebar/CatalogOutlineModel.h | 22 +++ reader/sidebar/CatalogTreeView.cpp | 91 +++++----- reader/sidebar/CatalogTreeView.h | 3 + reader/uiframe/DocSheet.cpp | 7 +- reader/uiframe/DocSheet.h | 2 + tests/document/ut_catalogoutlinemodel.cpp | 136 ++++++++++++++ tests/ofd-model/CMakeLists.txt | 4 +- tests/ofd-model/navigation_smoke.cc | 210 ++++++++++++++++++++++ tests/ofd-model/run_navigation_smoke.py | 59 ++++++ 12 files changed, 610 insertions(+), 52 deletions(-) create mode 100644 reader/sidebar/CatalogOutlineModel.cpp create mode 100644 reader/sidebar/CatalogOutlineModel.h create mode 100644 tests/document/ut_catalogoutlinemodel.cpp create mode 100644 tests/ofd-model/navigation_smoke.cc create mode 100644 tests/ofd-model/run_navigation_smoke.py diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index bb764ba03..1ddcfc500 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -44,6 +44,9 @@ #include #include #include +#include + +#include DWIDGET_USE_NAMESPACE @@ -735,6 +738,57 @@ void SheetBrowser::jumpToOutline(const qreal &linkLeft, const qreal &linkTop, in qCDebug(appLog) << "SheetBrowser::jumpToOutline() - Jump to outline completed"; } +bool SheetBrowser::navigateTo(const NavigationTarget &target) +{ + if (!m_sheet || !target.isValid()) + return false; + + if (!target.destination) { + const QUrl uri = resolveNavigationUri(target.uri.toString(QUrl::FullyEncoded)); + if (uri.isEmpty()) + return false; + SecurityDialog dialog(uri.toString(QUrl::FullyEncoded), this); + if (dialog.exec() == DDialog::Accepted) + QDesktopServices::openUrl(uri); + return true; + } + + const NavigationDestination &destination = *target.destination; + if (destination.pageIndex >= m_items.size() || !m_items.at(destination.pageIndex)) + return false; + + const SheetOperation &operation = m_sheet->operation(); + QPointF currentPosition; + const int currentIndex = currentPage() - 1; + if (operation.scaleFactor > 0 && currentIndex >= 0 && currentIndex < m_items.size()) + currentPosition = m_items.at(currentIndex)->mapFromScene(mapToScene(QPoint(0, 0))) + / operation.scaleFactor; + + const auto view = navigationView(destination, m_sheet->renderer()->getPageSize(destination.pageIndex), + QSizeF(viewport()->size()), currentPosition, operation.scaleFactor, + m_sheet->maxScaleFactor(), int(operation.rotation) * 90, + operation.layoutMode == Dr::TwoPagesMode); + if (!view) + return false; + + { + QScopedValueRollback suppressPageChanges(m_bNeedNotifyCurPageChanged, false); + m_sheet->setScaleFactor(view->scale); + const qreal scale = m_sheet->operation().scaleFactor; + const QRectF scaledFocus(view->focusRect.topLeft() * scale, view->focusRect.size() * scale); + const QPointF scenePoint = m_items.at(destination.pageIndex)->mapRectToScene(scaledFocus).topLeft(); + if (!std::isfinite(scenePoint.x()) || !std::isfinite(scenePoint.y())) + return false; + // Bound before converting: document coordinates need not fit in an int. + horizontalScrollBar()->setValue(qRound(qBound(qreal(horizontalScrollBar()->minimum()), + scenePoint.x(), qreal(horizontalScrollBar()->maximum())))); + verticalScrollBar()->setValue(qRound(qBound(qreal(verticalScrollBar()->minimum()), + scenePoint.y(), qreal(verticalScrollBar()->maximum())))); + } + curpageChanged(destination.pageIndex + 1); + return true; +} + void SheetBrowser::jumpToHighLight(deepin_reader::Annotation *annotation, const int index) { qCDebug(appLog) << "SheetBrowser::jumpToHighLight() - Starting jump to high light"; diff --git a/reader/browser/SheetBrowser.h b/reader/browser/SheetBrowser.h index f8de05115..f50698443 100644 --- a/reader/browser/SheetBrowser.h +++ b/reader/browser/SheetBrowser.h @@ -203,6 +203,7 @@ class SheetBrowser : public Dtk::Widget::DGraphicsView * @param index 哪一页 */ void jumpToOutline(const qreal &left, const qreal &top, int page); + bool navigateTo(const deepin_reader::NavigationTarget &target); /** * @brief jumpToHighLight diff --git a/reader/sidebar/CatalogOutlineModel.cpp b/reader/sidebar/CatalogOutlineModel.cpp new file mode 100644 index 000000000..fced2cbc3 --- /dev/null +++ b/reader/sidebar/CatalogOutlineModel.cpp @@ -0,0 +1,73 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later +#include "CatalogOutlineModel.h" +#include +#include + +namespace deepin_reader { +void applyCatalogExpansion(QTreeView *view, const std::optional &saved) +{ + if (!view || !view->model()) + return; + const QSignalBlocker blocker(view); + QSet paths; + if (saved) + paths = QSet(saved->cbegin(), saved->cend()); + struct Pending { QModelIndex parent; QString path; }; + QVector pending{{QModelIndex(), QString()}}; + while (!pending.isEmpty()) { + const Pending current = pending.takeLast(); + for (int row = 0; row < view->model()->rowCount(current.parent); ++row) { + const QModelIndex index = view->model()->index(row, 0, current.parent); + const QString title = index.data().toString(); + const QString path = current.parent.isValid() ? current.path + QLatin1Char('/') + title : title; + const QVariant expanded = index.data(CatalogExpandedRole); + if (saved || expanded.isValid()) + view->setExpanded(index, saved ? paths.contains(path) : expanded.toBool()); + pending.append({index, path}); + } + } +} + +QList catalogRow(const Section §ion) +{ + int pageIndex = section.nIndex; + if (section.navigation) { + pageIndex = section.navigation->isValid() && section.navigation->destination + ? section.navigation->destination->pageIndex : -1; + } + auto *title = new QStandardItem(section.title); + auto *page = new QStandardItem(pageIndex >= 0 ? QString::number(qint64(pageIndex) + 1) : QString()); + const QList row{title, page}; + for (QStandardItem *item : row) { + item->setData(pageIndex, CatalogPageRole); + item->setData(section.offsetPointF.x(), CatalogLeftRole); + item->setData(section.offsetPointF.y(), CatalogTopRole); + if (section.navigation) + item->setData(QVariant::fromValue(*section.navigation), CatalogNavigationRole); + if (section.expanded) + item->setData(*section.expanded, CatalogExpandedRole); + } + title->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); + page->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); + return row; +} + +void appendCatalogSections(QStandardItem *parent, const Outline &outline) +{ + if (!parent) + return; + struct Pending { QStandardItem *parent; const Section *section; }; + QVector pending; + for (auto it = outline.crbegin(); it != outline.crend(); ++it) + pending.append({parent, &*it}); + while (!pending.isEmpty()) { + const Pending current = pending.takeLast(); + const auto row = catalogRow(*current.section); + current.parent->appendRow(row); + const auto &children = current.section->children; + for (auto it = children.crbegin(); it != children.crend(); ++it) + pending.append({row.first(), &*it}); + } +} +} diff --git a/reader/sidebar/CatalogOutlineModel.h b/reader/sidebar/CatalogOutlineModel.h new file mode 100644 index 000000000..8987bd952 --- /dev/null +++ b/reader/sidebar/CatalogOutlineModel.h @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later +#ifndef CATALOGOUTLINEMODEL_H +#define CATALOGOUTLINEMODEL_H + +#include "Model.h" +#include +#include + +namespace deepin_reader { +enum CatalogRole { + CatalogPageRole = Qt::UserRole + 1, + CatalogLeftRole, + CatalogTopRole, + CatalogNavigationRole, + CatalogExpandedRole +}; +QList catalogRow(const Section §ion); +void appendCatalogSections(QStandardItem *parent, const Outline &outline); +void applyCatalogExpansion(QTreeView *view, const std::optional &saved = std::nullopt); +} +#endif diff --git a/reader/sidebar/CatalogTreeView.cpp b/reader/sidebar/CatalogTreeView.cpp index 9e8c5c6bd..71d4fe289 100644 --- a/reader/sidebar/CatalogTreeView.cpp +++ b/reader/sidebar/CatalogTreeView.cpp @@ -4,6 +4,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include "CatalogTreeView.h" +#include "CatalogOutlineModel.h" #include "Application.h" #include "Utils.h" #include "DocSheet.h" @@ -19,6 +20,8 @@ #include #include #include +#include +#include class ActiveProxyStyle : public QProxyStyle { @@ -148,20 +151,7 @@ void CatalogTreeView::setRightControl(bool hasControl) void CatalogTreeView::parseCatalogData(const deepin_reader::Section &ol, QStandardItem *parentItem) { - qCDebug(appLog) << "Parsing catalog section:" << ol.title << "with" << ol.children.size() << "children"; - - foreach (auto s, ol.children) { // 2级显示 - if (s.nIndex >= 0) { - auto itemList = getItemList(s.title, s.nIndex, s.offsetPointF.x(), s.offsetPointF.y()); - parentItem->appendRow(itemList); - - foreach (auto s1, s.children) { // 3级显示 - auto itemList1 = getItemList(s1.title, s1.nIndex, s1.offsetPointF.x(), s1.offsetPointF.y()); - itemList.at(0)->appendRow(itemList1); - } - } - } - qCDebug(appLog) << "CatalogTreeView::parseCatalogData() - Completed"; + deepin_reader::appendCatalogSections(parentItem, ol.children); } QList CatalogTreeView::getItemList(const QString &title, const int &index, const qreal &realleft, const qreal &realtop) @@ -191,6 +181,9 @@ void CatalogTreeView::handleOpenSuccess() auto model = qobject_cast(this->model()); if (model) { + const QScopedValueRollback populating(m_populating, true); + const QSignalBlocker viewBlocker(this); + const QSignalBlocker selectionBlocker(selectionModel()); qCDebug(appLog) << "CatalogTreeView::handleOpenSuccess() - Clearing model"; model->clear(); @@ -201,13 +194,18 @@ void CatalogTreeView::handleOpenSuccess() m_index = m_sheet->currentIndex(); const deepin_reader::Outline &ol = m_sheet->outline(); - for (const deepin_reader::Section &s : ol) { //root - if (s.nIndex >= 0) { - auto itemList = getItemList(s.title, s.nIndex, s.offsetPointF.x(), s.offsetPointF.y()); - model->appendRow(itemList); - parseCatalogData(s, itemList.at(0)); - } + deepin_reader::appendCatalogSections(model->invisibleRootItem(), ol); + const QColor color = Dtk::Gui::DGuiApplicationHelper::instance()->applicationPalette().textTips().color(); + const auto items = model->findItems("*", Qt::MatchWildcard | Qt::MatchRecursive); + for (QStandardItem *item : items) { + QStandardItem *parent = item->parent() ? item->parent() : model->invisibleRootItem(); + if (QStandardItem *page = parent->child(item->row(), 1)) + page->setForeground(QBrush(color)); } + if (!m_pendingExpandedSections && m_sheet->hasRestoredViewState()) + m_pendingExpandedSections = m_sheet->operation().expandedSections; + deepin_reader::applyCatalogExpansion(this, m_pendingExpandedSections); + m_pendingExpandedSections.reset(); setIndex(m_index); } resizeCoulumnWidth(); @@ -220,6 +218,12 @@ QStringList CatalogTreeView::getExpandedSections() const auto model = qobject_cast(this->model()); if (!model) return result; + if (model->rowCount() == 0) { + if (m_pendingExpandedSections) + return *m_pendingExpandedSections; + if (m_sheet && m_sheet->hasRestoredViewState()) + return m_sheet->operation().expandedSections; + } // 递归遍历所有节点,收集展开状态的节点标题路径 const QList &itemList = model->findItems("*", Qt::MatchWildcard | Qt::MatchRecursive); @@ -246,39 +250,14 @@ QStringList CatalogTreeView::getExpandedSections() const void CatalogTreeView::restoreExpandedSections(const QStringList §ions) { - if (sections.isEmpty()) - return; - auto model = qobject_cast(this->model()); if (!model) return; - - qCDebug(appLog) << "CatalogTreeView::restoreExpandedSections() - Restoring" << sections.size() << "sections"; - - // 先折叠所有节点 - collapseAll(); - - // 遍历所有节点,匹配路径并展开 - const QList &itemList = model->findItems("*", Qt::MatchWildcard | Qt::MatchRecursive); - for (QStandardItem *item : itemList) { - QModelIndex idx = item->index(); - if (idx.column() != 0) - continue; - - // 构建当前节点的标题路径 - QStringList pathParts; - QStandardItem *cur = item; - while (cur) { - pathParts.prepend(cur->text()); - cur = cur->parent(); - } - QString path = pathParts.join("/"); - - if (sections.contains(path)) { - expand(idx); - qCDebug(appLog) << "CatalogTreeView::restoreExpandedSections() - Expanded:" << path; - } + if (model->rowCount() == 0) { + m_pendingExpandedSections = sections; + return; } + deepin_reader::applyCatalogExpansion(this, sections); } void CatalogTreeView::slotCollapsed(const QModelIndex &index) @@ -314,7 +293,8 @@ void CatalogTreeView::slotExpanded(const QModelIndex &index) void CatalogTreeView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous); - if (!rightnotifypagechanged) { + if (!m_populating && !rightnotifypagechanged + && !current.data(deepin_reader::CatalogNavigationRole).isValid()) { if (nullptr == m_sheet) { qCritical() << "Cannot navigate - document sheet is null"; @@ -342,6 +322,14 @@ void CatalogTreeView::onItemClicked(const QModelIndex ¤t) qCritical() << "Cannot navigate to clicked item - document sheet is null"; return; } + if (m_populating || !current.isValid()) + return; + const QVariant navigation = current.data(deepin_reader::CatalogNavigationRole); + if (navigation.isValid()) { + m_title = current.data(Qt::DisplayRole).toString(); + m_sheet->navigateTo(navigation.value()); + return; + } int nIndex = current.data(Qt::UserRole + 1).toInt(); double left = current.data(Qt::UserRole + 2).toDouble(); @@ -375,6 +363,9 @@ void CatalogTreeView::keyPressEvent(QKeyEvent *event) // qCDebug(appLog) << "CatalogTreeView::keyPressEvent() - Starting key press event"; rightnotifypagechanged = false; DTreeView::keyPressEvent(event); + if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) + && currentIndex().data(deepin_reader::CatalogNavigationRole).isValid()) + onItemClicked(currentIndex()); // qCDebug(appLog) << "CatalogTreeView::keyPressEvent() - Completed"; } diff --git a/reader/sidebar/CatalogTreeView.h b/reader/sidebar/CatalogTreeView.h index 7eacb9319..7b3c6e2fb 100644 --- a/reader/sidebar/CatalogTreeView.h +++ b/reader/sidebar/CatalogTreeView.h @@ -10,6 +10,7 @@ #include #include +#include DWIDGET_USE_NAMESPACE namespace deepin_reader { @@ -138,6 +139,8 @@ private slots: void onFontChanged(const QFont &font); private: + std::optional m_pendingExpandedSections; + bool m_populating = false; /** * @brief parseCatalogData * 解析文档目录数据 diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index a8f65d1ac..ab5162c06 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -90,7 +90,7 @@ DocSheet::DocSheet(const Dr::FileType &fileType, const QString &filePath, QWidg #endif #ifdef OFD_SUPPORT_ENABLED else if (Dr::OFD == fileType) - m_sidebar = new SheetSidebar(this, PREVIEW_THUMBNAIL | PREVIEW_BOOKMARK); + m_sidebar = new SheetSidebar(this, PREVIEW_THUMBNAIL | PREVIEW_CATALOG | PREVIEW_BOOKMARK); #endif else m_sidebar = new SheetSidebar(this); @@ -358,6 +358,11 @@ void DocSheet::jumpToOutline(const qreal &left, const qreal &top, int index) m_browser->jumpToOutline(left, top, index); } +bool DocSheet::navigateTo(const deepin_reader::NavigationTarget &target) +{ + return m_browser && m_browser->navigateTo(target); +} + void DocSheet::jumpToHighLight(deepin_reader::Annotation *annotation, const int index) { qCDebug(appLog) << "jumpToHighLight"; diff --git a/reader/uiframe/DocSheet.h b/reader/uiframe/DocSheet.h index 63a0c97a5..d9015e66c 100644 --- a/reader/uiframe/DocSheet.h +++ b/reader/uiframe/DocSheet.h @@ -233,6 +233,8 @@ class DocSheet : public Dtk::Widget::DSplitter * @return */ deepin_reader::Outline outline(); + bool navigateTo(const deepin_reader::NavigationTarget &target); + bool hasRestoredViewState() const { return m_restoredFromState; } /** * @brief jumpToOutline diff --git a/tests/document/ut_catalogoutlinemodel.cpp b/tests/document/ut_catalogoutlinemodel.cpp new file mode 100644 index 000000000..cdf529f34 --- /dev/null +++ b/tests/document/ut_catalogoutlinemodel.cpp @@ -0,0 +1,136 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later +#include "CatalogOutlineModel.h" +#include + +using namespace deepin_reader; + +TEST(CatalogOutlineModel, PreservesTargetlessParentsAndDeepChildren) +{ + Section leaf; + leaf.title = QStringLiteral("leaf"); + leaf.nIndex = 2; + Section root = leaf; + for (int i = 0; i < 8; ++i) { + Section parent; + parent.title = QStringLiteral("group %1").arg(i); + parent.children.append(root); + root = parent; + } + QStandardItemModel model; + appendCatalogSections(model.invisibleRootItem(), {root}); + ASSERT_EQ(model.rowCount(), 1); + QStandardItem *item = model.item(0); + EXPECT_EQ(model.item(0, 1)->text(), QString()); + EXPECT_EQ(item->data(CatalogPageRole).toInt(), -1); + for (int i = 0; i < 8; ++i) { + ASSERT_EQ(item->rowCount(), 1); + item = item->child(0); + } + EXPECT_EQ(item->text(), QStringLiteral("leaf")); + EXPECT_EQ(item->data(CatalogPageRole).toInt(), 2); +} + +TEST(CatalogOutlineModel, KeepsLegacyPageAndOffsetRolesInBothColumns) +{ + Section section; + section.title = QStringLiteral("chapter"); + section.nIndex = 3; + section.offsetPointF = QPointF(12, 34); + QStandardItemModel model; + appendCatalogSections(model.invisibleRootItem(), {section}); + ASSERT_EQ(model.rowCount(), 1); + ASSERT_EQ(model.columnCount(), 2); + EXPECT_EQ(model.item(0, 1)->text(), QStringLiteral("4")); + for (int c = 0; c < 2; ++c) { + EXPECT_EQ(model.item(0, c)->data(CatalogPageRole).toInt(), 3); + EXPECT_EQ(model.item(0, c)->data(CatalogLeftRole).toDouble(), 12); + EXPECT_EQ(model.item(0, c)->data(CatalogTopRole).toDouble(), 34); + } +} + +TEST(CatalogOutlineModel, PreservesSiblingOrderAndHandlesEmptyOutline) +{ + QStandardItemModel model; + appendCatalogSections(nullptr, {}); + appendCatalogSections(model.invisibleRootItem(), {}); + EXPECT_EQ(model.rowCount(), 0); + Section a, b; + a.title = QStringLiteral("A"); + b.title = QStringLiteral("B"); + appendCatalogSections(model.invisibleRootItem(), {a, b}); + ASSERT_EQ(model.rowCount(), 2); + EXPECT_EQ(model.item(0)->text(), QStringLiteral("A")); + EXPECT_EQ(model.item(1)->text(), QStringLiteral("B")); +} + +TEST(CatalogOutlineModel, TypedTargetsAndExpansionArePreservedInBothColumns) +{ + Section section; + section.title = QStringLiteral("typed"); + NavigationDestination destination; + destination.pageIndex = 2; + section.navigation = NavigationTarget{destination, {}}; + section.expanded = false; + QStandardItemModel model; + appendCatalogSections(model.invisibleRootItem(), {section}); + ASSERT_EQ(model.rowCount(), 1); + EXPECT_EQ(model.item(0, 1)->text(), QStringLiteral("3")); + for (int c = 0; c < 2; ++c) { + const auto *item = model.item(0, c); + EXPECT_EQ(item->data(CatalogPageRole).toInt(), 2); + const auto target = item->data(CatalogNavigationRole).value(); + ASSERT_TRUE(target.destination.has_value()); + EXPECT_EQ(target.destination->pageIndex, 2); + EXPECT_TRUE(item->data(CatalogExpandedRole).isValid()); + EXPECT_FALSE(item->data(CatalogExpandedRole).toBool()); + } +} + +TEST(CatalogOutlineModel, ExternalAndInvalidTargetsNeverInheritLegacyPage) +{ + Section external, invalid; + external.nIndex = 9; + external.navigation = NavigationTarget{{}, QUrl("https://example.invalid/")}; + invalid.nIndex = 8; + invalid.navigation = NavigationTarget{}; + QStandardItemModel model; + appendCatalogSections(model.invisibleRootItem(), {external, invalid}); + ASSERT_EQ(model.rowCount(), 2); + for (int i = 0; i < 2; ++i) { + EXPECT_EQ(model.item(i)->data(CatalogPageRole).toInt(), -1); + EXPECT_TRUE(model.item(i, 1)->text().isEmpty()); + EXPECT_TRUE(model.item(i)->data(CatalogNavigationRole).isValid()); + } +} + +TEST(CatalogOutlineModel, StoredExpansionIncludingEmptyListOverridesDefaultsWithoutSignals) +{ + Section leaf, child, root; + leaf.title = QStringLiteral("leaf"); + child.title = QStringLiteral("child"); + child.expanded = true; + child.children = {leaf}; + root.title = QStringLiteral("root"); + root.expanded = true; + root.children = {child}; + QStandardItemModel model; + appendCatalogSections(model.invisibleRootItem(), {root}); + QTreeView view; + view.setModel(&model); + int signalCount = 0; + QObject::connect(&view, &QTreeView::expanded, [&signalCount] { ++signalCount; }); + QObject::connect(&view, &QTreeView::collapsed, [&signalCount] { ++signalCount; }); + const QModelIndex rootIndex = model.index(0, 0); + const QModelIndex childIndex = model.index(0, 0, rootIndex); + applyCatalogExpansion(&view); + EXPECT_TRUE(view.isExpanded(rootIndex)); + EXPECT_TRUE(view.isExpanded(childIndex)); + applyCatalogExpansion(&view, QStringList{QStringLiteral("root")}); + EXPECT_TRUE(view.isExpanded(rootIndex)); + EXPECT_FALSE(view.isExpanded(childIndex)); + applyCatalogExpansion(&view, QStringList{}); + EXPECT_FALSE(view.isExpanded(rootIndex)); + EXPECT_FALSE(view.isExpanded(childIndex)); + EXPECT_EQ(signalCount, 0); +} diff --git a/tests/ofd-model/CMakeLists.txt b/tests/ofd-model/CMakeLists.txt index aacb7c800..ca5a8828f 100644 --- a/tests/ofd-model/CMakeLists.txt +++ b/tests/ofd-model/CMakeLists.txt @@ -25,6 +25,8 @@ get_filename_component(READER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../.." ABSOLUTE) add_executable(ofd-model-check main.cc ../document/ut_ofdmodel.cpp ../document/ut_navigation.cpp + ../document/ut_catalogoutlinemodel.cpp + ${READER_ROOT}/reader/sidebar/CatalogOutlineModel.cpp ${READER_ROOT}/reader/document/Navigation.cpp ${READER_ROOT}/reader/document/Navigation.h ${READER_ROOT}/reader/document/OfdModel.cpp @@ -34,7 +36,7 @@ target_compile_definitions(ofd-model-check PRIVATE OFD_SUPPORT_ENABLED UTSOURCEDIR="${READER_ROOT}/tests") target_include_directories(ofd-model-check PRIVATE ${ROFD_INCLUDE_DIR} - ${READER_ROOT}/reader ${READER_ROOT}/reader/document ${READER_ROOT}/reader/app + ${READER_ROOT}/reader ${READER_ROOT}/reader/document ${READER_ROOT}/reader/app ${READER_ROOT}/reader/sidebar ${READER_ROOT}/tests ${READER_ROOT}/3rdparty/deepin-pdfium/include) target_link_libraries(ofd-model-check PRIVATE Qt${QT_VERSION_MAJOR}::Widgets PkgConfig::CAIRO PkgConfig::DTKCORE diff --git a/tests/ofd-model/navigation_smoke.cc b/tests/ofd-model/navigation_smoke.cc new file mode 100644 index 000000000..36a94b4cb --- /dev/null +++ b/tests/ofd-model/navigation_smoke.cc @@ -0,0 +1,210 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later +#include "Application.h" +#include "BrowserPage.h" +#include "CatalogTreeView.h" +#include "CatalogOutlineModel.h" +#include "DocSheet.h" +#include "Navigation.h" +#include "SecurityDialog.h" +#include "SheetBrowser.h" +#include "SheetRenderer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace deepin_reader; +static int checks = 0; +static void verify(bool condition, const char *description) +{ + if (!condition) + qFatal("FAIL: %s", description); + ++checks; +} +static void settle() +{ + QEventLoop loop; + QTimer::singleShot(250, &loop, &QEventLoop::quit); + loop.exec(); +} +class UrlSink : public QObject { + Q_OBJECT +public: + int calls = 0; +public slots: + void capture(const QUrl &) { ++calls; } +}; + +int main(int argc, char **argv) +{ + Application app(argc, argv); + QTimer::singleShot(60000, [] { qFatal("Smoke test timed out"); }); + QTemporaryDir fixture; + verify(fixture.isValid(), "fixture directory"); + QByteArray nested; + for (int i = 0; i < 8; ++i) + nested += ""; + nested += "" + "" + ""; + for (int i = 0; i < 8; ++i) + nested += ""; + nested += "" + ""; + const QMap entries{ + {"OFD.xml", "Document.xml"}, + {"Document.xml", "7 11 210 297" + "" + "" + nested + + ""}, + {"Page.xml", "7 11 210 297" + "" + "" + "" + "M 0 0 L 40 0 L 40 25 L 0 25 C" + ""}, + {"Second.xml", "3 5 100 120"} + }; + for (auto it = entries.cbegin(); it != entries.cend(); ++it) { + QFile file(fixture.filePath(it.key())); + verify(file.open(QIODevice::WriteOnly) && file.write(it.value()) == it.value().size(), "fixture file"); + } + QProcess zip; + zip.setWorkingDirectory(fixture.path()); + zip.start("cmake", QStringList{"-E", "tar", "cf", "smoke.ofd", "--format=zip"} + entries.keys()); + verify(zip.waitForFinished() && zip.exitCode() == 0, "fixture archive"); + UrlSink sink; + QDesktopServices::setUrlHandler("https", &sink, "capture"); + DocSheet sheet(Dr::OFD, fixture.filePath("smoke.ofd")); + sheet.resize(1100, 800); + sheet.show(); + verify(sheet.openFileExec(QString()), "open OFD in real DocSheet"); + settle(); + auto *browser = sheet.getSheetBrowser(); + auto *catalog = sheet.findChild(); + verify(browser && catalog, "OFD has browser and catalog widgets"); + catalog->handleOpenSuccess(); + verify(catalog->model()->rowCount() == 2, "root catalog rows"); + QModelIndex leaf; + for (int i = 0; i < 9; ++i) { + leaf = catalog->model()->index(0, 0, leaf); + verify(leaf.isValid(), "full catalog depth"); + if (i < 8) + verify(catalog->isExpanded(leaf), "document expansion defaults"); + } + verify(sheet.currentPage() == 1, "population does not navigate"); + catalog->setCurrentIndex(leaf); + verify(sheet.currentPage() == 1, "selection does not navigate"); + QKeyEvent enter(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); + QCoreApplication::sendEvent(catalog, &enter); + verify(sheet.currentPage() == 2 && qAbs(sheet.operation().scaleFactor - 2) < .001, + "keyboard activation uses target page and zoom"); + catalog->restoreExpandedSections({}); + verify(catalog->getExpandedSections().isEmpty(), "all-collapsed saved state wins"); + + const QModelIndex website = catalog->model()->index(1, 1); + int dialogs = 0; + QTimer cancel; + QObject::connect(&cancel, &QTimer::timeout, [&] { + for (QWidget *widget : QApplication::topLevelWidgets()) { + if (auto *dialog = qobject_cast(widget); dialog && dialog->isVisible()) { + ++dialogs; + dialog->reject(); + } + } + }); + cancel.start(10); + catalog->setCurrentIndex(website); + settle(); + verify(dialogs == 0 && sink.calls == 0, "URI selection has no effects"); + QCoreApplication::sendEvent(catalog, &enter); + verify(dialogs == 1 && sink.calls == 0, "URI keyboard activation confirms once and cancellation blocks opening"); + QMetaObject::invokeMethod(catalog, "onItemClicked", Qt::DirectConnection, Q_ARG(QModelIndex, website)); + verify(dialogs == 2 && sink.calls == 0, "URI click confirms once and cancellation blocks opening"); + + for (int rotation = 0; rotation < 4; ++rotation) { + if (rotation) + sheet.rotateRight(); + for (Dr::LayoutMode layout : {Dr::SinglePageMode, Dr::TwoPagesMode}) { + sheet.setLayoutMode(layout); + for (DestinationMode mode : {DestinationMode::XYZ, DestinationMode::Fit, DestinationMode::FitH, + DestinationMode::FitV, DestinationMode::FitR}) { + NavigationDestination destination; + destination.pageIndex = 1; + destination.mode = mode; + destination.left = 20; + destination.top = 30; + destination.right = 200; + destination.bottom = 250; + destination.zoom = 1.5; + NavigationTarget target; + target.destination = destination; + verify(sheet.navigateTo(target), "navigate mode/rotation/layout"); + verify(sheet.currentPage() == 2 && std::isfinite(sheet.operation().scaleFactor), "valid navigation state"); + BrowserPage *page = nullptr; + for (auto *item : browser->scene()->items()) + if (auto *candidate = dynamic_cast(item); candidate && candidate->itemIndex() == 1) + page = candidate; + verify(page, "target scene item"); + const auto view = navigationView(destination, sheet.renderer()->getPageSize(1), + QSizeF(browser->viewport()->size()), {}, sheet.operation().scaleFactor, + sheet.maxScaleFactor(), rotation * 90, layout == Dr::TwoPagesMode); + verify(view.has_value(), "navigation reference"); + const qreal scale = sheet.operation().scaleFactor; + const QPointF expected = page->mapRectToScene(QRectF(view->focusRect.topLeft() * scale, + view->focusRect.size() * scale)).topLeft(); + verify(browser->horizontalScrollBar()->value() == qRound(qBound(qreal(browser->horizontalScrollBar()->minimum()), expected.x(), qreal(browser->horizontalScrollBar()->maximum()))) + && browser->verticalScrollBar()->value() == qRound(qBound(qreal(browser->verticalScrollBar()->minimum()), expected.y(), qreal(browser->verticalScrollBar()->maximum()))), + "scroll aligns to transformed target"); + } + } + } + // Capture the old viewport position independently of navigationView. This + // exercises omitted-coordinate conversion through a rotated, scrolled page. + sheet.setLayoutMode(Dr::SinglePageMode); + sheet.setScaleFactor(2); + sheet.jumpToPage(2); + BrowserPage *sourcePage = nullptr; + BrowserPage *targetPage = nullptr; + for (auto *item : browser->scene()->items()) { + if (auto *page = dynamic_cast(item)) { + if (page->itemIndex() == 1) + sourcePage = page; + if (page->itemIndex() == 0) + targetPage = page; + } + } + verify(sourcePage && targetPage, "omitted-axis scene items"); + browser->horizontalScrollBar()->setValue(browser->horizontalScrollBar()->maximum() / 2); + const QPointF priorPosition = sourcePage->mapFromScene(browser->mapToScene(QPoint(0, 0))) / 2; + NavigationTarget partial; + partial.destination = NavigationDestination{}; + partial.destination->pageIndex = 0; + partial.destination->top = 40; + partial.destination->zoom = 0; + verify(sheet.navigateTo(partial), "rotated XYZ with omitted left"); + verify(sheet.operation().scaleFactor == 2, "zero zoom keeps the old scale"); + const QPointF expectedPartial = targetPage->mapToScene( + QPointF(qBound(qreal(0), priorPosition.x(), sheet.renderer()->getPageSize(0).width()), 40) * 2); + verify(browser->horizontalScrollBar()->value() == qRound(qBound(qreal(browser->horizontalScrollBar()->minimum()), expectedPartial.x(), qreal(browser->horizontalScrollBar()->maximum()))) + && browser->verticalScrollBar()->value() == qRound(qBound(qreal(browser->verticalScrollBar()->minimum()), expectedPartial.y(), qreal(browser->verticalScrollBar()->maximum()))), + "omitted axis retains captured current-page position"); + const auto oldScale = sheet.operation().scaleFactor; + NavigationTarget invalid; + invalid.destination = NavigationDestination{}; + invalid.destination->pageIndex = 999; + verify(!sheet.navigateTo(invalid) && sheet.operation().scaleFactor == oldScale, + "out-of-range target has no effects"); + verify(sink.calls == 0, "no network navigation attempted"); + QDesktopServices::unsetUrlHandler("https"); + qInfo("PASS: %d real-widget navigation checks", checks); + return 0; +} +#include "navigation_smoke.moc" diff --git a/tests/ofd-model/run_navigation_smoke.py b/tests/ofd-model/run_navigation_smoke.py new file mode 100644 index 000000000..e92bb3f08 --- /dev/null +++ b/tests/ofd-model/run_navigation_smoke.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# SPDX-License-Identifier: GPL-3.0-or-later +"""Run real-widget checks using an already-built Unix Makefiles reader target. + +Only the small smoke entry point is compiled. Reuse the application's objects +and libraries, replacing main, instead of building the monolithic unit tests. +""" + +import argparse +import json +import os +from pathlib import Path +import shlex +import subprocess +import tempfile + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("build", type=Path, help="completed reader CMake build directory") + args = parser.parse_args() + reader = args.build.resolve() / "reader" + target = reader / "CMakeFiles/deepin-reader.dir" + flags = {} + for line in (target / "flags.make").read_text().splitlines(): + key, separator, value = line.partition(" = ") + if separator: + flags[key] = shlex.split(value) + if "-DOFD_SUPPORT_ENABLED" not in flags["CXX_DEFINES"]: + parser.error("reader must have OFD support enabled") + link = shlex.split((target / "link.txt").read_text()) + main_object = "CMakeFiles/deepin-reader.dir/main.cpp.o" + if link.count(main_object) != 1 or link.count("-o") != 1: + parser.error("unsupported reader link command; use the Unix Makefiles generator") + moc = json.loads((reader / "CMakeFiles/deepin-reader_autogen.dir/AutogenInfo.json").read_text())["QT_MOC_EXECUTABLE"] + source = Path(__file__).resolve().with_name("navigation_smoke.cc") + with tempfile.TemporaryDirectory(prefix="navigation-smoke-", dir=args.build.resolve()) as directory: + work = Path(directory) + obj = work / "navigation_smoke.o" + binary = work / "navigation-smoke" + subprocess.run([moc, str(source), "-o", str(work / "navigation_smoke.moc")], check=True) + subprocess.run([link[0], *flags["CXX_DEFINES"], *flags["CXX_INCLUDES"], + *flags["CXX_FLAGS"], "-I", str(work), "-c", str(source), "-o", str(obj)], + cwd=reader, check=True) + link[link.index(main_object)] = str(obj) + link[link.index("-o") + 1] = str(binary) + link = [arg for arg in link if not arg.startswith("-Wl,--dependency-file=")] + subprocess.run(link, cwd=reader, check=True) + environment = dict(os.environ, QT_QPA_PLATFORM="offscreen", QT_LOGGING_RULES="*.debug=false") + for name in ("XDG_CONFIG_HOME", "XDG_DATA_HOME", "XDG_CACHE_HOME", "TMPDIR"): + path = work / name.lower() + path.mkdir() + environment[name] = str(path) + subprocess.run([str(binary)], cwd=reader, env=environment, check=True, timeout=90) + + +if __name__ == "__main__": + main() From 6ad67a73f337985041fb554eca7b5cf5b5497130 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 10:30:44 +0800 Subject: [PATCH 15/63] feat(ofd): connect page links to typed navigation --- CMakeLists.txt | 23 ++- reader/browser/SheetBrowser.cpp | 3 + reader/document/OfdModel.cpp | 97 +++++++++++ reader/document/OfdModel.h | 4 + tests/document/ut_ofdmodel.cpp | 241 +++++++++++++++++++++++++++- tests/ofd-model/navigation_smoke.cc | 49 ++++++ 6 files changed, 410 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16b7cd959..dc1056bcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,7 +109,12 @@ if (OFD_SUPPORT) rofd_metadata_t *metadata = 0; rofd_warning_list_t *warnings = 0; rofd_outline_t *outline = 0; + rofd_link_list_t *links = 0; + rofd_outline_node_t node = {0}; + rofd_action_t action = {0}; rofd_destination_t destination = {0}; + rofd_rect_t region = {0}; + size_t count = 0; int32_t w = 0, h = 0; rofd_pixel_rect_init(&viewport, sizeof(viewport)); rofd_renderer_get_pixel_canvas_size(0, 0, 0, &w, &h, 0); @@ -119,19 +124,29 @@ if (OFD_SUPPORT) rofd_metadata_free(metadata); rofd_document_get_warnings(0, &warnings, 0); rofd_warning_list_free(warnings); - (void)&rofd_document_get_outline; - (void)&rofd_outline_get_action_destination; - (void)&rofd_outline_free; rofd_document_get_outline(0, &outline, 0); + node.struct_size = sizeof(node); + action.struct_size = sizeof(action); destination.struct_size = sizeof(destination); + rofd_outline_get_count(outline, &count, 0); + rofd_outline_get_node(outline, 0, &node, 0); + rofd_outline_get_action(outline, 0, 0, &action, 0); rofd_outline_get_action_destination(outline, 0, 0, &destination, 0); rofd_outline_free(outline); + rofd_page_get_links(0, &links, 0); + rofd_link_list_get_count(links, &count, 0); + rofd_link_list_get_region_count(links, 0, &count, 0); + rofd_link_list_get_region(links, 0, 0, ®ion, 0); + rofd_link_list_get_action_count(links, 0, &count, 0); + rofd_link_list_get_action(links, 0, 0, &action, 0); + rofd_link_list_get_action_destination(links, 0, 0, &destination, 0); + rofd_link_list_free(links); return 0; } ]=] ROFD_READER_APIS_AVAILABLE) cmake_pop_check_state() if (NOT ROFD_READER_APIS_AVAILABLE) - message(FATAL_ERROR "rofd headers/library lack the required region, metadata, warning or outline APIs. Install matching rofd >= 0.4.0 headers and library, and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") + message(FATAL_ERROR "rofd headers/library lack the required region, metadata, warning, outline or page-link APIs. Install matching rofd >= 0.4.0 headers and library, and set ROFD_INCLUDE_DIR/ROFD_FFI_LIBRARY accordingly.") endif() message(STATUS ">>> OFD support enabled (rofd_ffi: ${ROFD_FFI_LIBRARY})") add_compile_definitions(OFD_SUPPORT_ENABLED) diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index 1ddcfc500..5a36dc9c5 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -2267,6 +2267,9 @@ bool SheetBrowser::jump2Link(QPointF point) Link link = m_sheet->renderer()->getLinkAtPoint(page->itemIndex(), point); + if (link.navigation) + return navigateTo(*link.navigation); + if (link.page > 0 && link.page <= allPages()) { qCDebug(appLog) << "SheetBrowser::jump2Link() - Link page is greater than 0 and less than or equal to all pages"; jump2PagePos(m_items.at(link.page - 1), link.left, link.top); diff --git a/reader/document/OfdModel.cpp b/reader/document/OfdModel.cpp index 4dfa76736..08627b1ed 100644 --- a/reader/document/OfdModel.cpp +++ b/reader/document/OfdModel.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace deepin_reader { @@ -596,6 +597,102 @@ QSizeF OfdPage::sizeF() const return m_sizePixel; } +Link OfdPage::getLinkAtPoint(const QPointF &point) +{ + if (!m_document || !m_page || !std::isfinite(point.x()) || !std::isfinite(point.y())) + return {}; + QMutexLocker lock(&m_linksMutex); + const bool loading = !m_linksLoaded; + if (loading) { + // The completed cache is Qt-owned and never changed, including empty + // and failed snapshots. Mouse movement must not retry failed parsing. + m_linksLoaded = true; + m_links = [this]() -> QList { + rofd_link_list_t *raw = nullptr; + rofd_error_t *error = nullptr; + const rofd_status_t status = rofd_page_get_links(m_page, &raw, &error); + const std::unique_ptr snapshot(raw, rofd_link_list_free); + if (status != ROFD_STATUS_OK || !snapshot) { + logSemanticError("Link loading", m_pageIndex, status, error); + return {}; + } + rofd_error_free(error); + size_t count = 0; + if (rofd_link_list_get_count(raw, &count, nullptr) != ROFD_STATUS_OK + || count > static_cast(std::numeric_limits::max())) { + qCWarning(appLog) << "Invalid OFD link count, page:" << m_pageIndex; + return {}; + } + QList links; + for (size_t i = 0; i < count; ++i) { + size_t actionCount = 0; + if (rofd_link_list_get_action_count(raw, i, &actionCount, nullptr) != ROFD_STATUS_OK) + continue; + Link link; + for (size_t actionIndex = 0; actionIndex < actionCount; ++actionIndex) { + rofd_action_t action = {}; + action.struct_size = sizeof(action); + if (rofd_link_list_get_action(raw, i, actionIndex, &action, nullptr) != ROFD_STATUS_OK) + continue; + rofd_destination_t destination = {}; + destination.struct_size = sizeof(destination); + const rofd_destination_t *target = nullptr; + if (action.event == ROFD_ACTION_EVENT_CLICK && action.kind == ROFD_ACTION_GOTO + && rofd_link_list_get_action_destination(raw, i, actionIndex, &destination, nullptr) == ROFD_STATUS_OK) { + target = &destination; + } + link.navigation = m_document->navigationTarget(action, target); + if (link.navigation) + break; + } + if (!link.navigation) + continue; + size_t regionCount = 0; + if (rofd_link_list_get_region_count(raw, i, ®ionCount, nullptr) != ROFD_STATUS_OK) + continue; + // addRect uses the same winding for each positive rectangle: + // overlapping areas stay clickable, but separated gaps do not. + link.boundary.setFillRule(Qt::WindingFill); + for (size_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { + rofd_rect_t region = {}; + if (rofd_link_list_get_region(raw, i, regionIndex, ®ion, nullptr) != ROFD_STATUS_OK) + continue; + const QRectF rect = toPixels(region); + if (std::isfinite(rect.x()) && std::isfinite(rect.y()) + && std::isfinite(rect.width()) && rect.width() > 0 + && std::isfinite(rect.height()) && rect.height() > 0 + && std::isfinite(rect.right()) && std::isfinite(rect.bottom())) { + link.boundary.addRect(rect); + } + } + if (link.boundary.isEmpty()) + continue; + if (link.navigation->destination) { + const auto &destination = *link.navigation->destination; + link.page = destination.pageIndex + 1; + link.left = destination.left.value_or(0); + link.top = destination.top.value_or(0); + } else { + link.urlOrFileName = link.navigation->uri.toString(QUrl::FullyEncoded); + } + links.append(std::move(link)); + } + return links; + }(); + } + Link result; + for (const Link &link : std::as_const(m_links)) { + if (link.boundary.contains(point)) { + result = link; + break; + } + } + lock.unlock(); + if (loading) + m_document->warningDetails(); + return result; +} + QImage OfdPage::render(int width, int height, const QRect &slice) const { if (nullptr == m_document || nullptr == m_page) { diff --git a/reader/document/OfdModel.h b/reader/document/OfdModel.h index 227b79304..ff58f233c 100644 --- a/reader/document/OfdModel.h +++ b/reader/document/OfdModel.h @@ -84,6 +84,7 @@ class OfdPage : public Page QString text(const QRectF &rect) const override; QVector search(const QString &text, bool matchCase, bool wholeWords) const override; QList words() override; + Link getLinkAtPoint(const QPointF &point) override; private: rofd_rect_t toMillimetres(const QRectF &rect) const; @@ -94,6 +95,9 @@ class OfdPage : public Page int m_pageIndex = -1; rofd_rect_t m_pageRectMm = {0.0, 0.0, 0.0, 0.0}; QSizeF m_sizePixel; + QMutex m_linksMutex; + bool m_linksLoaded = false; + QList m_links; }; } // namespace deepin_reader diff --git a/tests/document/ut_ofdmodel.cpp b/tests/document/ut_ofdmodel.cpp index 2b57eaa71..22a43095e 100644 --- a/tests/document/ut_ofdmodel.cpp +++ b/tests/document/ut_ofdmodel.cpp @@ -41,7 +41,8 @@ bool hasOfdFile() QString createOfdFixture(const QTemporaryDir &dir, const QByteArray &info, const QByteArray &pageArea = QByteArray(), const QByteArray &documentExtras = QByteArray(), - const QByteArray &secondPage = QByteArray()) + const QByteArray &secondPage = QByteArray(), + const QByteArray &extraObjects = QByteArray()) { QMap entries = { {"OFD.xml", "" + info @@ -51,7 +52,7 @@ QString createOfdFixture(const QTemporaryDir &dir, const QByteArray &info, + (secondPage.isEmpty() ? QByteArray() : QByteArray("")) + "" + documentExtras + ""}, - {"Page.xml", "" + pageArea + "" + pageArea + "" + extraObjects + "" "M 0 0 L 40 0 L 40 25 L 0 25 C" ""} @@ -82,6 +83,23 @@ QByteArray outlineNode(const QByteArray &title, const QByteArray &action) + action + ""; } +QByteArray linkAction(const QByteArray &action, const QByteArray ®ion = QByteArray(), + const QByteArray &event = "CLICK") +{ + return "" + region + action + ""; +} + +QPointF linkPoint(const OfdDocument &doc, qreal xMm, qreal yMm) +{ + return QPointF((xMm - 7) * doc.xRes() / 25.4, (yMm - 11) * doc.yRes() / 25.4); +} + +const QByteArray separatedLinkRegions = R"xml( + + + + )xml"; + } // namespace class TestOfdModel : public ::testing::Test @@ -311,7 +329,9 @@ TEST(OfdApi, outlineConcurrentAndEmptyOrFailedSnapshotsStayStable) const QByteArray deepOutline = "" + QByteArray("").repeated(66) + QByteArray("").repeated(66) + ""; for (const QByteArray &extras : {QByteArray(), deepOutline, - QByteArray("")}) { + QByteArray(""), + QByteArray("") + outlineNode("root", "") + + ""}) { QTemporaryDir dir; ASSERT_TRUE(dir.isValid()); const QString path = createOfdFixture(dir, {}, explicitPageArea, extras); @@ -332,6 +352,221 @@ TEST(OfdApi, outlineConcurrentAndEmptyOrFailedSnapshotsStayStable) } } +TEST(OfdApi, linksKeepSeparateRegionsAndChooseFirstSupportedOverlap) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QByteArray actions = "" + + linkAction("", {}, "PO") + + linkAction("", separatedLinkRegions) + + linkAction("", separatedLinkRegions) + + linkAction("", separatedLinkRegions) + ""; + const QString path = createOfdFixture(dir, {}, explicitPageArea + actions, + "" + "", offsetSecondPage); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + const Link first = page->getLinkAtPoint(linkPoint(*doc, 11, 21)); + EXPECT_TRUE(first.isValid()); // The inherited Page stub cannot provide a link. + ASSERT_TRUE(first.navigation.has_value()); + ASSERT_TRUE(first.navigation->destination.has_value()); + const auto &destination = *first.navigation->destination; + EXPECT_EQ(destination.pageIndex, 1); + EXPECT_EQ(first.page, 2); + ASSERT_TRUE(destination.left.has_value()); + ASSERT_TRUE(destination.top.has_value()); + EXPECT_DOUBLE_EQ(*destination.left, 10.0 * doc->xRes() / 25.4); + EXPECT_DOUBLE_EQ(*destination.top, 20.0 * doc->yRes() / 25.4); + ASSERT_TRUE(destination.zoom.has_value()); + EXPECT_DOUBLE_EQ(*destination.zoom, 0.0); + for (const QPointF point : {linkPoint(*doc, 15, 25), linkPoint(*doc, 45, 45)}) { + const Link hit = page->getLinkAtPoint(point); + EXPECT_TRUE(hit.isValid()); + EXPECT_EQ(hit.page, 2); + EXPECT_TRUE(hit.boundary.contains(point)); + } + EXPECT_FALSE(page->getLinkAtPoint(linkPoint(*doc, 30, 35)).isValid()); + EXPECT_FALSE(first.boundary.contains(linkPoint(*doc, 30, 35))); + page.reset(); + doc.reset(); + EXPECT_EQ(first.navigation->destination->pageIndex, 1); + EXPECT_FALSE(first.boundary.isEmpty()); +} + +TEST(OfdApi, linksUseAlreadyTransformedRegionsAndBoundaryFallback) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QByteArray explicitRegion = "" + ""; + const auto object = [](const QByteArray &id, const QByteArray &boundary, const QByteArray &actions) { + return "M 0 0 L 1 0 L 1 1 C" + "" + actions + ""; + }; + const QByteArray objects = object("10", "50 60 20 10", + linkAction("", explicitRegion)) + + object("11", "100 110 20 10", linkAction("")); + const QString path = createOfdFixture(dir, {}, explicitPageArea, {}, {}, objects); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + for (const auto &sample : {std::make_pair(QPointF(55, 65), QString("https://explicit.invalid/")), + std::make_pair(QPointF(105, 115), QString("https://fallback.invalid/"))}) { + const Link hit = page->getLinkAtPoint(linkPoint(*doc, sample.first.x(), sample.first.y())); + ASSERT_TRUE(hit.navigation.has_value()); + EXPECT_EQ(hit.urlOrFileName, sample.second); + EXPECT_EQ(hit.navigation->uri, QUrl(sample.second)); + EXPECT_NEAR(hit.boundary.boundingRect().width(), 20 * doc->xRes() / 25.4, 1e-6); + EXPECT_NEAR(hit.boundary.boundingRect().height(), 10 * doc->yRes() / 25.4, 1e-6); + } + EXPECT_FALSE(page->getLinkAtPoint(linkPoint(*doc, 80, 90)).isValid()); + EXPECT_FALSE(page->getLinkAtPoint(linkPoint(*doc, 1000, 1100)).isValid()); +} + +TEST(OfdApi, linksResolveSafeBaseAndSkipAllUnsupportedActions) +{ + const QList unsupported = { + linkAction("", {}, "PO"), + linkAction("", {}, "DO"), + linkAction("", {}, "CUSTOM"), + linkAction(""), linkAction(""), + linkAction(""), + linkAction(""), + linkAction(""), + linkAction(""), + linkAction(""), + linkAction("") + }; + QByteArray allUnsupported; + for (const QByteArray &action : unsupported) + allUnsupported += action; + for (bool hasSupported : {false, true}) { + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QByteArray supported = hasSupported + ? linkAction("") + + linkAction("") : QByteArray(); + const QString path = createOfdFixture(dir, {}, explicitPageArea + "" + + allUnsupported + supported + ""); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + const Link hit = page->getLinkAtPoint(linkPoint(*doc, 15, 25)); + EXPECT_EQ(hit.isValid(), hasSupported); + if (hasSupported) { + ASSERT_TRUE(hit.navigation.has_value()); + EXPECT_EQ(hit.navigation->uri, QUrl("https://example.invalid/base/child?q=1&x=2")); + EXPECT_EQ(hit.urlOrFileName, QStringLiteral("https://example.invalid/base/child?q=1&x=2")); + EXPECT_EQ(hit.page, -1); + } + } +} + +TEST(OfdApi, linksRemainIndependentOfFailedOutlines) +{ + const QByteArray deepOutline = "" + QByteArray("").repeated(66) + + QByteArray("").repeated(66) + ""; + for (bool outlineFirst : {false, true}) { + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, {}, explicitPageArea + "" + + linkAction("") + "", deepOutline + + "", + offsetSecondPage); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + if (outlineFirst) + EXPECT_TRUE(doc->outline().isEmpty()); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + const Link hit = page->getLinkAtPoint(linkPoint(*doc, 15, 25)); + ASSERT_TRUE(hit.navigation.has_value()); + ASSERT_TRUE(hit.navigation->destination.has_value()); + EXPECT_EQ(hit.navigation->destination->pageIndex, 1); + EXPECT_TRUE(doc->outline().isEmpty()); + EXPECT_TRUE(page->getLinkAtPoint(linkPoint(*doc, 15, 25)).isValid()); + } +} + +TEST(OfdApi, linksRefreshLazyWarningsWithoutInventingInvalidRegions) +{ + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, {}, explicitPageArea + "" + + linkAction("", "") + + linkAction("", separatedLinkRegions) + + "", {}, ""); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + EXPECT_TRUE(doc->properties().value("Warnings").toList().isEmpty()); + const Link hit = page->getLinkAtPoint(linkPoint(*doc, 15, 25)); + ASSERT_TRUE(hit.navigation.has_value()); + ASSERT_TRUE(hit.navigation->destination.has_value()); + EXPECT_DOUBLE_EQ(*hit.navigation->destination->left, 10.0 * doc->xRes() / 25.4); + const QVariantList warnings = doc->properties().value("Warnings").toList(); + ASSERT_EQ(warnings.size(), 2); + QList codes; + for (const QVariant &warning : warnings) + codes.append(warning.toMap().value("Code").toUInt()); + EXPECT_TRUE(codes.contains(ROFD_WARNING_NAVIGATION_INVALID)); + EXPECT_TRUE(codes.contains(ROFD_WARNING_PAGE_AREA_FALLBACK)); + EXPECT_FALSE(page->getLinkAtPoint(linkPoint(*doc, 100, 100)).isValid()); + EXPECT_EQ(doc->properties().value("Warnings").toList(), warnings); + EXPECT_FALSE(page->render(210, 297).isNull()); +} + +TEST(OfdApi, linksConcurrentEmptyAndFailedSnapshotsStayStable) +{ + // Deferred action XML is allowed to load the page but exceeds rofd's + // 100000-node navigation budget when a link snapshot is requested. + const QByteArray tooManyNodes = "" + QByteArray("").repeated(100001) + ""; + const QByteArray validGoto = "" + linkAction("") + + ""; + for (const QByteArray &actions : {QByteArray(), validGoto, tooManyNodes}) { + QTemporaryDir dir; + ASSERT_TRUE(dir.isValid()); + const QString path = createOfdFixture(dir, {}, explicitPageArea + actions); + ASSERT_FALSE(path.isEmpty()); + Document::Error error; + std::unique_ptr doc(OfdDocument::loadDocument(path, error)); + ASSERT_NE(doc, nullptr); + std::unique_ptr page(doc->page(0)); + ASSERT_NE(page, nullptr); + const QPointF point = linkPoint(*doc, 15, 25); + std::vector> queries; + for (int i = 0; i < 8; ++i) + queries.push_back(std::async(std::launch::async, [&page, point] { return page->getLinkAtPoint(point); })); + for (auto &query : queries) + EXPECT_EQ(query.get().isValid(), actions == validGoto); + EXPECT_EQ(page->getLinkAtPoint(point).isValid(), actions == validGoto); + EXPECT_FALSE(page->render(210, 297).isNull()); + } +} + +TEST(OfdApi, linksMissingOwnersAreInert) +{ + OfdPage page(nullptr, nullptr, -1); + EXPECT_FALSE(page.getLinkAtPoint(QPointF(1, 1)).isValid()); + EXPECT_FALSE(page.getLinkAtPoint(QPointF(1, 1)).navigation.has_value()); +} + TEST_F(TestOfdModel, loadDocument) { EXPECT_GT(m_doc->pageCount(), 0); diff --git a/tests/ofd-model/navigation_smoke.cc b/tests/ofd-model/navigation_smoke.cc index 36a94b4cb..79535118e 100644 --- a/tests/ofd-model/navigation_smoke.cc +++ b/tests/ofd-model/navigation_smoke.cc @@ -69,6 +69,10 @@ int main(int argc, char **argv) "" "" "M 0 0 L 40 0 L 40 25 L 0 25 C" + "" + "" + "" + "M 0 0 L 40 0 L 40 25 L 0 25 C" ""}, {"Second.xml", "3 5 100 120"} }; @@ -202,6 +206,51 @@ int main(int argc, char **argv) invalid.destination->pageIndex = 999; verify(!sheet.navigateTo(invalid) && sheet.operation().scaleFactor == oldScale, "out-of-range target has no effects"); + + while (sheet.operation().rotation != Dr::RotateBy0) + sheet.rotateRight(); + NavigationTarget firstPage; + firstPage.destination = NavigationDestination{}; + firstPage.destination->pageIndex = 0; + firstPage.destination->left = 0; + firstPage.destination->top = 0; + firstPage.destination->zoom = 1; + verify(sheet.navigateTo(firstPage), "prepare page link interaction"); + const auto hitPoint = [&](qreal xMillimetres) { + // Source physical origin is (7,11); fixture hit is at y=35 mm. + const QPointF local((xMillimetres - 7) * targetPage->boundingRect().width() / 210, + 24 * targetPage->boundingRect().height() / 297); + browser->centerOn(targetPage->mapToScene(local)); + return browser->mapFromScene(targetPage->mapToScene(local)); + }; + const auto clickLink = [&](const QPoint &point) { + QMouseEvent press(QEvent::MouseButtonPress, QPointF(point), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QMouseEvent release(QEvent::MouseButtonRelease, QPointF(point), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); + QCoreApplication::sendEvent(browser->viewport(), &press); + QCoreApplication::sendEvent(browser->viewport(), &release); + }; + QPoint hit = hitPoint(25); + QMouseEvent hover(QEvent::MouseMove, QPointF(hit), Qt::NoButton, Qt::NoButton, Qt::NoModifier); + QCoreApplication::sendEvent(browser->viewport(), &hover); + verify(browser->cursor().shape() == Qt::PointingHandCursor, "page link hover cursor"); + NavigationDestination fit; + fit.pageIndex = 1; + fit.mode = DestinationMode::Fit; + const auto expectedFit = navigationView(fit, sheet.renderer()->getPageSize(1), + QSizeF(browser->viewport()->size()), {}, sheet.operation().scaleFactor, + sheet.maxScaleFactor(), 0, false); + verify(expectedFit.has_value(), "page-link fit reference"); + clickLink(hit); + verify(sheet.currentPage() == 2, "page link reaches typed destination"); + verify(qAbs(sheet.operation().scaleFactor - expectedFit->scale) < .001, + "page link preserves Fit destination mode"); + verify(sheet.navigateTo(firstPage), "return to URI page link"); + hit = hitPoint(85); + const Link uriLink = sheet.renderer()->getLinkAtPoint(0, QPointF(78 * targetPage->boundingRect().width() / 210, + 24 * targetPage->boundingRect().height() / 297)); + verify(uriLink.urlOrFileName == "https://example.invalid/page", "page link hover URL"); + clickLink(hit); + verify(dialogs == 3 && sink.calls == 0, "URI page link confirms once and cancellation blocks opening"); verify(sink.calls == 0, "no network navigation attempted"); QDesktopServices::unsetUrlHandler("https"); qInfo("PASS: %d real-widget navigation checks", checks); From 7e07bc261f695b4843b9391ffb5266c625df057a Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 10:31:29 +0800 Subject: [PATCH 16/63] docs(ofd): record navigation integration verification --- .../plans/2026-09-11-ofd-navigation.md | 93 +++++++++++++------ .../specs/2026-09-11-ofd-navigation-design.md | 7 +- tests/ofd-model/README.md | 35 ++++++- 3 files changed, 102 insertions(+), 33 deletions(-) diff --git a/docs/superpowers/plans/2026-09-11-ofd-navigation.md b/docs/superpowers/plans/2026-09-11-ofd-navigation.md index 046566ccd..09770f1b0 100644 --- a/docs/superpowers/plans/2026-09-11-ofd-navigation.md +++ b/docs/superpowers/plans/2026-09-11-ofd-navigation.md @@ -33,11 +33,11 @@ ctest --test-dir build/ofd-model --output-on-failure `tests/document/ut_navigation.cpp`; modify `reader/document/Model.h` and `tests/ofd-model/CMakeLists.txt`. -- [ ] Add tests first for missing/zero fields, all five modes, invalid rectangles, +- [x] Add tests first for missing/zero fields, all five modes, invalid rectangles, scale limits, 90/180/270-degree rotation, double-page viewport allocation, allowed URI resolution, rejected file/relative/unknown URI, and legacy defaults. -- [ ] Run the focused target and capture the missing-behavior failure before implementation. -- [ ] Implement this shared contract (namespace `deepin_reader`): +- [x] Run the focused target and capture the missing-behavior failure before implementation. +- [x] Implement this shared contract (namespace `deepin_reader`): ```cpp enum class DestinationMode { XYZ, Fit, FitH, FitV, FitR }; @@ -72,31 +72,31 @@ std::optional navigationView( XYZ defaults use currentPosition; zoom absent/zero preserves currentScale. URI resolution accepts only absolute HTTP/HTTPS with host and nonempty mailto, uses QUrl strict parsing and explicit Base, and never performs I/O. -- [ ] Verify all tests, including `Link legacy; legacy.page = 1; EXPECT_TRUE(legacy.isValid());`. -- [ ] Review the exact diff for spec compliance, then code quality, before consuming the contract. +- [x] Verify all tests, including `Link legacy; legacy.page = 1; EXPECT_TRUE(legacy.isValid());`. +- [x] Review the exact diff for spec compliance, then code quality, before consuming the contract. ### Task 2: OFD outlines and destinations **Files:** Modify `reader/document/OfdModel.h`, `OfdModel.cpp`, `tests/document/ut_ofdmodel.cpp`, `CMakeLists.txt`, `debian/control`. -- [ ] Add controlled two-page OFD fixtures with page origins `(7,11)` and `(3,5)`, +- [x] Add controlled two-page OFD fixtures with page origins `(7,11)` and `(3,5)`, nested titles four levels deep, a non-clickable parent, named and explicit destinations, zero/omitted fields, invalid targets and non-CLICK actions. First assertion against the current stub is `ASSERT_EQ(doc->outline().size(), 1);`. -- [ ] Run and observe the empty-outline failure. -- [ ] Implement `Outline outline() const override` with a mutex-protected cache, +- [x] Run and observe the empty-outline failure. +- [x] Implement `Outline outline() const override` with a mutex-protected cache, including empty/failed results. Convert preorder nodes in reverse index order into the tree after validating parent-before-child indices; retain invalid-target nodes without a page number. Copy all strings before releasing the RAII snapshot. A document helper maps rofd actions/destinations to Task 1's values and lazily caches target-page physical rectangles. Only CLICK Goto or allowed URI actions become targets; preserve optional coordinates and use target-page origins. -- [ ] Probe outline/destination functions at configure time and require +- [x] Probe outline/destination functions at configure time and require `librofd-ffi-dev (>= 0.4.0)`; refresh warnings after lazy navigation queries. -- [ ] Verify geometry with `EXPECT_NEAR(*target.destination->left, (13-3)*dpi/25.4, 1e-6);`, +- [x] Verify geometry with `EXPECT_NEAR(*target.destination->left, (13-3)*dpi/25.4, 1e-6);`, unresolved page targets remain absent, and repeated outline calls are stable. -- [ ] Run spec review then quality review; checkpoint the scoped backend change. +- [x] Run spec review then quality review; checkpoint the scoped backend change. ### Task 3: Complete catalog and view execution @@ -105,58 +105,97 @@ std::optional navigationView( `reader/uiframe/DocSheet.h/.cpp`, `reader/browser/SheetBrowser.h/.cpp`, `tests/ofd-model/CMakeLists.txt`. -- [ ] Test model construction first: a targetless root with a four-level child +- [x] Test model construction first: a targetless root with a four-level child must remain present, have a blank page column, retain navigation/expansion roles, and expose the leaf. Preserve legacy page and offset roles. -- [ ] Observe a failing model test, then implement reusable iterative tree-to-item +- [x] Observe a failing model test, then implement reusable iterative tree-to-item population. Bind both columns to the same target. CatalogTreeView uses it, expands OFD defaults, and does not activate targets while populating or syncing. -- [ ] Add `bool navigateTo(const deepin_reader::NavigationTarget &)` to SheetBrowser +- [x] Add `bool navigateTo(const deepin_reader::NavigationTarget &)` to SheetBrowser and a forwarding DocSheet method. Validate page count before changing state. Compute currentPosition by mapping viewport origin to the current page and dividing by current scale. Apply Task 1's view, call setScaleFactor, and map focusRect at the actual resulting scale through the target item's scene transform before setting scrollbars and notifying the current page. -- [ ] For a typed URI, revalidate, display the final URL in SecurityDialog, and +- [x] For a typed URI, revalidate, display the final URL in SecurityDialog, and call QDesktopServices only after Accepted. Share this path with Task 4. -- [ ] Enable PREVIEW_CATALOG for OFD. Typed outline actions execute on explicit +- [x] Enable PREVIEW_CATALOG for OFD. Typed outline actions execute on explicit click or keyboard activation exactly once, not currentChanged; legacy paths remain unchanged. Stored expansion state, including all-collapsed state, wins over defaults when the catalog is opened lazily. - [ ] Verify model/calculator tests and reader compilation; exercise actual outline activation, rotation and cancellation in a controlled app window. -- [ ] Spec review then quality review; checkpoint directory/navigation integration. +- [x] Spec review then quality review; checkpoint directory/navigation integration. ### Task 4: Page link adapter and shared activation **Files:** Modify `reader/document/OfdModel.h/.cpp`, `tests/document/ut_ofdmodel.cpp`, `reader/browser/SheetBrowser.cpp`, `CMakeLists.txt`. -- [ ] Add links to controlled fixtures with separated regions, overlaps, +- [x] Add links to controlled fixtures with separated regions, overlaps, transformed bounds, CLICK/PO/DO events, URI/Base and GotoA actions. First assertion against the stub is `EXPECT_TRUE(page->getLinkAtPoint(hit).isValid());`. -- [ ] Run and observe that missing-link failure. -- [ ] Implement a per-page immutable Qt-owned link cache guarded during init. +- [x] Run and observe that missing-link failure. +- [x] Implement a per-page immutable Qt-owned link cache guarded during init. Preserve source order, use the first supported hit, and union independent rectangles as paths without filling the gaps. Copy borrowed data before freeing the snapshot. Empty/failed lists are cached. Reuse Task 2 conversion and refresh warnings after rofd_page_get_links. No adapter action executes external code. -- [ ] `SheetBrowser::jump2Link` calls navigateTo when `link.navigation` exists; +- [x] `SheetBrowser::jump2Link` calls navigateTo when `link.navigation` exists; otherwise preserves the old PDF/XPS path. Keep resolved URI text for hover tips. -- [ ] Extend CMake symbol checks and tests for gaps, deterministic overlap, +- [x] Extend CMake symbol checks and tests for gaps, deterministic overlap, unsafe targets, failure isolation from outlines and repeated queries. -- [ ] Run spec review then quality review; checkpoint page-link integration. +- [x] Run spec review then quality review; checkpoint page-link integration. ### Task 5: Integrated validation and delivery **Files:** Update `tests/ofd-model/README.md` and this checklist with actual results. -- [ ] Run `git diff --check`, all focused tests, and inspect linked rofd SONAME. -- [ ] Build only `deepin-reader -j1`, reusing the existing PDFium build where possible. +- [x] Run `git diff --check`, all focused tests, and inspect linked rofd SONAME. +- [x] Build only `deepin-reader -j1`, reusing the existing PDFium build where possible. - [ ] Verify real window catalog depth/activation, page link hover/click, rotation, scale changes and external-link cancellation. Do not visit test URLs. -- [ ] Check legacy PDF/XPS targets keep their prior path and no new automatic actions +- [x] Check legacy PDF/XPS targets keep their prior path and no new automatic actions occur on opening a document, restoring state or selecting a catalog item. -- [ ] Review the entire diff after task reviews, report exact evidence and any +- [x] Review the entire diff after task reviews, report exact evidence and any unverified conditions. Keep outline/navigation and page links separable in history; do not push or merge to main without the user's request. + +## Execution evidence (2026-09-11) + +- Paired rofd snapshot: `35cb164`, version 0.4.0; the source repository was not + modified. The original reader worktree remains on `ofd_support`. +- Task 1: 22 navigation/legacy tests passed after the missing-behavior RED run. + Task 2: five new outline tests first failed on the empty inherited outline. + Task 3: six catalog-model tests passed after their RED runs. +- Task 4: six link tests first failed on the inherited empty link. The additional + missing-owner test reproduced a crash before the guard was added. The GUI + regression also failed with the backend connected but the old browser route: + a real mouse click changed pages but lost the destination's Fit scale. +- Fresh focused test run: **59 tests passed**, seven suites, no skips. +- Fresh `deepin-reader -j1` build succeeded with `BUILD_TESTS=OFF` and the existing + PDFium shared library. No aggregate test build or OOM occurred. +- Reproducible real-widget checks: **247 assertions passed** through + `python3 tests/ofd-model/run_navigation_smoke.py build/reader-local`. + Includes deep catalogs, inert selection, explicit Enter/click activation, + all five modes at four rotations and two layouts, omitted coordinates, + page-link hover and actual mouse press/release, Fit semantics, and URI cancel. + External test URLs were intercepted and never opened. +- `ldd` resolves `librofd_ffi.so.0` to the paired sibling `rofd/` snapshot and + PDFium to the original reader's existing shared build. A negative configure + check with the old rofd library correctly failed on missing navigation APIs. +- `git diff --check` passes. Spec and quality reviews passed for all four + implementation tasks and the integrated change, with no critical or important + findings. Direct fitting-ratio overflow/underflow coverage remains an optional + test enhancement; the bounded implementation was reviewed. +- Scoped implementation commits: `f5be344a` (typed targets/calculations), + `db340c99` (outline adapter), `d4336b10` (catalog/navigation UI and widget runner), + `b2431562` (page links and shared activation). + +### Validation limit + +The real-widget checks use Qt's **offscreen** platform. Visible desktop-window +acceptance remains unchecked above: the native UI automation runtime was not +available. The aggregate test executable was deliberately not built, following +the user's reader-only build constraint. No main-branch merge or remote push +has been performed. diff --git a/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md b/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md index 1ff769215..722199d94 100644 --- a/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md +++ b/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md @@ -12,6 +12,9 @@ - `9e4a169`:目录、动作与目标,本次接入。 - `2331199`:页面链接映射,本次接入。 +实施时补充:rofd 随后推进到 `35cb164`,发布版本为 0.4.0。因此本次实现使用 +配套的 0.4.0 头文件和共享库,并将 Debian 最低依赖更新为 0.4.0。 + 不增加附件提取、附件执行、自动动作、脚本、注释编辑或文件写回。 不重构 PDF/XPS 后端,也不把 rofd 的矩形链接范围描述为精确路径命中。 @@ -116,8 +119,8 @@ URI 先使用显式 Base 解析,再校验最终地址。首轮只允许有效 更新本地构建使用的配套 rofd 头文件和共享库;CMake 增加目录、目标与链接 符号检查,避免旧库带着相同版本号通过配置后才在链接阶段失败。 -不在源码提交中加入生成的共享库。rofd 当前仍标为 0.3.0,不虚构软件包版本; -发行版依赖下限在上游正式抬升版本后再更新。 +不在源码提交中加入生成的共享库。设计时 rofd 仍标为 0.3.0;实施时上游已正式 +发布 0.4.0,发行版依赖下限相应更新为 0.4.0。 实现分两项审查与交付: diff --git a/tests/ofd-model/README.md b/tests/ofd-model/README.md index 0de5e7cff..c60b514ce 100644 --- a/tests/ofd-model/README.md +++ b/tests/ofd-model/README.md @@ -1,7 +1,7 @@ # Focused OFD adapter checks -This independent CMake project runs `tests/document/ut_ofdmodel.cpp` against the -real reader adapter and a shared rofd library. It does not link PDFium or the +This independent CMake project runs the OFD adapter, navigation calculator and +catalog-model tests against a shared rofd library. It does not link PDFium or the monolithic `test-deepin-reader` executable. The `.cc` entry point is intentionally outside the main test project's `.cpp`/`.h` source glob. @@ -13,8 +13,8 @@ cmake --build build/ofd-model -j1 ctest --test-dir build/ofd-model --output-on-failure ``` -The library must provide the region, metadata and warning APIs added in rofd -commits `56da925` and `6db9bac`; the initial 0.3.0 release does not include them. +Use matching rofd **0.4.0 or newer** headers and library, including region, +metadata, warnings, outline/destination and page-link APIs. Its runtime SONAME (`librofd_ffi.so.0`) must resolve to the same library. Qt Widgets, DTK Core, Cairo, Google Test and CMake are required. Fixtures are created in temporary directories using `cmake -E tar --format=zip`. @@ -23,3 +23,30 @@ Coverage includes full and tiled rendering, nonzero physical page origins, small tiles on canvases larger than 4 GiB, pre-allocation raster limits, real-invoice pixel comparisons, search/selection, metadata/DocID, missing or invalid dates, and fresh warning snapshots after lazy page and annotation loads. +Navigation checks cover target-page physical origins, optional coordinates, +five destination modes, rotation/two-page fitting, safe URI resolution, deep +catalogs, expansion restoration, independent link regions and cached failures. + +## Real-widget smoke checks + +After building **only the reader application**, the following optional check +reuses its objects and link libraries with a small test entry point: + +```sh +cmake --build build/reader-local --target deepin-reader -j1 +python3 tests/ofd-model/run_navigation_smoke.py build/reader-local +``` + +The runner requires a completed, up-to-date **Unix Makefiles** CMake build with +OFD enabled. Use the shared PDFium/rofd configuration to keep linking small; this +does not build the aggregate `test-deepin-reader` target. It compiles only +`navigation_smoke.cc`, discovers moc from CMake, and isolates temporary files and +XDG application state. The source uses `.cc` to stay out of the aggregate test +source glob. + +It exercises real DocSheet, CatalogTreeView, SheetBrowser and SecurityDialog +objects with the Qt **offscreen** platform: deep catalog/explicit activation, +selection without navigation, all-collapsed restoration, five modes at four +rotations and both layouts, omitted coordinates, page-link hover/activation, +and cancellation of external links. Test URLs are intercepted and never opened. +These are in-process widget checks, not a visible desktop-window acceptance test. From 57f1735bc05a062c84ec095c96d7ea971fb1762c Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 11:28:45 +0800 Subject: [PATCH 17/63] fix(reader): preserve explicit navigation during state restoration --- reader/browser/SheetBrowser.cpp | 4 + reader/uiframe/DocSheet.cpp | 16 ++++ reader/uiframe/DocSheet.h | 3 + tests/ofd-model/navigation_smoke.cc | 123 +++++++++++++++++++++++++++- 4 files changed, 143 insertions(+), 3 deletions(-) diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index 5a36dc9c5..fd533784e 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -771,6 +771,10 @@ bool SheetBrowser::navigateTo(const NavigationTarget &target) if (!view) return false; + // 目标校验成功后,主动导航取代旧的恢复任务;否则页码信号会被守卫 + // 忽略,布局稳定后还会跳回保存的锚点。目录和页面链接共用此路径。 + m_sheet->cancelRestoreGuard(); + { QScopedValueRollback suppressPageChanges(m_bNeedNotifyCurPageChanged, false); m_sheet->setScaleFactor(view->scale); diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index ab5162c06..9a9ce3029 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -1945,6 +1945,22 @@ void DocSheet::onBrowserDeformed() m_restoreSettleTimer->start(kRestoreSettleMs); } +void DocSheet::cancelRestoreGuard() +{ + if (!m_restoreGuardActive) + return; + + m_restoreSettleTimer->stop(); + m_restoreGuardActive = false; + m_restoreNotifyTip = false; + dismissRestoreTip(); + + // 守卫期间可见页可能已变化,但操作记录仍停留在恢复锚点。 + // 同页导航不会再发 sigPageChanged,解除守卫时先同步当前可见页。 + if (m_browser) + onBrowserPageChanged(m_browser->currentPage()); +} + void DocSheet::onLayoutSettled() { if (!m_restoreGuardActive) diff --git a/reader/uiframe/DocSheet.h b/reader/uiframe/DocSheet.h index d9015e66c..c6b9f4f0f 100644 --- a/reader/uiframe/DocSheet.h +++ b/reader/uiframe/DocSheet.h @@ -694,6 +694,9 @@ class DocSheet : public Dtk::Widget::DSplitter */ void beginRestoreGuard(bool notifyTip); + /** 有效的用户导航优先于尚未完成的阅读位置恢复。 */ + void cancelRestoreGuard(); + /** * @brief 获取当前滚动位置(0.0~1.0) */ diff --git a/tests/ofd-model/navigation_smoke.cc b/tests/ofd-model/navigation_smoke.cc index 79535118e..15cb65f94 100644 --- a/tests/ofd-model/navigation_smoke.cc +++ b/tests/ofd-model/navigation_smoke.cc @@ -9,6 +9,15 @@ #include "SecurityDialog.h" #include "SheetBrowser.h" #include "SheetRenderer.h" +#include "ThumbnailDelegate.h" +#include "SideBarImageViewModel.h" +#include "EyeProtectionManager.h" +#include "NightFilter.h" +#include +#include +#include +#include +#include #include #include #include @@ -28,10 +37,10 @@ static void verify(bool condition, const char *description) qFatal("FAIL: %s", description); ++checks; } -static void settle() +static void settle(int milliseconds = 250) { QEventLoop loop; - QTimer::singleShot(250, &loop, &QEventLoop::quit); + QTimer::singleShot(milliseconds, &loop, &QEventLoop::quit); loop.exec(); } class UrlSink : public QObject { @@ -42,6 +51,65 @@ public slots: void capture(const QUrl &) { ++calls; } }; +static void verifyThumbnailAppearance() +{ + auto *eye = EyeProtectionManager::instance(); + auto *theme = Dtk::Gui::DGuiApplicationHelper::instance(); + const auto oldMode = eye->mode(); + const auto oldPalette = theme->paletteType(); + const auto restore = qScopeGuard([=] { eye->setMode(oldMode); theme->setPaletteType(oldPalette); }); + QListView view; + view.setProperty("adaptScale", 1.0); + ThumbnailDelegate delegate(&view); + QStandardItemModel model(1, 1); + view.setModel(&model); + const QModelIndex index = model.index(0, 0); + model.setData(index, QSize(210, 297), IMAGE_PAGE_SIZE); + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 240, 300); + for (auto appearance : {Dtk::Gui::DGuiApplicationHelper::LightType, + Dtk::Gui::DGuiApplicationHelper::DarkType}) { + theme->setPaletteType(appearance); + verify(theme->themeType() == appearance, "thumbnail theme fixture takes effect"); + for (auto mode : {EyeProtectionManager::Off, EyeProtectionManager::Classic, + EyeProtectionManager::Green, EyeProtectionManager::Night}) { + eye->setMode(mode); + for (const QColor &color : {QColor(Qt::white), QColor(90, 140, 200)}) { + QPixmap source(32, 48); + source.setDevicePixelRatio(2); + source.fill(color); + model.setData(index, source, IMAGE_PIXMAP); + QImage expected(1, 1, QImage::Format_ARGB32_Premultiplied); + expected.fill(color); + if (mode == EyeProtectionManager::Night) + expected = NightFilter::applyPage(expected, {}); + { + QPainter painter(&expected); + if (mode == EyeProtectionManager::Night) { + QColor overlay = eye->pageBackgroundColor(); + overlay.setAlpha(60); + painter.fillRect(expected.rect(), overlay); + } else if (mode != EyeProtectionManager::Off) { + painter.setCompositionMode(QPainter::CompositionMode_Multiply); + painter.fillRect(expected.rect(), eye->pageBackgroundColor()); + } + } + for (int rotation : {0, 90}) { + model.setData(index, rotation, IMAGE_ROTATE); + QImage canvas(240, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); + { + QPainter painter(&canvas); + static_cast(delegate).paint(&painter, option, index); + } + verify(canvas.pixelColor(120, 150) == expected.pixelColor(0, 0), + "thumbnail paint follows eye mode independently of system theme"); + } + } + } + } +} + int main(int argc, char **argv) { Application app(argc, argv); @@ -106,10 +174,41 @@ int main(int argc, char **argv) verify(sheet.currentPage() == 1, "population does not navigate"); catalog->setCurrentIndex(leaf); verify(sheet.currentPage() == 1, "selection does not navigate"); + // Opening/restoring a tab must not swallow an explicit catalog activation. + sheet.beginRestoreGuard(true); QKeyEvent enter(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); QCoreApplication::sendEvent(catalog, &enter); verify(sheet.currentPage() == 2 && qAbs(sheet.operation().scaleFactor - 2) < .001, "keyboard activation uses target page and zoom"); + settle(kRestoreSettleMs + 100); + verify(sheet.currentPage() == 2 && browser->currentPage() == 2 && !sheet.needsRestoreTip(), + "explicit catalog navigation supersedes pending restore and its notification"); + sheet.saveCurrentViewState(); + verify(sheet.operation().scrollPosition > 0, "nonzero saved position for restore checks"); + sheet.beginRestoreGuard(true); + browser->setCurrentPage(1); + verify(browser->currentPage() == 1 && sheet.currentPage() == 2, + "restore guard freezes the saved page during a layout page change"); + NavigationTarget alreadyVisible; + alreadyVisible.destination = NavigationDestination{}; + alreadyVisible.destination->pageIndex = 0; + alreadyVisible.destination->zoom = sheet.operation().scaleFactor; + verify(sheet.navigateTo(alreadyVisible), "navigate to a page already visible during restoration"); + verify(sheet.currentPage() == 1 && browser->currentPage() == 1, + "explicit navigation synchronizes the saved page even without a browser page change"); + sheet.jumpToPage(2); + sheet.saveCurrentViewState(); + sheet.beginRestoreGuard(true); + NavigationTarget invalidDuringRestore; + invalidDuringRestore.destination = NavigationDestination{}; + invalidDuringRestore.destination->pageIndex = 999; + verify(!sheet.navigateTo(invalidDuringRestore), "invalid navigation rejected during restore"); + browser->setCurrentPage(1); + verify(sheet.currentPage() == 2, "invalid target leaves restore guard active"); + settle(kRestoreSettleMs + 100); + verify(browser->currentPage() == 2 && sheet.needsRestoreTip(), + "normal saved-page restoration and its notification remain intact"); + sheet.dismissRestoreTip(); catalog->restoreExpandedSections({}); verify(catalog->getExpandedSections().isEmpty(), "all-collapsed saved state wins"); @@ -128,8 +227,12 @@ int main(int argc, char **argv) catalog->setCurrentIndex(website); settle(); verify(dialogs == 0 && sink.calls == 0, "URI selection has no effects"); + sheet.beginRestoreGuard(true); QCoreApplication::sendEvent(catalog, &enter); verify(dialogs == 1 && sink.calls == 0, "URI keyboard activation confirms once and cancellation blocks opening"); + settle(kRestoreSettleMs + 100); + verify(sheet.needsRestoreTip(), "external link cancellation does not cancel page restoration"); + sheet.dismissRestoreTip(); QMetaObject::invokeMethod(catalog, "onItemClicked", Qt::DirectConnection, Q_ARG(QModelIndex, website)); verify(dialogs == 2 && sink.calls == 0, "URI click confirms once and cancellation blocks opening"); @@ -240,10 +343,15 @@ int main(int argc, char **argv) QSizeF(browser->viewport()->size()), {}, sheet.operation().scaleFactor, sheet.maxScaleFactor(), 0, false); verify(expectedFit.has_value(), "page-link fit reference"); + sheet.saveCurrentViewState(); + sheet.beginRestoreGuard(true); clickLink(hit); verify(sheet.currentPage() == 2, "page link reaches typed destination"); verify(qAbs(sheet.operation().scaleFactor - expectedFit->scale) < .001, "page link preserves Fit destination mode"); + settle(kRestoreSettleMs + 100); + verify(sheet.currentPage() == 2 && browser->currentPage() == 2 && !sheet.needsRestoreTip(), + "page-link navigation is not overwritten by a pending restore"); verify(sheet.navigateTo(firstPage), "return to URI page link"); hit = hitPoint(85); const Link uriLink = sheet.renderer()->getLinkAtPoint(0, QPointF(78 * targetPage->boundingRect().width() / 210, @@ -252,8 +360,17 @@ int main(int argc, char **argv) clickLink(hit); verify(dialogs == 3 && sink.calls == 0, "URI page link confirms once and cancellation blocks opening"); verify(sink.calls == 0, "no network navigation attempted"); + sheet.jumpToPage(2); + sheet.saveCurrentViewState(); + verify(sheet.operation().scrollPosition > 0, "tab-return restore has a saved position"); + sheet.restoreSavedViewState(); + verify(sheet.navigateTo(firstPage), "explicit navigation immediately after tab return"); + settle(kRestoreSettleMs + 100); + verify(sheet.currentPage() == 1 && browser->currentPage() == 1 && !sheet.needsRestoreTip(), + "tab-return restoration cannot overwrite explicit navigation"); QDesktopServices::unsetUrlHandler("https"); - qInfo("PASS: %d real-widget navigation checks", checks); + verifyThumbnailAppearance(); + qInfo("PASS: %d real-widget navigation/appearance checks", checks); return 0; } #include "navigation_smoke.moc" From 362d90029ec39b71a27a9a14243789465fc69868 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 11:28:45 +0800 Subject: [PATCH 18/63] test(sidebar): detect Qt version in focused appearance checks --- tests/sidebar-appearance/CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/sidebar-appearance/CMakeLists.txt b/tests/sidebar-appearance/CMakeLists.txt index a40a50e6f..18cad65dd 100644 --- a/tests/sidebar-appearance/CMakeLists.txt +++ b/tests/sidebar-appearance/CMakeLists.txt @@ -3,9 +3,14 @@ project(reader-sidebar-appearance-tests LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) -find_package(Qt6 REQUIRED COMPONENTS Widgets) +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) find_package(PkgConfig REQUIRED) -pkg_check_modules(DTK REQUIRED IMPORTED_TARGET dtk6widget) +if (QT_VERSION_MAJOR EQUAL 6) + pkg_check_modules(DTK REQUIRED IMPORTED_TARGET dtk6widget) +else() + pkg_check_modules(DTK REQUIRED IMPORTED_TARGET dtkwidget) +endif() set(READER_DIR "${CMAKE_CURRENT_LIST_DIR}/../../reader") add_executable(test-sidebar-appearance @@ -17,7 +22,7 @@ add_executable(test-sidebar-appearance target_include_directories(test-sidebar-appearance PRIVATE ${READER_DIR} ${READER_DIR}/app ${READER_DIR}/sidebar ${READER_DIR}/eyeprotection ${READER_DIR}/browser) -target_link_libraries(test-sidebar-appearance PRIVATE Qt6::Widgets PkgConfig::DTK) +target_link_libraries(test-sidebar-appearance PRIVATE Qt${QT_VERSION_MAJOR}::Widgets PkgConfig::DTK) enable_testing() add_test(NAME sidebar-appearance COMMAND test-sidebar-appearance) From 1952fcb066842cc5f47db81e2e5a170b30ad7f38 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Fri, 11 Sep 2026 11:28:45 +0800 Subject: [PATCH 19/63] docs(ofd): document post-rebase compatibility checks --- tests/ofd-model/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/ofd-model/README.md b/tests/ofd-model/README.md index c60b514ce..d4ff94e35 100644 --- a/tests/ofd-model/README.md +++ b/tests/ofd-model/README.md @@ -49,4 +49,39 @@ objects with the Qt **offscreen** platform: deep catalog/explicit activation, selection without navigation, all-collapsed restoration, five modes at four rotations and both layouts, omitted coordinates, page-link hover/activation, and cancellation of external links. Test URLs are intercepted and never opened. +It also covers navigation during the mainline reading-state restore guard: +catalog and page-link activation, timer expiry, tab return, already-visible +destinations, and preservation of normal restoration for invalid/external targets. +Actual thumbnail painting is checked in light/dark themes and all four eye modes, +including rotated, high-DPI source pixmaps. These checks compare content pixels; +they do not verify border styling or desktop repaint timing. These are in-process widget checks, not a visible desktop-window acceptance test. + +## Focused thumbnail filter checks + +The smaller sidebar project checks the production thumbnail filter/cache without +linking the reader, PDFium or rofd: + +```sh +cmake -S tests/sidebar-appearance -B build/sidebar-appearance +cmake --build build/sidebar-appearance -j1 +ctest --test-dir build/sidebar-appearance --output-on-failure +``` + +It compares pixels with the mainline `NightFilter`, including transparent input, +device-pixel ratio, cache invalidation and filter-before-rotation behavior. +Thumbnail image-object masks are not yet supplied: thumbnails use the mainline +filter's empty-mask fallback, not the main page's photo-preservation path. + +## Rebuilding after the master rebase + +Master `9acd6e5a` includes the new `DPdfPage::imageObjectRects(int, int)` API. +When reusing a locally built shared PDFium wrapper, update that wrapper as well +as its header; an older shared library will fail to link despite a clean rebase. +The existing underlying PDFium static library can be reused if its sources and +build configuration have not changed. Keep `BUILD_TESTS=OFF` and build only the +`deepin-reader` target with `-j1`; the focused checks above remain independent. + +Validation after this rebase on Qt 6/rofd 0.4.0: reader-only build, 59 model tests, +41 filter/cache checks and 294 real-widget checks passed. The qmake path and +visible desktop-window acceptance were not part of this validation. From 5cdc91529f16cdd4036798de411d6a974921f61b Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2026 06:09:54 +0000 Subject: [PATCH 20/63] [skip CI] Translate deepin-reader.ts in fi 100% translated source file: 'deepin-reader.ts' on 'fi'. --- translations/deepin-reader_fi.ts | 146 +++++++++++++++++++++---------- 1 file changed, 100 insertions(+), 46 deletions(-) diff --git a/translations/deepin-reader_fi.ts b/translations/deepin-reader_fi.ts index 075594936..edb841b18 100755 --- a/translations/deepin-reader_fi.ts +++ b/translations/deepin-reader_fi.ts @@ -241,7 +241,7 @@ Central - + Documents Asiakirjat @@ -254,44 +254,44 @@ Muotoa ei tueta - + Open failed Avaaminen epäonnistui - + Please check if the file is damaged Tarkista, onko tiedosto vaurioitunut - + Conversion failed, please check if the file is damaged Muuntaminen epäonnistui. Tarkista, onko tiedosto vaurioitunut - + Save failed Tallennus epäonnistui - + Saved successfully Tallennettu onnistuneesti - + Save as Tallenna nimellä - - + + Invalid file name Virheellinen tiedostonimi - - + + OK button OK @@ -318,20 +318,20 @@ DocSheet - - + + The bookmark has been removed Kirjanmerkki on poistettu - - + + Please select the text Valitse teksti - - + + The annotation has been removed Merkinnät on poistettu @@ -360,6 +360,37 @@ Väärä salasana + + EyeProtection + + + No eye protection + Ei yövaloa + + + + Classic eye protection + Yövalo klassinen + + + + Green eye protection + Yövalo vihreä + + + + Night eye protection + Yövalo + + + + EyeProtectionAction + + + Eye protection mode + Yövalotilat + + FindWidget @@ -402,7 +433,7 @@ PagingWidget - + Invalid page number Virheellinen sivunumero @@ -423,38 +454,56 @@ Asiakirjaa ei ole tallennettu + + RestoreTipWidget + + + Restored to last reading position + Palautettu edelliseen lukuasentoon + + + + Jump to first page + Siirry alkuun + + + + Close + Sulje + + SaveDialog - + Save the changes to "%1"? Tallennetaanko muutokset "%1"? - + Cancel button Peru - + Discard button Hylkää - + Save button Tallenna - + Cancel Peru - + Delete Poista @@ -583,12 +632,12 @@ Zoom in - Lähennä + Lähemmäksi Zoom out - Loitonna + Kauemmaksi @@ -759,23 +808,23 @@ SideBarImageListView - + Copy Kopioi - + Remove annotation Poista merkinnät - - + + Remove all Poista kaikki - + Remove bookmark Poista kirjanmerkki @@ -804,48 +853,48 @@ TitleMenu - + New window Uusi ikkuna - + New tab Uusi välilehti - - + + Save Tallenna - + Save as Tallenna nimellä - + Display in file manager Näytä tiedostohallinnassa - + Magnifer Suurennuslasi - + Tools Työkalut - + Search Etsi - + Print Tulosta @@ -869,25 +918,30 @@ main - + Document File Path. Asiakirjan tiedoston polku. - - + + FilePath Polku - + ThumbnailPath Path. Esikatselukuvan polku. - + Generate thumbnail. Luo esikatselukuva. + + + Batch print documents without UI. + Erätulostus ilman käyttöliittymää. + \ No newline at end of file From 4215f121fe31174903a2108f4c8382087b33d46b Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Mon, 14 Sep 2026 10:31:39 +0800 Subject: [PATCH 21/63] fix(reader): clamp OFD render slices to page canvas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The big-image task split pages into 1000px-wide tiles without clamping the last tile to the actual page width. Pages whose width was not a multiple of 1000 produced out-of-canvas requests that the OFD document model rejects, leaving the right edge unpainted. The magnifier (getImagePoint) could also request rects beyond the canvas near page edges; intersect the rect with the canvas first. 大图任务按1000px分片时末尾未截断到页面实际宽度,页宽非1000整数倍 时越界请求被OFD文档模型拒绝,页面右侧无法绘制;放大镜在页边悬停 时同样可能越界,先与整页画布求交集。 Log: 修复OFD分片越界导致页面右侧渲染缺失 Influence: OFD文档大图分片与放大镜渲染不再产生越界请求,页面右侧不再缺失。 --- reader/browser/BrowserPage.cpp | 12 ++++++++++-- reader/browser/PageRenderThread.cpp | 7 ++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/reader/browser/BrowserPage.cpp b/reader/browser/BrowserPage.cpp index 2df1063f7..05122aadb 100644 --- a/reader/browser/BrowserPage.cpp +++ b/reader/browser/BrowserPage.cpp @@ -564,8 +564,16 @@ QImage BrowserPage::getImagePoint(double scaleFactor, QPoint point) int ss = static_cast(122 * scaleFactor / m_scaleFactor); - QRect rect = QRect(qRound(point.x() * scaleFactor / m_scaleFactor - ss / 2.0), - qRound(point.y() * scaleFactor / m_scaleFactor - ss / 2.0), ss, ss); + // 悬停点靠近页面边缘时,请求矩形可能超出整页画布; + // 文档模型拒绝越界渲染请求,需先与画布求交集(与 getImage 的取整方式保持一致) + const QRect canvas(0, 0, static_cast(m_originSizeF.width() * scaleFactor), + static_cast(m_originSizeF.height() * scaleFactor)); + const QRect rect = QRect(qRound(point.x() * scaleFactor / m_scaleFactor - ss / 2.0), + qRound(point.y() * scaleFactor / m_scaleFactor - ss / 2.0), ss, ss) + .intersected(canvas); + + if (rect.isEmpty()) + return QImage(); return m_sheet->renderer()->getImage(itemIndex(), static_cast(m_originSizeF.width() * scaleFactor), diff --git a/reader/browser/PageRenderThread.cpp b/reader/browser/PageRenderThread.cpp index 3bcb3c7bb..6dcdfb043 100644 --- a/reader/browser/PageRenderThread.cpp +++ b/reader/browser/PageRenderThread.cpp @@ -362,9 +362,10 @@ void PageRenderThread::run() //if has signature,render whole rect renderRects.append(task.rect); } else { - int wCount = task.rect.width() % 1000 == 0 ? (task.rect.width() / 1000) : (task.rect.width() / 1000 + 1); - for (int i = 0; i < wCount; ++i) {//只能以宽度前进(即只能分割宽度),如果x从0开始,每次都将消耗一定时间 - renderRects.append(QRect(i * 1000, 0, 1000, task.rect.height())); + // 末尾分片须截断到页面实际宽度,否则越界请求会被文档模型拒绝, + // 页面右侧会因取到空图而残留未绘制区域 + for (int i = 0; i < task.rect.width(); i += 1000) {//只能以宽度前进(即只能分割宽度),如果x从0开始,每次都将消耗一定时间 + renderRects.append(QRect(i, 0, qMin(1000, task.rect.width() - i), task.rect.height())); }; } From 7eb905ed45c34e236e224dd88046018a9eebae03 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Mon, 14 Sep 2026 13:38:01 +0800 Subject: [PATCH 22/63] chore(docs): remove non-standard docs/superpowers directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs/superpowers 目录为开发过程中的临时设计记录与计划文档, 不符合项目正式文档规范,按维护要求整体移除。相关设计说明由 代码注释与 rofd 仓库文档承载。 Log: 移除不规范的docs/superpowers目录 Influence: 仅删除开发期文档,不影响编译、功能与打包。 --- .../plans/2026-09-10-ofd-semantic-text.md | 106 --------- .../plans/2026-09-11-ofd-navigation.md | 201 ------------------ .../2026-09-10-ofd-semantic-text-design.md | 62 ------ .../specs/2026-09-11-ofd-navigation-design.md | 149 ------------- 4 files changed, 518 deletions(-) delete mode 100644 docs/superpowers/plans/2026-09-10-ofd-semantic-text.md delete mode 100644 docs/superpowers/plans/2026-09-11-ofd-navigation.md delete mode 100644 docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md delete mode 100644 docs/superpowers/specs/2026-09-11-ofd-navigation-design.md diff --git a/docs/superpowers/plans/2026-09-10-ofd-semantic-text.md b/docs/superpowers/plans/2026-09-10-ofd-semantic-text.md deleted file mode 100644 index 9ceaf16d4..000000000 --- a/docs/superpowers/plans/2026-09-10-ofd-semantic-text.md +++ /dev/null @@ -1,106 +0,0 @@ -# OFD Semantic Text Integration Implementation Plan - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. - -**Goal:** Make OFD documents participate in the reader's existing text extraction, search, selection, and copy workflows using the current `rofd` semantic C ABI. - -**Architecture:** Keep semantic adaptation inside `OfdPage`. Convert between physical-page millimetres and reader logical pixels at the boundary, use owned result handles per query, and expose character layout through the existing `Word` list. - -**Tech Stack:** C++17, Qt Core/Gui, GoogleTest, `rofd` stable C ABI - ---- - -### Task 1: Fixture-backed semantic behavior - -**Files:** -- Modify: `tests/document/ut_ofdmodel.cpp` - -- [ ] **Step 1: Add failing tests** - -Add tests that load `normal.ofd`, require non-empty full-page text, extract text -from the first returned word rectangle, verify case-sensitive and whole-word -search filtering, and require non-empty `words()` entries with valid geometry. - -- [ ] **Step 2: Run the focused tests and verify RED** - -Run: - -```bash -QT_QPA_PLATFORM=offscreen build-semantic/tests/test-deepin-reader \ - --gtest_filter='TestOfdModel.semantic*' -``` - -Expected: the text, search, and words assertions fail because `OfdPage` still -returns empty values. - -### Task 2: Coordinate-safe semantic adapter - -**Files:** -- Modify: `reader/document/OfdModel.h` -- Modify: `reader/document/OfdModel.cpp` -- Test: `tests/document/ut_ofdmodel.cpp` - -- [ ] **Step 1: Store physical page geometry and declare `words()`** - -Add `QList words() override`, store the page's complete `rofd_rect_t`, and -declare private `toMillimetres` and `toPixels` rectangle helpers. - -- [ ] **Step 2: Implement owned-string extraction** - -Use `rofd_page_get_text` for a null rectangle and -`rofd_page_get_text_for_area` otherwise. Convert the borrowed UTF-8 bytes with -an explicit length before freeing `rofd_string_t`. - -- [ ] **Step 3: Implement semantic search** - -Initialize `rofd_find_options_t`, set `ROFD_FIND_CASE_SENSITIVE` and -`ROFD_FIND_WHOLE_WORDS` as requested, enumerate matches, convert each match -rectangle, and append `PageSection{PageLine{QString(), rect}}`. - -- [ ] **Step 4: Implement selectable character layout** - -Acquire canonical text and a layout snapshot, skip synthesized separators and -zero-area geometry, validate every UTF-8 span, and append one `Word` per scalar -using the converted rectangle. - -- [ ] **Step 5: Run focused tests and verify GREEN** - -Run the semantic test filter and expect every new test to pass. - -### Task 3: Build contract and regression verification - -**Files:** -- Modify only if required by configure checks: `CMakeLists.txt` -- Modify: `debian/control` only after the semantic package version is known - -- [ ] **Step 1: Configure against local current `rofd main`** - -Build `rofd-ffi` into an isolated `/tmp` target, then configure a fresh reader -build using `-DROFD_ROOT=/home/hualet/projects/hualet/rofd` and the matching -library directory. - -- [ ] **Step 2: Build the reader and tests** - -Run the normal CMake build for `test-deepin-reader` and `deepin-reader`. - -- [ ] **Step 3: Run all OFD model tests** - -Run: - -```bash -QT_QPA_PLATFORM=offscreen build-semantic/tests/test-deepin-reader \ - --gtest_filter='TestOfdModel.*' -``` - -Expected: all OFD model tests pass. - -- [ ] **Step 4: Run the complete document-model test subset** - -Run the repository's document model test filters and report any unrelated -pre-existing failures separately. - -- [ ] **Step 5: Inspect the final diff** - -Confirm only the OFD adapter, OFD tests, and approved build-contract changes are -present. Leave implementation changes uncommitted until the user requests a -commit. diff --git a/docs/superpowers/plans/2026-09-11-ofd-navigation.md b/docs/superpowers/plans/2026-09-11-ofd-navigation.md deleted file mode 100644 index 09770f1b0..000000000 --- a/docs/superpowers/plans/2026-09-11-ofd-navigation.md +++ /dev/null @@ -1,201 +0,0 @@ -# OFD Navigation Implementation Plan - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox syntax for tracking. - -**Goal:** Expose OFD outlines and clickable page links without losing destination semantics or enabling automatic actions. - -**Architecture:** Add optional typed navigation values to the existing model. A pure view calculator and URI validator are shared by outline and page-link activation; rofd remains behind the OFD adapter. Preserve legacy PDF/XPS navigation when the optional value is absent. - -**Tech Stack:** C++17, Qt Widgets, rofd 0.4.0 C ABI, GoogleTest, CMake. - -## Execution and build boundaries - -Use the approved design at `docs/superpowers/specs/2026-09-11-ofd-navigation-design.md`. -The isolated worktree is `/tmp/deepin-reader-ofd-nav.bx98sU/tree`; the baseline is -`e50708ff`. The paired rofd header/library are in the sibling `rofd/` directory. -Upstream advanced to `35cb164` / 0.4.0 after design approval, so update the package -minimum instead of retaining the design's historical 0.3.0 limitation. - -Run only focused tests and the reader target, with `-j1`. Never build the -`test-deepin-reader` aggregate. The clean baseline passes all 19 OFD tests. - -```sh -cmake -S tests/ofd-model -B build/ofd-model \ - -DROFD_INCLUDE_DIR=/tmp/deepin-reader-ofd-nav.bx98sU/rofd/include \ - -DROFD_FFI_LIBRARY=/tmp/deepin-reader-ofd-nav.bx98sU/rofd/librofd_ffi.so -cmake --build build/ofd-model -j1 -ctest --test-dir build/ofd-model --output-on-failure -``` - -### Task 1: Typed targets and pure navigation calculations - -**Files:** Create `reader/document/Navigation.h`, `Navigation.cpp`, -`tests/document/ut_navigation.cpp`; modify `reader/document/Model.h` and -`tests/ofd-model/CMakeLists.txt`. - -- [x] Add tests first for missing/zero fields, all five modes, invalid rectangles, - scale limits, 90/180/270-degree rotation, double-page viewport allocation, - allowed URI resolution, rejected file/relative/unknown URI, and legacy defaults. -- [x] Run the focused target and capture the missing-behavior failure before implementation. -- [x] Implement this shared contract (namespace `deepin_reader`): - -```cpp -enum class DestinationMode { XYZ, Fit, FitH, FitV, FitR }; -struct NavigationDestination { - int pageIndex = -1; - DestinationMode mode = DestinationMode::XYZ; - std::optional left, top, right, bottom, zoom; - bool isValid() const; -}; -struct NavigationTarget { - std::optional destination; - QUrl uri; - bool isValid() const; -}; -struct NavigationView { - qreal scale = 1; - QRectF focusRect; // unscaled page coordinates; zero-size rectangle for a point -}; -QUrl resolveNavigationUri(const QString &uri, const QString &base = QString()); -std::optional navigationView( - const NavigationDestination &destination, const QSizeF &pageSize, - const QSizeF &viewportSize, const QPointF ¤tPosition, - qreal currentScale, qreal maximumScale, int rotationDegrees, bool twoPages); -``` - - `Section` and `Link` gain `std::optional navigation`; - `Section` additionally gains `std::optional expanded`. Register the - target metatype. Absent navigation retains old `Link::isValid()` behavior; - present navigation is checked on its own, never falling back to stale fields. - Calculate fit scale using rotated bounds and half viewport width for two pages, - clamp to `[0.1, maximumScale]`, reject non-finite inputs and invalid FitR. - XYZ defaults use currentPosition; zoom absent/zero preserves currentScale. - URI resolution accepts only absolute HTTP/HTTPS with host and nonempty mailto, - uses QUrl strict parsing and explicit Base, and never performs I/O. -- [x] Verify all tests, including `Link legacy; legacy.page = 1; EXPECT_TRUE(legacy.isValid());`. -- [x] Review the exact diff for spec compliance, then code quality, before consuming the contract. - -### Task 2: OFD outlines and destinations - -**Files:** Modify `reader/document/OfdModel.h`, `OfdModel.cpp`, -`tests/document/ut_ofdmodel.cpp`, `CMakeLists.txt`, `debian/control`. - -- [x] Add controlled two-page OFD fixtures with page origins `(7,11)` and `(3,5)`, - nested titles four levels deep, a non-clickable parent, named and explicit - destinations, zero/omitted fields, invalid targets and non-CLICK actions. - First assertion against the current stub is `ASSERT_EQ(doc->outline().size(), 1);`. -- [x] Run and observe the empty-outline failure. -- [x] Implement `Outline outline() const override` with a mutex-protected cache, - including empty/failed results. Convert preorder nodes in reverse index order - into the tree after validating parent-before-child indices; retain invalid-target - nodes without a page number. Copy all strings before releasing the RAII snapshot. - A document helper maps rofd actions/destinations to Task 1's values and lazily - caches target-page physical rectangles. Only CLICK Goto or allowed URI actions - become targets; preserve optional coordinates and use target-page origins. -- [x] Probe outline/destination functions at configure time and require - `librofd-ffi-dev (>= 0.4.0)`; refresh warnings after lazy navigation queries. -- [x] Verify geometry with `EXPECT_NEAR(*target.destination->left, (13-3)*dpi/25.4, 1e-6);`, - unresolved page targets remain absent, and repeated outline calls are stable. -- [x] Run spec review then quality review; checkpoint the scoped backend change. - -### Task 3: Complete catalog and view execution - -**Files:** Create `reader/sidebar/CatalogOutlineModel.h/.cpp` and -`tests/document/ut_catalogoutlinemodel.cpp`; modify `CatalogTreeView.h/.cpp`, -`reader/uiframe/DocSheet.h/.cpp`, `reader/browser/SheetBrowser.h/.cpp`, -`tests/ofd-model/CMakeLists.txt`. - -- [x] Test model construction first: a targetless root with a four-level child - must remain present, have a blank page column, retain navigation/expansion roles, - and expose the leaf. Preserve legacy page and offset roles. -- [x] Observe a failing model test, then implement reusable iterative tree-to-item - population. Bind both columns to the same target. CatalogTreeView uses it, - expands OFD defaults, and does not activate targets while populating or syncing. -- [x] Add `bool navigateTo(const deepin_reader::NavigationTarget &)` to SheetBrowser - and a forwarding DocSheet method. Validate page count before changing state. - Compute currentPosition by mapping viewport origin to the current page and - dividing by current scale. Apply Task 1's view, call setScaleFactor, and map - focusRect at the actual resulting scale through the target item's scene transform - before setting scrollbars and notifying the current page. -- [x] For a typed URI, revalidate, display the final URL in SecurityDialog, and - call QDesktopServices only after Accepted. Share this path with Task 4. -- [x] Enable PREVIEW_CATALOG for OFD. Typed outline actions execute on explicit - click or keyboard activation exactly once, not currentChanged; legacy paths - remain unchanged. Stored expansion state, including all-collapsed state, wins - over defaults when the catalog is opened lazily. -- [ ] Verify model/calculator tests and reader compilation; exercise actual - outline activation, rotation and cancellation in a controlled app window. -- [x] Spec review then quality review; checkpoint directory/navigation integration. - -### Task 4: Page link adapter and shared activation - -**Files:** Modify `reader/document/OfdModel.h/.cpp`, -`tests/document/ut_ofdmodel.cpp`, `reader/browser/SheetBrowser.cpp`, `CMakeLists.txt`. - -- [x] Add links to controlled fixtures with separated regions, overlaps, - transformed bounds, CLICK/PO/DO events, URI/Base and GotoA actions. - First assertion against the stub is `EXPECT_TRUE(page->getLinkAtPoint(hit).isValid());`. -- [x] Run and observe that missing-link failure. -- [x] Implement a per-page immutable Qt-owned link cache guarded during init. - Preserve source order, use the first supported hit, and union independent - rectangles as paths without filling the gaps. Copy borrowed data before freeing - the snapshot. Empty/failed lists are cached. Reuse Task 2 conversion and refresh - warnings after rofd_page_get_links. No adapter action executes external code. -- [x] `SheetBrowser::jump2Link` calls navigateTo when `link.navigation` exists; - otherwise preserves the old PDF/XPS path. Keep resolved URI text for hover tips. -- [x] Extend CMake symbol checks and tests for gaps, deterministic overlap, - unsafe targets, failure isolation from outlines and repeated queries. -- [x] Run spec review then quality review; checkpoint page-link integration. - -### Task 5: Integrated validation and delivery - -**Files:** Update `tests/ofd-model/README.md` and this checklist with actual results. - -- [x] Run `git diff --check`, all focused tests, and inspect linked rofd SONAME. -- [x] Build only `deepin-reader -j1`, reusing the existing PDFium build where possible. -- [ ] Verify real window catalog depth/activation, page link hover/click, rotation, - scale changes and external-link cancellation. Do not visit test URLs. -- [x] Check legacy PDF/XPS targets keep their prior path and no new automatic actions - occur on opening a document, restoring state or selecting a catalog item. -- [x] Review the entire diff after task reviews, report exact evidence and any - unverified conditions. Keep outline/navigation and page links separable in history; - do not push or merge to main without the user's request. - -## Execution evidence (2026-09-11) - -- Paired rofd snapshot: `35cb164`, version 0.4.0; the source repository was not - modified. The original reader worktree remains on `ofd_support`. -- Task 1: 22 navigation/legacy tests passed after the missing-behavior RED run. - Task 2: five new outline tests first failed on the empty inherited outline. - Task 3: six catalog-model tests passed after their RED runs. -- Task 4: six link tests first failed on the inherited empty link. The additional - missing-owner test reproduced a crash before the guard was added. The GUI - regression also failed with the backend connected but the old browser route: - a real mouse click changed pages but lost the destination's Fit scale. -- Fresh focused test run: **59 tests passed**, seven suites, no skips. -- Fresh `deepin-reader -j1` build succeeded with `BUILD_TESTS=OFF` and the existing - PDFium shared library. No aggregate test build or OOM occurred. -- Reproducible real-widget checks: **247 assertions passed** through - `python3 tests/ofd-model/run_navigation_smoke.py build/reader-local`. - Includes deep catalogs, inert selection, explicit Enter/click activation, - all five modes at four rotations and two layouts, omitted coordinates, - page-link hover and actual mouse press/release, Fit semantics, and URI cancel. - External test URLs were intercepted and never opened. -- `ldd` resolves `librofd_ffi.so.0` to the paired sibling `rofd/` snapshot and - PDFium to the original reader's existing shared build. A negative configure - check with the old rofd library correctly failed on missing navigation APIs. -- `git diff --check` passes. Spec and quality reviews passed for all four - implementation tasks and the integrated change, with no critical or important - findings. Direct fitting-ratio overflow/underflow coverage remains an optional - test enhancement; the bounded implementation was reviewed. -- Scoped implementation commits: `f5be344a` (typed targets/calculations), - `db340c99` (outline adapter), `d4336b10` (catalog/navigation UI and widget runner), - `b2431562` (page links and shared activation). - -### Validation limit - -The real-widget checks use Qt's **offscreen** platform. Visible desktop-window -acceptance remains unchecked above: the native UI automation runtime was not -available. The aggregate test executable was deliberately not built, following -the user's reader-only build constraint. No main-branch merge or remote push -has been performed. diff --git a/docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md b/docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md deleted file mode 100644 index 240cbec98..000000000 --- a/docs/superpowers/specs/2026-09-10-ofd-semantic-text-design.md +++ /dev/null @@ -1,62 +0,0 @@ -# OFD Semantic Text Integration Design - -## Scope - -Connect the semantic text API already available in the current `rofd` C ABI to -the existing `deepin_reader::Page` abstraction. The change implements OFD page -text extraction, text search, and selectable character geometry. It does not -add OFD-specific UI or attempt metadata, outline, links, annotations, native -writing, or tiled rendering, because those still require new `rofd` APIs. - -## Architecture - -`OfdPage` remains the only adapter between `deepin-reader` page semantics and -`rofd`. It stores the physical page rectangle returned by -`rofd_page_get_size_mm`, then uses small private conversion helpers for physical -millimetres and the logical page-pixel coordinate system used by the reader. - -Each public query creates and frees its own immutable `rofd` result handle. No -mutable semantic cache is shared between render and search worker threads. -This follows the existing adapter structure and the C ABI's concurrent -read-only handle contract. - -## Data Flow - -- `text(rect)` converts the requested logical-pixel rectangle to physical-page - millimetres and calls `rofd_page_get_text_for_area`. A null rectangle requests - the full canonical page text through `rofd_page_get_text`. -- `search(query, matchCase, wholeWords)` initializes - `rofd_find_options_t`, maps the two reader flags to `ROFD_FIND_*`, and turns - every match rectangle into one `PageSection` containing one `PageLine`. -- `words()` gets canonical UTF-8 text plus its layout snapshot. Every - non-synthesized scalar with valid geometry becomes one `Word`; its text is - decoded from the canonical string using the layout's byte offset and length. - One scalar per `Word` matches the existing selection overlay contract. - -## Coordinates - -The reader expresses page text geometry in logical pixels at the document's X -and Y logical DPI. `rofd` expresses geometry in physical-page millimetres. -Conversions include the physical page rectangle's X/Y origin: - -``` -mm.x = physical.x + px.x * 25.4 / xDpi -px.x = (mm.x - physical.x) * xDpi / 25.4 -``` - -The same formula applies independently to Y, width, and height. - -## Error Handling - -Invalid handles, empty search input, invalid rectangles, invalid UTF-8 spans, -and failed C ABI queries return the empty result expected by `Page`. Owned -`rofd` handles are always freed. ABI failures are logged with page index, -status, and the optional error message. - -## Verification - -Fixture-backed tests prove full and area text extraction, case-sensitive and -whole-word search behavior, search rectangles, and selectable character text -and geometry. The tests are first run against the current stubs to demonstrate -the intended failures, then rerun against the implementation using a local -build of the latest `rofd main` semantic ABI. diff --git a/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md b/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md deleted file mode 100644 index 722199d94..000000000 --- a/docs/superpowers/specs/2026-09-11-ofd-navigation-design.md +++ /dev/null @@ -1,149 +0,0 @@ -# OFD 目录与页面链接接入设计 - -## 范围与基线 - -在现有 OFD 渲染、语义文本、元数据和警告支持上,接入 rofd 的目录树、 -跳转目标和页面链接,复用 reader 的侧栏、页面交互及安全确认界面。 - -本次核对的 rofd main 为 `2331199`,包含: - -- `56da925`:像素区域渲染,reader 已接入。 -- `6db9bac`:元数据和警告,reader 已接入。 -- `9e4a169`:目录、动作与目标,本次接入。 -- `2331199`:页面链接映射,本次接入。 - -实施时补充:rofd 随后推进到 `35cb164`,发布版本为 0.4.0。因此本次实现使用 -配套的 0.4.0 头文件和共享库,并将 Debian 最低依赖更新为 0.4.0。 - -不增加附件提取、附件执行、自动动作、脚本、注释编辑或文件写回。 -不重构 PDF/XPS 后端,也不把 rofd 的矩形链接范围描述为精确路径命中。 - -## 架构与兼容性 - -为公共模型增加可选的导航目标,由目录项和页面链接共同使用。目标区分 -页内跳转与外部 URI;页内目标保存零基页码、目标模式、可选坐标和缩放。 -可选值必须区分缺省与显式零,不能只靠浮点数是否为零判断字段存在。 - -`Section`、`Link` 保留原有字段和默认行为。PDF/XPS 等未提供新目标的 -对象继续走原路径;OFD 使用新路径,不复用目录跳转中 PDF 风格的 Y 轴翻转。 -目录项另保存可选的初始展开状态,避免改变其它格式的默认展开行为。 - -职责分配: - -- `OfdDocument`:获取目录快照、转换树和导航目标,缓存目标页尺寸。 -- `OfdPage`:获取并缓存页面链接,完成命中查询,不执行任何动作。 -- 公共导航转换/计算辅助代码:校验目标、转换坐标、计算缩放与滚动位置; - 将可独立验证的计算从大型浏览器类中分离。 -- `CatalogTreeView`:完整展示树,将目录用户操作交给导航入口。 -- `DocSheet` / `SheetBrowser`:执行目标,更新缩放、布局、滚动及当前页; - 外链复用 `SecurityDialog`,适配层不调用桌面服务。 - -## 目录树 - -实现 `OfdDocument::outline()`,并为 OFD 开启 `PREVIEW_CATALOG`。 -按 rofd 的父子关系与源顺序转换完整目录,不依赖源文件的建议子节点数量。 -校验关系索引,遍历必须有界,不因深层目录造成无限递归。 - -目录展示不再限制为三层。没有动作、目标失效、动作不支持的节点仍保留标题 -和子树,页码栏留空,不能把 `-1` 或 `ROFD_NO_INDEX` 显示或解释为第一页。 -这些节点可以展开和选择,但选择不触发跳转。 - -首次显示使用 OFD 的 `expanded` 值;已有阅读记录中的展开状态优先。 -刷新模型、恢复展开状态、随当前页同步选中项均不能执行动作。 -用户鼠标或键盘激活每次最多执行一次;外链不能因选中项变化而自动弹窗。 - -## 目标语义与坐标 - -rofd 已解析 PageID 和命名书签。仅在 `HAS_PAGE_INDEX` 存在、索引未越界 -且模式受支持时建立可执行的页内目标;未知模式与未解析目标不执行。 -零基页码仅在兼容旧 `Link.page` 等一基字段时加一。 - -坐标先转换为目标页未旋转、未缩放的逻辑像素: - -```text -x = (left_mm - physical_page.x) * xDpi / 25.4 -y = (top_mm - physical_page.y) * yDpi / 25.4 -``` - -使用目标页的物理原点,而不是源链接所在页的原点。右、下边界做同样转换。 -缺省坐标不参与换算,不能把缺省的零减去物理原点。旋转只在视图映射时处理, -通过页面到场景的变换定位,避免重复旋转或重复应用对象 CTM。 - -执行模式: - -- `XYZ`:应用明确指定的坐标;缺省轴保留激活前视口相对当前页的位置, - 映射到目标页后受页面和滚动范围限制。缩放缺省或为零时保持当前比例; - 正值作为倍率交给 reader 的比例限制逻辑,负值或非有限值拒绝。 -- `Fit`:按目标整页与可用视口计算比例,定位目标页。 -- `FitH`:按目标页宽度适配,应用可选 Top;Top 缺省时沿用上述缺省轴策略。 -- `FitV`:按目标页高度适配,应用可选 Left;Left 缺省时沿用上述缺省轴策略。 -- `FitR`:要求四条边界均存在、有限且形成正面积矩形;适配并定位该区域。 - 不完整或退化矩形不执行,不悄悄变成整页或第一页跳转。 - -所有模式遵守 reader 当前缩放上下限,不绕过大页面的安全比例限制。 -适配比例根据目标页/目标区域计算,不直接借用基于文档最大页尺寸的全局 -适配结果。旋转和双页布局纳入可用视口与场景变换计算。 - -## 页面链接与动作策略 - -实现 `OfdPage::getLinkAtPoint()`。首次查询生成 Qt 自有的不可变链接缓存, -包含命中范围和可执行目标;空列表也作为已加载状态缓存,鼠标移动不重复 -构造快照或解析页面。初始化同步保护,失败保留失败状态并记录诊断,避免 -每次悬停重复失败和刷日志。 - -仅考虑 `CLICK` 动作。按 rofd 返回的源顺序选择第一个命中且受支持的动作, -每次激活最多执行一个,不连带执行同区域的其它动作。目录中的动作使用相同 -筛选策略。文档打开、页面打开和未知事件始终不执行。 - -一个链接的多个矩形独立参与命中,不能合并成覆盖中间空白的大包围盒。 -矩形已经包含 rofd 应用的对象与祖先变换,只做页面原点和 DPI 换算。 -命中能力以 rofd 提供的保守矩形为界,不承诺裁剪、遮挡或曲线路径的精确命中。 - -URI 先使用显式 Base 解析,再校验最终地址。首轮只允许有效的绝对 -`http`、`https`、`mailto` 地址;没有可用 Base 的相对地址不猜测为本地文件。 -`file`、其它协议、附件 GotoA 和未知动作均不可执行。 -安全确认对话框显示最终将打开的地址;用户取消时不调用外部程序。 -此限制只作用于新 OFD 导航,不改变其它格式已有的外链策略。 - -## 资源、警告与错误 - -所有 rofd 输出记录初始化 `struct_size`,遵守 `HAS_*` 和 `ROFD_NO_INDEX`。 -快照用 RAII 释放;标题、URI 和其它借用字符串在释放前复制为 Qt 自有数据。 -文档/页面所有者销毁前结束相关查询,不跨线程共享可变输出槽。 - -目录、目标页尺寸和链接查询可能触发惰性解析。完成查询后刷新现有警告接口, -复用文档警告去重与属性展示。导航失败不影响已有渲染或文本查询。 -目录与页面链接分别缓存,目录失败不能阻止 rofd 本可独立提供的链接查询。 - -## 构建与交付边界 - -更新本地构建使用的配套 rofd 头文件和共享库;CMake 增加目录、目标与链接 -符号检查,避免旧库带着相同版本号通过配置后才在链接阶段失败。 -不在源码提交中加入生成的共享库。设计时 rofd 仍标为 0.3.0;实施时上游已正式 -发布 0.4.0,发行版依赖下限相应更新为 0.4.0。 - -实现分两项审查与交付: - -1. 目录、公共导航目标与跳转执行,包括侧栏、完整树、坐标、模式及共享动作 - 安全策略;目录外链同样需要显式激活和确认。 -2. 页面链接与命中缓存,复用第一项的页内跳转及外链安全策略,并补充页面 - 点击和悬停场景的验证。 - -## 验收 - -先增加回归测试并确认未接入时失败,再实现;继续使用不链接 PDFium 的轻量 -OFD 测试目标。为目录模型和纯导航计算增加独立轻量覆盖,不构建或链接 -`test-deepin-reader` 聚合测试程序。 - -必须覆盖: - -- 空目录、无目标父节点、四层以上目录、初始展开状态和恢复状态优先级。 -- PageID 与命名书签、缺失目标、未知模式、缺省坐标、显式零、`Zoom=0`。 -- 非零物理原点、跨不同尺寸页面、五种目标模式、旋转与双页布局。 -- 单链接多个矩形、中间空白不命中、重叠链接的确定性选择、空/失败缓存。 -- 非 CLICK 事件、附件动作、URI/Base 解析、协议限制和用户取消外链确认。 -- 新增惰性导航警告,以及未设置新目标时 PDF/XPS 仍走原有路径。 - -最终只以 `cmake --build build --target deepin-reader -j1` 构建 reader 本体, -检查实际加载的 rofd 库,并用受控 OFD 做真实窗口的目录/链接交互验证。 -界面验证与后台测试分别报告,不把适配层测试通过当成用户交互已验证。 From 5de3f0dcaf28d71a47b66221810a7016db5b612a Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Tue, 15 Sep 2026 11:31:24 +0800 Subject: [PATCH 23/63] feat(batch-print): add headless batch print for pdf/docx/djvu/xps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add deepin-reader-batchprint standalone process for multi-file batch printing from file manager context menu without any dialog interaction. 新增无界面批量打印能力:文件管理器多选文档后右键"批量打印" 拉起独立进程静默完成打印,支持 pdf/docx/djvu/xps 格式。 Bundle libqt6waylandclient6 matching the apt Qt 6.8.0 set and resolve indirect deps via rpath-link, fixing linglong link failure caused by mixing runtime's libQt6WaylandClient private ABI. 修复玲珑构建链接失败:打包与本体 Qt 版本一致的 libQt6WaylandClient, 并通过 rpath-link 优先解析应用自带的间接依赖,避免混用运行时 Qt。 Log: 新增deepin-reader批量打印功能并修复玲珑构建 Influence: 用户可在文件管理器中多选文档批量打印,无需逐个操作。 --- CMakeLists.txt | 6 + batch-print/CMakeLists.txt | 125 ++++++++++ batch-print/batchprintapp.cpp | 88 +++++++ batch-print/batchprintapp.h | 28 +++ batch-print/cupsclient.cpp | 210 ++++++++++++++++ batch-print/cupsclient.h | 53 ++++ batch-print/errormessages.cpp | 54 +++++ batch-print/errormessages.h | 21 ++ batch-print/formatconverter.cpp | 226 ++++++++++++++++++ batch-print/formatconverter.h | 20 ++ batch-print/icupsapi.h | 29 +++ batch-print/main.cpp | 50 ++++ batch-print/notifyclient.cpp | 100 ++++++++ batch-print/notifyclient.h | 19 ++ batch-print/printsettings.cpp | 43 ++++ batch-print/printsettings.h | 67 ++++++ cmake/translation-generate.cmake | 23 +- debian/control | 3 +- linglong.yaml | 42 ++-- reader/CMakeLists.txt | 1 + reader/document/DjVuModel.cpp | 5 + reader/document/DjVuModel.h | 1 + reader/document/Model.cpp | 9 +- reader/document/Model.h | 1 + .../deepin-reader-batchprint.conf | 16 ++ tests/CMakeLists.txt | 6 + tests/batch-print/CMakeLists.txt | 53 ++++ tests/batch-print/ut_cupsclient.cpp | 211 ++++++++++++++++ tests/batch-print/ut_formatconverter.cpp | 111 +++++++++ tests/batch-print/ut_notifyclient.cpp | 123 ++++++++++ tests/batch-print/ut_printsettings.cpp | 135 +++++++++++ 31 files changed, 1849 insertions(+), 30 deletions(-) create mode 100644 batch-print/CMakeLists.txt create mode 100644 batch-print/batchprintapp.cpp create mode 100644 batch-print/batchprintapp.h create mode 100644 batch-print/cupsclient.cpp create mode 100644 batch-print/cupsclient.h create mode 100644 batch-print/errormessages.cpp create mode 100644 batch-print/errormessages.h create mode 100644 batch-print/formatconverter.cpp create mode 100644 batch-print/formatconverter.h create mode 100644 batch-print/icupsapi.h create mode 100644 batch-print/main.cpp create mode 100644 batch-print/notifyclient.cpp create mode 100644 batch-print/notifyclient.h create mode 100644 batch-print/printsettings.cpp create mode 100644 batch-print/printsettings.h create mode 100644 src/context-menus/deepin-reader-batchprint.conf create mode 100644 tests/batch-print/CMakeLists.txt create mode 100644 tests/batch-print/ut_cupsclient.cpp create mode 100644 tests/batch-print/ut_formatconverter.cpp create mode 100644 tests/batch-print/ut_notifyclient.cpp create mode 100644 tests/batch-print/ut_printsettings.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index dc1056bcb..25087b613 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,6 +265,12 @@ if (USE_PDFIUM_BUNDLE) add_subdirectory(3rdparty/deepin-pdfium) endif() +add_subdirectory(batch-print) + +# Install context-menus (batch print) +install(FILES src/context-menus/deepin-reader-batchprint.conf + DESTINATION ${CMAKE_INSTALL_DATADIR}/applications/context-menus) + # 单元测试(可选) option(BUILD_TESTS "Build unit tests" OFF) if (BUILD_TESTS) diff --git a/batch-print/CMakeLists.txt b/batch-print/CMakeLists.txt new file mode 100644 index 000000000..0593816a2 --- /dev/null +++ b/batch-print/CMakeLists.txt @@ -0,0 +1,125 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# [v4] Batch print unit tests switch (default OFF) +# Unit tests moved to top-level tests/batch-print (built under BUILD_TESTS) + +# Find Qt components needed by batch-print modules (DBus for notifications, PrintSupport for QPdfWriter) +pkg_check_modules(FREETYPE REQUIRED freetype2) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus PrintSupport Sql) + +# Import the system pdfium target in this scope (reader/ creates it only for its own subtree) +if (NOT USE_PDFIUM_BUNDLE) + pkg_check_modules(Deepin-pdfium REQUIRED IMPORTED_TARGET deepin-pdfium) +endif() + +# batchprint-core: CupsClient + NotifyClient + PrintSettings + ErrorMessages (no reader source dependency) +add_library(batchprint-core STATIC + cupsclient.h cupsclient.cpp + icupsapi.h + notifyclient.h notifyclient.cpp + printsettings.h printsettings.cpp + errormessages.h errormessages.cpp +) + +target_include_directories(batchprint-core PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_link_libraries(batchprint-core PUBLIC + Qt${QT_VERSION_MAJOR}::Gui + Qt${QT_VERSION_MAJOR}::DBus +) + +# batchprint-convert: FormatConverter (depends on selected reader/document sources + deepin-pdfium) +# Explicitly list only the reader source files needed for document loading/rendering, +# NOT the entire reader GUI (browser/sidebar/widgets/uiframe). +set(BATCHPRINT_READER_SOURCES + ${CMAKE_SOURCE_DIR}/reader/app/Global.cpp + ${CMAKE_SOURCE_DIR}/reader/document/Model.cpp + ${CMAKE_SOURCE_DIR}/reader/document/PDFModel.cpp + ${CMAKE_SOURCE_DIR}/reader/document/DjVuModel.cpp + ${CMAKE_SOURCE_DIR}/reader/document/XpsDocumentAdapter.cpp + ${CMAKE_SOURCE_DIR}/reader/document/XpsTextExtractor.cpp +) + +add_library(batchprint-convert STATIC + formatconverter.h formatconverter.cpp + ${BATCHPRINT_READER_SOURCES} +) + +set_target_properties(batchprint-convert PROPERTIES + AUTOMOC ON + AUTOUIC ON +) + +target_include_directories(batchprint-convert PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/reader + ${CMAKE_SOURCE_DIR}/reader/app + ${CMAKE_SOURCE_DIR}/reader/document + ${PDFIUM_INCLUDE_DIRS} + $<$:${XPS_DEPS_INCLUDE_DIRS}> +) + +target_compile_definitions(batchprint-convert PRIVATE + INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" + INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" + APP_VERSION="1.0.0" +) + +target_link_libraries(batchprint-convert PUBLIC + batchprint-core + Qt${QT_VERSION_MAJOR}::Gui + Qt${QT_VERSION_MAJOR}::Widgets + Qt${QT_VERSION_MAJOR}::PrintSupport + Qt${QT_VERSION_MAJOR}::Network + Qt${QT_VERSION_MAJOR}::Svg + Qt${QT_VERSION_MAJOR}::Concurrent + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Xml + ${DDJVU_LIBRARIES} + ${LIBJPEG_LIBRARIES} + ${FREETYPE_LIBRARIES} + $<$:${XPS_DEPS_LIBRARIES}> +) + +# DTK linking +if(DTK_USE_TARGETS) + target_link_libraries(batchprint-convert PUBLIC + Dtk${DTK_VERSION_MAJOR}::Widget + Dtk${DTK_VERSION_MAJOR}::Gui + Dtk${DTK_VERSION_MAJOR}::Core + ) +endif() + +if (QT_VERSION_MAJOR MATCHES 6) + target_link_libraries(batchprint-convert PUBLIC Qt${QT_VERSION_MAJOR}::Core5Compat) +endif() + +if (USE_PDFIUM_BUNDLE) + target_link_libraries(batchprint-convert PUBLIC deepin-pdfium-reader) +else() + target_link_libraries(batchprint-convert PUBLIC PkgConfig::Deepin-pdfium) +endif() + +if (XPS_SUPPORT_ENABLED) + target_compile_definitions(batchprint-convert PUBLIC XPS_SUPPORT_ENABLED) + target_compile_options(batchprint-convert PUBLIC ${XPS_DEPS_CFLAGS_OTHER}) +endif() + +# Executable +add_executable(deepin-reader-batchprint + main.cpp + batchprintapp.h batchprintapp.cpp +) + +target_link_libraries(deepin-reader-batchprint PRIVATE + batchprint-core + batchprint-convert +) + +install(TARGETS deepin-reader-batchprint + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/batch-print/batchprintapp.cpp b/batch-print/batchprintapp.cpp new file mode 100644 index 000000000..7a18af757 --- /dev/null +++ b/batch-print/batchprintapp.cpp @@ -0,0 +1,88 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "batchprintapp.h" +#include "formatconverter.h" +#include "notifyclient.h" +#include "errormessages.h" + +#include +#include +#include + +BatchPrintApp::BatchPrintApp(ICupsApi *cupsApi) +{ + if (cupsApi) { + m_cupsApi = cupsApi; + m_ownsCupsApi = false; + } else { + m_cupsApi = new CupsClient(); + m_ownsCupsApi = true; + } +} + +BatchPrintApp::~BatchPrintApp() +{ + if (m_ownsCupsApi) + delete m_cupsApi; +} + +int BatchPrintApp::run(const QStringList &fileList) +{ + CupsClient *cups = dynamic_cast(m_cupsApi); + if (cups) { + if (!cups->init()) { + qWarning() << "CUPS init failed"; + NotifyClient::notifyError(ErrorMessages::cupsUnavailable()); + return 2; + } + if (!cups->checkEnvironment()) { + qWarning() << "CUPS environment check failed"; + NotifyClient::notifyError(ErrorMessages::noDefaultPrinter()); + return 2; + } + if (cups->isColorSupported()) { + m_settings.colorMode = ColorMode::Auto; + } else { + m_settings.colorMode = ColorMode::Gray; + } + } + + int total = fileList.size(); + int succeeded = 0; + QStringList failedFiles; + + for (const QString &filePath : fileList) { + QTemporaryDir tempDir; + if (!tempDir.isValid()) { + failedFiles.append(QFileInfo(filePath).fileName()); + continue; + } + + QString outputPdfPath; + QString errorMsg; + if (!FormatConverter::convertToPdf(filePath, tempDir.path(), + outputPdfPath, errorMsg)) { + qWarning() << errorMsg; + failedFiles.append(QFileInfo(filePath).fileName()); + continue; + } + + QString jobTitle = QFileInfo(filePath).fileName(); + bool printOk = m_cupsApi->submitJob(outputPdfPath, jobTitle, m_settings); + + if (!printOk) { + failedFiles.append(QFileInfo(filePath).fileName()); + continue; + } + + ++succeeded; + } + + NotifyClient::notifyResult(total, succeeded, failedFiles); + + if (succeeded == total) + return 0; + return 1; +} diff --git a/batch-print/batchprintapp.h b/batch-print/batchprintapp.h new file mode 100644 index 000000000..c7c22cee4 --- /dev/null +++ b/batch-print/batchprintapp.h @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef BATCHPRINTAPP_H +#define BATCHPRINTAPP_H + +#include "cupsclient.h" +#include "printsettings.h" + +#include +#include + +class BatchPrintApp +{ +public: + explicit BatchPrintApp(ICupsApi *cupsApi = nullptr); + ~BatchPrintApp(); + + int run(const QStringList &fileList); + +private: + ICupsApi *m_cupsApi = nullptr; + bool m_ownsCupsApi = false; + PrintSettings m_settings; +}; + +#endif // BATCHPRINTAPP_H diff --git a/batch-print/cupsclient.cpp b/batch-print/cupsclient.cpp new file mode 100644 index 000000000..dda4b1a74 --- /dev/null +++ b/batch-print/cupsclient.cpp @@ -0,0 +1,210 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "cupsclient.h" + +#include +#include + +#include +#include + +#include + +typedef int (*cupsGetDests_fn)(cups_dest_t **dests); +typedef void (*cupsFreeDests_fn)(int num_dests, cups_dest_t *dests); +typedef ipp_t *(*cupsDoRequest_fn)(http_t *http, ipp_t *request, const char *resource); +typedef ipp_t *(*ippNewRequest_fn)(ipp_op_t op); +typedef void (*ippAddString_fn)(ipp_t *ipp, ipp_tag_t group, ipp_tag_t tag, const char *name, const char *language, const char *value); +typedef void (*ippAddStrings_fn)(ipp_t *ipp, ipp_tag_t group, ipp_tag_t tag, const char *name, int num_values, const char *language, const char *const *values); +typedef ipp_attribute_t *(*ippFindAttribute_fn)(ipp_t *ipp, const char *name, ipp_tag_t type); +typedef int (*cupsPrintFile_fn)(const char *printer, const char *filename, const char *title, int num_options, cups_option_t *options); +typedef const char *(*cupsGetOption_fn)(const char *name, int num_options, cups_option_t *options); +typedef void (*ippDelete_fn)(ipp_t *ipp); +typedef int (*ippGetBoolean_fn)(ipp_attribute_t *attr, int element); + +CupsClient::CupsClient() +{ +} + +CupsClient::~CupsClient() +{ +} + +bool CupsClient::loadSymbols() +{ + m_cupsGetDests = (void *)m_lib.resolve("cupsGetDests"); + m_cupsFreeDests = (void *)m_lib.resolve("cupsFreeDests"); + m_cupsDoRequest = (void *)m_lib.resolve("cupsDoRequest"); + m_ippNewRequest = (void *)m_lib.resolve("ippNewRequest"); + m_ippAddString = (void *)m_lib.resolve("ippAddString"); + m_ippAddStrings = (void *)m_lib.resolve("ippAddStrings"); + m_ippFindAttribute = (void *)m_lib.resolve("ippFindAttribute"); + m_cupsPrintFile = (void *)m_lib.resolve("cupsPrintFile"); + m_cupsGetOption = (void *)m_lib.resolve("cupsGetOption"); + m_ippDelete = (void *)m_lib.resolve("ippDelete"); + m_ippGetBoolean = (void *)m_lib.resolve("ippGetBoolean"); + + return m_cupsGetDests && m_cupsFreeDests && m_cupsDoRequest && + m_ippNewRequest && m_ippAddString && m_ippAddStrings && + m_ippFindAttribute && m_cupsPrintFile && m_cupsGetOption && m_ippDelete && m_ippGetBoolean; +} + +bool CupsClient::init() +{ + m_lib.setFileName(QStringLiteral("cups")); + if (!m_lib.load()) { + qWarning() << "Failed to dlopen libcups:" << m_lib.errorString(); + return false; + } + + m_loaded = loadSymbols(); + if (!m_loaded) { + qWarning() << "Failed to resolve CUPS symbols"; + return false; + } + + return true; +} + +bool CupsClient::checkEnvironment() +{ + if (!m_loaded) + return false; + + cups_dest_t *dests = nullptr; + int numDest = ((cupsGetDests_fn)m_cupsGetDests)(&dests); + if (numDest <= 0) { + qWarning() << "No printers found"; + return false; + } + + for (int i = 0; i < numDest; ++i) { + if (dests[i].is_default) { + m_defaultPrinterName = QString::fromUtf8(dests[i].name); + ((cupsFreeDests_fn)m_cupsFreeDests)(numDest, dests); + return true; + } + } + + m_defaultPrinterName = QString::fromUtf8(dests[0].name); + ((cupsFreeDests_fn)m_cupsFreeDests)(numDest, dests); + + return true; +} + +bool CupsClient::isColorSupported() +{ + if (!m_loaded || m_defaultPrinterName.isEmpty()) + return false; + + bool supported = false; + if (queryColorSupported(m_defaultPrinterName, supported)) { + m_colorSupported = supported; + } else { + m_colorSupported = false; + } + return m_colorSupported; +} + +bool CupsClient::getCupsDests(cups_dest_t **dests) +{ + if (!m_loaded || !m_cupsGetDests) + return false; + + int numDest = ((cupsGetDests_fn)m_cupsGetDests)(dests); + return numDest > 0; +} + +bool CupsClient::queryColorSupported(const QString &printerName, bool &supported) +{ + if (!m_loaded) + return false; + + ipp_t *request = ((ippNewRequest_fn)m_ippNewRequest)(IPP_GET_PRINTER_ATTRIBUTES); + if (!request) + return false; + + QString printerUri = QStringLiteral("ipp://localhost/printers/") + + QString::fromUtf8(QUrl::toPercentEncoding(printerName)); + + ((ippAddString_fn)m_ippAddString)(request, IPP_TAG_OPERATION, IPP_TAG_URI, + "printer-uri", nullptr, + printerUri.toUtf8().constData()); + + static const char *requestedAttrs[] = {"color-supported", "printer-type"}; + ((ippAddStrings_fn)m_ippAddStrings)(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", 2, nullptr, + requestedAttrs); + + ipp_t *response = ((cupsDoRequest_fn)m_cupsDoRequest)(CUPS_HTTP_DEFAULT, request, "/"); + if (!response) { + supported = false; + return false; + } + + ipp_attribute_t *attr = ((ippFindAttribute_fn)m_ippFindAttribute)(response, "color-supported", IPP_TAG_BOOLEAN); + if (attr) { + supported = ((ippGetBoolean_fn)m_ippGetBoolean)(attr, 0); + ((ippDelete_fn)m_ippDelete)(response); + return true; + } + + ((ippDelete_fn)m_ippDelete)(response); + supported = false; + return false; +} + +bool CupsClient::submitJob(const QString &pdfPath, const QString &title, const PrintSettings &settings) +{ + if (!m_loaded || m_defaultPrinterName.isEmpty()) + return false; + + bool printerSupportsColor = m_colorSupported; + QStringList optionList = toCupsOptions(settings, printerSupportsColor); + + int numOptions = optionList.size() / 2; + cups_option_t *options = nullptr; + if (numOptions > 0) { + options = (cups_option_t *)calloc(numOptions, sizeof(cups_option_t)); + if (!options) + return false; + + for (int i = 0; i < numOptions; ++i) { + options[i].name = strdup(optionList[i * 2].toUtf8().constData()); + options[i].value = strdup(optionList[i * 2 + 1].toUtf8().constData()); + } + } + + int result = ((cupsPrintFile_fn)m_cupsPrintFile)( + m_defaultPrinterName.toUtf8().constData(), + pdfPath.toUtf8().constData(), + title.toUtf8().constData(), + numOptions, options); + + if (options) { + for (int i = 0; i < numOptions; ++i) { + free(options[i].name); + free(options[i].value); + } + free(options); + } + + return result > 0; +} + +bool CupsClient::printFile(const QString &printerName, const QString &filename, + const QString &title, int numOptions, cups_option_t *options) +{ + if (!m_loaded || !m_cupsPrintFile) + return false; + + int result = ((cupsPrintFile_fn)m_cupsPrintFile)( + printerName.toUtf8().constData(), + filename.toUtf8().constData(), + title.toUtf8().constData(), + numOptions, options); + + return result > 0; +} diff --git a/batch-print/cupsclient.h b/batch-print/cupsclient.h new file mode 100644 index 000000000..5a09ffdfa --- /dev/null +++ b/batch-print/cupsclient.h @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef CUPSCLIENT_H +#define CUPSCLIENT_H + +#include "icupsapi.h" +#include "printsettings.h" + +#include +#include + +class CupsClient : public ICupsApi +{ +public: + CupsClient(); + ~CupsClient() override; + + bool init(); + bool checkEnvironment(); + bool isColorSupported(); + bool submitJob(const QString &pdfPath, const QString &title, const PrintSettings &settings) override; + + bool getCupsDests(cups_dest_t **dests) override; + bool queryColorSupported(const QString &printerName, bool &supported) override; + bool printFile(const QString &printerName, const QString &filename, + const QString &title, int numOptions, cups_option_t *options) override; + + QString defaultPrinterName() const { return m_defaultPrinterName; } + +private: + bool loadSymbols(); + + QLibrary m_lib; + bool m_loaded = false; + QString m_defaultPrinterName; + bool m_colorSupported = false; + + void *m_cupsGetDests = nullptr; + void *m_cupsFreeDests = nullptr; + void *m_cupsDoRequest = nullptr; + void *m_ippNewRequest = nullptr; + void *m_ippAddString = nullptr; + void *m_ippAddStrings = nullptr; + void *m_ippFindAttribute = nullptr; + void *m_cupsPrintFile = nullptr; + void *m_cupsGetOption = nullptr; + void *m_ippDelete = nullptr; + void *m_ippGetBoolean = nullptr; +}; + +#endif // CUPSCLIENT_H diff --git a/batch-print/errormessages.cpp b/batch-print/errormessages.cpp new file mode 100644 index 000000000..a995d3fa9 --- /dev/null +++ b/batch-print/errormessages.cpp @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "errormessages.h" + +#include + +QString ErrorMessages::cupsUnavailable() +{ + return QGuiApplication::translate("batchprint", + "CUPS is not available. Please check if the printing service is running."); +} + +QString ErrorMessages::noDefaultPrinter() +{ + return QGuiApplication::translate("batchprint", + "No default printer found. Please set a default printer first."); +} + +QString ErrorMessages::convertFailed(const QString &fileName) +{ + return QGuiApplication::translate("batchprint", + "Failed to convert file: %1").arg(fileName); +} + +QString ErrorMessages::printFailed(const QString &fileName) +{ + return QGuiApplication::translate("batchprint", + "Failed to print file: %1").arg(fileName); +} + +QString ErrorMessages::notifyTitle() +{ + return QGuiApplication::translate("batchprint", "Batch Print"); +} + +QString ErrorMessages::notifySuccess(int count) +{ + return QGuiApplication::translate("batchprint", + "All %n file(s) printed successfully.", "", count); +} + +QString ErrorMessages::notifyPartialSuccess(int succeeded, int failed) +{ + return QGuiApplication::translate("batchprint", + "%1 file(s) printed successfully, %2 file(s) failed.").arg(succeeded).arg(failed); +} + +QString ErrorMessages::notifyAllFailed(int count) +{ + return QGuiApplication::translate("batchprint", + "All %n file(s) failed to print.", "", count); +} diff --git a/batch-print/errormessages.h b/batch-print/errormessages.h new file mode 100644 index 000000000..d1ac614df --- /dev/null +++ b/batch-print/errormessages.h @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef ERRORMESSAGES_H +#define ERRORMESSAGES_H + +#include + +namespace ErrorMessages { + QString cupsUnavailable(); + QString noDefaultPrinter(); + QString convertFailed(const QString &fileName); + QString printFailed(const QString &fileName); + QString notifyTitle(); + QString notifySuccess(int count); + QString notifyPartialSuccess(int succeeded, int failed); + QString notifyAllFailed(int count); +} + +#endif // ERRORMESSAGES_H diff --git a/batch-print/formatconverter.cpp b/batch-print/formatconverter.cpp new file mode 100644 index 000000000..b29ab74bf --- /dev/null +++ b/batch-print/formatconverter.cpp @@ -0,0 +1,226 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "formatconverter.h" +#include "errormessages.h" + +#include "Global.h" +#include "Model.h" + +#include +#include +#include +#include +#include +#include +#include + +using deepin_reader::Document; +using deepin_reader::DocumentFactory; +using deepin_reader::Page; + +static const int FallbackDpi = 300; + +static Dr::FileType detectFileTypeWithFallback(const QString &filePath) +{ + Dr::FileType type = Dr::fileType(filePath); + if (type != Dr::Unknown) + return type; + + QString suffix = QFileInfo(filePath).suffix().toLower(); + if (suffix == QStringLiteral("pdf")) + return Dr::PDF; + if (suffix == QStringLiteral("docx")) + return Dr::DOCX; + if (suffix == QStringLiteral("djvu") || suffix == QStringLiteral("djv")) + return Dr::DJVU; +#ifdef XPS_SUPPORT_ENABLED + if (suffix == QStringLiteral("xps") || suffix == QStringLiteral("oxps")) + return Dr::XPS; +#endif + return Dr::Unknown; +} + +QSizeF FormatConverter::computePageSizeMm(double widthPx, double heightPx, int dpi) +{ + if (dpi <= 0) + dpi = FallbackDpi; + + double widthPt = widthPx * 72.0 / dpi; + double heightPt = heightPx * 72.0 / dpi; + double widthMm = widthPt * 25.4 / 72.0; + double heightMm = heightPt * 25.4 / 72.0; + + if (widthMm <= 0 || heightMm <= 0) + return QSizeF(210.0, 297.0); + + return QSizeF(widthMm, heightMm); +} + +bool FormatConverter::convertToPdf(const QString &filePath, const QString &outputDir, + QString &outputPdfPath, QString &errorMsg) +{ + QFileInfo fi(filePath); + if (!fi.exists() || !fi.isReadable()) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + + Dr::FileType type = detectFileTypeWithFallback(filePath); + + switch (type) { + case Dr::PDF: { + outputPdfPath = filePath; + return true; + } + case Dr::DOCX: { + QString convertedDir = outputDir; + if (convertedDir.isEmpty()) + convertedDir = fi.absolutePath(); + + Document::Error error = Document::NoError; + QProcess *proc = nullptr; + Document *doc = DocumentFactory::getDocument(Dr::DOCX, filePath, convertedDir, + QString(), &proc, error); + if (doc) { + delete doc; + outputPdfPath = convertedDir + QStringLiteral("/temp.pdf"); + if (!QFileInfo::exists(outputPdfPath)) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + return true; + } + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + case Dr::DJVU: { + Document::Error error = Document::NoError; + Document *doc = DocumentFactory::getDocument(Dr::DJVU, filePath, QString(), + QString(), nullptr, error); + if (!doc) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + + int pageCount = doc->pageCount(); + if (pageCount <= 0) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + delete doc; + return false; + } + + outputPdfPath = outputDir + QStringLiteral("/temp.pdf"); + QPdfWriter pdfWriter(outputPdfPath); + pdfWriter.setResolution(FallbackDpi); + + // Set first page size BEFORE creating QPainter — QPdfWriter applies + // page size when a new page begins, and the first page begins at + // painter construction. Setting it afterwards has no effect on page 0. + QScopedPointer firstPage(doc->page(0)); + if (firstPage) { + QSizeF firstPageSizePx = firstPage->sizeF(); + int firstDpi = firstPage->resolution(); + if (firstDpi <= 0) + firstDpi = FallbackDpi; + double firstWidthPt = firstPageSizePx.width() * 72.0 / firstDpi; + double firstHeightPt = firstPageSizePx.height() * 72.0 / firstDpi; + double firstWidthMm = firstWidthPt * 25.4 / 72.0; + double firstHeightMm = firstHeightPt * 25.4 / 72.0; + if (firstWidthMm <= 0 || firstHeightMm <= 0) { + firstWidthMm = 210.0; + firstHeightMm = 297.0; + } + pdfWriter.setPageSize(QPageSize(QSizeF(firstWidthMm, firstHeightMm), + QPageSize::Millimeter)); + } + + QPainter painter(&pdfWriter); + if (!painter.isActive()) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + delete doc; + return false; + } + + bool anyPageRendered = false; + for (int i = 0; i < pageCount; ++i) { + QScopedPointer page(i == 0 ? firstPage.take() : doc->page(i)); + if (!page) { + if (i > 0) + pdfWriter.newPage(); + continue; + } + + QSizeF pageSizePx = page->sizeF(); + int dpi = page->resolution(); + if (dpi <= 0) + dpi = FallbackDpi; + + double widthPt = pageSizePx.width() * 72.0 / dpi; + double heightPt = pageSizePx.height() * 72.0 / dpi; + double widthMm = widthPt * 25.4 / 72.0; + double heightMm = heightPt * 25.4 / 72.0; + + if (widthMm <= 0 || heightMm <= 0) { + widthMm = 210.0; + heightMm = 297.0; + } + + if (i > 0) { + pdfWriter.setPageSize(QPageSize(QSizeF(widthMm, heightMm), QPageSize::Millimeter)); + pdfWriter.newPage(); + } + + int renderWidthPx = qRound(widthPt * FallbackDpi / 72.0); + int renderHeightPx = qRound(heightPt * FallbackDpi / 72.0); + if (renderWidthPx <= 0 || renderHeightPx <= 0) { + renderWidthPx = static_cast(8.27 * FallbackDpi); + renderHeightPx = static_cast(11.69 * FallbackDpi); + } + + QImage image = page->render(renderWidthPx, renderHeightPx); + + if (!image.isNull()) { + anyPageRendered = true; + painter.drawImage(0, 0, image); + } + } + + painter.end(); + delete doc; + + if (!anyPageRendered) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + return true; + } + case Dr::XPS: { +#ifdef XPS_SUPPORT_ENABLED + Document::Error error = Document::NoError; + Document *doc = DocumentFactory::getDocument(Dr::XPS, filePath, QString(), + QString(), nullptr, error); + if (!doc) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + + outputPdfPath = outputDir + QStringLiteral("/temp.pdf"); + bool ok = doc->saveAs(outputPdfPath); + delete doc; + if (!ok || !QFileInfo::exists(outputPdfPath)) { + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } + return true; +#else + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; +#endif + } + default: + errorMsg = ErrorMessages::convertFailed(fi.fileName()); + return false; + } +} diff --git a/batch-print/formatconverter.h b/batch-print/formatconverter.h new file mode 100644 index 000000000..52439f457 --- /dev/null +++ b/batch-print/formatconverter.h @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef FORMATCONVERTER_H +#define FORMATCONVERTER_H + +#include +#include + +class FormatConverter +{ +public: + static bool convertToPdf(const QString &filePath, const QString &outputDir, + QString &outputPdfPath, QString &errorMsg); + + static QSizeF computePageSizeMm(double widthPx, double heightPx, int dpi); +}; + +#endif // FORMATCONVERTER_H diff --git a/batch-print/icupsapi.h b/batch-print/icupsapi.h new file mode 100644 index 000000000..ca8acdfcf --- /dev/null +++ b/batch-print/icupsapi.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef ICUPSAPI_H +#define ICUPSAPI_H + +#include + +#include "printsettings.h" + +struct cups_dest_s; +typedef struct cups_dest_s cups_dest_t; +struct cups_option_s; +typedef struct cups_option_s cups_option_t; + +class ICupsApi +{ +public: + virtual ~ICupsApi() = default; + virtual bool getCupsDests(cups_dest_t **dests) = 0; + virtual bool queryColorSupported(const QString &printerName, bool &supported) = 0; + virtual bool printFile(const QString &printerName, const QString &filename, + const QString &title, int numOptions, cups_option_t *options) = 0; + virtual bool submitJob(const QString &pdfPath, const QString &title, + const PrintSettings &settings) = 0; +}; + +#endif // ICUPSAPI_H diff --git a/batch-print/main.cpp b/batch-print/main.cpp new file mode 100644 index 000000000..73fdc0159 --- /dev/null +++ b/batch-print/main.cpp @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "batchprintapp.h" + +#include + +#include +#include +#include +#include +#include + +#include + +DGUI_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ + if (!qEnvironmentVariableIsSet("DISPLAY") && + !qEnvironmentVariableIsSet("WAYLAND_DISPLAY")) { + qputenv("QT_QPA_PLATFORM", "offscreen"); + } + + QGuiApplication app(argc, argv); + app.setApplicationName(QStringLiteral("deepin-reader-batchprint")); + + DGuiApplicationHelper::loadTranslator("deepin-reader", "deepin-reader"); + + QCommandLineParser parser; + parser.setApplicationDescription( + QGuiApplication::translate("batchprint", "Batch print documents silently")); + parser.addHelpOption(); + parser.addPositionalArgument(QStringLiteral("files"), + QGuiApplication::translate("batchprint", "Document files to print"), + QStringLiteral("[files...]")); + parser.process(app); + + QStringList files = parser.positionalArguments(); + if (files.isEmpty()) { + fprintf(stderr, "%s\n", + QGuiApplication::translate("batchprint", "No files specified.") + .toUtf8().constData()); + return 2; + } + + BatchPrintApp batchApp; + return batchApp.run(files); +} diff --git a/batch-print/notifyclient.cpp b/batch-print/notifyclient.cpp new file mode 100644 index 000000000..8e3151956 --- /dev/null +++ b/batch-print/notifyclient.cpp @@ -0,0 +1,100 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "notifyclient.h" +#include "errormessages.h" + +#include +#include +#include +#include + +#include + +static const int MaxFailedDisplay = 5; + +QString NotifyClient::buildBody(int total, int succeeded, const QStringList &failedFiles) +{ + QString body; + int failed = total - succeeded; + + if (failed == 0) { + body = ErrorMessages::notifySuccess(total); + } else if (succeeded == 0) { + body = ErrorMessages::notifyAllFailed(failed); + } else { + body = ErrorMessages::notifyPartialSuccess(succeeded, failed); + } + + if (failed > 0 && !failedFiles.isEmpty()) { + QStringList displayList = failedFiles.mid(0, MaxFailedDisplay); + body += QStringLiteral("\n"); + for (const QString &f : displayList) { + body += QStringLiteral("\n") + f; + } + if (failedFiles.size() > MaxFailedDisplay) { + body += QStringLiteral("\n") + + QGuiApplication::translate("batchprint", + "and %1 more file(s) failed.").arg(failedFiles.size() - MaxFailedDisplay); + } + } + + return body; +} + +void NotifyClient::notifyResult(int total, int succeeded, const QStringList &failedFiles) +{ + QString body = buildBody(total, succeeded, failedFiles); + + QDBusInterface iface(QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("/org/freedesktop/Notifications"), + QStringLiteral("org.freedesktop.Notifications")); + + if (!iface.isValid()) { + fprintf(stderr, "%s\n", body.toUtf8().constData()); + return; + } + + QVariantList args; + args << QStringLiteral("deepin-reader"); + args << quint32(0); + args << QStringLiteral("deepin-reader"); + args << ErrorMessages::notifyTitle(); + args << body; + args << QStringList(); + args << QVariantMap(); + args << qint32(-1); + + QDBusMessage reply = iface.call(QStringLiteral("Notify"), args); + if (reply.type() == QDBusMessage::ErrorMessage) { + fprintf(stderr, "%s\n", body.toUtf8().constData()); + } +} + +void NotifyClient::notifyError(const QString &body) +{ + QDBusInterface iface(QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("/org/freedesktop/Notifications"), + QStringLiteral("org.freedesktop.Notifications")); + + if (!iface.isValid()) { + fprintf(stderr, "%s\n", body.toUtf8().constData()); + return; + } + + QVariantList args; + args << QStringLiteral("deepin-reader"); + args << quint32(0); + args << QStringLiteral("deepin-reader"); + args << ErrorMessages::notifyTitle(); + args << body; + args << QStringList(); + args << QVariantMap(); + args << qint32(-1); + + QDBusMessage reply = iface.call(QStringLiteral("Notify"), args); + if (reply.type() == QDBusMessage::ErrorMessage) { + fprintf(stderr, "%s\n", body.toUtf8().constData()); + } +} diff --git a/batch-print/notifyclient.h b/batch-print/notifyclient.h new file mode 100644 index 000000000..d4880e4ba --- /dev/null +++ b/batch-print/notifyclient.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef NOTIFYCLIENT_H +#define NOTIFYCLIENT_H + +#include +#include + +class NotifyClient +{ +public: + static void notifyResult(int total, int succeeded, const QStringList &failedFiles); + static void notifyError(const QString &body); + static QString buildBody(int total, int succeeded, const QStringList &failedFiles); +}; + +#endif // NOTIFYCLIENT_H diff --git a/batch-print/printsettings.cpp b/batch-print/printsettings.cpp new file mode 100644 index 000000000..c5c8d909f --- /dev/null +++ b/batch-print/printsettings.cpp @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "printsettings.h" + +#include + +QStringList toCupsOptions(const PrintSettings &settings, bool printerSupportsColor) +{ + QStringList options; + + int copies = qBound(1, settings.copies, 999); + options << QStringLiteral("copies") << QString::number(copies); + + switch (settings.duplex) { + case DuplexMode::OneSided: + options << QStringLiteral("sides") << QStringLiteral("one-sided"); + break; + case DuplexMode::LongEdge: + options << QStringLiteral("sides") << QStringLiteral("two-sided-long-edge"); + break; + case DuplexMode::ShortEdge: + options << QStringLiteral("sides") << QStringLiteral("two-sided-short-edge"); + break; + } + + bool useColor = false; + switch (settings.colorMode) { + case ColorMode::Auto: + useColor = printerSupportsColor; + break; + case ColorMode::Color: + useColor = true; + break; + case ColorMode::Gray: + useColor = false; + break; + } + options << QStringLiteral("ColorModel") << (useColor ? QStringLiteral("RGB") : QStringLiteral("Gray")); + + return options; +} diff --git a/batch-print/printsettings.h b/batch-print/printsettings.h new file mode 100644 index 000000000..56724e1bd --- /dev/null +++ b/batch-print/printsettings.h @@ -0,0 +1,67 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef PRINTSETTINGS_H +#define PRINTSETTINGS_H + +#include +#include + +enum class Orientation { + Portrait = 0, + Landscape = 1, + Auto = 2 +}; + +enum class ColorMode { + Auto = 0, + Color = 1, + Gray = 2 +}; + +enum class DuplexMode { + OneSided = 0, + LongEdge = 1, + ShortEdge = 2 +}; + +enum class WatermarkLayout { + Tiled = 0, + Center = 1 +}; + +enum class WatermarkTextType { + None = 0, + Confidential = 1, + Draft = 2, + Custom = 3 +}; + +struct PrintSettings { + int copies = 1; + DuplexMode duplex = DuplexMode::OneSided; + ColorMode colorMode = ColorMode::Auto; + + Orientation orientation = Orientation::Auto; + QString paperSize; + + bool watermarkEnabled = false; + WatermarkLayout watermarkLayout = WatermarkLayout::Center; + WatermarkTextType watermarkTextType = WatermarkTextType::Confidential; + int watermarkAngle = 30; + int watermarkSize = 100; + int watermarkOpacity = 30; + QString watermarkColor = QStringLiteral("#6F6F6F"); + QString watermarkText; + + QString pageRange; + QString margin; + int scale = 100; + int perPage = 1; + int printOrder = 0; +}; + +QStringList toCupsOptions(const PrintSettings &settings, bool printerSupportsColor); + +#endif // PRINTSETTINGS_H diff --git a/cmake/translation-generate.cmake b/cmake/translation-generate.cmake index a45ee68e5..5f0af0398 100644 --- a/cmake/translation-generate.cmake +++ b/cmake/translation-generate.cmake @@ -1,12 +1,23 @@ function(TRANSLATION_GENERATE QMS) find_package(Qt${QT_VERSION_MAJOR}LinguistTools QUIET) - if (NOT Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE) - set(QT_LRELEASE "/lib/qt${QT_VERSION_MAJOR}/bin/lrelease") - message(STATUS "NOT found lrelease, set QT_LRELEASE = ${QT_LRELEASE}") - else() - set(QT_LRELEASE "${Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE}") - endif() + if (NOT Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE) + find_program(QT_LRELEASE + NAMES lrelease lrelease-qt${QT_VERSION_MAJOR} + HINTS + /lib/qt${QT_VERSION_MAJOR}/bin + /usr/lib/qt${QT_VERSION_MAJOR}/bin + /runtime/lib/qt${QT_VERSION_MAJOR}/bin + ) + if (NOT QT_LRELEASE) + set(QT_LRELEASE "/lib/qt${QT_VERSION_MAJOR}/bin/lrelease") + message(STATUS "NOT found lrelease, fallback to QT_LRELEASE = ${QT_LRELEASE}") + else() + message(STATUS "Found lrelease via find_program: ${QT_LRELEASE}") + endif() + else() + set(QT_LRELEASE "${Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE}") + endif() if(NOT ARGN) message(SEND_ERROR "Error: TRANSLATION_GENERATE() called without any .ts path") diff --git a/debian/control b/debian/control index 9b5da795e..fd82c8d1e 100644 --- a/debian/control +++ b/debian/control @@ -39,7 +39,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, - pandoc, + pandoc, + libcups2, libqt6webenginecore6-bin [!mipsel !mips64el] | libqt5core5a, Description: a tool for reading document files. Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. diff --git a/linglong.yaml b/linglong.yaml index 5ad612de3..9e69099a1 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -20,36 +20,34 @@ command: build: | # 下载和安装依赖 - apt -y install --download-only qt6-base-dev qt6-base-dev-tools qt6-tools-dev libdtk6widget-dev libspectre-dev libdjvulibre-dev libtiff-dev libjpeg-dev libicu-dev libpng-dev zlib1g-dev liblcms2-dev libopenjp2-7-dev libfreetype6-dev libgtest-dev libchardet-dev qt6-webengine-dev qt6-5compat-dev libdtk6gui-dev libdtk6core-dev qt6-svg-dev pandoc libgxps-dev libcairo2-dev libglib2.0-dev - bash ./install_dep /var/cache/apt/archives "$PREFIX" + # libqt6waylandclient6: libdtk6gui 的隐式依赖(未在 deb 声明),必须随 apt 的 Qt 6.8.0 一起打包, + # 否则链接时会拉取 /runtime 中 webengine 运行时的 libQt6WaylandClient,其私有 ABI 与打包的 Qt 不一致导致链接失败 + apt -y install --download-only qt6-base-dev qt6-base-dev-tools qt6-tools-dev libdtk6widget-dev libspectre-dev libdjvulibre-dev libtiff-dev libjpeg-dev libicu-dev libpng-dev zlib1g-dev liblcms2-dev libopenjp2-7-dev libfreetype6-dev libgtest-dev libchardet-dev qt6-webengine-dev qt6-5compat-dev libdtk6gui-dev libdtk6core-dev qt6-svg-dev pandoc libgxps-dev libcairo2-dev libglib2.0-dev libqt6waylandclient6 + # 第三个参数强制安装 runtime 已提供的 libqt6waylandclient6,保证其与打包的 Qt 版本一致 + bash ./install_dep /var/cache/apt/archives "$PREFIX" "libqt6waylandclient6" - # 设置INCLUDEPATH为引入的CFLAGS环境变量获取的路径 - sed -i '33i INCLUDEPATH += $$INCPATHS' 3rdparty/deepin-pdfium/src/src.pro - sed -i '35i INCLUDEPATH += $$INCPATHS' htmltopdf/htmltopdf.pro - sed -i '2i INCLUDEPATH += $$INCPATHS' reader/reader.pro - sed -i 's|/usr/lib/qt6/bin/lrelease|lrelease|g' translate_generation.sh - - # 构建 - VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') - mkdir -p build && cd build - qmake -set APP_INSTALL_LIBS ${PREFIX}/lib/${TRIPLET} - qmake "VERSION=${VERSION}" \ - "PREFIX=${PREFIX}" \ - "LINGLONG_BUILD_ON=1" \ - "INCPATHS=$(echo "$CFLAGS" | sed 's/-I//g')" \ - "LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET}" \ - "INSTALL_ROOT=${PREFIX}" \ - ../deepin_reader.pro - make -j`nproc` + # 构建(CMake) + rm -rf build && mkdir -p build && cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_INSTALL_LIBDIR=lib/${TRIPLET} \ + -DCMAKE_PREFIX_PATH=${PREFIX} \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}" + make -j$(nproc) make install > ../install.log 2>&1 cd .. # 项目生成应用名和动态隐式加载的依赖库,ldd无法找到的其他库 LDD_FILES=( deepin-reader - ../lib/deepin-reader/htmltopdf + deepin-reader-batchprint + ../lib/${TRIPLET}/deepin-reader/htmltopdf pandoc libdeepin-pdfium-reader.so + # dtk6gui 的隐式依赖,需打包与本体 Qt 版本一致的 waylandclient,避免运行时混用 /runtime 的 Qt + libQt6WaylandClient.so # 定制插件不存在 libzpdcallback.so ) @@ -59,7 +57,7 @@ build: | bash ./deploy_dep "${LDD_FILES[@]}" # lib/deepin-reader 文件添加到 install 文件 - for OTHER in "${PREFIX}"/lib/deepin-reader/*; do + for OTHER in "${PREFIX}"/lib/${TRIPLET}/deepin-reader/*; do if [[ -f "$OTHER" ]]; then echo "$OTHER" >> "${ID_VALUE}.install" fi diff --git a/reader/CMakeLists.txt b/reader/CMakeLists.txt index 1b801808b..b918d89cd 100644 --- a/reader/CMakeLists.txt +++ b/reader/CMakeLists.txt @@ -115,6 +115,7 @@ endif() # 定义安装前缀 target_compile_definitions(${PROJECT_NAME} PRIVATE INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" + INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" APP_VERSION="${APP_VERSION}" ) diff --git a/reader/document/DjVuModel.cpp b/reader/document/DjVuModel.cpp index 680d20c79..5429ce7de 100644 --- a/reader/document/DjVuModel.cpp +++ b/reader/document/DjVuModel.cpp @@ -442,6 +442,11 @@ QSizeF DjVuPage::sizeF() const return m_size; } +int DjVuPage::resolution() const +{ + return m_resolution > 0 ? m_resolution : 300; +} + QImage DjVuPage::render(int width, int height, const QRect &slice)const { qCDebug(appLog) << "Rendering page" << m_index << "with size" << width << "x" << height << "and slice" << slice; diff --git a/reader/document/DjVuModel.h b/reader/document/DjVuModel.h index ad8e39823..995b500f3 100644 --- a/reader/document/DjVuModel.h +++ b/reader/document/DjVuModel.h @@ -27,6 +27,7 @@ class DjVuPage : public Page ~DjVuPage(); QSizeF sizeF() const override; + int resolution() const override; QImage render(int width, int height, const QRect &slice = QRect())const override; diff --git a/reader/document/Model.cpp b/reader/document/Model.cpp index 6ed8e31fe..03b981f72 100644 --- a/reader/document/Model.cpp +++ b/reader/document/Model.cpp @@ -59,7 +59,14 @@ static int calculateTimeout(qint64 sizeInMB, int baseTimeout, int perMbTimeout) static QString getHtmlToPdfPath() { - QString path = QString(INSTALL_PREFIX) + "/lib/deepin-reader/htmltopdf"; + // Check the actual install libdir first (multiarch-aware, e.g. lib/x86_64-linux-gnu) + QString path = QString(INSTALL_PREFIX) + "/" + INSTALL_LIBDIR + "/deepin-reader/htmltopdf"; + if (QFile::exists(path)) { + qCDebug(appLog) << "Found htmltopdf in INSTALL_LIBDIR: " << path; + return path; + } + + path = QString(INSTALL_PREFIX) + "/lib/deepin-reader/htmltopdf"; if (QFile::exists(path)) { qCDebug(appLog) << "Found htmltopdf in INSTALL_PREFIX: " << path; return path; diff --git a/reader/document/Model.h b/reader/document/Model.h index e1681865c..19871e49a 100644 --- a/reader/document/Model.h +++ b/reader/document/Model.h @@ -188,6 +188,7 @@ class Page: public QObject virtual ~Page() {} virtual QSizeF sizeF() const = 0; + virtual int resolution() const { return 72; } virtual QImage render(int width, int height, const QRect &slice = QRect()) const = 0; /** * @brief 图片对象包围盒(与 render(width,height) 整页输出像素对齐) diff --git a/src/context-menus/deepin-reader-batchprint.conf b/src/context-menus/deepin-reader-batchprint.conf new file mode 100644 index 000000000..b8f498f5d --- /dev/null +++ b/src/context-menus/deepin-reader-batchprint.conf @@ -0,0 +1,16 @@ +[Menu Entry] +Actions=Zero +Version=1.0 + +[Menu Action Zero] +Exec=deepin-reader-batchprint %F +MimeType=application/pdf:application/vnd.openxmlformats-officedocument.wordprocessingml.document:application/wps-office.docx:image/vnd.djvu:application/vnd.ms-xpsdocument:application/oxps +Name=Batch Print +PosNum=6 +Separator=Top +X-DFM-ExcludeMimeTypes=inode/directory:application/x-desktop +X-DFM-MenuTypes=SingleFile:MultiFiles +X-DFM-SupportSchemes=file +Name[zh_CN]=批量打印 +Name[zh_HK]=批量打印 +Name[zh_TW]=批量打印 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dad235786..2b870b41b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -107,6 +107,8 @@ file(GLOB_RECURSE TEST_SOURCES list(FILTER TEST_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/at/") list(FILTER TEST_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/files/") list(FILTER TEST_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/include/") +# batch-print 测试为独立可执行文件(见 batch-print/CMakeLists.txt),不并入本测试目标 +list(FILTER TEST_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/batch-print/") # ====== 合并所有源文件 ====== set(ALL_SOURCES @@ -150,6 +152,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE UTSOURCEDIR="${CMAKE_CURRENT_SOURCE_DIR}" APP_VERSION="${APP_VERSION}" INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" + INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" ) if (QT_DESIRED_VERSION MATCHES 6) @@ -248,3 +251,6 @@ target_sources(${PROJECT_NAME} PRIVATE ${RESOURCES}) # 启用测试 enable_testing() add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) + +# 批量打印单元测试(独立 gtest 可执行文件) +add_subdirectory(batch-print) diff --git a/tests/batch-print/CMakeLists.txt b/tests/batch-print/CMakeLists.txt new file mode 100644 index 000000000..557291898 --- /dev/null +++ b/tests/batch-print/CMakeLists.txt @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Batch print unit tests (standalone gtest executables linking batchprint-core/convert) + +find_package(GTest REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Gui) + +# ut_printsettings: test toCupsOptions three-item mapping +add_executable(ut_printsettings ut_printsettings.cpp) +target_link_libraries(ut_printsettings PRIVATE + batchprint-core + GTest::GTest + GTest::Main + Qt${QT_VERSION_MAJOR}::Test + Qt${QT_VERSION_MAJOR}::Gui +) +add_test(NAME ut_printsettings COMMAND ut_printsettings) + +# ut_cupsclient: test via ICupsApi mock injection +add_executable(ut_cupsclient ut_cupsclient.cpp) +target_link_libraries(ut_cupsclient PRIVATE + batchprint-core + GTest::GTest + GTest::Main + Qt${QT_VERSION_MAJOR}::Test + Qt${QT_VERSION_MAJOR}::Gui +) +add_test(NAME ut_cupsclient COMMAND ut_cupsclient) + +# ut_formatconverter: test format detection and conversion paths +add_executable(ut_formatconverter ut_formatconverter.cpp) +target_link_libraries(ut_formatconverter PRIVATE + batchprint-core + batchprint-convert + GTest::GTest + GTest::Main + Qt${QT_VERSION_MAJOR}::Test + Qt${QT_VERSION_MAJOR}::Gui +) +add_test(NAME ut_formatconverter COMMAND ut_formatconverter) + +# ut_notifyclient: test notification message formatting +add_executable(ut_notifyclient ut_notifyclient.cpp) +target_link_libraries(ut_notifyclient PRIVATE + batchprint-core + GTest::GTest + GTest::Main + Qt${QT_VERSION_MAJOR}::Test + Qt${QT_VERSION_MAJOR}::Gui +) +add_test(NAME ut_notifyclient COMMAND ut_notifyclient) diff --git a/tests/batch-print/ut_cupsclient.cpp b/tests/batch-print/ut_cupsclient.cpp new file mode 100644 index 000000000..c37d88e36 --- /dev/null +++ b/tests/batch-print/ut_cupsclient.cpp @@ -0,0 +1,211 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "icupsapi.h" +#include "printsettings.h" +#include "cupsclient.h" + +#include +#include +#include +#include + +static int argc = 1; +static char *argv[] = { const_cast("ut_cupsclient"), nullptr }; + +class CupsClientTest : public ::testing::Test { +protected: + static void SetUpTestSuite() { + static QGuiApplication *app = nullptr; + if (!app) + app = new QGuiApplication(argc, argv); + } +}; + +// Mock implementation of ICupsApi for testing +class MockCupsApi : public ICupsApi { +public: + bool getCupsDestsResult = true; + bool queryColorResult = true; + bool colorSupportedValue = true; + bool printFileResult = true; + int printFileCallCount = 0; + bool submitJobResult = true; + int submitJobCallCount = 0; + QString lastTitle; + QString lastPrinter; + QString lastFilename; + int lastNumOptions = -1; + QString lastSubmitPath; + QString lastSubmitTitle; + PrintSettings lastSubmitSettings; + + bool getCupsDests(cups_dest_t **dests) override { + Q_UNUSED(dests) + return getCupsDestsResult; + } + + bool queryColorSupported(const QString &printerName, bool &supported) override { + Q_UNUSED(printerName) + supported = colorSupportedValue; + return queryColorResult; + } + + bool printFile(const QString &printerName, const QString &filename, + const QString &title, int numOptions, cups_option_t *options) override { + Q_UNUSED(options) + lastPrinter = printerName; + lastFilename = filename; + lastTitle = title; + lastNumOptions = numOptions; + ++printFileCallCount; + return printFileResult; + } + + bool submitJob(const QString &pdfPath, const QString &title, + const PrintSettings &settings) override { + lastSubmitPath = pdfPath; + lastSubmitTitle = title; + lastSubmitSettings = settings; + ++submitJobCallCount; + return submitJobResult; + } +}; + +TEST_F(CupsClientTest, MockInterfaceBasicOperation) { + MockCupsApi mock; + mock.getCupsDestsResult = true; + mock.queryColorResult = true; + mock.colorSupportedValue = true; + mock.printFileResult = true; + + cups_dest_t *dests = nullptr; + EXPECT_TRUE(mock.getCupsDests(&dests)); + + bool supported = false; + EXPECT_TRUE(mock.queryColorSupported(QStringLiteral("test-printer"), supported)); + EXPECT_TRUE(supported); + + EXPECT_TRUE(mock.printFile(QStringLiteral("test-printer"), + QStringLiteral("/tmp/test.pdf"), + QStringLiteral("test-job"), 0, nullptr)); + EXPECT_EQ(mock.printFileCallCount, 1); +} + +TEST_F(CupsClientTest, MockColorNotSupported) { + MockCupsApi mock; + mock.colorSupportedValue = false; + + bool supported = true; + EXPECT_TRUE(mock.queryColorSupported(QStringLiteral("mono-printer"), supported)); + EXPECT_FALSE(supported); +} + +TEST_F(CupsClientTest, MockPrintFailure) { + MockCupsApi mock; + mock.printFileResult = false; + + EXPECT_FALSE(mock.printFile(QStringLiteral("test"), + QStringLiteral("/tmp/nonexistent.pdf"), + QStringLiteral("fail-job"), 0, nullptr)); +} + +TEST_F(CupsClientTest, MockGetDestsFailure) { + MockCupsApi mock; + mock.getCupsDestsResult = false; + + cups_dest_t *dests = nullptr; + EXPECT_FALSE(mock.getCupsDests(&dests)); +} + +TEST_F(CupsClientTest, CupsClientInitWithoutCups) { + CupsClient client; + bool result = client.init(); + SUCCEED() << "CupsClient::init() returned: " << result; +} + +// Real coverage: verify toCupsOptions produces exact key-value pairs +TEST_F(CupsClientTest, ToCupsOptionsCopiesAndSidesAndColor) { + PrintSettings settings; + settings.copies = 2; + settings.duplex = DuplexMode::OneSided; + settings.colorMode = ColorMode::Auto; + + QStringList opts = toCupsOptions(settings, true); + + EXPECT_EQ(opts.size(), 6); + EXPECT_EQ(opts.at(0), QStringLiteral("copies")); + EXPECT_EQ(opts.at(1), QStringLiteral("2")); + EXPECT_EQ(opts.at(2), QStringLiteral("sides")); + EXPECT_EQ(opts.at(3), QStringLiteral("one-sided")); + EXPECT_EQ(opts.at(4), QStringLiteral("ColorModel")); + EXPECT_EQ(opts.at(5), QStringLiteral("RGB")); +} + +TEST_F(CupsClientTest, ToCupsOptionsCopiesClamp) { + PrintSettings settings; + settings.copies = 5000; + settings.colorMode = ColorMode::Gray; + + QStringList opts = toCupsOptions(settings, true); + int idx = opts.indexOf(QStringLiteral("copies")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("999")); +} + +TEST_F(CupsClientTest, ToCupsOptionsColorForceGray) { + PrintSettings settings; + settings.colorMode = ColorMode::Gray; + + QStringList opts = toCupsOptions(settings, true); + int idx = opts.indexOf(QStringLiteral("ColorModel")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("Gray")); +} + +TEST_F(CupsClientTest, ToCupsOptionsColorForceColor) { + PrintSettings settings; + settings.colorMode = ColorMode::Color; + + QStringList opts = toCupsOptions(settings, false); + int idx = opts.indexOf(QStringLiteral("ColorModel")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("RGB")); +} + +// Verify that printFile passes the title through correctly (not hardcoded) +TEST_F(CupsClientTest, MockPrintFileTitlePropagation) { + MockCupsApi mock; + QString expectedTitle = QStringLiteral("my-document.pdf"); + mock.printFile(QStringLiteral("printer1"), + QStringLiteral("/tmp/output.pdf"), + expectedTitle, 0, nullptr); + EXPECT_EQ(mock.lastTitle, expectedTitle); + EXPECT_EQ(mock.lastPrinter, QStringLiteral("printer1")); + EXPECT_EQ(mock.lastFilename, QStringLiteral("/tmp/output.pdf")); + EXPECT_EQ(mock.lastNumOptions, 0); +} + +// Verify that submitJob propagates title and print settings to the backend +TEST_F(CupsClientTest, MockSubmitJobSettingsPropagation) { + MockCupsApi mock; + PrintSettings settings; + settings.copies = 3; + settings.duplex = DuplexMode::LongEdge; + settings.colorMode = ColorMode::Gray; + + EXPECT_TRUE(mock.submitJob(QStringLiteral("/tmp/output.pdf"), + QStringLiteral("doc.pdf"), settings)); + EXPECT_EQ(mock.submitJobCallCount, 1); + EXPECT_EQ(mock.lastSubmitPath, QStringLiteral("/tmp/output.pdf")); + EXPECT_EQ(mock.lastSubmitTitle, QStringLiteral("doc.pdf")); + EXPECT_EQ(mock.lastSubmitSettings.copies, 3); + EXPECT_EQ(mock.lastSubmitSettings.duplex, DuplexMode::LongEdge); + EXPECT_EQ(mock.lastSubmitSettings.colorMode, ColorMode::Gray); + + mock.submitJobResult = false; + EXPECT_FALSE(mock.submitJob(QStringLiteral("/tmp/other.pdf"), + QStringLiteral("other.pdf"), settings)); + EXPECT_EQ(mock.submitJobCallCount, 2); +} diff --git a/tests/batch-print/ut_formatconverter.cpp b/tests/batch-print/ut_formatconverter.cpp new file mode 100644 index 000000000..bd521c833 --- /dev/null +++ b/tests/batch-print/ut_formatconverter.cpp @@ -0,0 +1,111 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "formatconverter.h" + +#include +#include +#include +#include +#include +#include +#include + +static int argc = 1; +static char *argv[] = { const_cast("ut_formatconverter"), nullptr }; + +class FormatConverterTest : public ::testing::Test { +protected: + static void SetUpTestSuite() { + static QGuiApplication *app = nullptr; + if (!app) + app = new QGuiApplication(argc, argv); + } +}; + +TEST_F(FormatConverterTest, NonexistentFileFails) { + QString outputPdfPath; + QString errorMsg; + EXPECT_FALSE(FormatConverter::convertToPdf( + QStringLiteral("/nonexistent/file.pdf"), + QStringLiteral("/tmp"), outputPdfPath, errorMsg)); + EXPECT_FALSE(errorMsg.isEmpty()); +} + +TEST_F(FormatConverterTest, PdfPassthroughReturnsOriginalPath) { + QTemporaryFile tempFile(QStringLiteral("XXXXXX.pdf")); + ASSERT_TRUE(tempFile.open()); + { + QTextStream stream(&tempFile); + stream << "%PDF-1.0\n1 0 obj\n<< /Type /Catalog >>\nendobj\n"; + stream << "trailer\n<< /Root 1 0 R >>\n%%EOF\n"; + } + tempFile.close(); + ASSERT_TRUE(QFileInfo::exists(tempFile.fileName())); + + QTemporaryDir tempDir; + ASSERT_TRUE(tempDir.isValid()); + + QString outputPdfPath; + QString errorMsg; + bool result = FormatConverter::convertToPdf(tempFile.fileName(), tempDir.path(), + outputPdfPath, errorMsg); + EXPECT_TRUE(result); + EXPECT_EQ(outputPdfPath, tempFile.fileName()); +} + +TEST_F(FormatConverterTest, UnknownFormatFails) { + QTemporaryFile tempFile(QStringLiteral("XXXXXX.unknown")); + ASSERT_TRUE(tempFile.open()); + tempFile.write("dummy content"); + tempFile.close(); + + QTemporaryDir tempDir; + ASSERT_TRUE(tempDir.isValid()); + + QString outputPdfPath; + QString errorMsg; + EXPECT_FALSE(FormatConverter::convertToPdf(tempFile.fileName(), tempDir.path(), + outputPdfPath, errorMsg)); + EXPECT_FALSE(errorMsg.isEmpty()); +} + +// DJVU geometry conversion: pixel dimensions at a given DPI must convert to +// correct millimeter page sizes. This verifies the fix for review item 1. +TEST_F(FormatConverterTest, DjvuGeometryConversion300dpi) { + // A US Letter page at 300 dpi: 2550 x 3300 pixels + QSizeF mm = FormatConverter::computePageSizeMm(2550.0, 3300.0, 300); + // US Letter = 215.9 x 279.4 mm + EXPECT_NEAR(mm.width(), 215.9, 0.5); + EXPECT_NEAR(mm.height(), 279.4, 0.5); +} + +TEST_F(FormatConverterTest, DjvuGeometryConversion72dpi) { + // At 72 dpi, pixels == points, so 595 x 842 px → 210 x 297 mm (A4) + QSizeF mm = FormatConverter::computePageSizeMm(595.0, 842.0, 72); + EXPECT_NEAR(mm.width(), 210.0, 0.5); + EXPECT_NEAR(mm.height(), 297.2, 0.5); +} + +TEST_F(FormatConverterTest, DjvuGeometryConversionFallbackDpi) { + // dpi <= 0 should fall back to 300 + QSizeF mm = FormatConverter::computePageSizeMm(2550.0, 3300.0, 0); + EXPECT_NEAR(mm.width(), 215.9, 0.5); + EXPECT_NEAR(mm.height(), 279.4, 0.5); +} + +TEST_F(FormatConverterTest, DjvuGeometryConversionInvalidSize) { + // Zero or negative dimensions should fall back to A4 + QSizeF mm = FormatConverter::computePageSizeMm(0.0, 0.0, 300); + EXPECT_EQ(mm.width(), 210.0); + EXPECT_EQ(mm.height(), 297.0); +} + +TEST_F(FormatConverterTest, DjvuGeometryConversionNonA4Landscape) { + // A3 landscape at 300 dpi: 4961 x 3508 pixels + QSizeF mm = FormatConverter::computePageSizeMm(4961.0, 3508.0, 300); + // A3 = 297 x 420 mm (landscape) + EXPECT_NEAR(mm.width(), 419.9, 1.0); + EXPECT_NEAR(mm.height(), 296.9, 1.0); +} diff --git a/tests/batch-print/ut_notifyclient.cpp b/tests/batch-print/ut_notifyclient.cpp new file mode 100644 index 000000000..abad7969f --- /dev/null +++ b/tests/batch-print/ut_notifyclient.cpp @@ -0,0 +1,123 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "notifyclient.h" +#include "errormessages.h" + +#include +#include + +static int argc = 1; +static char *argv[] = { const_cast("ut_notifyclient"), nullptr }; + +class NotifyClientTest : public ::testing::Test { +protected: + static void SetUpTestSuite() { + static QGuiApplication *app = nullptr; + if (!app) + app = new QGuiApplication(argc, argv); + } +}; + +// Notification body parameter assertions: verify buildBody produces correct +// content for each scenario. This verifies the fix for review item 2. + +TEST_F(NotifyClientTest, AllSuccessBodyContainsSuccess) { + QString body = NotifyClient::buildBody(3, 3, QStringList()); + EXPECT_FALSE(body.isEmpty()); + EXPECT_FALSE(body.contains(QStringLiteral("failed"))); +} + +TEST_F(NotifyClientTest, AllFailedBodyContainsFailed) { + QStringList failed; + failed << QStringLiteral("file1.pdf") << QStringLiteral("file2.pdf"); + QString body = NotifyClient::buildBody(2, 0, failed); + EXPECT_FALSE(body.isEmpty()); + EXPECT_TRUE(body.contains(QStringLiteral("failed"))); + EXPECT_TRUE(body.contains(QStringLiteral("file1.pdf"))); + EXPECT_TRUE(body.contains(QStringLiteral("file2.pdf"))); +} + +TEST_F(NotifyClientTest, PartialSuccessBodyContainsBoth) { + QStringList failed; + failed << QStringLiteral("file2.docx"); + QString body = NotifyClient::buildBody(3, 2, failed); + EXPECT_FALSE(body.isEmpty()); + EXPECT_TRUE(body.contains(QStringLiteral("file2.docx"))); +} + +TEST_F(NotifyClientTest, ManyFailedFilesTruncated) { + QStringList failed; + for (int i = 0; i < 10; ++i) + failed << QStringLiteral("file%1.pdf").arg(i); + QString body = NotifyClient::buildBody(10, 0, failed); + // Should contain first 5 files + EXPECT_TRUE(body.contains(QStringLiteral("file0.pdf"))); + EXPECT_TRUE(body.contains(QStringLiteral("file4.pdf"))); + // Should contain truncation notice + EXPECT_TRUE(body.contains(QStringLiteral("5 more"))); +} + +TEST_F(NotifyClientTest, EmptyListBody) { + QString body = NotifyClient::buildBody(0, 0, QStringList()); + EXPECT_FALSE(body.isEmpty()); +} + +TEST_F(NotifyClientTest, NotifyResultAllSuccessDoesNotCrash) { + NotifyClient::notifyResult(3, 3, QStringList()); + SUCCEED(); +} + +TEST_F(NotifyClientTest, NotifyResultAllFailedDoesNotCrash) { + QStringList failed; + failed << QStringLiteral("file1.pdf") << QStringLiteral("file2.pdf"); + NotifyClient::notifyResult(2, 0, failed); + SUCCEED(); +} + +TEST_F(NotifyClientTest, NotifyResultPartialSuccessDoesNotCrash) { + QStringList failed; + failed << QStringLiteral("file2.docx"); + NotifyClient::notifyResult(3, 2, failed); + SUCCEED(); +} + +TEST_F(NotifyClientTest, NotifyResultManyFailedDoesNotCrash) { + QStringList failed; + for (int i = 0; i < 10; ++i) + failed << QStringLiteral("file%1.pdf").arg(i); + NotifyClient::notifyResult(10, 0, failed); + SUCCEED(); +} + +TEST_F(NotifyClientTest, NotifyResultEmptyListDoesNotCrash) { + NotifyClient::notifyResult(0, 0, QStringList()); + SUCCEED(); +} + +// Regression test: buildBody with total==0 and an error message in failedFiles +// must NOT surface the error text — buildBody is designed for result statistics +// only, not environment errors. This is exactly the gap that let the original +// bug slip through: every existing test only exercised success/failure branches. +TEST_F(NotifyClientTest, BuildBodyTotalZeroDoesNotContainErrorMessage) { + QStringList errList; + errList << ErrorMessages::cupsUnavailable(); + QString body = NotifyClient::buildBody(0, 0, errList); + EXPECT_FALSE(body.isEmpty()); + // The error message must NOT appear in buildBody output for total==0. + EXPECT_FALSE(body.contains(ErrorMessages::cupsUnavailable())); + // buildBody(0,0,...) falls into the "All 0 file(s) printed successfully." branch. + EXPECT_TRUE(body.contains(QStringLiteral("successfully"))); +} + +// Environment error path uses notifyError, not buildBody/notifyResult. +TEST_F(NotifyClientTest, NotifyErrorDoesNotCrash) { + NotifyClient::notifyError(ErrorMessages::cupsUnavailable()); + SUCCEED(); +} + +TEST_F(NotifyClientTest, NotifyErrorNoDefaultPrinterDoesNotCrash) { + NotifyClient::notifyError(ErrorMessages::noDefaultPrinter()); + SUCCEED(); +} diff --git a/tests/batch-print/ut_printsettings.cpp b/tests/batch-print/ut_printsettings.cpp new file mode 100644 index 000000000..f116b3cc8 --- /dev/null +++ b/tests/batch-print/ut_printsettings.cpp @@ -0,0 +1,135 @@ +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "printsettings.h" + +#include +#include + +#include + +static int argc = 1; +static char *argv[] = { const_cast("ut_printsettings"), nullptr }; + +class PrintSettingsTest : public ::testing::Test { +protected: + static void SetUpTestSuite() { + static QGuiApplication *app = nullptr; + if (!app) + app = new QGuiApplication(argc, argv); + } +}; + +TEST_F(PrintSettingsTest, CopiesMapping) { + PrintSettings s; + s.copies = 3; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("copies")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("3")); +} + +TEST_F(PrintSettingsTest, CopiesClampHigh) { + PrintSettings s; + s.copies = 9999; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("copies")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("999")); +} + +TEST_F(PrintSettingsTest, CopiesClampLow) { + PrintSettings s; + s.copies = 0; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("copies")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("1")); +} + +TEST_F(PrintSettingsTest, CopiesClampNegative) { + PrintSettings s; + s.copies = -5; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("copies")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("1")); +} + +TEST_F(PrintSettingsTest, SidesOneSided) { + PrintSettings s; + s.duplex = DuplexMode::OneSided; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("sides")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("one-sided")); +} + +TEST_F(PrintSettingsTest, SidesLongEdge) { + PrintSettings s; + s.duplex = DuplexMode::LongEdge; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("sides")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("two-sided-long-edge")); +} + +TEST_F(PrintSettingsTest, SidesShortEdge) { + PrintSettings s; + s.duplex = DuplexMode::ShortEdge; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("sides")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("two-sided-short-edge")); +} + +TEST_F(PrintSettingsTest, ColorModelAutoWithColorSupport) { + PrintSettings s; + s.colorMode = ColorMode::Auto; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("ColorModel")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("RGB")); +} + +TEST_F(PrintSettingsTest, ColorModelAutoWithoutColorSupport) { + PrintSettings s; + s.colorMode = ColorMode::Auto; + QStringList opts = toCupsOptions(s, false); + int idx = opts.indexOf(QStringLiteral("ColorModel")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("Gray")); +} + +TEST_F(PrintSettingsTest, ColorModelColor) { + PrintSettings s; + s.colorMode = ColorMode::Color; + QStringList opts = toCupsOptions(s, false); + int idx = opts.indexOf(QStringLiteral("ColorModel")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("RGB")); +} + +TEST_F(PrintSettingsTest, ColorModelGray) { + PrintSettings s; + s.colorMode = ColorMode::Gray; + QStringList opts = toCupsOptions(s, true); + int idx = opts.indexOf(QStringLiteral("ColorModel")); + ASSERT_GE(idx, 0); + EXPECT_EQ(opts.at(idx + 1), QStringLiteral("Gray")); +} + +TEST_F(PrintSettingsTest, DefaultValues) { + PrintSettings s; + EXPECT_EQ(s.copies, 1); + EXPECT_EQ(s.duplex, DuplexMode::OneSided); + EXPECT_EQ(s.colorMode, ColorMode::Auto); + EXPECT_EQ(s.orientation, Orientation::Auto); + EXPECT_EQ(s.watermarkEnabled, false); + EXPECT_EQ(s.watermarkAngle, 30); + EXPECT_EQ(s.watermarkSize, 100); + EXPECT_EQ(s.watermarkOpacity, 30); + EXPECT_EQ(s.watermarkLayout, WatermarkLayout::Center); + EXPECT_EQ(s.watermarkTextType, WatermarkTextType::Confidential); +} From 8cd33994be58980d6fba750fae0970fc1bddff5d Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 15 Sep 2026 14:51:37 +0800 Subject: [PATCH 24/63] fix(reader): pin render task lifetime to renderer ref and uuid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Render task structs now carry a renderer shared reference and a uuid snapshot; workers dereference only those and skip tasks whose sheet is gone (existSheetByUuid). DocSheet owns SheetRenderer via QSharedPointer and purges queued tasks (clearAllTasksForSheet/Page) before destruction. BrowserPage validates page aliveness before writing render results back, and the pinch-zoom timer callback is bound to its receiver to avoid UAF. 渲染任务结构体改为携带渲染器共享引用与入队时快照的 uuid:worker 线 程仅解引用这两者,并经 existSheetByUuid 跳过已销毁文档的任务。 DocSheet 改用 QSharedPointer 持有 SheetRenderer,析构前排空排队任务 (clearAllTasksForSheet/Page);BrowserPage 回写渲染结果前校验页面 存活;捏合缩放定时器回调绑定 receiver,消除悬空指针。 Log: 渲染任务生命周期加固,消除文档销毁后 worker/回包路径悬空指针 PMS: BUG-377151 Influence: 文档关闭/缩放过程中渲染回调不再有悬空指针风险;正常渲染行为不变。 --- reader/browser/BrowserPage.cpp | 35 ++++++ reader/browser/BrowserPage.h | 9 ++ reader/browser/PageRenderThread.cpp | 154 ++++++++++++++++++----- reader/browser/PageRenderThread.h | 48 ++++++- reader/browser/SheetBrowser.cpp | 3 +- reader/sidebar/SideBarImageViewModel.cpp | 4 + reader/uiframe/DocSheet.cpp | 29 +++-- reader/uiframe/DocSheet.h | 17 ++- reader/uiframe/SheetRenderer.cpp | 27 ++-- reader/uiframe/SheetRenderer.h | 21 +++- tests/browser/ut_browserpage.cpp | 1 + tests/browser/ut_pagerenderthread.cpp | 12 +- tests/browser/ut_sheetbrowser.cpp | 6 +- tests/uiframe/ut_docsheet.cpp | 6 +- tests/uiframe/ut_sheetrenderer.cpp | 6 +- tests/ut_mainwindow.cpp | 2 +- 16 files changed, 308 insertions(+), 72 deletions(-) diff --git a/reader/browser/BrowserPage.cpp b/reader/browser/BrowserPage.cpp index 05122aadb..cf0a37c4f 100644 --- a/reader/browser/BrowserPage.cpp +++ b/reader/browser/BrowserPage.cpp @@ -33,10 +33,15 @@ const int ICON_SIZE = 23; +// 主线程专用的存活页注册表:入队时的 page 裸指针仅在回包时由主线程 handler 解引用, +// handler 必须先经 existPage 校验,避免向已析构页面回包(UAF) +static QSet g_alivePages; + BrowserPage::BrowserPage(SheetBrowser *parent, int index, DocSheet *sheet) : QGraphicsItem(), m_sheet(sheet), m_parent(parent), m_index(index) { qCDebug(appLog) << "BrowserPage created, index:" << index; + g_alivePages.insert(this); setAcceptHoverEvents(true); setFlag(QGraphicsItem::ItemIsPanel); @@ -48,7 +53,9 @@ BrowserPage::BrowserPage(SheetBrowser *parent, int index, DocSheet *sheet) : BrowserPage::~BrowserPage() { // qCDebug(appLog) << "BrowserPage destroyed, index:" << m_index; + g_alivePages.remove(this); PageRenderThread::clearImageTasks(m_sheet, this); + PageRenderThread::clearAllTasksForPage(this); // 断开并销毁夜间异步任务 watcher:后台滤镜任务持有的都是副本,安全丢弃 delete m_nightWatcher; @@ -62,6 +69,12 @@ BrowserPage::~BrowserPage() // qCDebug(appLog) << "BrowserPage::~BrowserPage() - Destructor completed"; } +bool BrowserPage::existPage(const BrowserPage *page) +{ + // 仅主线程调用:注册表只在主线程增删,无需加锁 + return g_alivePages.contains(page); +} + QRectF BrowserPage::boundingRect() const { // qCDebug(appLog) << "BrowserPage::boundingRect() - Calculating bounding rectangle"; @@ -329,6 +342,10 @@ void BrowserPage::render(const double &scaleFactor, const Dr::Rotation &rotation task.page = this; + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); + task.pageIndex = itemIndex(); + task.pixmapId = m_pixmapId; const qreal deviceRatio = dApp ? dApp->devicePixelRatio() : 1.0; @@ -345,6 +362,12 @@ void BrowserPage::render(const double &scaleFactor, const Dr::Rotation &rotation task.page = this; + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); + task.pageIndex = itemIndex(); + task.scaleFactor = m_scaleFactor; + task.originSize = m_originSizeF; + task.pixmapId = m_pixmapId; const qreal deviceRatio = dApp ? dApp->devicePixelRatio() : 1.0; @@ -365,6 +388,10 @@ void BrowserPage::render(const double &scaleFactor, const Dr::Rotation &rotation task.page = this; + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); + task.pageIndex = itemIndex(); + PageRenderThread::appendTask(task); } } @@ -394,6 +421,10 @@ void BrowserPage::renderRect(const QRectF &rect) task.page = this; + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); + task.pageIndex = itemIndex(); + task.pixmapId = m_pixmapId; task.whole = QRect(0, 0, @@ -659,6 +690,10 @@ void BrowserPage::loadWords() task.page = this; + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); + task.pageIndex = itemIndex(); + PageRenderThread::appendTask(task); m_wordHasRendered = false; diff --git a/reader/browser/BrowserPage.h b/reader/browser/BrowserPage.h index 9e2198db8..b2a9d5986 100644 --- a/reader/browser/BrowserPage.h +++ b/reader/browser/BrowserPage.h @@ -41,6 +41,15 @@ class BrowserPage : public QGraphicsItem ~BrowserPage() override; + /** + * @brief existPage + * 判断页面是否存活(仅主线程调用)。渲染回包 handler 解引用 task.page + * 之前必须校验,避免向已析构页面回包 + * @param page 待校验页面 + * @return 存活返回 true + */ + static bool existPage(const BrowserPage *page); + /** * @brief 文档页缩放后的原区域 不受旋转影响 * @return diff --git a/reader/browser/PageRenderThread.cpp b/reader/browser/PageRenderThread.cpp index 6dcdfb043..61ba9aa27 100644 --- a/reader/browser/PageRenderThread.cpp +++ b/reader/browser/PageRenderThread.cpp @@ -133,6 +133,79 @@ bool PageRenderThread::clearImageTasks(DocSheet *sheet, BrowserPage *page, int p // qCDebug(appLog) << "PageRenderThread::clearImageTasks() - Clear image tasks completed"; return true; } +void PageRenderThread::clearAllTasksForSheet(DocSheet *sheet) +{ + PageRenderThread *inst = instance(); + if (nullptr == inst) + return; + + // 排空所有引用该 sheet 的待处理任务,避免析构后后台线程悬空访问 + inst->m_pageNormalImageMutex.lock(); + for (int i = inst->m_pageNormalImageTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageNormalImageTasks[i].sheet == sheet) + inst->m_pageNormalImageTasks.removeAt(i); + } + inst->m_pageNormalImageMutex.unlock(); + + inst->m_pageSliceImageMutex.lock(); + for (int i = inst->m_pageSliceImageTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageSliceImageTasks[i].sheet == sheet) + inst->m_pageSliceImageTasks.removeAt(i); + } + inst->m_pageSliceImageMutex.unlock(); + + inst->m_pageBigImageMutex.lock(); + for (int i = inst->m_pageBigImageTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageBigImageTasks[i].sheet == sheet) + inst->m_pageBigImageTasks.removeAt(i); + } + inst->m_pageBigImageMutex.unlock(); + + inst->m_pageWordMutex.lock(); + for (int i = inst->m_pageWordTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageWordTasks[i].sheet == sheet) + inst->m_pageWordTasks.removeAt(i); + } + inst->m_pageWordMutex.unlock(); + + inst->m_pageAnnotationMutex.lock(); + for (int i = inst->m_pageAnnotationTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageAnnotationTasks[i].sheet == sheet) + inst->m_pageAnnotationTasks.removeAt(i); + } + inst->m_pageAnnotationMutex.unlock(); + + inst->m_pageThumbnailMutex.lock(); + for (int i = inst->m_pageThumbnailTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageThumbnailTasks[i].sheet == sheet) + inst->m_pageThumbnailTasks.removeAt(i); + } + inst->m_pageThumbnailMutex.unlock(); +} + +void PageRenderThread::clearAllTasksForPage(const BrowserPage *page) +{ + PageRenderThread *inst = instance(); + if (nullptr == inst || nullptr == page) + return; + + // BrowserPage 析构时调用:文字/注释任务不在 clearImageTasks 覆盖范围内, + // 若不清除,worker 完成后回包将解引用已析构的 page(主线程 handler 崩溃) + inst->m_pageWordMutex.lock(); + for (int i = inst->m_pageWordTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageWordTasks[i].page == page) + inst->m_pageWordTasks.removeAt(i); + } + inst->m_pageWordMutex.unlock(); + + inst->m_pageAnnotationMutex.lock(); + for (int i = inst->m_pageAnnotationTasks.count() - 1; i >= 0; --i) { + if (inst->m_pageAnnotationTasks[i].page == page) + inst->m_pageAnnotationTasks.removeAt(i); + } + inst->m_pageAnnotationMutex.unlock(); +} + void PageRenderThread::appendTask(DocPageNormalImageTask task) { @@ -356,9 +429,13 @@ void PageRenderThread::run() continue; } + if (task.renderer.isNull()) { + continue; + } + QList renderRects; - if (task.sheet->renderer()->hasWidgetAnnots(task.page->itemIndex())) { + if (task.renderer->hasWidgetAnnots(task.pageIndex)) { //if has signature,render whole rect renderRects.append(task.rect); } else { @@ -377,12 +454,12 @@ void PageRenderThread::run() if (m_quit) break; - //外部删除了此处不判断会导致崩溃 - if (!DocSheet::existSheet(task.sheet)) + //uuid失效说明sheet已销毁(或新文档已接管),仅用于避免为将死文档做无用渲染; + //正确性由任务中的renderer共享引用保证,此处解引用不再有UAF风险 + if (!DocSheet::existSheetByUuid(task.uuid)) break; - //判断page存在之后 使用page之前,也就是此处,如果主线程先一步进入page被删流程,【理论上会导致崩溃】,目前概率非常低,未发现 - QImage image = task.sheet->getImage(task.page->itemIndex(), task.rect.width(), task.rect.height(), + QImage image = task.renderer->getImage(task.pageIndex, task.rect.width(), task.rect.height(), QRect(static_cast(rect.x()), static_cast(rect.y()), static_cast(rect.width()), @@ -421,9 +498,9 @@ void PageRenderThread::run() break; // 预取图片对象 bbox(夜间蒙版用):在工作线程取,避免 UI 线程与渲染争文档锁 - if (DocSheet::existSheet(task.sheet) && task.sheet->renderer()->opened()) { - task.imageRects = task.sheet->renderer()->getImageObjectRects( - task.page->itemIndex(), task.rect.width(), task.rect.height()); + if (DocSheet::existSheetByUuid(task.uuid) && task.renderer->opened()) { + task.imageRects = task.renderer->getImageObjectRects( + task.pageIndex, task.rect.width(), task.rect.height()); } emit sigDocPageBigImageTaskFinished(task, pixmap); @@ -599,7 +676,7 @@ bool PageRenderThread::execNextDocPageNormalImageTask() return false; } - if (!DocSheet::existSheet(task.sheet)) { + if (task.renderer.isNull() || !DocSheet::existSheetByUuid(task.uuid)) { qCWarning(appLog) << "Sheet no longer exists, skip task"; return true; } @@ -608,24 +685,22 @@ bool PageRenderThread::execNextDocPageNormalImageTask() int targetHeight = task.rect.height(); if (targetWidth <= 0 || targetHeight <= 0) { const qreal deviceRatio = dApp ? dApp->devicePixelRatio() : 1.0; - const double pageScale = (task.page && task.page->m_scaleFactor > 0.0) - ? task.page->m_scaleFactor - : (task.sheet ? task.sheet->operation().scaleFactor : 1.0); - const QSizeF pageSize = task.page ? task.page->m_originSizeF : QSizeF(); + const double pageScale = task.scaleFactor > 0.0 ? task.scaleFactor : 1.0; + const QSizeF pageSize = task.originSize; targetWidth = qMax(1, qRound(pageSize.width() * pageScale * deviceRatio)); targetHeight = qMax(1, qRound(pageSize.height() * pageScale * deviceRatio)); task.rect = QRect(0, 0, targetWidth, targetHeight); } - QImage image = task.sheet->getImage(task.page->itemIndex(), targetWidth, targetHeight); + QImage image = task.renderer->getImage(task.pageIndex, targetWidth, targetHeight); if (image.isNull()) { - qCWarning(appLog) << "Failed to get image for page:" << task.page->itemIndex(); + qCWarning(appLog) << "Failed to get image for page:" << task.pageIndex; } else { - qCDebug(appLog) << "Image rendered successfully for page:" << task.page->itemIndex(); + qCDebug(appLog) << "Image rendered successfully for page:" << task.pageIndex; // 预取图片对象 bbox(夜间蒙版用):在工作线程取,避免 UI 线程与渲染争文档锁 - task.imageRects = task.sheet->renderer()->getImageObjectRects( - task.page->itemIndex(), targetWidth, targetHeight); + task.imageRects = task.renderer->getImageObjectRects( + task.pageIndex, targetWidth, targetHeight); emit sigDocPageNormalImageTaskFinished(task, QPixmap::fromImage(image)); } @@ -648,12 +723,12 @@ bool PageRenderThread::execNextDocPageSliceImageTask() } - if (!DocSheet::existSheet(task.sheet)) { + if (task.renderer.isNull() || !DocSheet::existSheetByUuid(task.uuid)) { qCDebug(appLog) << "文档不存在,取切片任务已结束"; return true; } - QImage image = task.sheet->getImage(task.page->itemIndex(), task.whole.width(), task.whole.height(), task.slice); + QImage image = task.renderer->getImage(task.pageIndex, task.whole.width(), task.whole.height(), task.slice); if (!image.isNull()) emit sigDocPageSliceImageTaskFinished(task, QPixmap::fromImage(image)); @@ -677,13 +752,13 @@ bool PageRenderThread::execNextDocPageWordTask() return false; } - if (!DocSheet::existSheet(task.sheet)) { + if (task.renderer.isNull() || !DocSheet::existSheetByUuid(task.uuid)) { qCDebug(appLog) << "文档不存在,取页码文字任务已结束"; return true; } - const QList &words = task.sheet->renderer()->getWords(task.page->itemIndex()); + const QList &words = task.renderer->getWords(task.pageIndex); emit sigDocPageWordTaskFinished(task, words); @@ -706,12 +781,12 @@ bool PageRenderThread::execNextDocPageAnnotationTask() return false; } - if (!DocSheet::existSheet(task.sheet)) { + if (task.renderer.isNull() || !DocSheet::existSheetByUuid(task.uuid)) { qCDebug(appLog) << "文档不存在,取页码注释任务已结束"; return true; } - const QList annots = task.sheet->renderer()->getAnnotations(task.page->itemIndex()); + const QList annots = task.renderer->getAnnotations(task.pageIndex); emit sigDocPageAnnotationTaskFinished(task, annots); @@ -734,15 +809,16 @@ bool PageRenderThread::execNextDocPageThumbnailTask() return false; } - if (!DocSheet::existSheet(task.sheet)) { + if (task.renderer.isNull() || !DocSheet::existSheetByUuid(task.uuid)) { qCDebug(appLog) << "文档不存在,缩略图任务已结束"; return true; } - QImage image = task.sheet->getImage(task.index, 174, 174); + QImage image = task.renderer->getImage(task.index, 174, 174); - if (!image.isNull()) + if (!image.isNull()) { emit sigDocPageThumbnailTaskFinished(task, QPixmap::fromImage(image)); + } qCDebug(appLog) << "执行缩略图任务已完成"; return true; } @@ -762,19 +838,22 @@ bool PageRenderThread::execNextDocOpenTask() return false;//false 为不用再继续循环调用 } - if (!DocSheet::existSheet(task.sheet)) { + if (task.uuid.isEmpty() || !DocSheet::existSheetByUuid(task.uuid)) { qCDebug(appLog) << "文档不存在,文档打开任务已结束"; return true; } - QString filePath = task.sheet->filePath(); + QString filePath = task.filePath; PERF_PRINT_BEGIN("POINT-03", QString("filename=%1,filesize=%2").arg(QFileInfo(filePath).fileName()).arg(QFileInfo(filePath).size())); deepin_reader::Document::Error error = deepin_reader::Document::NoError; - qCDebug(appLog) << "PageRenderThread::execNextDocOpenTask" << task.sheet->convertedFileDir(); - deepin_reader::Document *document = deepin_reader::DocumentFactory::getDocument(task.sheet->fileType(), filePath, task.sheet->convertedFileDir(), task.password, &(task.sheet->m_process), error); + qCDebug(appLog) << "PageRenderThread::execNextDocOpenTask" << task.convertedFileDir; + //getDocument出参改为局部变量,由worker带回、主线程回调写回sheet,避免跨线程写sheet成员 + QProcess *process = nullptr; + deepin_reader::Document *document = deepin_reader::DocumentFactory::getDocument(task.fileType, filePath, task.convertedFileDir, task.password, &process, error); + task.process = process; if (nullptr == document) { emit sigDocOpenTask(task, error, nullptr, QList()); @@ -832,6 +911,8 @@ void PageRenderThread::onDocPageNormalImageTaskFinished(DocPageNormalImageTask t { // qCDebug(appLog) << "PageRenderThread::onDocPageNormalImageTaskFinished() - Starting on doc page normal image task finished"; if (DocSheet::existSheet(task.sheet)) { + if (nullptr != task.page && !BrowserPage::existPage(task.page)) + return; // 页面已析构,丢弃残留回包(task.page 非空时必须存活才可解引用) task.page->setImageObjectRects(task.imageRects, task.rect.width(), task.rect.height()); task.page->handleRenderFinished(task.pixmapId, pixmap); } @@ -842,6 +923,8 @@ void PageRenderThread::onDocPageSliceImageTaskFinished(DocPageSliceImageTask tas { // qCDebug(appLog) << "PageRenderThread::onDocPageSliceImageTaskFinished() - Starting on doc page slice image task finished"; if (DocSheet::existSheet(task.sheet)) { + if (nullptr != task.page && !BrowserPage::existPage(task.page)) + return; // 页面已析构,丢弃残留回包 task.page->handleRenderFinished(task.pixmapId, pixmap, task.slice); } // qCDebug(appLog) << "PageRenderThread::onDocPageSliceImageTaskFinished() - On doc page slice image task finished completed"; @@ -851,6 +934,8 @@ void PageRenderThread::onDocPageBigImageTaskFinished(DocPageBigImageTask task, Q { // qCDebug(appLog) << "PageRenderThread::onDocPageBigImageTaskFinished() - Starting on doc page big image task finished"; if (DocSheet::existSheet(task.sheet)) { + if (nullptr != task.page && !BrowserPage::existPage(task.page)) + return; // 页面已析构,丢弃残留回包 task.page->setImageObjectRects(task.imageRects, task.rect.width(), task.rect.height()); task.page->handleRenderFinished(task.pixmapId, pixmap); } @@ -861,6 +946,8 @@ void PageRenderThread::onDocPageWordTaskFinished(DocPageWordTask task, QListhandleWordLoaded(words); } // qCDebug(appLog) << "PageRenderThread::onDocPageWordTaskFinished() - On doc page word task finished completed"; @@ -870,6 +957,8 @@ void PageRenderThread::onDocPageAnnotationTaskFinished(DocPageAnnotationTask tas { // qCDebug(appLog) << "PageRenderThread::onDocPageAnnotationTaskFinished() - Starting on doc page annotation task finished"; if (DocSheet::existSheet(task.sheet)) { + if (nullptr != task.page && !BrowserPage::existPage(task.page)) + return; // 页面已析构,丢弃残留回包 task.page->handleAnnotationLoaded(annots); } // qCDebug(appLog) << "PageRenderThread::onDocPageAnnotationTaskFinished() - On doc page annotation task finished completed"; @@ -895,6 +984,9 @@ void PageRenderThread::onDocOpenTask(DocOpenTask task, deepin_reader::Document:: return; } + //getDocument在worker线程创建的QProcess,此处(主线程)写回sheet,消除worker对sheet成员的跨线程写 + sheet->m_process = task.process; + sheet->renderer()->handleOpened(error, document, pages); // qCDebug(appLog) << "PageRenderThread::onDocOpenTask() - On doc open task completed"; } diff --git a/reader/browser/PageRenderThread.h b/reader/browser/PageRenderThread.h index 13a6945a7..12b4a6df5 100644 --- a/reader/browser/PageRenderThread.h +++ b/reader/browser/PageRenderThread.h @@ -14,13 +14,24 @@ #include #include #include +#include class DocSheet; class BrowserPage; class SheetRenderer; class SideBarImageViewModel; +class QProcess; +// worker 线程约定:任务结构体中仅允许解引用 renderer(共享引用,生命周期安全)与 +// 入队时快照的值类型数据;sheet/page 等裸指针仅供主线程回调使用,worker 禁止访问。 struct DocPageNormalImageTask {//正常取图 + // ---- worker 线程只读数据 ---- + QSharedPointer renderer; //渲染器共享引用 + QString uuid; //入队时sheet唯一标识,worker据此跳过已销毁文档的任务(仅优化) + int pageIndex = -1; //入队时快照,worker不再解引用BrowserPage + qreal scaleFactor = 0.0; //入队时快照,兜底尺寸计算用 + QSizeF originSize; //入队时快照,兜底尺寸计算用 + // ---- 仅供主线程回调使用 ---- DocSheet *sheet = nullptr; BrowserPage *page = nullptr; int pixmapId = 0; //任务艾迪 @@ -29,6 +40,9 @@ struct DocPageNormalImageTask {//正常取图 }; struct DocPageSliceImageTask {//取切片 + QSharedPointer renderer; + QString uuid; + int pageIndex = -1; DocSheet *sheet = nullptr; BrowserPage *page = nullptr; int pixmapId = 0; //任务艾迪 @@ -37,6 +51,9 @@ struct DocPageSliceImageTask {//取切片 }; struct DocPageBigImageTask {//取大图 + QSharedPointer renderer; + QString uuid; + int pageIndex = -1; DocSheet *sheet = nullptr; BrowserPage *page = nullptr; int pixmapId = 0; //任务艾迪 @@ -45,26 +62,37 @@ struct DocPageBigImageTask {//取大图 }; struct DocPageWordTask {//取页码文字 + QSharedPointer renderer; + QString uuid; + int pageIndex = -1; DocSheet *sheet = nullptr; BrowserPage *page = nullptr; }; struct DocPageAnnotationTask {//取页码注释 + QSharedPointer renderer; + QString uuid; + int pageIndex = -1; DocSheet *sheet = nullptr; BrowserPage *page = nullptr; }; struct DocPageThumbnailTask {//缩略图 + QSharedPointer renderer; + QString uuid; DocSheet *sheet = nullptr; SideBarImageViewModel *model = nullptr; int index = -1; }; struct DocOpenTask {//打开文档 - DocSheet *sheet = nullptr; + DocSheet *sheet = nullptr; //仅供主线程回调使用 QString password; - SheetRenderer *renderer = nullptr; QString uuid; //排队时的sheet唯一标识,防止地址复用误判存活 + QString filePath; //入队时快照,worker不再访问sheet + QString convertedFileDir; + int fileType = 0; //Dr::FileType + QProcess *process = nullptr; //getDocument出参,由主线程回调写回sheet->m_process }; struct DocCloseTask {//关闭文档 @@ -89,6 +117,22 @@ class PageRenderThread : public QThread * @return 是否成功 */ static bool clearImageTasks(DocSheet *sheet, BrowserPage *page, int pixmapId = -1); + /** + * @brief clearAllTasksForSheet + * 清除指定 sheet 的所有待处理任务(图片/文字/注释/缩略图)。 + * 用于 DocSheet 析构前排空引用该 sheet 的后台任务,避免悬空访问。 + * @param sheet 目标 sheet 指针 + */ + static void clearAllTasksForSheet(DocSheet *sheet); + + /** + * @brief clearAllTasksForPage + * 排空队列中所有引用指定 page 的文字/注释任务(图像任务由 clearImageTasks 负责); + * 仅主线程调用(BrowserPage 析构时),与 worker 通过各队列互斥锁互斥 + * @param page 页面对象 + */ + static void clearAllTasksForPage(const BrowserPage *page); + /** * @brief appendTask diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index fd533784e..74adbbd78 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -983,7 +983,8 @@ void SheetBrowser::pinchTriggered(QPinchGesture *gesture) if (gesture->state() == Qt::GestureFinished) { // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Gesture finished"; this->setProperty("pinchgetsturing", false); - QTimer::singleShot(10, [this]() { + // 必须传 receiver=this:否则 browser 在定时器触发前被销毁时,lambda 仍会执行并写已死对象(UAF) + QTimer::singleShot(10, this, [this]() { //稍微延迟下,不然还是会引起mouse事件触发 m_startPinch = false; }); diff --git a/reader/sidebar/SideBarImageViewModel.cpp b/reader/sidebar/SideBarImageViewModel.cpp index b493450fa..f8ab61d49 100644 --- a/reader/sidebar/SideBarImageViewModel.cpp +++ b/reader/sidebar/SideBarImageViewModel.cpp @@ -129,6 +129,8 @@ QVariant SideBarImageViewModel::data(const QModelIndex &index, int role) const task.sheet = m_sheet; task.index = nRow; task.model = const_cast(this); + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); PageRenderThread::appendTask(task); } @@ -198,6 +200,8 @@ void SideBarImageViewModel::onUpdateImage(int index) task.sheet = m_sheet; task.index = index; task.model = const_cast(this); + task.renderer = m_sheet ? m_sheet->rendererPtr() : nullptr; + task.uuid = m_sheet ? m_sheet->uuid() : QString(); PageRenderThread::appendTask(task); qCDebug(appLog) << "Updating image for index:" << index << "end"; } diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index 9a9ce3029..f0fd3c77b 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -72,8 +72,8 @@ DocSheet::DocSheet(const Dr::FileType &fileType, const QString &filePath, QWidg connect(m_searchTask, &PageSearchThread::finished, this, &DocSheet::onSearchFinished, Qt::QueuedConnection); connect(m_searchTask, &PageSearchThread::sigSearchResultNotEmpty, this, &DocSheet::onSearchResultNotEmpty, Qt::QueuedConnection); - m_renderer = new SheetRenderer(this); - connect(m_renderer, &SheetRenderer::sigOpened, this, &DocSheet::onOpened); + m_renderer = QSharedPointer::create(); + connect(m_renderer.data(), &SheetRenderer::sigOpened, this, &DocSheet::onOpened); m_browser = new SheetBrowser(this); m_browser->setMinimumWidth(481); @@ -157,12 +157,14 @@ DocSheet::~DocSheet() setAlive(false); + // 排空引用本 sheet 的所有待处理渲染任务(仅优化,避免为将死文档做无用渲染); + // 正确性由任务中捕获的renderer共享引用与uuid校验保证,不再依赖析构与线程间的时序 + PageRenderThread::clearAllTasksForSheet(this); + delete m_browser; delete m_sidebar; - delete m_renderer; - delete m_searchTask; delete m_encryPage; @@ -235,6 +237,17 @@ bool DocSheet::existSheet(DocSheet *sheet) return result; } +bool DocSheet::existSheetByUuid(const QString &uuid) +{ + g_lock.lockForRead(); + + bool result = !uuid.isEmpty() && g_uuidList.contains(uuid); + + g_lock.unlock(); + + return result; +} + DocSheet *DocSheet::getSheet(QString uuid) { qCDebug(appLog) << "getSheet"; @@ -279,7 +292,7 @@ bool DocSheet::openFileExec(const QString &password) qCDebug(appLog) << "Executing file open synchronously"; m_password = password; - bool result = m_renderer->openFileExec(password); + bool result = m_renderer->openFileExec(password, m_filePath, convertedFileDir(), m_uuid, static_cast(m_fileType), this); if (!result) { qCWarning(appLog) << "Failed to open file synchronously"; } @@ -293,7 +306,7 @@ void DocSheet::openFileAsync(const QString &password) m_password = password; qCInfo(appLog) << "添加异步打开任务..."; - m_renderer->openFileAsync(m_password); + m_renderer->openFileAsync(m_password, m_filePath, convertedFileDir(), m_uuid, static_cast(m_fileType), this); } void DocSheet::jumpToPage(int page) @@ -1880,7 +1893,7 @@ void DocSheet::onExtractPassword(const QString &password) qCDebug(appLog) << "Extracted password, attempting to open file"; m_password = password; - m_renderer->openFileAsync(m_password); + m_renderer->openFileAsync(m_password, m_filePath, convertedFileDir(), m_uuid, static_cast(m_fileType), this); } void DocSheet::saveCurrentViewState() @@ -2008,7 +2021,7 @@ float DocSheet::currentScrollPosition() const SheetRenderer *DocSheet::renderer() { // qCDebug(appLog) << "renderer"; - return m_renderer; + return m_renderer.data(); } void DocSheet::onPopPrintDialog() diff --git a/reader/uiframe/DocSheet.h b/reader/uiframe/DocSheet.h index c6b9f4f0f..c8244acaf 100644 --- a/reader/uiframe/DocSheet.h +++ b/reader/uiframe/DocSheet.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +110,14 @@ class DocSheet : public Dtk::Widget::DSplitter */ static bool existSheet(DocSheet *sheet); + /** + * @brief existSheetByUuid + * 进程是否存在该uuid对应的文档(worker线程安全,仅读锁+串查找) + * @param uuid + * @return + */ + static bool existSheetByUuid(const QString &uuid); + /** * @brief getSheet * 根据uuid返回sheet @@ -709,6 +718,12 @@ class DocSheet : public Dtk::Widget::DSplitter */ SheetRenderer *renderer(); + /** + * @brief rendererPtr + * 获取渲染器共享引用(入队时捕获,任务在worker线程使用期间生命周期安全) + */ + QSharedPointer rendererPtr() const { return m_renderer; } + QString uuid() const { return m_uuid; } public slots: @@ -960,7 +975,7 @@ private slots: SheetSidebar *m_sidebar = nullptr; //操作左侧ui SheetBrowser *m_browser = nullptr; //操作右侧ui - SheetRenderer *m_renderer = nullptr; //数据渲染器 + QSharedPointer m_renderer; //数据渲染器(共享所有权:worker持有引用期间不因析构悬空) QString m_filePath; QString m_password; diff --git a/reader/uiframe/SheetRenderer.cpp b/reader/uiframe/SheetRenderer.cpp index 08a5f891a..e285e838c 100644 --- a/reader/uiframe/SheetRenderer.cpp +++ b/reader/uiframe/SheetRenderer.cpp @@ -9,9 +9,11 @@ #include -SheetRenderer::SheetRenderer(DocSheet *parent) : QObject(parent), m_sheet(parent) +// 无父对象:由DocSheet以QSharedPointer持有,去除了对DocSheet的反向依赖, +// 使本对象可被worker线程通过共享引用安全使用 +SheetRenderer::SheetRenderer() : QObject(nullptr) { - qCDebug(appLog) << "Creating SheetRenderer for sheet:" << (parent ? parent->filePath() : "null"); + qCDebug(appLog) << "Creating SheetRenderer (parentless, shared ownership)"; } SheetRenderer::~SheetRenderer() @@ -27,14 +29,15 @@ SheetRenderer::~SheetRenderer() qCDebug(appLog) << "关闭文档任务已添加"; } -bool SheetRenderer::openFileExec(const QString &password) +bool SheetRenderer::openFileExec(const QString &password, const QString &filePath, + const QString &convertedFileDir, const QString &uuid, int fileType, DocSheet *sheet) { qCDebug(appLog) << "Executing synchronous file open"; QEventLoop loop; connect(this, &SheetRenderer::sigOpened, &loop, &QEventLoop::quit); - openFileAsync(password); + openFileAsync(password, filePath, convertedFileDir, uuid, fileType, sheet); loop.exec(); @@ -45,19 +48,23 @@ bool SheetRenderer::openFileExec(const QString &password) return success; } -void SheetRenderer::openFileAsync(const QString &password) +void SheetRenderer::openFileAsync(const QString &password, const QString &filePath, + const QString &convertedFileDir, const QString &uuid, int fileType, DocSheet *sheet) { qCDebug(appLog) << "Starting asynchronous file open"; DocOpenTask task; - task.sheet = m_sheet; - task.password = password; - task.renderer = this; + task.uuid = uuid; + + task.filePath = filePath; + + task.convertedFileDir = convertedFileDir; + + task.fileType = fileType; - if (nullptr != m_sheet) - task.uuid = m_sheet->uuid(); + task.sheet = sheet; //仅供主线程回调路由,worker线程不访问 PageRenderThread::appendTask(task); qCDebug(appLog) << "SheetRenderer::openFileAsync end"; diff --git a/reader/uiframe/SheetRenderer.h b/reader/uiframe/SheetRenderer.h index d920b8963..75ceaf85c 100644 --- a/reader/uiframe/SheetRenderer.h +++ b/reader/uiframe/SheetRenderer.h @@ -18,7 +18,7 @@ class SheetRenderer : public QObject { Q_OBJECT public: - explicit SheetRenderer(DocSheet *parent); + explicit SheetRenderer(); ~SheetRenderer(); @@ -26,16 +26,28 @@ class SheetRenderer : public QObject * @brief openFileExec * 阻塞式打开文档 * @param password + * @param filePath 文档路径(入队时快照,worker不再访问DocSheet) + * @param convertedFileDir 转换目录(入队时快照) + * @param uuid 所属DocSheet唯一标识 + * @param fileType 文档类型(入队时快照) + * @param sheet 所属DocSheet,仅供主线程回调路由使用 */ - bool openFileExec(const QString &password); + bool openFileExec(const QString &password, const QString &filePath, + const QString &convertedFileDir, const QString &uuid, int fileType, DocSheet *sheet); /** * @brief openFileAsync * 异步式打开文档,完成后会发出sigFileOpened * @param password 文档密码 + * @param filePath 文档路径(入队时快照,worker不再访问DocSheet) + * @param convertedFileDir 转换目录(入队时快照) + * @param uuid 所属DocSheet唯一标识(主线程回调路由用) + * @param fileType 文档类型(入队时快照) + * @param sheet 所属DocSheet,仅供主线程回调路由使用(worker禁止解引用) * @return */ - void openFileAsync(const QString &password); + void openFileAsync(const QString &password, const QString &filePath, + const QString &convertedFileDir, const QString &uuid, int fileType, DocSheet *sheet); /** * @brief opened @@ -222,7 +234,8 @@ class SheetRenderer : public QObject void sigOpened(deepin_reader::Document::Error error); private: - DocSheet *m_sheet = nullptr; + // 注意:无m_sheet反向指针、无QObject父对象;由DocSheet以QSharedPointer持有, + // worker线程持有共享引用期间生命周期安全,可跨线程安全使用 deepin_reader::Document::Error m_error = deepin_reader::Document::NoError; bool m_pageLabelLoaded = false; //是否已经加载page label QMap m_lable2Page; // 文档下标页码 diff --git a/tests/browser/ut_browserpage.cpp b/tests/browser/ut_browserpage.cpp index f098ff600..f5171d532 100644 --- a/tests/browser/ut_browserpage.cpp +++ b/tests/browser/ut_browserpage.cpp @@ -538,6 +538,7 @@ TEST_F(TestBrowserPage, UT_BrowserPage_addHighlightAnnotation_001) s.set(ADDR(SheetRenderer, getWords), getWords_stub); s.set(ADDR(QGraphicsItem, isSelected), isSelected_stub); s.set(ADDR(SheetRenderer, addHighlightAnnotation), addHighlightAnnotation_stub); + s.set(ADDR(BrowserPage, renderRect), renderRect_stub); BrowserWord *w1 = new BrowserWord(nullptr, Word("first", QRectF(0, 0, 20, 10))); BrowserWord *w2 = new BrowserWord(nullptr, Word("second", QRectF(20, 0, 40, 10))); m_tester->m_words.append(w1); diff --git a/tests/browser/ut_pagerenderthread.cpp b/tests/browser/ut_pagerenderthread.cpp index ee5f853f6..8f0294f75 100644 --- a/tests/browser/ut_pagerenderthread.cpp +++ b/tests/browser/ut_pagerenderthread.cpp @@ -101,7 +101,7 @@ static QString uuid_stub() // DocSheet::renderer 档:占位渲染器(handleOpened已stub)。堆分配不释放,避免静态对象在 main 返回后析构 static SheetRenderer *renderer_stub() { - static SheetRenderer *dummy = new SheetRenderer(nullptr); + static SheetRenderer *dummy = new SheetRenderer(); return dummy; } @@ -216,7 +216,6 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocOpenTask_001) { DocOpenTask task; task.sheet = nullptr; - task.renderer = nullptr; QList pages; m_tester->onDocOpenTask(task, deepin_reader::Document::NoError, nullptr, pages); SUCCEED(); @@ -340,9 +339,12 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocOpenTask_002) s.set(ADDR(DocSheet, renderer), renderer_stub); s.set(ADDR(SheetRenderer, handleOpened), handleOpened_stub); + // onDocOpenTask会直接写 sheet->m_process(非函数调用,stub拦截不到), + // 因此用足够大的可写静态存储充当假sheet,而非非法地址 + static unsigned char fake_sheet_storage[8192] = {}; + DocOpenTask task; - task.sheet = reinterpret_cast(0x1); //成员调用均已被stub - task.renderer = nullptr; + task.sheet = reinterpret_cast(fake_sheet_storage); //成员调用均已被stub task.uuid = "ut-sheet-uuid"; //与uuid_stub一致,校验通过 QList pages; m_tester->onDocOpenTask(task, deepin_reader::Document::NoError, nullptr, pages); @@ -361,7 +363,6 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocOpenTask_003) DocOpenTask task; task.sheet = reinterpret_cast(0x1); - task.renderer = reinterpret_cast(0x1); //悬空,不应被解引用 task.uuid = "stale-uuid"; //与uuid_stub不一致 QList pages; m_tester->onDocOpenTask(task, deepin_reader::Document::NoError, nullptr, pages); @@ -466,7 +467,6 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_appendTask_Open) DocOpenTask task; task.sheet = nullptr; - task.renderer = nullptr; PageRenderThread::appendTask(task); EXPECT_FALSE(m_tester->m_openTasks.isEmpty()); m_tester->m_openTasks.clear(); diff --git a/tests/browser/ut_sheetbrowser.cpp b/tests/browser/ut_sheetbrowser.cpp index 7ca19eb62..f6a957fa4 100644 --- a/tests/browser/ut_sheetbrowser.cpp +++ b/tests/browser/ut_sheetbrowser.cpp @@ -208,8 +208,10 @@ Qt::MouseEventSource source_stub2() static BrowserPage *g_pBrowserPage2 = nullptr; BrowserPage *getBrowserPageForPoint_stub(QPointF &) { - DocSheet sheet(Dr::FileType::PDF, "1.pdf", nullptr); - g_pBrowserPage2 = new BrowserPage(nullptr, 0, &sheet); + // 用堆上静态sheet而非栈对象:返回的BrowserPage持有其指针, + // 若绑定栈对象会在函数返回后悬空(loadWords等路径解引用即崩) + static DocSheet *s_stubSheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + g_pBrowserPage2 = new BrowserPage(nullptr, 0, s_stubSheet); g_pBrowserPage2->m_index = 3; return g_pBrowserPage2; } diff --git a/tests/uiframe/ut_docsheet.cpp b/tests/uiframe/ut_docsheet.cpp index e586cf728..9049bd468 100644 --- a/tests/uiframe/ut_docsheet.cpp +++ b/tests/uiframe/ut_docsheet.cpp @@ -73,13 +73,13 @@ QImage firstThumbnail_stub(const QString &) return QImage(100, 100, QImage::Format_ARGB32); } -bool openFileExec_stub(const QString &) +bool openFileExec_stub(const QString &, const QString &, const QString &, const QString &, int, DocSheet *) { g_funcName = __FUNCTION__; return true; } -void openFileAsync_stub(const QString &) +void openFileAsync_stub(const QString &, const QString &, const QString &, const QString &, int, DocSheet *) { g_funcName = __FUNCTION__; } @@ -1493,7 +1493,7 @@ QSizeF getPageSize_stub2(int) return QSizeF(100.0, 200.0); } -void openFileAsync_stub2(const QString &) +void openFileAsync_stub2(const QString &, const QString &, const QString &, const QString &, int, DocSheet *) { g_funcName = __FUNCTION__; } diff --git a/tests/uiframe/ut_sheetrenderer.cpp b/tests/uiframe/ut_sheetrenderer.cpp index 8ab8f178e..a3fb987dd 100644 --- a/tests/uiframe/ut_sheetrenderer.cpp +++ b/tests/uiframe/ut_sheetrenderer.cpp @@ -56,7 +56,7 @@ void TestSheetRenderer::SetUp() QString strPath = UTSOURCEDIR; strPath += "/files/1.pdf"; m_sheet = new DocSheet(Dr::FileType::PDF, strPath, m_parent); - m_tester = m_sheet->m_renderer; + m_tester = m_sheet->m_renderer.data(); ASSERT_NE(m_tester, nullptr); } @@ -275,7 +275,7 @@ TEST_F(TestSheetRenderer, testOpenFileAsync) // otherwise a queued sigDocOpenTask referencing this renderer outlives the test // and gets delivered to freed memory later. QSignalSpy spy(m_tester, &SheetRenderer::sigOpened); - m_tester->openFileAsync("test"); + m_tester->openFileAsync("test", UTSOURCEDIR "/files/normal.pdf", QString(), m_sheet->uuid(), static_cast(Dr::PDF), m_sheet); QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 30000); SUCCEED(); } @@ -283,6 +283,6 @@ TEST_F(TestSheetRenderer, testOpenFileAsync) TEST_F(TestSheetRenderer, testOpenFileExec) { // Let openFileExec wait for the REAL sigOpened of the actual open task. - bool result = m_tester->openFileExec("test"); + bool result = m_tester->openFileExec("test", UTSOURCEDIR "/files/normal.pdf", QString(), m_sheet->uuid(), static_cast(Dr::PDF), m_sheet); EXPECT_TRUE(result); } diff --git a/tests/ut_mainwindow.cpp b/tests/ut_mainwindow.cpp index 456473ea9..7beade3d4 100644 --- a/tests/ut_mainwindow.cpp +++ b/tests/ut_mainwindow.cpp @@ -21,7 +21,7 @@ #include "ut_compat.h" #include -static void openFileAsync_stub(const QString &) +static void openFileAsync_stub(const QString &, const QString &, const QString &, const QString &, int, DocSheet *) { return; } From 16be35699ca6e909daab80a5f5a660e2bd398779 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 15 Sep 2026 17:07:57 +0800 Subject: [PATCH 25/63] fix(database): synchronize cleanup of bookmarks and tab groups in orphan states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleanup could leave dangling references because bookmarks and tab groups were removed independently while ownership records were still being reconciled; the residue was re-persisted by later sync runs. 孤立状态下的书签与标签组独立清理时归属记录仍在协调,残留项会被 后续同步再次落盘。 Log: 修复孤立状态下书签与标签组清理不同步导致残留引用的问题 Influence: 数据库书签与标签组清理逻辑,孤立状态下不再残留悬挂引用。 --- reader/app/Database.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reader/app/Database.cpp b/reader/app/Database.cpp index b37190027..53823fb2e 100644 --- a/reader/app/Database.cpp +++ b/reader/app/Database.cpp @@ -794,10 +794,13 @@ int Database::cleanupOrphanStates() cleanedCount++; qCDebug(appLog) << "Cleaned orphan state:" << path; } - // 同步清理书签(在同一事务中保证数据一致性) + // 同步清理书签与标签页组(在同一事务中保证数据一致性) deleteQuery.prepare("DELETE FROM bookmark WHERE filePath = :filePath"); deleteQuery.bindValue(":filePath", path); deleteQuery.exec(); + deleteQuery.prepare("DELETE FROM tabgroup WHERE filePath = :filePath"); + deleteQuery.bindValue(":filePath", path); + deleteQuery.exec(); } transaction.commit(); From 506d79804a892a0900128fa4d573be21a51b95a5 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 15 Sep 2026 14:52:25 +0800 Subject: [PATCH 26/63] fix(reader): invert sidebar thumbnails only under dark theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidebar thumbnails followed eye-protection mode and stayed white in dark theme. Now they follow the system theme only: white pages are inverted via the shared NightFilter (CIELAB L*), image objects keep original colors through a mask prefetched by the worker and cached with the thumbnail, and scanned pages (>70% coverage) are fully inverted. Bookmark/notes lists and the search-result page thumbnails follow the same rules, and mask rects are scaled to the scaled pixmap before filtering. 侧边栏缩略图原先跟随护眼模式,深色主题下仍是白底。现改为只跟随系统 深浅主题:白底经主干夜间滤镜(CIELAB L*)反转为黑底白字,照片区域按 worker 预取、随缩略图缓存的图片对象蒙版保持原色,扫描页(覆盖率超 70%)整页反色;书签/注释列表与搜索结果页的页面小图同规则,蒙版坐标 先映射到缩放后的像素图再进滤镜。 Log: 侧边栏缩略图/书签/注释/搜索结果深色主题反色并支持图片对象蒙版 PMS: BUG-377151 Influence: 深色主题下侧边栏(含触发搜索后的结果页)观感与主视图一致,浅色主题显示不变。 --- reader/browser/PageRenderThread.cpp | 7 +- reader/browser/PageRenderThread.h | 1 + reader/sidebar/BookMarkDelegate.cpp | 52 +++--- reader/sidebar/NotesDelegate.cpp | 47 +++++- reader/sidebar/NotesDelegate.h | 8 + reader/sidebar/SearchResDelegate.cpp | 25 ++- reader/sidebar/SearchResDelegate.h | 18 +++ reader/sidebar/SideBarImageViewModel.cpp | 9 +- reader/sidebar/SideBarImageViewModel.h | 8 +- reader/sidebar/ThumbnailDelegate.cpp | 40 ++--- reader/sidebar/ThumbnailDelegate.h | 7 +- reader/uiframe/DocSheet.cpp | 9 +- reader/uiframe/DocSheet.h | 12 +- tests/browser/ut_pagerenderthread.cpp | 130 ++++++++++++++- tests/sidebar/ut_bookmarkdelegate.cpp | 139 ++++++++++++++++ tests/sidebar/ut_notesdelegate.cpp | 139 ++++++++++++++++ tests/sidebar/ut_searchresdelegate.cpp | 147 ++++++++++++++++- tests/sidebar/ut_sidebarimageviewmodel.cpp | 32 ++++ tests/sidebar/ut_thumbnaildelegate.cpp | 178 ++++++++++++++++++--- tests/uiframe/ut_docsheet.cpp | 21 +++ 20 files changed, 938 insertions(+), 91 deletions(-) diff --git a/reader/browser/PageRenderThread.cpp b/reader/browser/PageRenderThread.cpp index 61ba9aa27..ba38b29c4 100644 --- a/reader/browser/PageRenderThread.cpp +++ b/reader/browser/PageRenderThread.cpp @@ -817,6 +817,11 @@ bool PageRenderThread::execNextDocPageThumbnailTask() QImage image = task.renderer->getImage(task.index, 174, 174); if (!image.isNull()) { + // 预取图片对象 bbox(夜间/深色蒙版用):在工作线程取,避免 UI 线程与渲染争文档锁; + // 与 getImage 同尺寸(174,174)请求,蒙版与缩略图输出像素一一对齐 + if (DocSheet::existSheetByUuid(task.uuid) && task.renderer->opened()) { + task.imageRects = task.renderer->getImageObjectRects(task.index, 174, 174); + } emit sigDocPageThumbnailTaskFinished(task, QPixmap::fromImage(image)); } qCDebug(appLog) << "执行缩略图任务已完成"; @@ -968,7 +973,7 @@ void PageRenderThread::onDocPageThumbnailTask(DocPageThumbnailTask task, QPixmap { // qCDebug(appLog) << "PageRenderThread::onDocPageThumbnailTask() - Starting on doc page thumbnail task"; if (DocSheet::existSheet(task.sheet)) { - task.model->handleRenderThumbnail(task.index, pixmap); + task.model->handleRenderThumbnail(task.index, pixmap, task.imageRects); } // qCDebug(appLog) << "PageRenderThread::onDocPageThumbnailTask() - On doc page thumbnail task completed"; } diff --git a/reader/browser/PageRenderThread.h b/reader/browser/PageRenderThread.h index 12b4a6df5..0b8ff46bb 100644 --- a/reader/browser/PageRenderThread.h +++ b/reader/browser/PageRenderThread.h @@ -83,6 +83,7 @@ struct DocPageThumbnailTask {//缩略图 DocSheet *sheet = nullptr; SideBarImageViewModel *model = nullptr; int index = -1; + QVector imageRects; //图片对象 bbox(夜间/深色蒙版用,与缩略图像素对齐,worker线程预取) }; struct DocOpenTask {//打开文档 diff --git a/reader/sidebar/BookMarkDelegate.cpp b/reader/sidebar/BookMarkDelegate.cpp index de692eed4..7bea597e9 100644 --- a/reader/sidebar/BookMarkDelegate.cpp +++ b/reader/sidebar/BookMarkDelegate.cpp @@ -5,6 +5,7 @@ #include "BookMarkDelegate.h" #include "SideBarImageViewModel.h" +#include "NightFilter.h" #include "Application.h" #include "ddlog.h" @@ -48,42 +49,33 @@ void BookMarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti clipPath.addRoundedRect(rect, borderRadius, borderRadius); painter->setClipPath(clipPath); // 深色主题下将白底缩略图反色为黑底白字(仅绘制时反色,不改缓存原图): - // HSL 亮度反转,下限钳制 37(#252525),反转后 ≥192 提亮纯白。 + // 统一走主干夜间滤镜 NightFilter(CIELAB L* 反转),图片对象区域不反色 + // (照片零负片,与主视图蒙版行为一致),含扫描页整页反色特判。 if (DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->themeType() == DTK_NAMESPACE::Gui::DGuiApplicationHelper::DarkType) { - // 按源图 cacheKey() 缓存反色结果,避免每次重绘重复逐像素计算 + // 图片对象 bbox(与存储缩略图像素对齐,渲染线程预取) + const QVector imageRects = index.data(ImageinfoType_e::IMAGE_NIGHT_MASK).value>(); + // 按源缩略图 cacheKey() 缓存反色结果,避免每次重绘重复逐像素计算 QPixmap invertedPixmap; if (QPixmap *cached = m_darkPixmapCache.object(pixmap.cacheKey())) { invertedPixmap = *cached; } else { - QImage img = scalePix.toImage(); - if (!img.isNull()) { - if (img.format() != QImage::Format_ARGB32) - img = img.convertToFormat(QImage::Format_ARGB32); - const int w = img.width(); - const int h = img.height(); - const int kMinLightAfterInvert = 37; // #252525 - const int kMaxLightBoostThreshold = 192; // 0xC0,提亮阈值 - for (int y = 0; y < h; ++y) { - QRgb *line = reinterpret_cast(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - const QRgb px = line[x]; - const int alpha = qAlpha(px); - QColor c = QColor::fromRgb(qRed(px), qGreen(px), qBlue(px)); - int hue, sat, light, dummy; - c.getHsl(&hue, &sat, &light, &dummy); - light = 255 - light; - if (light >= kMaxLightBoostThreshold) - light = 255; - light = qMax(light, kMinLightAfterInvert); - c.setHsl(hue, sat, light); - line[x] = qRgba(c.red(), c.green(), c.blue(), alpha); - } - } - invertedPixmap = QPixmap::fromImage(img); - invertedPixmap.setDevicePixelRatio(scalePix.devicePixelRatio()); + // bbox 是存储缩略图(174px)坐标,而 scalePix 是等比缩小后的图, + // 须先映射到 scalePix 坐标,否则覆盖率特判/蒙版区域全错 + QVector scaledRects; + scaledRects.reserve(imageRects.size()); + const qreal sx = pixmap.isNull() || pixmap.width() == 0 + ? 0.0 : qreal(scalePix.width()) / pixmap.width(); + const qreal sy = pixmap.isNull() || pixmap.height() == 0 + ? 0.0 : qreal(scalePix.height()) / pixmap.height(); + for (const QRectF &r : imageRects) + scaledRects.append(QRectF(r.x() * sx, r.y() * sy, + r.width() * sx, r.height() * sy)); + + invertedPixmap = QPixmap::fromImage(NightFilter::applyPage(scalePix.toImage(), scaledRects)); + invertedPixmap.setDevicePixelRatio(scalePix.devicePixelRatio()); + if (!invertedPixmap.isNull()) m_darkPixmapCache.insert(pixmap.cacheKey(), new QPixmap(invertedPixmap), - img.width() * img.height() * 4); // ARGB32 每像素固定 4 字节 - } + invertedPixmap.width() * invertedPixmap.height() * 4); // ARGB32 每像素固定 4 字节 } if (!invertedPixmap.isNull()) painter->drawPixmap(rect.x(), rect.y(), invertedPixmap); diff --git a/reader/sidebar/NotesDelegate.cpp b/reader/sidebar/NotesDelegate.cpp index c4a1fcdea..d4f0f99af 100644 --- a/reader/sidebar/NotesDelegate.cpp +++ b/reader/sidebar/NotesDelegate.cpp @@ -5,6 +5,7 @@ #include "NotesDelegate.h" #include "SideBarImageViewModel.h" +#include "NightFilter.h" #include "Utils.h" #include "Application.h" #include "ddlog.h" @@ -15,12 +16,14 @@ #include #include #include +#include NotesDelegate::NotesDelegate(QAbstractItemView *parent) : DStyledItemDelegate(parent) { // qCDebug(appLog) << "NotesDelegate::NotesDelegate() - Starting constructor"; m_parent = parent; + m_darkPixmapCache.setMaxCost(8 * 1024 * 1024); // 反色缓存预算 8MB,按像素字节数计费 // qCDebug(appLog) << "NotesDelegate::NotesDelegate() - Constructor completed"; } @@ -45,7 +48,42 @@ void NotesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, QPainterPath clipPath; clipPath.addRoundedRect(rect, borderRadius, borderRadius); painter->setClipPath(clipPath); - painter->drawPixmap(rect.x(), rect.y(), scalePix); + // 深色主题下将白底缩略图反色为黑底白字(仅绘制时反色,不改缓存原图): + // 统一走主干夜间滤镜 NightFilter(CIELAB L* 反转),图片对象区域不反色 + // (照片零负片,与主视图蒙版行为一致),含扫描页整页反色特判。 + if (DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->themeType() == DTK_NAMESPACE::Gui::DGuiApplicationHelper::DarkType) { + // 图片对象 bbox(与存储缩略图像素对齐,渲染线程预取) + const QVector imageRects = index.data(ImageinfoType_e::IMAGE_NIGHT_MASK).value>(); + // 按源缩略图 cacheKey() 缓存反色结果,避免每次重绘重复逐像素计算 + QPixmap invertedPixmap; + if (QPixmap *cached = m_darkPixmapCache.object(pixmap.cacheKey())) { + invertedPixmap = *cached; + } else { + // bbox 是存储缩略图(174px)坐标,而 scalePix 是等比缩小后的图, + // 须先映射到 scalePix 坐标,否则覆盖率特判/蒙版区域全错 + QVector scaledRects; + scaledRects.reserve(imageRects.size()); + const qreal sx = pixmap.isNull() || pixmap.width() == 0 + ? 0.0 : qreal(scalePix.width()) / pixmap.width(); + const qreal sy = pixmap.isNull() || pixmap.height() == 0 + ? 0.0 : qreal(scalePix.height()) / pixmap.height(); + for (const QRectF &r : imageRects) + scaledRects.append(QRectF(r.x() * sx, r.y() * sy, + r.width() * sx, r.height() * sy)); + + invertedPixmap = QPixmap::fromImage(NightFilter::applyPage(scalePix.toImage(), scaledRects)); + invertedPixmap.setDevicePixelRatio(scalePix.devicePixelRatio()); + if (!invertedPixmap.isNull()) + m_darkPixmapCache.insert(pixmap.cacheKey(), new QPixmap(invertedPixmap), + invertedPixmap.width() * invertedPixmap.height() * 4); // ARGB32 每像素固定 4 字节 + } + if (!invertedPixmap.isNull()) + painter->drawPixmap(rect.x(), rect.y(), invertedPixmap); + else + painter->drawPixmap(rect.x(), rect.y(), scalePix); + } else { + painter->drawPixmap(rect.x(), rect.y(), scalePix); + } painter->restore(); } @@ -57,7 +95,12 @@ void NotesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->setPen(QPen(DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->applicationPalette().highlight().color(), 2)); painter->drawRoundedRect(rect, borderRadius, borderRadius); } else { - painter->setPen(QPen(DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->applicationPalette().frameShadowBorder().color(), 1)); + QColor frameColor = DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->applicationPalette().frameShadowBorder().color(); + if (DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->themeType() == DTK_NAMESPACE::Gui::DGuiApplicationHelper::DarkType) { + frameColor = DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->applicationPalette().windowText().color(); + frameColor.setAlphaF(0.2); + } + painter->setPen(QPen(frameColor, 1)); painter->drawRoundedRect(rect, borderRadius, borderRadius); } painter->restore(); diff --git a/reader/sidebar/NotesDelegate.h b/reader/sidebar/NotesDelegate.h index 95bd6e63d..1ce70812a 100644 --- a/reader/sidebar/NotesDelegate.h +++ b/reader/sidebar/NotesDelegate.h @@ -8,6 +8,9 @@ #include +#include +#include + DWIDGET_USE_NAMESPACE /** * @brief The NotesDelegate class @@ -39,6 +42,11 @@ class NotesDelegate : public DStyledItemDelegate private: QAbstractItemView *m_parent = nullptr; + + /** + * @brief 深色主题反色结果缓存(键:源图 cacheKey();paint() 为 const 故 mutable) + */ + mutable QCache m_darkPixmapCache; }; #endif // NOTESDELEGATE_H diff --git a/reader/sidebar/SearchResDelegate.cpp b/reader/sidebar/SearchResDelegate.cpp index 6301a7745..c5171bcef 100644 --- a/reader/sidebar/SearchResDelegate.cpp +++ b/reader/sidebar/SearchResDelegate.cpp @@ -5,6 +5,7 @@ #include "SearchResDelegate.h" #include "SideBarImageViewModel.h" +#include "NightFilter.h" #include "Utils.h" #include "Application.h" #include "ddlog.h" @@ -39,7 +40,13 @@ void SearchResDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt if (!pixmap.isNull()) { - const QPixmap &scalePix = pixmap.scaled(pageSize); + // 深色主题下搜索结果页的页面小图与缩略图侧栏一致走主干夜间滤镜 + // (CIELAB L* 反转,图片对象区域保持原色,扫描页整页反色特判), + // 浅色主题照常绘制原图;先按原始尺寸反色再缩放,蒙版坐标无需换算 + const bool darkTheme = (DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->themeType() == DTK_NAMESPACE::Gui::DGuiApplicationHelper::DarkType); + const QVector imageRects = index.data(ImageinfoType_e::IMAGE_NIGHT_MASK).value>(); + const QPixmap &displayPixmap = darkTheme ? nightPixmap(pixmap, imageRects) : pixmap; + const QPixmap &scalePix = displayPixmap.scaled(pageSize); //clipPath pixmap painter->save(); QPainterPath clipPath; @@ -124,3 +131,19 @@ QSize SearchResDelegate::sizeHint(const QStyleOptionViewItem &option, const QMod return size; } +QPixmap SearchResDelegate::nightPixmap(const QPixmap &src, const QVector &imageRects) const +{ + if (src.isNull()) + return src; + + // 搜索结果列表滚动时同一张页面小图会被反复重绘,缓存反色结果避免逐像素重复计算; + // 页面重渲染时 cacheKey 必然变化,无需将蒙版纳入缓存键 + if (m_nightSourceCache.cacheKey() == src.cacheKey() && !m_nightPixmapCache.isNull()) + return m_nightPixmapCache; + + m_nightSourceCache = src; + m_nightPixmapCache = QPixmap::fromImage(NightFilter::applyPage(src.toImage(), imageRects)); + m_nightPixmapCache.setDevicePixelRatio(src.devicePixelRatio()); + return m_nightPixmapCache; +} + diff --git a/reader/sidebar/SearchResDelegate.h b/reader/sidebar/SearchResDelegate.h index 4b53b6890..e3503c439 100644 --- a/reader/sidebar/SearchResDelegate.h +++ b/reader/sidebar/SearchResDelegate.h @@ -7,6 +7,9 @@ #define SEARCHRESDELEGATE_H #include +#include +#include +#include DWIDGET_USE_NAMESPACE /** @@ -37,8 +40,23 @@ class SearchResDelegate : public DStyledItemDelegate */ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; +private: + /** + * @brief nightPixmap + * 夜间智能滤镜/深色主题下页面小图的反色结果(带缓存): + * 走主干 NightFilter 管线(CIELAB L* 反转 + 图片对象区域跳过 + 扫描页整页反色特判), + * 与缩略图侧栏/主视图观感一致 + * @param src 原始缩略图 + * @param imageRects 图片对象 bbox(与 src 像素对齐,这些区域不反色避免照片负片) + * @return 反色后的缩略图 + */ + QPixmap nightPixmap(const QPixmap &src, const QVector &imageRects = QVector()) const; + private: QAbstractItemView *m_parent = nullptr; + + mutable QPixmap m_nightSourceCache; // 反色缓存的源缩略图 + mutable QPixmap m_nightPixmapCache; // 反色后的缩略图 }; #endif // SEARCHRESDELEGATE_H diff --git a/reader/sidebar/SideBarImageViewModel.cpp b/reader/sidebar/SideBarImageViewModel.cpp index f8ab61d49..3d64d743b 100644 --- a/reader/sidebar/SideBarImageViewModel.cpp +++ b/reader/sidebar/SideBarImageViewModel.cpp @@ -159,6 +159,9 @@ QVariant SideBarImageViewModel::data(const QModelIndex &index, int role) const } else if (role == ImageinfoType_e::IMAGE_PAGE_SIZE) { // qCDebug(appLog) << "Getting page size for index:" << nRow; return QVariant::fromValue(m_sheet->pageSizeByIndex(nRow)); + } else if (role == ImageinfoType_e::IMAGE_NIGHT_MASK) { + // 图片对象 bbox:夜间/深色反色时跳过这些区域,与主视图(BrowserPage)蒙版行为一致 + return QVariant::fromValue(m_sheet->thumbnailImageRects(nRow)); } return QVariant(); } @@ -302,11 +305,11 @@ int SideBarImageViewModel::findItemForAnno(deepin_reader::Annotation *annotation return -1; } -void SideBarImageViewModel::handleRenderThumbnail(int index, QPixmap pixmap) +void SideBarImageViewModel::handleRenderThumbnail(int index, QPixmap pixmap, const QVector &imageRects) { - qCDebug(appLog) << "Handling thumbnail render for page:" << index << "size:" << pixmap.size(); + qCDebug(appLog) << "Handling thumbnail render for page:" << index << "size:" << pixmap.size() << "imageRects:" << imageRects.size(); pixmap.setDevicePixelRatio(dApp->devicePixelRatio()); - m_sheet->setThumbnail(index, pixmap); + m_sheet->setThumbnail(index, pixmap, imageRects); m_pendingUpdatePages.insert(index); if (!m_batchUpdateTimer->isActive()) { diff --git a/reader/sidebar/SideBarImageViewModel.h b/reader/sidebar/SideBarImageViewModel.h index 8e8b877e8..f89011a09 100644 --- a/reader/sidebar/SideBarImageViewModel.h +++ b/reader/sidebar/SideBarImageViewModel.h @@ -10,11 +10,15 @@ #include #include #include +#include +#include namespace deepin_reader { class Annotation; } +Q_DECLARE_METATYPE(QVector) + typedef enum E_SideBar { SIDE_THUMBNIL = 0, SIDE_BOOKMARK, @@ -31,6 +35,7 @@ typedef enum ImageinfoType_e { IMAGE_CONTENT_TEXT = Qt::UserRole + 4, IMAGE_SEARCH_COUNT = Qt::UserRole + 5, IMAGE_PAGE_SIZE = Qt::UserRole + 6, + IMAGE_NIGHT_MASK = Qt::UserRole + 7, //图片对象 bbox 列表(夜间/深色反色时跳过图片区域,与 IMAGE_PIXMAP 像素对齐) } ImageinfoType_e; typedef struct ImagePageInfo_t { @@ -157,8 +162,9 @@ class SideBarImageViewModel : public QAbstractListModel * 处理缩略图 * @param index * @param pixmap + * @param imageRects 图片对象 bbox(与 pixmap 像素对齐,夜间/深色反色跳过图片区域用) */ - void handleRenderThumbnail(int index, QPixmap pixmap); + void handleRenderThumbnail(int index, QPixmap pixmap, const QVector &imageRects = QVector()); public slots: /** diff --git a/reader/sidebar/ThumbnailDelegate.cpp b/reader/sidebar/ThumbnailDelegate.cpp index d5b199e3f..09d5b0258 100644 --- a/reader/sidebar/ThumbnailDelegate.cpp +++ b/reader/sidebar/ThumbnailDelegate.cpp @@ -5,7 +5,6 @@ #include "ThumbnailDelegate.h" #include "SideBarImageViewModel.h" -#include "EyeProtectionManager.h" #include "NightFilter.h" #include "Utils.h" #include "Application.h" @@ -67,34 +66,20 @@ void ThumbnailDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt QPainterPath clipPath; clipPath.addRoundedRect(rect, borderRadius, borderRadius); painter->setClipPath(clipPath); - // 缩略图外观必须与主视图(BrowserPage::paint)保持一致,因此跟随护眼模式而非 - // 系统深浅主题:此前按系统深色主题反色,深色主题 + 无护眼时会出现主视图 - // 仍是白底、侧边栏缩略图却是黑底的不一致(尤其白底的 OFD/PDF 文档)。 - // 使用主干的夜间滤镜;缩略图尚无图片对象蒙版,采用其整页回退路径: - // Night → CIELAB 明度反转 + 深色压暗 - // Classic/Green → 正片叠底(Multiply)染色 - // Off → 原图 - EyeProtectionManager *epMgr = EyeProtectionManager::instance(); - const EyeProtectionManager::Mode mode = epMgr->mode(); + // 缩略图反色只跟随系统深色主题:深色主题下白底文档反转为黑底白字 + // (与书签/注释列表观感一致),浅色主题照常绘制原图。 + // 反色统一走主干夜间滤镜 NightFilter(CIELAB L* 反转,不再用旧 HSL 方案), + // 图片对象区域蒙版随缩略图由渲染线程预取(与主视图同源),照片区域不反色, + // 并含扫描页覆盖率特判(超过阈值整页反色,避免回贴/蒙版异常) + const bool darkTheme = (DTK_NAMESPACE::Gui::DGuiApplicationHelper::instance()->themeType() == DTK_NAMESPACE::Gui::DGuiApplicationHelper::DarkType); + const QVector imageRects = index.data(ImageinfoType_e::IMAGE_NIGHT_MASK).value>(); // 反色结果按未旋转的原始缩略图缓存,再叠加旋转,避免每次重绘都逐像素反色 - const QPixmap displayPixmap = (mode == EyeProtectionManager::Night) - ? nightPixmap(rawPixmap).transformed(transform) + const QPixmap displayPixmap = darkTheme + ? nightPixmap(rawPixmap, imageRects).transformed(transform) : pixmap; painter->drawPixmap(rect.x(), rect.y(), rect.width(), rect.height(), displayPixmap); - - if (mode == EyeProtectionManager::Night) { - // 与主视图一致:叠加轻微深色半透明层降低整体亮度 - QColor dark = epMgr->pageBackgroundColor(); - dark.setAlpha(60); - painter->fillRect(rect, dark); - } else if (mode != EyeProtectionManager::Off) { - // 与主视图一致:经典/绿色护眼用正片叠底染色 - painter->setCompositionMode(QPainter::CompositionMode_Multiply); - painter->fillRect(rect, epMgr->pageBackgroundColor()); - painter->setCompositionMode(QPainter::CompositionMode_SourceOver); - } painter->restore(); } @@ -128,17 +113,18 @@ QSize ThumbnailDelegate::sizeHint(const QStyleOptionViewItem &option, const QMod return DStyledItemDelegate::sizeHint(option, index); } -QPixmap ThumbnailDelegate::nightPixmap(const QPixmap &src) const +QPixmap ThumbnailDelegate::nightPixmap(const QPixmap &src, const QVector &imageRects) const { if (src.isNull()) return src; - // 滚动/选中时同一张缩略图会被反复重绘,缓存反色结果避免逐像素重复计算 + // 滚动/选中时同一张缩略图会被反复重绘,缓存反色结果避免逐像素重复计算; + // 缩略图重渲染时 cacheKey 必然变化,无需将蒙版纳入缓存键 if (m_nightSourceCache.cacheKey() == src.cacheKey() && !m_nightPixmapCache.isNull()) return m_nightPixmapCache; m_nightSourceCache = src; - m_nightPixmapCache = QPixmap::fromImage(NightFilter::applyPage(src.toImage(), {})); + m_nightPixmapCache = QPixmap::fromImage(NightFilter::applyPage(src.toImage(), imageRects)); m_nightPixmapCache.setDevicePixelRatio(src.devicePixelRatio()); return m_nightPixmapCache; } diff --git a/reader/sidebar/ThumbnailDelegate.h b/reader/sidebar/ThumbnailDelegate.h index 80f6bdd4c..573611429 100644 --- a/reader/sidebar/ThumbnailDelegate.h +++ b/reader/sidebar/ThumbnailDelegate.h @@ -50,11 +50,14 @@ class ThumbnailDelegate : public DStyledItemDelegate /** * @brief nightPixmap - * 夜间护眼模式下缩略图的智能反色结果(带缓存) + * 夜间智能滤镜/深色主题下缩略图的反色结果(带缓存): + * 走主干 NightFilter 管线(CIELAB L* 反转 + 图片对象区域跳过 + 扫描页整页反色特判), + * 与主视图观感一致 * @param src 原始缩略图 + * @param imageRects 图片对象 bbox(与 src 像素对齐,这些区域不反色避免照片负片) * @return 反色后的缩略图 */ - QPixmap nightPixmap(const QPixmap &src) const; + QPixmap nightPixmap(const QPixmap &src, const QVector &imageRects = QVector()) const; private: QAbstractItemView *m_parent = nullptr; diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index f0fd3c77b..a07111aa9 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -540,10 +540,17 @@ QPixmap DocSheet::thumbnail(int index) return m_thumbnailMap.value(index); } -void DocSheet::setThumbnail(int index, QPixmap pixmap) +QVector DocSheet::thumbnailImageRects(int index) +{ + // qCDebug(appLog) << "thumbnailImageRects"; + return m_thumbnailImageRects.value(index); +} + +void DocSheet::setThumbnail(int index, QPixmap pixmap, const QVector &imageRects) { // qCDebug(appLog) << "setThumbnail"; m_thumbnailMap[index] = pixmap; + m_thumbnailImageRects[index] = imageRects; } void DocSheet::setScaleMode(Dr::ScaleMode mode) diff --git a/reader/uiframe/DocSheet.h b/reader/uiframe/DocSheet.h index c8244acaf..4be2d37cd 100644 --- a/reader/uiframe/DocSheet.h +++ b/reader/uiframe/DocSheet.h @@ -321,12 +321,21 @@ class DocSheet : public Dtk::Widget::DSplitter */ QPixmap thumbnail(int index); + /** + * @brief thumbnailImageRects + * 获取缩略图对应的图片对象 bbox(夜间/深色蒙版用,与缩略图像素对齐;需要先设置) + * @param index + * @return 该页无图片对象时为空 + */ + QVector thumbnailImageRects(int index); + /** * @brief setThumbnail * @param index * @param pixmap + * @param imageRects 图片对象 bbox(缩略图渲染坐标系,与 pixmap 对齐),随缩略图一同缓存 */ - void setThumbnail(int index, QPixmap pixmap); + void setThumbnail(int index, QPixmap pixmap, const QVector &imageRects = QVector()); /** * @brief openMagnifier @@ -983,6 +992,7 @@ private slots: QString m_uuid; QTemporaryDir *m_tempDir = nullptr; //存放临时数据 QMap m_thumbnailMap; + QMap> m_thumbnailImageRects; //缩略图图片对象 bbox(与 m_thumbnailMap 同生命周期) bool m_documentChanged = false; bool m_bookmarkChanged = false; diff --git a/tests/browser/ut_pagerenderthread.cpp b/tests/browser/ut_pagerenderthread.cpp index 8f0294f75..c7904c299 100644 --- a/tests/browser/ut_pagerenderthread.cpp +++ b/tests/browser/ut_pagerenderthread.cpp @@ -11,6 +11,7 @@ #include "stub.h" #include +#include #include #include #include @@ -82,7 +83,7 @@ static void handleAnnotationLoaded_stub(const QList g_funcName = __FUNCTION__; } -static void handleRenderThumbnail_stub(int, QPixmap) +static void handleRenderThumbnail_stub(int, QPixmap, const QVector &) { g_funcName = __FUNCTION__; } @@ -485,5 +486,132 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_appendTask_Close) m_tester->m_closeTasks.clear(); } +/**********execNextDocPageThumbnailTask*************/ + +// DocSheet::existSheetByUuid 档:任务校验通过 +static bool existSheetByUuid_true_stub(const QString &) +{ + return true; +} + +// execNextDocPageThumbnailTask: 预取图片对象 bbox(夜间/深色蒙版用)并随任务转发给模型 +static QVector g_imageRectsResult; // getImageObjectRects 返回值(输入) +static QVector g_forwardedRects; // handleRenderThumbnail 收到的 bbox(输出) +static QVector getImageObjectRects_stub(int, int, int) +{ + return g_imageRectsResult; +} + +static bool opened_true_stub() +{ + return true; +} + +static bool opened_false_stub() +{ + return false; +} + +// 足够大的可写静态存储充当假 sheet(同 onDocOpenTask_002 做法) +static unsigned char fake_sheet_storage[8192] = {}; +// 假 model:任务经信号转发到 onDocPageThumbnailTask 时以 existSheet+model 调 handleRenderThumbnail +static unsigned char fake_model_storage[8192] = {}; + +// 空删除器:测试结束不删除 renderer,避免 ~SheetRenderer 往任务池塞关闭任务 +// (会 start 真实工作线程,与测试拆解竞态导致堆损坏) +static void thumbnailRendererNoopDeleter(SheetRenderer *) {} + +static QImage getImage_stub(int, int, int, const QRect &) +{ + QImage img(174, 174, QImage::Format_ARGB32_Premultiplied); + img.fill(Qt::white); + return img; +} + +// 成员函数桩:首参占位 this(Itanium ABI 下成员函数≈隐式 this 的自由函数), +// 否则实参寄存器整体错位,解引用 rects 会读到垃圾内存 +static void handleRenderThumbnail_rects_stub(SideBarImageViewModel *, int, QPixmap, const QVector &rects) +{ + g_funcName = "handleRenderThumbnail_rects_stub"; + g_forwardedRects = rects; +} + +TEST_F(TestPageRenderThread, UT_PageRenderThread_execNextDocPageThumbnailTask_prefetchesImageRects) +{ + // renderStub 由 RAII 管理恢复,避免影响后续用例 + Stub s; + const QVector rects { QRectF(1, 2, 3, 4) }; + g_imageRectsResult = rects; + g_funcName.clear(); + + s.set(ADDR(DocSheet, existSheetByUuid), existSheetByUuid_true_stub); + // 任务经信号转发到 onDocPageThumbnailTask,其中以 existSheet 校验后调 handleRenderThumbnail + s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(SheetRenderer, getImage), getImage_stub); + s.set(ADDR(SheetRenderer, opened), opened_true_stub); + s.set(ADDR(SheetRenderer, getImageObjectRects), getImageObjectRects_stub); + s.set(ADDR(SideBarImageViewModel, handleRenderThumbnail), handleRenderThumbnail_rects_stub); + + DocPageThumbnailTask task; + task.sheet = reinterpret_cast(fake_sheet_storage); // 成员调用均已被桩 + task.uuid = "ut-sheet-uuid"; // 与 uuid_stub 一致,校验通过 + // renderer 为空会提前结束任务;空删除器避免析构竞态(见 thumbnailRendererNoopDeleter) + task.renderer = QSharedPointer(renderer_stub(), &thumbnailRendererNoopDeleter); + task.model = reinterpret_cast(fake_model_storage); // 槽内 model->handleRenderThumbnail 已被桩 + task.index = 0; + m_tester->m_pageThumbnailTasks.append(task); + + EXPECT_TRUE(m_tester->execNextDocPageThumbnailTask()); + EXPECT_TRUE(m_tester->m_pageThumbnailTasks.isEmpty()); + // sigDocPageThumbnailTaskFinished 为 QueuedConnection,手动派发队列中的槽调用 + QEventLoop loop; + QMetaObject::invokeMethod(&loop, "quit", Qt::QueuedConnection); + loop.exec(); + QCoreApplication::sendPostedEvents(nullptr, QEvent::MetaCall); + // 任务转发到 handleRenderThumbnail,且预取的 bbox 原样传给模型 + EXPECT_TRUE(g_funcName == "handleRenderThumbnail_rects_stub"); + EXPECT_TRUE(g_forwardedRects == rects); + g_imageRectsResult.clear(); + g_forwardedRects.clear(); +} + +// 渲染器未打开时不预取 bbox,任务照常转发(imageRects 为空) +TEST_F(TestPageRenderThread, UT_PageRenderThread_execNextDocPageThumbnailTask_skipRectsWhenNotOpened) +{ + Stub s; + static const QVector kEmpty; + g_imageRectsResult = QVector() << QRectF(9, 9, 9, 9); // 若被误取会带入任务 + g_funcName.clear(); + + s.set(ADDR(DocSheet, existSheetByUuid), existSheetByUuid_true_stub); + // 任务经信号转发到 onDocPageThumbnailTask,其中以 existSheet 校验后调 handleRenderThumbnail + s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(SheetRenderer, getImage), getImage_stub); + s.set(ADDR(SheetRenderer, opened), opened_false_stub); + s.set(ADDR(SheetRenderer, getImageObjectRects), getImageObjectRects_stub); + s.set(ADDR(SideBarImageViewModel, handleRenderThumbnail), handleRenderThumbnail_rects_stub); + + DocPageThumbnailTask task; + task.sheet = reinterpret_cast(fake_sheet_storage); + task.uuid = "ut-sheet-uuid"; + // renderer 为空会提前结束任务;空删除器避免析构竞态(见 thumbnailRendererNoopDeleter) + task.renderer = QSharedPointer(renderer_stub(), &thumbnailRendererNoopDeleter); + task.model = reinterpret_cast(fake_model_storage); // 槽内 model->handleRenderThumbnail 已被桩 + task.index = 0; + m_tester->m_pageThumbnailTasks.append(task); + + EXPECT_TRUE(m_tester->execNextDocPageThumbnailTask()); + // 同上:派发队列中的槽调用后再校验 + QEventLoop loop2; + QMetaObject::invokeMethod(&loop2, "quit", Qt::QueuedConnection); + loop2.exec(); + QCoreApplication::sendPostedEvents(nullptr, QEvent::MetaCall); + EXPECT_TRUE(g_funcName == "handleRenderThumbnail_rects_stub"); + // 未预取:转发给模型的 bbox 应为空 + EXPECT_TRUE(g_forwardedRects.isEmpty()); + g_imageRectsResult.clear(); + g_forwardedRects.clear(); +} + // (NullInstance test removed: modifying s_quitForever corrupts global state // and causes segfaults in subsequent DocSheet destructor tests.) diff --git a/tests/sidebar/ut_bookmarkdelegate.cpp b/tests/sidebar/ut_bookmarkdelegate.cpp index b87442b33..debdc0aba 100644 --- a/tests/sidebar/ut_bookmarkdelegate.cpp +++ b/tests/sidebar/ut_bookmarkdelegate.cpp @@ -14,6 +14,45 @@ #include #include #include +#include + +#include +#include + +DGUI_USE_NAMESPACE + +namespace { + +// 未打开文档时渲染器没有页面尺寸,桩掉以得到稳定的缩略图卡片区域 +QSizeF pageSizeByIndex_stub(DocSheet *, int) +{ + return QSizeF(210, 297); +} + +// 测试期间屏蔽 dtk 主题持久化,避免 setPaletteType 污染用户配置 +class ThemeGuard +{ +public: + explicit ThemeGuard(DGuiApplicationHelper::ColorType type) + { + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, true); + m_previous = DGuiApplicationHelper::instance()->themeType(); + DGuiApplicationHelper::instance()->setPaletteType(type); + } + ~ThemeGuard() + { + if (m_previous != DGuiApplicationHelper::UnknownType) + DGuiApplicationHelper::instance()->setPaletteType(m_previous); + else + DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, false); + } + +private: + DGuiApplicationHelper::ColorType m_previous = DGuiApplicationHelper::UnknownType; +}; + +} // namespace class UT_BookMarkDelegate : public ::testing::Test { @@ -59,3 +98,103 @@ TEST_F(UT_BookMarkDelegate, UT_BookMarkDelegate_paint) EXPECT_TRUE(m_tester->m_parent == m_pView); delete painter; } + +namespace { + +// 绘制到离屏画布:页面 (210,297) 按 62×62 等比缩放后绘制在 +// (option.rect.x()+10, 垂直居中) 处,返回缩略图卡片内相对坐标 (rx, ry) 处像素 +QColor paintPixelAt(UT_BookMarkDelegate *fixture, const QPixmap &thumb, int rx, int ry) +{ + fixture->m_pView->getImageModel()->insertPageIndex(0); + fixture->m_sheet->setThumbnail(0, thumb); + + const QModelIndex index = fixture->m_pView->getImageModel()->index(0, 0); + if (!index.isValid()) + return QColor(); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 200, 300); + + QImage canvas(200, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); // 红底便于观察是否被绘制覆盖 + QPainter painter(&canvas); + fixture->m_tester->paint(&painter, option, index); + painter.end(); + + // 缩略图卡片:宽 44(=62*210/297)、高 62,起点 (10, 150-31) + return canvas.pixelColor(10 + rx, 150 - 31 + ry); +} + +} // namespace + +// 浅色主题:书签列表保持文档原始白底 +TEST_F(UT_BookMarkDelegate, UT_BookMarkDelegate_paintLightThemeKeepsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard light(DGuiApplicationHelper::LightType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintPixelAt(this, whiteThumb, 22, 31); + + EXPECT_GT(center.lightness(), 239); +} + +// 深色主题:白底反转为深色(走 NightFilter 主干滤镜) +TEST_F(UT_BookMarkDelegate, UT_BookMarkDelegate_paintDarkThemeInvertsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintPixelAt(this, whiteThumb, 22, 31); + + EXPECT_LT(center.lightness(), 32); +} + +// 深色主题 + 图片对象蒙版:照片区域保持原始像素,白底反转为深色 +TEST_F(UT_BookMarkDelegate, UT_BookMarkDelegate_paintDarkThemeWithNightMaskKeepsPhotoPixels) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + // 左半为纯色照片块(70,70,70),右半白底;蒙版罩住照片(源缩略图 174 像素坐标) + QPixmap mixed(174, 246); + mixed.fill(Qt::white); + QPainter p(&mixed); + p.fillRect(0, 0, 87, 246, QColor(70, 70, 70)); + p.end(); + + m_pView->getImageModel()->insertPageIndex(0); + m_sheet->setThumbnail(0, mixed, QVector() << QRectF(0, 0, 87, 246)); + + const QModelIndex index = m_pView->getImageModel()->index(0, 0); + ASSERT_TRUE(index.isValid()); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 200, 300); + + QImage canvas(200, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); + QPainter painter(&canvas); + m_tester->paint(&painter, option, index); + painter.end(); + + // 蒙版区域(照片中心,避开缩放采样边界)像素保持不变 + EXPECT_EQ(canvas.pixelColor(10 + 15, 150), QColor(70, 70, 70)); + // 蒙版外白底已反转为深色 + EXPECT_LT(canvas.pixelColor(10 + 40, 150).lightness(), 32); +} diff --git a/tests/sidebar/ut_notesdelegate.cpp b/tests/sidebar/ut_notesdelegate.cpp index 329efeadb..a73c402bb 100644 --- a/tests/sidebar/ut_notesdelegate.cpp +++ b/tests/sidebar/ut_notesdelegate.cpp @@ -14,6 +14,45 @@ #include #include #include +#include + +#include +#include + +DGUI_USE_NAMESPACE + +namespace { + +// 未打开文档时渲染器没有页面尺寸,桩掉以得到稳定的缩略图卡片区域 +QSizeF pageSizeByIndex_stub(DocSheet *, int) +{ + return QSizeF(210, 297); +} + +// 测试期间屏蔽 dtk 主题持久化,避免 setPaletteType 污染用户配置 +class ThemeGuard +{ +public: + explicit ThemeGuard(DGuiApplicationHelper::ColorType type) + { + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, true); + m_previous = DGuiApplicationHelper::instance()->themeType(); + DGuiApplicationHelper::instance()->setPaletteType(type); + } + ~ThemeGuard() + { + if (m_previous != DGuiApplicationHelper::UnknownType) + DGuiApplicationHelper::instance()->setPaletteType(m_previous); + else + DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, false); + } + +private: + DGuiApplicationHelper::ColorType m_previous = DGuiApplicationHelper::UnknownType; +}; + +} // namespace class UT_NotesDelegate : public ::testing::Test { @@ -60,6 +99,106 @@ TEST_F(UT_NotesDelegate, UT_NotesDelegate_paint) delete painter; } +namespace { + +// 绘制到离屏画布:页面 (210,297) 按 62×62 等比缩放后绘制在 +// (option.rect.x()+10, 垂直居中) 处,返回缩略图卡片内相对坐标 (rx, ry) 处像素 +QColor paintPixelAt(UT_NotesDelegate *fixture, const QPixmap &thumb, int rx, int ry) +{ + fixture->m_pView->getImageModel()->insertPageIndex(0); + fixture->m_sheet->setThumbnail(0, thumb); + + const QModelIndex index = fixture->m_pView->getImageModel()->index(0, 0); + if (!index.isValid()) + return QColor(); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 200, 300); + + QImage canvas(200, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); // 红底便于观察是否被绘制覆盖 + QPainter painter(&canvas); + fixture->m_tester->paint(&painter, option, index); + painter.end(); + + // 缩略图卡片:宽 44(=62*210/297)、高 62,起点 (10, 150-31) + return canvas.pixelColor(10 + rx, 150 - 31 + ry); +} + +} // namespace + +// 浅色主题:注释列表保持文档原始白底 +TEST_F(UT_NotesDelegate, UT_NotesDelegate_paintLightThemeKeepsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard light(DGuiApplicationHelper::LightType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintPixelAt(this, whiteThumb, 22, 31); + + EXPECT_GT(center.lightness(), 239); +} + +// 深色主题:白底反转为深色(走 NightFilter 主干滤镜) +TEST_F(UT_NotesDelegate, UT_NotesDelegate_paintDarkThemeInvertsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintPixelAt(this, whiteThumb, 22, 31); + + EXPECT_LT(center.lightness(), 32); +} + +// 深色主题 + 图片对象蒙版:照片区域保持原始像素,白底反转为深色 +TEST_F(UT_NotesDelegate, UT_NotesDelegate_paintDarkThemeWithNightMaskKeepsPhotoPixels) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + // 左半为纯色照片块(70,70,70),右半白底;蒙版罩住照片(源缩略图 174 像素坐标) + QPixmap mixed(174, 246); + mixed.fill(Qt::white); + QPainter p(&mixed); + p.fillRect(0, 0, 87, 246, QColor(70, 70, 70)); + p.end(); + + m_pView->getImageModel()->insertPageIndex(0); + m_sheet->setThumbnail(0, mixed, QVector() << QRectF(0, 0, 87, 246)); + + const QModelIndex index = m_pView->getImageModel()->index(0, 0); + ASSERT_TRUE(index.isValid()); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 200, 300); + + QImage canvas(200, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); + QPainter painter(&canvas); + m_tester->paint(&painter, option, index); + painter.end(); + + // 蒙版区域(照片中心,避开缩放采样边界)像素保持不变 + EXPECT_EQ(canvas.pixelColor(10 + 15, 150), QColor(70, 70, 70)); + // 蒙版外白底已反转为深色 + EXPECT_LT(canvas.pixelColor(10 + 40, 150).lightness(), 32); +} + TEST_F(UT_NotesDelegate, UT_NotesDelegate_sizeHint) { m_pView->getImageModel()->insertPageIndex(1); diff --git a/tests/sidebar/ut_searchresdelegate.cpp b/tests/sidebar/ut_searchresdelegate.cpp index 45b5142c5..0b1e710b3 100644 --- a/tests/sidebar/ut_searchresdelegate.cpp +++ b/tests/sidebar/ut_searchresdelegate.cpp @@ -1,12 +1,12 @@ -// Copyright (C) 2019-2026 ~ 2020 UnionTech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "SearchResDelegate.h" -#include "DocSheet.h" #include "SideBarImageListview.h" #include "SideBarImageViewModel.h" +#include "DocSheet.h" #include "stub.h" @@ -14,6 +14,45 @@ #include #include #include +#include + +#include +#include + +DGUI_USE_NAMESPACE + +namespace { + +// 未打开文档时渲染器没有页面尺寸,桩掉以得到稳定的搜索结果卡片区域 +QSizeF pageSizeByIndex_stub(DocSheet *, int) +{ + return QSizeF(210, 297); +} + +// 测试期间屏蔽 dtk 主题持久化,避免 setPaletteType 污染用户配置 +class ThemeGuard +{ +public: + explicit ThemeGuard(DGuiApplicationHelper::ColorType type) + { + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, true); + m_previous = DGuiApplicationHelper::instance()->themeType(); + DGuiApplicationHelper::instance()->setPaletteType(type); + } + ~ThemeGuard() + { + if (m_previous != DGuiApplicationHelper::UnknownType) + DGuiApplicationHelper::instance()->setPaletteType(m_previous); + else + DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, false); + } + +private: + DGuiApplicationHelper::ColorType m_previous = DGuiApplicationHelper::UnknownType; +}; + +} // namespace class UT_SearchResDelegate : public ::testing::Test { @@ -27,6 +66,7 @@ class UT_SearchResDelegate : public ::testing::Test strPath += "/files/1.pdf"; m_sheet = new DocSheet(Dr::PDF, strPath, nullptr); m_pView = new SideBarImageListView(m_sheet); + m_pView->setListType(E_SideBar::SIDE_SEARCH); m_tester = new SearchResDelegate(m_pView); m_pView->setItemDelegate(m_tester); m_tester->disconnect(); @@ -60,6 +100,107 @@ TEST_F(UT_SearchResDelegate, UT_SearchResDelegate_paint) delete painter; } +namespace { + +// 绘制到离屏画布:页面 (210,297) 按 62×62 等比缩放后绘制在 +// (option.rect.x()+10, 垂直居中) 处,返回卡片内相对坐标 (rx, ry) 处像素 +QColor paintPixelAt(UT_SearchResDelegate *fixture, const QPixmap &thumb, int rx, int ry) +{ + fixture->m_pView->getImageModel()->insertPageIndex(0); + fixture->m_sheet->setThumbnail(0, thumb); + + const QModelIndex index = fixture->m_pView->getImageModel()->index(0, 0); + if (!index.isValid()) + return QColor(); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 200, 300); + + QImage canvas(200, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); // 红底便于观察是否被绘制覆盖 + QPainter painter(&canvas); + fixture->m_tester->paint(&painter, option, index); + painter.end(); + + // 搜索结果卡片:宽 43(=62*210/297)、高 62,起点 (10, 150-31) + return canvas.pixelColor(10 + rx, 150 - 31 + ry); +} + +} // namespace + +// 浅色主题:搜索结果页小图保持文档原始白底 +TEST_F(UT_SearchResDelegate, UT_SearchResDelegate_paintLightThemeKeepsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard light(DGuiApplicationHelper::LightType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintPixelAt(this, whiteThumb, 20, 31); + + EXPECT_GT(center.lightness(), 239); +} + +// 深色主题:触发搜索后结果页小图同样反转为深色(走 NightFilter 主干滤镜), +// 不能再显示原始白底 +TEST_F(UT_SearchResDelegate, UT_SearchResDelegate_paintDarkThemeInvertsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintPixelAt(this, whiteThumb, 20, 31); + + EXPECT_LT(center.lightness(), 32); +} + +// 深色主题 + 图片对象蒙版:搜索结果页小图中照片区域保持原始像素,白底反转为深色 +TEST_F(UT_SearchResDelegate, UT_SearchResDelegate_paintDarkThemeWithNightMaskKeepsPhotoPixels) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + // 左半为纯色照片块(70,70,70),右半白底;蒙版罩住照片(源缩略图 174 像素坐标) + QPixmap mixed(174, 246); + mixed.fill(Qt::white); + QPainter p(&mixed); + p.fillRect(0, 0, 87, 246, QColor(70, 70, 70)); + p.end(); + + m_pView->getImageModel()->insertPageIndex(0); + m_sheet->setThumbnail(0, mixed, QVector() << QRectF(0, 0, 87, 246)); + + const QModelIndex index = m_pView->getImageModel()->index(0, 0); + ASSERT_TRUE(index.isValid()); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 200, 300); + + QImage canvas(200, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); + QPainter painter(&canvas); + m_tester->paint(&painter, option, index); + painter.end(); + + // 蒙版区域(照片中心,避开缩放采样边界)像素保持不变 + EXPECT_EQ(canvas.pixelColor(10 + 10, 150), QColor(70, 70, 70)); + // 蒙版外白底已反转为深色 + EXPECT_LT(canvas.pixelColor(10 + 35, 150).lightness(), 32); +} + TEST_F(UT_SearchResDelegate, UT_SearchResDelegate_sizeHint) { m_pView->getImageModel()->insertPageIndex(1); diff --git a/tests/sidebar/ut_sidebarimageviewmodel.cpp b/tests/sidebar/ut_sidebarimageviewmodel.cpp index 20b38cee0..1ce5ac713 100644 --- a/tests/sidebar/ut_sidebarimageviewmodel.cpp +++ b/tests/sidebar/ut_sidebarimageviewmodel.cpp @@ -195,6 +195,38 @@ TEST_F(TestSideBarImageViewModel, testhandleRenderThumbnail) m_tester->handleRenderThumbnail(0, QPixmap()); } +// handleRenderThumbnail 第三参(图片对象 bbox)需存入 DocSheet,供 data(IMAGE_NIGHT_MASK) 读取 +TEST_F(TestSideBarImageViewModel, testhandleRenderThumbnailStoresImageRects) +{ + const QVector rects { QRectF(1, 2, 3, 4), QRectF(5, 6, 7, 8) }; + QPixmap thumb(174, 174); + thumb.fill(Qt::white); + + m_tester->handleRenderThumbnail(0, thumb, rects); + + EXPECT_TRUE(m_sheet->thumbnailImageRects(0) == rects); + + // data(IMAGE_NIGHT_MASK) 返回同一份 bbox,供代理反色时跳过图片区域 + m_tester->insertPageIndex(0); + const QModelIndex index = m_tester->index(0, 0); + ASSERT_TRUE(index.isValid()); + const QVector got = + index.data(ImageinfoType_e::IMAGE_NIGHT_MASK).value>(); + EXPECT_TRUE(got == rects); +} + +// 未设置蒙版时 IMAGE_NIGHT_MASK 返回空列表(整页反色,不跳过图片区域) +TEST_F(TestSideBarImageViewModel, testImageNightMaskDefaultsEmpty) +{ + m_tester->insertPageIndex(0); + const QModelIndex index = m_tester->index(0, 0); + ASSERT_TRUE(index.isValid()); + const QVector got = + index.data(ImageinfoType_e::IMAGE_NIGHT_MASK).value>(); + EXPECT_TRUE(got.isEmpty()); + EXPECT_TRUE(m_sheet->thumbnailImageRects(0).isEmpty()); +} + TEST_F(TestSideBarImageViewModel, testonBatchUpdateTimer) { // Trigger onBatchUpdateTimer directly diff --git a/tests/sidebar/ut_thumbnaildelegate.cpp b/tests/sidebar/ut_thumbnaildelegate.cpp index 119fe170e..c8da55ee0 100644 --- a/tests/sidebar/ut_thumbnaildelegate.cpp +++ b/tests/sidebar/ut_thumbnaildelegate.cpp @@ -15,6 +15,12 @@ #include #include #include +#include + +#include +#include + +DGUI_USE_NAMESPACE namespace { @@ -24,6 +30,29 @@ QSizeF pageSizeByIndex_stub(DocSheet *, int) return QSizeF(210, 297); } +// 测试期间屏蔽 dtk 主题持久化,避免 setPaletteType 污染用户配置 +class ThemeGuard +{ +public: + explicit ThemeGuard(DGuiApplicationHelper::ColorType type) + { + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, true); + m_previous = DGuiApplicationHelper::instance()->themeType(); + DGuiApplicationHelper::instance()->setPaletteType(type); + } + ~ThemeGuard() + { + if (m_previous != DGuiApplicationHelper::UnknownType) + DGuiApplicationHelper::instance()->setPaletteType(m_previous); + else + DGuiApplicationHelper::instance()->setPaletteType(DGuiApplicationHelper::LightType); + DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::DontSaveApplicationTheme, false); + } + +private: + DGuiApplicationHelper::ColorType m_previous = DGuiApplicationHelper::UnknownType; +}; + } // namespace class UT_ThumbnailDelegate : public ::testing::Test @@ -96,19 +125,107 @@ TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_sizeHint) EXPECT_FALSE(size.isEmpty()); } -// 缩略图外观跟随护眼模式(而非系统深浅主题),与主视图保持一致: -// 无护眼时保持文档原始白底,夜间护眼时反转为深色底 -TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintFollowsEyeProtectionMode) +namespace { + +// 绘制到离屏画布,返回画面中心的像素(缩略图卡片正中) +QColor paintCenterPixel(UT_ThumbnailDelegate *fixture, const QPixmap &thumb) +{ + fixture->m_pView->getImageModel()->insertPageIndex(0); + fixture->m_sheet->setThumbnail(0, thumb); + + const QModelIndex index = fixture->m_pView->getImageModel()->index(0, 0); + if (!index.isValid()) + return QColor(); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 240, 300); + + QImage canvas(240, 300, QImage::Format_ARGB32_Premultiplied); + canvas.fill(Qt::red); // 红底便于观察是否被绘制覆盖 + QPainter painter(&canvas); + fixture->m_tester->paint(&painter, option, index); + painter.end(); + return canvas.pixelColor(120, 150); +} + +} // namespace + +// 缩略图外观只跟随系统深浅主题(不再跟随护眼模式): +// 浅色主题保持文档原始白底,深色主题反转为深色底 +TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintLightThemeKeepsWhitePage) { Stub s; typedef QSizeF(*fptr)(DocSheet *, int); fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); s.set(pageSizeFunc, pageSizeByIndex_stub); - m_pView->getImageModel()->insertPageIndex(0); + ThemeGuard light(DGuiApplicationHelper::LightType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintCenterPixel(this, whiteThumb); + + EXPECT_GT(center.lightness(), 239); +} + +// 深色主题下白底反转为深色(与 BookMark/Notes 列表观感一致) +TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintDarkThemeInvertsWhitePage) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + QPixmap whiteThumb(174, 246); + whiteThumb.fill(Qt::white); + const QColor center = paintCenterPixel(this, whiteThumb); + + EXPECT_LT(center.lightness(), 32); +} + +// 护眼模式不再影响缩略图:夜间护眼开启时浅色主题下仍绘制原始白底 +TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintIgnoresEyeProtectionMode) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard light(DGuiApplicationHelper::LightType); + + const EyeProtectionManager::Mode previousMode = EyeProtectionManager::instance()->mode(); + EyeProtectionManager::instance()->setMode(EyeProtectionManager::Night); + QPixmap whiteThumb(174, 246); whiteThumb.fill(Qt::white); - m_sheet->setThumbnail(0, whiteThumb); + const QColor center = paintCenterPixel(this, whiteThumb); + + EyeProtectionManager::instance()->setMode(previousMode); + + EXPECT_GT(center.lightness(), 239); +} + +// 深色主题 + 图片对象蒙版:蒙版区域(照片)保持原始像素,非蒙版区域(白底)反转为深色 +TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintDarkThemeWithNightMaskKeepsPhotoPixels) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + // 左半为纯色照片块(70,70,70),右半白底;蒙版仅罩住照片,覆盖率 < 70% 不触发扫描页整页反色 + QPixmap mixed(174, 246); + mixed.fill(Qt::white); + QPainter p(&mixed); + p.fillRect(0, 0, 87, 246, QColor(70, 70, 70)); + p.end(); + + m_pView->getImageModel()->insertPageIndex(0); + m_sheet->setThumbnail(0, mixed, QVector() << QRectF(0, 0, 87, 246)); const QModelIndex index = m_pView->getImageModel()->index(0, 0); ASSERT_TRUE(index.isValid()); @@ -117,21 +234,46 @@ TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintFollowsEyeProtectionMode) option.rect = QRect(0, 0, 240, 300); QImage canvas(240, 300, QImage::Format_ARGB32_Premultiplied); - - const auto previousMode = EyeProtectionManager::instance()->mode(); - EyeProtectionManager::instance()->setMode(EyeProtectionManager::Off); canvas.fill(Qt::red); - QPainter offPainter(&canvas); - m_tester->paint(&offPainter, option, index); - offPainter.end(); - EXPECT_GT(canvas.pixelColor(120, 150).lightness(), 239); + QPainter painter(&canvas); + m_tester->paint(&painter, option, index); + painter.end(); - EyeProtectionManager::instance()->setMode(EyeProtectionManager::Night); + // 蒙版区域像素保持不变(imageDimFactor=1 时 dimPixelImage 不修改像素值) + EXPECT_EQ(canvas.pixelColor(60, 150), QColor(70, 70, 70)); + // 蒙版外白底已反转为深色 + EXPECT_LT(canvas.pixelColor(180, 150).lightness(), 32); +} + +// 深色主题 + 扫描页(图片 bbox 覆盖率 > 70%):整页反色,蒙版不生效 +TEST_F(UT_ThumbnailDelegate, UT_ThumbnailDelegate_paintDarkThemeScannedPageFullInvert) +{ + Stub s; + typedef QSizeF(*fptr)(DocSheet *, int); + fptr pageSizeFunc = (fptr)(&DocSheet::pageSizeByIndex); + s.set(pageSizeFunc, pageSizeByIndex_stub); + + ThemeGuard dark(DGuiApplicationHelper::DarkType); + + // 整页照片(米黄纸面色):bbox 覆盖率 100%,按扫描页整页反色,深色像素反转后提亮为白 + QPixmap scanned(174, 246); + scanned.fill(QColor(60, 60, 60)); + + m_pView->getImageModel()->insertPageIndex(0); + m_sheet->setThumbnail(0, scanned, QVector() << QRectF(0, 0, 174, 246)); + + const QModelIndex index = m_pView->getImageModel()->index(0, 0); + ASSERT_TRUE(index.isValid()); + + QStyleOptionViewItem option; + option.rect = QRect(0, 0, 240, 300); + + QImage canvas(240, 300, QImage::Format_ARGB32_Premultiplied); canvas.fill(Qt::red); - QPainter nightPainter(&canvas); - m_tester->paint(&nightPainter, option, index); - nightPainter.end(); - EXPECT_LT(canvas.pixelColor(120, 150).lightness(), 32); + QPainter painter(&canvas); + m_tester->paint(&painter, option, index); + painter.end(); - EyeProtectionManager::instance()->setMode(previousMode); + // 中心点:若蒙版生效则保持 (60,60,60);整页反色后亮度提升,应明显偏亮 + EXPECT_GT(canvas.pixelColor(120, 150).lightness(), 128); } diff --git a/tests/uiframe/ut_docsheet.cpp b/tests/uiframe/ut_docsheet.cpp index 9049bd468..5a9370a78 100644 --- a/tests/uiframe/ut_docsheet.cpp +++ b/tests/uiframe/ut_docsheet.cpp @@ -728,6 +728,27 @@ TEST_F(TestDocSheet, UT_DocSheet_setThumbnail_001) EXPECT_TRUE(m_tester->m_thumbnailMap.size() == 1); } +// setThumbnail 带 bbox:thumbnailImageRects 返回同一份蒙版 +TEST_F(TestDocSheet, UT_DocSheet_thumbnailImageRects_001) +{ + EXPECT_TRUE(m_tester->thumbnailImageRects(1).isEmpty()); + + const QVector rects { QRectF(0, 0, 10, 20), QRectF(1, 1, 2, 2) }; + m_tester->setThumbnail(1, QPixmap(10, 20), rects); + EXPECT_TRUE(m_tester->thumbnailImageRects(1) == rects); +} + +// 不带 bbox 重设缩略图时,旧蒙版需被清空(避免残留旧页面蒙版) +TEST_F(TestDocSheet, UT_DocSheet_setThumbnailClearsStaleImageRects) +{ + const QVector rects { QRectF(0, 0, 10, 20) }; + m_tester->setThumbnail(2, QPixmap(10, 20), rects); + EXPECT_FALSE(m_tester->thumbnailImageRects(2).isEmpty()); + + m_tester->setThumbnail(2, QPixmap(10, 20)); + EXPECT_TRUE(m_tester->thumbnailImageRects(2).isEmpty()); +} + TEST_F(TestDocSheet, UT_DocSheet_setScaleMode_001) { m_tester->m_operation.scaleMode = Dr::FitToPageWorHMode; From 9fc57e18b65ce34d2529d6dd5d691465eb8cbb13 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 15 Sep 2026 19:20:58 +0800 Subject: [PATCH 27/63] fix(batchprint): link OfdModel and rofd into batch print converter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model.cpp is compiled with the global OFD_SUPPORT_ENABLED definition, but batchprint-convert neither built OfdModel.cpp (which implements OfdDocument::loadDocument) nor linked rofd_ffi/cairo, so linking deepin-reader-batchprint failed with an undefined reference. Add OfdModel.cpp and Navigation.cpp plus the rofd/cairo include dirs, compile options and link libraries behind OFD_SUPPORT_ENABLED, mirroring the existing XPS handling. batchprint-convert 编译 Model.cpp 时继承了全局 OFD_SUPPORT_ENABLED 宏, 但既未编译实现 OfdDocument::loadDocument 的 OfdModel.cpp,也未链接 rofd_ffi/cairo,导致 deepin-reader-batchprint 链接报未定义引用。仿照 XPS 的处理方式,在 OFD_SUPPORT_ENABLED 下补充 OfdModel.cpp、 Navigation.cpp 及 rofd/cairo 头文件路径、编译选项与链接库。 Log: 修复批量打印 OFD 开启时缺少 OfdModel/rofd 链接导致的编译失败 Influence: 仅构建调整:OFD 支持开启时 batchprint 可正常编译链接,关闭 OFD 时行为不变。 --- batch-print/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/batch-print/CMakeLists.txt b/batch-print/CMakeLists.txt index 0593816a2..33d919451 100644 --- a/batch-print/CMakeLists.txt +++ b/batch-print/CMakeLists.txt @@ -44,6 +44,15 @@ set(BATCHPRINT_READER_SOURCES ${CMAKE_SOURCE_DIR}/reader/document/XpsTextExtractor.cpp ) +# OFD: Model.cpp gets OFD_SUPPORT_ENABLED from the global add_compile_definitions, +# so OfdModel.cpp (implements OfdDocument::loadDocument) and rofd/cairo must be linked too. +if (OFD_SUPPORT_ENABLED) + list(APPEND BATCHPRINT_READER_SOURCES + ${CMAKE_SOURCE_DIR}/reader/document/OfdModel.cpp + ${CMAKE_SOURCE_DIR}/reader/document/Navigation.cpp + ) +endif() + add_library(batchprint-convert STATIC formatconverter.h formatconverter.cpp ${BATCHPRINT_READER_SOURCES} @@ -61,6 +70,8 @@ target_include_directories(batchprint-convert PUBLIC ${CMAKE_SOURCE_DIR}/reader/document ${PDFIUM_INCLUDE_DIRS} $<$:${XPS_DEPS_INCLUDE_DIRS}> + $<$:${ROFD_INCLUDE_DIR}> + $<$:${OFD_CAIRO_INCLUDE_DIRS}> ) target_compile_definitions(batchprint-convert PRIVATE @@ -83,6 +94,8 @@ target_link_libraries(batchprint-convert PUBLIC ${LIBJPEG_LIBRARIES} ${FREETYPE_LIBRARIES} $<$:${XPS_DEPS_LIBRARIES}> + $<$:${ROFD_FFI_LIBRARY}> + $<$:${OFD_CAIRO_LIBRARIES}> ) # DTK linking @@ -109,6 +122,10 @@ if (XPS_SUPPORT_ENABLED) target_compile_options(batchprint-convert PUBLIC ${XPS_DEPS_CFLAGS_OTHER}) endif() +if (OFD_SUPPORT_ENABLED) + target_compile_options(batchprint-convert PRIVATE ${OFD_CAIRO_CFLAGS_OTHER}) +endif() + # Executable add_executable(deepin-reader-batchprint main.cpp From 5c62504f129e59165f20b22185a68c2957f29d40 Mon Sep 17 00:00:00 2001 From: fuqian Date: Mon, 17 Aug 2026 10:46:43 +0800 Subject: [PATCH 28/63] fix(icon): simplify import_photo svg structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Replace Sketch-exported nested groups with defs-based structure 2. Remove redundant Sketch metadata (generator comment, title, desc) 3. Keep 128x128 size, viewBox, opacity and visual semantics unchanged Log: Simplify the dark-theme import_photo icon SVG structure Influence: Reduces icon file size while keeping the same look. fix(icon): 精简 import_photo 图标的 SVG 结构 1. 用 defs 引用结构替换 Sketch 导出的多层嵌套分组 2. 移除冗余的 Sketch 元数据(生成器注释、标题、描述) 3. 保持 128x128 尺寸、viewBox、透明度及视觉语义不变 Log: 精简深色主题 import_photo 图标的 SVG 结构 PMS: BUG-373779 Influence: 减小图标体积,外观保持一致。 --- .../dark/actions/dr_import_photo_128px.svg | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/resources/builtin/dark/actions/dr_import_photo_128px.svg b/resources/builtin/dark/actions/dr_import_photo_128px.svg index ddd60162c..3311d7a75 100644 --- a/resources/builtin/dark/actions/dr_import_photo_128px.svg +++ b/resources/builtin/dark/actions/dr_import_photo_128px.svg @@ -1,20 +1,14 @@ - - icon_import_photo - Created with Sketch. - - - - - - - - - - - - + 添加文档 + + + + + + + + From 74f0aaec555ba3149651efaa47d6255ed8bf95c3 Mon Sep 17 00:00:00 2001 From: fuqian Date: Mon, 17 Aug 2026 10:55:33 +0800 Subject: [PATCH 29/63] fix(icon): remove dead defs and invalid xlink:href MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address auto-review feedback on PR #318: 1. Remove unused block (dead code, path-1 never effectively referenced) 2. Remove invalid xlink:href attribute on element (not supported by SVG spec on ) 3. Restore separate path/rect/circle elements for maintainability 4. Keep Sketch metadata removal and dark-theme id/label cleanup from prior commit 5. Visual output is pixel-identical to upstream master Log: Fix SVG spec violations flagged by auto review Influence: Removes dead code while keeping the same look. fix(icon): 移除死代码defs与无效xlink:href 针对 PR #318 自动评审反馈修复: 1. 移除未被有效引用的 死代码块 2. 移除 元素上不符合 SVG 规范的 xlink:href 属性 3. 恢复独立的 path/rect/circle 元素以提升可维护性 4. 保留前次提交的 Sketch 元数据清理与深色主题 id 语义化 5. 视觉输出与上游 master 像素级一致 Log: 修复自动评审指出的 SVG 规范违规 PMS: BUG-373779 Influence: 移除死代码,外观保持一致。 --- .../dark/actions/dr_import_photo_128px.svg | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/resources/builtin/dark/actions/dr_import_photo_128px.svg b/resources/builtin/dark/actions/dr_import_photo_128px.svg index 3311d7a75..0db873ac0 100644 --- a/resources/builtin/dark/actions/dr_import_photo_128px.svg +++ b/resources/builtin/dark/actions/dr_import_photo_128px.svg @@ -1,14 +1,18 @@ 添加文档 - - - - - - - + + + + + + + + + + + From 223d0b5af581195c49b7977e1b84cf0cdbd8c2b2 Mon Sep 17 00:00:00 2001 From: fuqian Date: Mon, 17 Aug 2026 13:47:24 +0800 Subject: [PATCH 30/63] fix(icon): remove fill to resolve dark-theme overlap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log: 深色主题下 import_photo 图标线条互相覆盖 Bug: https://pms.uniontech.com/bug-view-373779.html 问题根因: SVG 中 path/circle 元素使用 fill="#252525" 深色填充, 在 opacity=0.3 下与 stroke="#C5CFE0" 描边叠加, 导致 alpha 通道多层累积 (最高达 193/255), 图标边缘出现线条互相覆盖。 修复: 将 fill="#252525" 改为 fill="none", 移除深色填充区域, 保留 stroke 描边和 rect/circle 的浅色填充不变。 Qt SVG 渲染验证: 重叠像素 (alpha>150) 从 1437 降至 0。 Influence: 仅修改深色主题图标资源文件, 不影响代码逻辑, 渲染效果保持图标语义不变 (文档+下载箭头)。 PMS: BUG-373779 --- resources/builtin/dark/actions/dr_import_photo_128px.svg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/builtin/dark/actions/dr_import_photo_128px.svg b/resources/builtin/dark/actions/dr_import_photo_128px.svg index 0db873ac0..ba0a8bf2e 100644 --- a/resources/builtin/dark/actions/dr_import_photo_128px.svg +++ b/resources/builtin/dark/actions/dr_import_photo_128px.svg @@ -5,13 +5,13 @@ - + - + - + From 720aa908756a6013ebdf4c8e6ecf60009f896efa Mon Sep 17 00:00:00 2001 From: fuqian Date: Mon, 17 Aug 2026 13:54:30 +0800 Subject: [PATCH 31/63] fix(icon): resolve dark-theme icon overlap via merged path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log: 深色主题下 import_photo 图标线条互相覆盖 Bug: https://pms.uniontech.com/bug-view-373779.html 问题根因: SVG 父级 g 元素设置 opacity=0.3, 每个子元素 (path/rect/circle) 的 alpha 均为 0.3. 当多个子元素几何重叠时 (文档外形与下载圆圈), alpha 通道相加 (0.3+0.3=0.6), 导致图标边缘出现线条互相覆盖的视觉重合. 修复方案: 将所有形状合并为单个 path, 使用 fill-rule="evenodd" 处理子形状 间的切割关系. 由于整个图标仅一个元素, 只有一层 alpha, 彻底消除 alpha 叠加. 首个 path 设置 fill-opacity=0.4 作为文档底板, 第二个 path fill="#FFFFFF" 绘制可见的图标线条 (文档轮廓/横线/下载圆/箭头). 验证: Qt SVG 渲染器 256px 渲染, alpha 重叠区 (sum>360) 从 223 降至 0. Influence: 仅修改深色主题图标资源文件, 不涉及代码逻辑, 图标语义 (文档+下载箭头) 保持不变. PMS: BUG-373779 --- .../dark/actions/dr_import_photo_128px.svg | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/resources/builtin/dark/actions/dr_import_photo_128px.svg b/resources/builtin/dark/actions/dr_import_photo_128px.svg index ba0a8bf2e..17cc55983 100644 --- a/resources/builtin/dark/actions/dr_import_photo_128px.svg +++ b/resources/builtin/dark/actions/dr_import_photo_128px.svg @@ -2,17 +2,10 @@ 添加文档 - - - - - - - - - - - + + + + From a0acd1b65a2fe93b6aec55d4b19a7f58067a12f6 Mon Sep 17 00:00:00 2001 From: fuqian Date: Mon, 17 Aug 2026 14:08:56 +0800 Subject: [PATCH 32/63] fix(icon): add accessibility attributes to svg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log: 为 import_photo 图标添加无障碍访问属性 Bug: https://pms.uniontech.com/bug-view-373779.html 采纳自动评审建议, 给 添加 role="img" aria-labelledby, 给 添加 id, 增强屏幕阅读器对图标的语义识别。 不影响渲染效果 (Qt 渲染像素 MD5 与前次一致)。 Influence: 仅修改图标资源文件的无障碍属性, 不影响视觉渲染。 PMS: BUG-373779 --- resources/builtin/dark/actions/dr_import_photo_128px.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/builtin/dark/actions/dr_import_photo_128px.svg b/resources/builtin/dark/actions/dr_import_photo_128px.svg index 17cc55983..2633e72c0 100644 --- a/resources/builtin/dark/actions/dr_import_photo_128px.svg +++ b/resources/builtin/dark/actions/dr_import_photo_128px.svg @@ -1,6 +1,6 @@ - - 添加文档 + + 添加文档 From 92a73703cf94bb21e1cfb04cd9859f5533ba957d Mon Sep 17 00:00:00 2001 From: F-windy <135823805+F-windy@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:25:51 +0800 Subject: [PATCH 33/63] fix(sidebar): align catalog scrollbar to far-right edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Set mainLayout contentsMargins to (0,0,0,0) in CatalogWidget 2. CatalogTreeView vertical scrollbar no longer floats 9px inside 3. Aligns CatalogWidget with other 4 sidebar scroll components Log: fix catalog sidebar scrollbar floating inside 9px gutter Influence: catalog scrollbar now lands on sidebar far-right edge fix(sidebar): 目录侧边栏滚动条对齐至右边缘 1. 设置 CatalogWidget mainLayout contentsMargins 为 (0,0,0,0) 2. 目录树垂直滚动条不再内缩 9px 3. 与侧边栏其余 4 个滚动组件统一边距 Log: 修复目录侧边栏滚动条内缩 9px 的问题 PMS: BUG-375255 Influence: 目录滚动条现贴齐侧边栏右边缘,与其他组件一致 --- reader/sidebar/CatalogWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/reader/sidebar/CatalogWidget.cpp b/reader/sidebar/CatalogWidget.cpp index 2de2ba725..1071b9579 100644 --- a/reader/sidebar/CatalogWidget.cpp +++ b/reader/sidebar/CatalogWidget.cpp @@ -48,6 +48,7 @@ void CatalogWidget::initWidget() titleLayout->addWidget(titleLabel); QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->addLayout(titleLayout); From ae9cc07f55e0fe18d4ce2ea99861968ef42b8ced Mon Sep 17 00:00:00 2001 From: F-windy <135823805+F-windy@users.noreply.github.com> Date: Fri, 28 Aug 2026 14:11:47 +0800 Subject: [PATCH 34/63] fix(catalog): use default text color for page numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Page number items used textTips() color, a semi-transparent low-contrast hint color 2. The color was cached as a static QBrush at creation and never updated on theme switch 3. Remove setForeground() so page numbers fall back to the view default opaque text color 4. Page numbers now follow the standard content text color and adapt to theme changes Log: Remove textTips() foreground from catalog page numbers Influence: Page numbers now readable in light and dark themes fix(catalog): 目录页码使用默认文本色 1. 目录页码项使用 textTips() 颜色,为半透明低对比度的提示色 2. 该颜色在创建时缓存为静态 QBrush,主题切换后不更新 3. 移除 setForeground() 调用,页码改用视图默认不透明文本色 4. 页码现跟随标准内容文本色,随主题切换自动适配 Log: 移除目录页码的 textTips 前景色设置 PMS: BUG-375491 Influence: 浅色和深色主题下页码均可清晰显示 --- reader/sidebar/CatalogTreeView.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/reader/sidebar/CatalogTreeView.cpp b/reader/sidebar/CatalogTreeView.cpp index 71d4fe289..91d2e55c3 100644 --- a/reader/sidebar/CatalogTreeView.cpp +++ b/reader/sidebar/CatalogTreeView.cpp @@ -168,8 +168,6 @@ QList CatalogTreeView::getItemList(const QString &title, const item1->setData(realleft, Qt::UserRole + 2); item1->setData(realtop, Qt::UserRole + 3); item1->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); - QColor color = Dtk::Gui::DGuiApplicationHelper::instance()->applicationPalette().textTips().color(); - item1->setForeground(QBrush(color)); qCDebug(appLog) << "CatalogTreeView::getItemList() - Returning item list"; return QList() << item << item1; From 13821ae37427c3ceaad26b1b1b1d4fae1994954b Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Thu, 17 Sep 2026 19:06:56 +0800 Subject: [PATCH 35/63] chore: Update version to 6.6.0 - update version to 6.6.0 log: update version to 6.6.0 --- debian/changelog | 40 ++++++++++++++++++++++++++++++++++++++++ linglong.yaml | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 469eeb967..b5a48cac0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,43 @@ +deepin-reader (6.6.0) unstable; urgency=medium + + * chore: Update version to 6.6.0 + * fix(catalog): use default text color for page numbers + * fix(sidebar): align catalog scrollbar to far-right edge + * fix(icon): add accessibility attributes to svg + * fix(icon): resolve dark-theme icon overlap via merged path + * fix(icon): remove fill to resolve dark-theme overlap + * fix(icon): remove dead defs and invalid xlink:href + * fix(icon): simplify import_photo svg structure + * fix(batchprint): link OfdModel and rofd into batch print converter + * fix(reader): invert sidebar thumbnails only under dark theme + * fix(database): synchronize cleanup of bookmarks and tab groups in orphan states + * fix(reader): pin render task lifetime to renderer ref and uuid + * feat(batch-print): add headless batch print for pdf/docx/djvu/xps + * chore(docs): remove non-standard docs/superpowers directory + * fix(reader): clamp OFD render slices to page canvas + * [skip CI] Translate deepin-reader.ts in fi + * docs(ofd): document post-rebase compatibility checks + * test(sidebar): detect Qt version in focused appearance checks + * fix(reader): preserve explicit navigation during state restoration + * docs(ofd): record navigation integration verification + * feat(ofd): connect page links to typed navigation + * feat(reader): expose full OFD catalogs and typed navigation + * feat(ofd): adapt outline trees and navigation destinations + * feat(reader): add typed navigation targets and view calculations + * docs(ofd): plan navigation and page link integration + * docs(ofd): define outline and page link integration + * docs(ofd): record semantic text integration design and plan + * feat(ofd): surface document parsing warnings + * feat(ofd): expose document metadata and identifiers + * feat(ofd): render page regions with bounded memory + * fix(ofd): expose search in reader UI + * feat(ofd): integrate semantic text support + * fix(sidebar): align thumbnail appearance with eye protection mode + * build: depend on distro librofd-ffi packages for OFD support + * feat(reader): add OFD document support via rofd C ABI + + -- zhanghongyuan Thu, 17 Sep 2026 19:06:40 +0800 + deepin-reader (6.5.65) unstable; urgency=medium * chore: Update version to 6.5.65 diff --git a/linglong.yaml b/linglong.yaml index 9e69099a1..792779dff 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.5.65.1 + version: 6.6.0.1 kind: app description: | reader for deepin os. From 2713c9ed2b3fa0f1d4600187408207c4321dc0e7 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Sat, 19 Sep 2026 00:43:06 +0800 Subject: [PATCH 36/63] fix(reader): correct null-page guard operator in render callback slots 1. Five async render callback slots used `nullptr != task.page && !existPage(task.page)` as the guard, which short-circuits to false when task.page is null, falling through to dereference the null pointer 2. Change the operator from `&&` to `||` so the guard returns early when task.page is null OR the page has been destroyed, preventing null-pointer dereference 3. Affected functions: onDocPageNormalImageTaskFinished, onDocPageSliceImageTaskFinished, onDocPageBigImageTaskFinished, onDocPageWordTaskFinished, onDocPageAnnotationTaskFinished 4. Adapt _002 series unit tests: add existPage stub returning true and set non-null placeholder page pointer so stubbed handlers are still invoked Log: Fix null-page guard operator in PageRenderThread render callback slots Influence: Prevents crash when async render callback delivers to a null page --- reader/browser/PageRenderThread.cpp | 20 ++++++++++---------- tests/browser/ut_pagerenderthread.cpp | 23 ++++++++++++++++++----- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/reader/browser/PageRenderThread.cpp b/reader/browser/PageRenderThread.cpp index ba38b29c4..906f5da8d 100644 --- a/reader/browser/PageRenderThread.cpp +++ b/reader/browser/PageRenderThread.cpp @@ -916,8 +916,8 @@ void PageRenderThread::onDocPageNormalImageTaskFinished(DocPageNormalImageTask t { // qCDebug(appLog) << "PageRenderThread::onDocPageNormalImageTaskFinished() - Starting on doc page normal image task finished"; if (DocSheet::existSheet(task.sheet)) { - if (nullptr != task.page && !BrowserPage::existPage(task.page)) - return; // 页面已析构,丢弃残留回包(task.page 非空时必须存活才可解引用) + if (nullptr == task.page || !BrowserPage::existPage(task.page)) + return; // 页面为空或已析构,丢弃残留回包 task.page->setImageObjectRects(task.imageRects, task.rect.width(), task.rect.height()); task.page->handleRenderFinished(task.pixmapId, pixmap); } @@ -928,8 +928,8 @@ void PageRenderThread::onDocPageSliceImageTaskFinished(DocPageSliceImageTask tas { // qCDebug(appLog) << "PageRenderThread::onDocPageSliceImageTaskFinished() - Starting on doc page slice image task finished"; if (DocSheet::existSheet(task.sheet)) { - if (nullptr != task.page && !BrowserPage::existPage(task.page)) - return; // 页面已析构,丢弃残留回包 + if (nullptr == task.page || !BrowserPage::existPage(task.page)) + return; // 页面为空或已析构,丢弃残留回包 task.page->handleRenderFinished(task.pixmapId, pixmap, task.slice); } // qCDebug(appLog) << "PageRenderThread::onDocPageSliceImageTaskFinished() - On doc page slice image task finished completed"; @@ -939,8 +939,8 @@ void PageRenderThread::onDocPageBigImageTaskFinished(DocPageBigImageTask task, Q { // qCDebug(appLog) << "PageRenderThread::onDocPageBigImageTaskFinished() - Starting on doc page big image task finished"; if (DocSheet::existSheet(task.sheet)) { - if (nullptr != task.page && !BrowserPage::existPage(task.page)) - return; // 页面已析构,丢弃残留回包 + if (nullptr == task.page || !BrowserPage::existPage(task.page)) + return; // 页面为空或已析构,丢弃残留回包 task.page->setImageObjectRects(task.imageRects, task.rect.width(), task.rect.height()); task.page->handleRenderFinished(task.pixmapId, pixmap); } @@ -951,8 +951,8 @@ void PageRenderThread::onDocPageWordTaskFinished(DocPageWordTask task, QListhandleWordLoaded(words); } // qCDebug(appLog) << "PageRenderThread::onDocPageWordTaskFinished() - On doc page word task finished completed"; @@ -962,8 +962,8 @@ void PageRenderThread::onDocPageAnnotationTaskFinished(DocPageAnnotationTask tas { // qCDebug(appLog) << "PageRenderThread::onDocPageAnnotationTaskFinished() - Starting on doc page annotation task finished"; if (DocSheet::existSheet(task.sheet)) { - if (nullptr != task.page && !BrowserPage::existPage(task.page)) - return; // 页面已析构,丢弃残留回包 + if (nullptr == task.page || !BrowserPage::existPage(task.page)) + return; // 页面为空或已析构,丢弃残留回包 task.page->handleAnnotationLoaded(annots); } // qCDebug(appLog) << "PageRenderThread::onDocPageAnnotationTaskFinished() - On doc page annotation task finished completed"; diff --git a/tests/browser/ut_pagerenderthread.cpp b/tests/browser/ut_pagerenderthread.cpp index c7904c299..9dd73b7cc 100644 --- a/tests/browser/ut_pagerenderthread.cpp +++ b/tests/browser/ut_pagerenderthread.cpp @@ -114,6 +114,14 @@ static bool existSheet_true_stub(DocSheet *) return true; } +// Makes BrowserPage::existPage() return true so the onDoc*Finished guard +// (nullptr == task.page || !existPage(task.page)) passes with a non-null +// placeholder page whose handler methods are already stubbed. +static bool existPage_true_stub(const BrowserPage *) +{ + return true; +} + /*********测试用例**********/ //TEST_F(TestPageRenderThread, UT_PageRenderThread_clearImageTasks_001) //{ @@ -234,12 +242,13 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocPageNormalImageTaskFinishe { Stub s; s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(BrowserPage, existPage), existPage_true_stub); s.set(ADDR(BrowserPage, handleRenderFinished), handleRenderFinished_stub); s.set(ADDR(BrowserPage, setImageObjectRects), setImageObjectRects_stub); DocPageNormalImageTask task; task.sheet = nullptr; // existSheet is stubbed to return true anyway - task.page = nullptr; // stub will be invoked, nullptr this is ignored + task.page = reinterpret_cast(0x1); // non-null placeholder; handler methods are stubbed task.pixmapId = 1; QPixmap pix; m_tester->onDocPageNormalImageTaskFinished(task, pix); @@ -252,11 +261,12 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocPageSliceImageTaskFinished { Stub s; s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(BrowserPage, existPage), existPage_true_stub); s.set(ADDR(BrowserPage, handleRenderFinished), handleRenderFinished_stub); DocPageSliceImageTask task; task.sheet = nullptr; - task.page = nullptr; + task.page = reinterpret_cast(0x1); task.pixmapId = 2; task.slice = QRect(0, 0, 10, 10); QPixmap pix; @@ -270,12 +280,13 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocPageBigImageTaskFinished_0 { Stub s; s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(BrowserPage, existPage), existPage_true_stub); s.set(ADDR(BrowserPage, handleRenderFinished), handleRenderFinished_stub); s.set(ADDR(BrowserPage, setImageObjectRects), setImageObjectRects_stub); DocPageBigImageTask task; task.sheet = nullptr; - task.page = nullptr; + task.page = reinterpret_cast(0x1); task.pixmapId = 3; QPixmap pix; m_tester->onDocPageBigImageTaskFinished(task, pix); @@ -288,11 +299,12 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocPageWordTaskFinished_002) { Stub s; s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(BrowserPage, existPage), existPage_true_stub); s.set(ADDR(BrowserPage, handleWordLoaded), handleWordLoaded_stub); DocPageWordTask task; task.sheet = nullptr; - task.page = nullptr; + task.page = reinterpret_cast(0x1); QList words; m_tester->onDocPageWordTaskFinished(task, words); EXPECT_TRUE(g_funcName == "handleWordLoaded_stub"); @@ -304,11 +316,12 @@ TEST_F(TestPageRenderThread, UT_PageRenderThread_onDocPageAnnotationTaskFinished { Stub s; s.set(ADDR(DocSheet, existSheet), existSheet_true_stub); + s.set(ADDR(BrowserPage, existPage), existPage_true_stub); s.set(ADDR(BrowserPage, handleAnnotationLoaded), handleAnnotationLoaded_stub); DocPageAnnotationTask task; task.sheet = nullptr; - task.page = nullptr; + task.page = reinterpret_cast(0x1); QList annots; m_tester->onDocPageAnnotationTaskFinished(task, annots); EXPECT_TRUE(g_funcName == "handleAnnotationLoaded_stub"); From 87210860c1efd306fa600677bef2fdcade5ed36e Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Fri, 18 Sep 2026 21:05:41 +0800 Subject: [PATCH 37/63] fix: replace unsafe strcpy with memcpy in setLibNames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: setLibNames() used strcpy() which does not bound the copy length, flagged by clang-analyzer as CWE-119 risk 2. Fix: extract size_t len = strlen(tmp.chDocumentPr) + 1, use memcpy with len for bounded copy, reuse len for malloc too 3. Impact: no behavior change, memcpy copies identical content including null terminator, eliminates redundant strlen call Influence: 1. Verify application startup loads dynamic library path correctly 2. Verify document processing functions work as expected 3. No regression expected as copy semantics are identical fix: 替换 setLibNames 中不安全的 strcpy 为 memcpy 1. 根因:setLibNames() 使用 strcpy() 进行拷贝,该函数不限制拷贝 长度,被 clang-analyzer 标记为 CWE-119 安全风险 2. 方案:提取 size_t len = strlen(tmp.chDocumentPr) + 1 变量, 使用 memcpy 配合 len 做有界拷贝,len 同时复用于 malloc 3. 影响:无行为变化,memcpy 拷贝内容与 strcpy 完全一致(含 null 终止符),同时消除冗余 strlen 调用 Influence: 1. 验证应用启动时动态库路径正确加载 2. 验证文档处理功能正常工作 3. 拷贝语义完全一致,预期无回归 PMS: BUG-212 --- reader/load_libs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reader/load_libs.c b/reader/load_libs.c index e200a2bac..31307401c 100755 --- a/reader/load_libs.c +++ b/reader/load_libs.c @@ -115,12 +115,12 @@ void setLibNames(LoadLibNames tmp) g_ldnames.chDocumentPr = NULL; } else { fprintf(stderr, "INFO: Copying library path: %s\n", tmp.chDocumentPr); - g_ldnames.chDocumentPr = (char*)malloc(strlen(tmp.chDocumentPr)+1); + size_t len = strlen(tmp.chDocumentPr) + 1; + g_ldnames.chDocumentPr = (char*)malloc(len); if (!g_ldnames.chDocumentPr) { fprintf(stderr, "ERROR: Failed to allocate memory for library path\n"); return; } - strcpy(g_ldnames.chDocumentPr,tmp.chDocumentPr); + memcpy(g_ldnames.chDocumentPr, tmp.chDocumentPr, len); } } - From 9e61ce277aaa2cb0ccf5e32c4298631b0845e11a Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Fri, 18 Sep 2026 19:25:27 +0800 Subject: [PATCH 38/63] fix: guard null sidebar pointer in setAlive close path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: m_sidebar is initialized to nullptr and the same function already guards with "if (m_sidebar && ...)" at line 1776, but the changeResetModelData() call at line 1800 omits the null check, causing a potential null pointer dereference 2. Fix: add "if (m_sidebar)" guard before calling changeResetModelData() to skip the call when sidebar is null 3. Impact: no behavior change when sidebar is non-null; prevents crash when sidebar pointer is null during document close path Influence: 1. Test opening and closing documents with sidebar visible 2. Test closing documents when sidebar is not initialized 3. Verify no regression on annotation save and bookmark persistence fix: 修复关闭文档路径中侧边栏空指针解引用 1. 根因:m_sidebar 初始化为 nullptr,同函数第 1776 行已有 "if (m_sidebar && ...)" 守卫,但第 1800 行调用 changeResetModelData() 时遗漏空检查,存在空指针解引用风险 2. 方案:在调用 changeResetModelData() 前增加 "if (m_sidebar)" 守卫,指针为空时跳过调用 3. 影响:侧边栏非空时行为不变;侧边栏为空时避免崩溃 Influence: 1. 测试侧边栏可见时打开和关闭文档 2. 测试侧边栏未初始化时关闭文档 3. 验证批注保存和书签持久化无回归 PMS: BUG-213 --- reader/uiframe/DocSheet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reader/uiframe/DocSheet.cpp b/reader/uiframe/DocSheet.cpp index a07111aa9..df567eb35 100644 --- a/reader/uiframe/DocSheet.cpp +++ b/reader/uiframe/DocSheet.cpp @@ -1797,7 +1797,9 @@ void DocSheet::setAlive(bool alive) if (m_documentChanged && m_renderer) { if (m_renderer->save()) { m_documentChanged = false; - m_sidebar->changeResetModelData(); + if (m_sidebar) { + m_sidebar->changeResetModelData(); + } // 注释保存后文件内容已变化,重写书签刷新内容指纹, // 避免下次打开时书签因指纹不匹配被误判为旧文件遗留 Database::instance()->saveBookmarks(filePath(), m_bookmarks); From 122ea004f8068d98be787ca44b094b4b199f95b8 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Sun, 20 Sep 2026 13:20:08 +0800 Subject: [PATCH 39/63] fix(reader): guard null annotation and event pointers - check the annotation pointer first in BrowserPage::removeAllAnnotation so a null entry from the renderer cannot be dereferenced by contents()/boundary() - null-check the event before testing its type in SheetBrowser::gestureEvent handling --- reader/browser/BrowserPage.cpp | 2 +- reader/browser/SheetBrowser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reader/browser/BrowserPage.cpp b/reader/browser/BrowserPage.cpp index cf0a37c4f..708c39bc3 100644 --- a/reader/browser/BrowserPage.cpp +++ b/reader/browser/BrowserPage.cpp @@ -1031,7 +1031,7 @@ bool BrowserPage::removeAllAnnotation() for (int index = 0; index < m_annotations.size(); index++) { deepin_reader::Annotation *annota = m_annotations.at(index); - if (!m_annotations.contains(annota) || (annota && annota->contents().isEmpty())) + if (!annota || !m_annotations.contains(annota) || annota->contents().isEmpty()) continue; annoBoundaries << annota->boundary(); diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index 74adbbd78..433304ac4 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -922,7 +922,7 @@ bool SheetBrowser::event(QEvent *event) } } - if (event->type() == QEvent::Gesture) { + if (event && event->type() == QEvent::Gesture) { // qCDebug(appLog) << "SheetBrowser::event() - Gesture event"; return gestureEvent(reinterpret_cast(event)); } From e7bc32c2168af1bc3c6fbd43c0df309f69154213 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Fri, 18 Sep 2026 13:38:09 +0800 Subject: [PATCH 40/63] feat(build): add sources to rofd to support OFD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增 sources 拉取 rofd 源码,装 cargo/rustc 及 libjbig2dec0-dev 2. cargo 构建 rofd-ffi,安装 so 与头文件 3. CMake 加 -DROFD_ROOT,LDD_FILES 加 librofd_ffi.so / libjbig2dec.so 1. Add sources to fetch rofd, install cargo/rustc and libjbig2dec0-dev 2. Build rofd-ffi with cargo, install so and header 3. Add -DROFD_ROOT to CMake, add librofd_ffi.so / libjbig2dec.so to LDD_FILES Log: 源码构建 rofd-ffi 并打包 libjbig2dec,新增 OFD 支持 Influence: deepin-reader 支持 OFD 渲染,运行时依赖自带 --- linglong.yaml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/linglong.yaml b/linglong.yaml index 792779dff..34b9cfd5f 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -15,6 +15,11 @@ package: base: org.deepin.base/25.2.2 runtime: org.deepin.runtime.webengine/6.7.0 +sources: + - kind: git + url: https://github.com/linuxdeepin/rofd.git + commit: 96d9f8b8a1075ab57dc496da90d2891731003129 + command: - deepin-reader @@ -22,9 +27,50 @@ build: | # 下载和安装依赖 # libqt6waylandclient6: libdtk6gui 的隐式依赖(未在 deb 声明),必须随 apt 的 Qt 6.8.0 一起打包, # 否则链接时会拉取 /runtime 中 webengine 运行时的 libQt6WaylandClient,其私有 ABI 与打包的 Qt 不一致导致链接失败 - apt -y install --download-only qt6-base-dev qt6-base-dev-tools qt6-tools-dev libdtk6widget-dev libspectre-dev libdjvulibre-dev libtiff-dev libjpeg-dev libicu-dev libpng-dev zlib1g-dev liblcms2-dev libopenjp2-7-dev libfreetype6-dev libgtest-dev libchardet-dev qt6-webengine-dev qt6-5compat-dev libdtk6gui-dev libdtk6core-dev qt6-svg-dev pandoc libgxps-dev libcairo2-dev libglib2.0-dev libqt6waylandclient6 - # 第三个参数强制安装 runtime 已提供的 libqt6waylandclient6,保证其与打包的 Qt 版本一致 - bash ./install_dep /var/cache/apt/archives "$PREFIX" "libqt6waylandclient6" + apt -y install --download-only qt6-base-dev qt6-base-dev-tools qt6-tools-dev libdtk6widget-dev libspectre-dev libdjvulibre-dev libtiff-dev libjpeg-dev libicu-dev libpng-dev zlib1g-dev liblcms2-dev libopenjp2-7-dev libfreetype6-dev libgtest-dev libchardet-dev qt6-webengine-dev qt6-5compat-dev libdtk6gui-dev libdtk6core-dev qt6-svg-dev pandoc libgxps-dev libcairo2-dev libglib2.0-dev libqt6waylandclient6 cargo rustc pkg-config libjbig2dec0-dev + # 供 rofd 源码构建使用:cargo/rustc 构建工具链;pkg-config 供 sys crate 探测系统库; + # libjbig2dec0-dev 对应 rofd-render 默认开启的 jbig2 特性(cairo/freetype/glib 的 -dev 已在上方列表中) + # libjbig2dec0 已被 base 安装,上面的 --download-only 不会下载其 deb,用 --reinstall + # 强制下载;注意必须先于下方 install_dep 执行,install_dep 才能在 archives 里找到它 + apt -y install --download-only --reinstall libjbig2dec0 + # 第三个参数强制安装 runtime 已提供的 libqt6waylandclient6;libjbig2dec0 是 rofd 的运行时 + # 依赖(jbig2 特性),base 虽自带,但为不随 base 组成变化而破,强制解压随包分发 + bash ./install_dep /var/cache/apt/archives "$PREFIX" "libqt6waylandclient6,libjbig2dec0" + + # cargo/rustc 等构建工具由 install_dep 解压到 $PREFIX,加入 PATH 供 rofd 构建调用 + export PATH="$PREFIX/bin:$PATH" + + # ================= 从源码构建 rofd(OFD 支持库) ================= + # 源码来自上方 sources 段;crates.io 依赖由 Cargo.lock 固定,构建机需可访问 github 与 crates.io + ROFD_SRC="" + for d in /project/linglong/sources/rofd /project/sources/rofd /project/rofd /source/rofd; do + if [ -f "$d/Cargo.toml" ] && [ -f "$d/crates/rofd-ffi/include/rofd.h" ]; then ROFD_SRC="$d"; break; fi + done + if [ -z "$ROFD_SRC" ]; then + ROFD_SRC=$(find /project -maxdepth 8 -type f -path "*/crates/rofd-ffi/include/rofd.h" 2>/dev/null | head -1 | sed 's|/crates/rofd-ffi/include/rofd.h$||') + fi + if [ ! -f "$ROFD_SRC/Cargo.toml" ] || [ ! -f "$ROFD_SRC/crates/rofd-ffi/include/rofd.h" ]; then + echo "ERROR: 未找到 rofd 源码,sources 拉取失败?检查构建机对 github.com 的访问权限" >&2 + exit 1 + fi + echo ">>> rofd 源码: $ROFD_SRC (commit: $(git -C $ROFD_SRC rev-parse --short HEAD 2>/dev/null || echo unknown))" + # 增量构建会复用容器 /tmp,旧产物指纹可能指向旧源码路径,先清理 + rm -rf /tmp/rofd-build + # 仅构建 OFD 支持所需的 C ABI 库(rofd-ffi),不构建 rofd Qt 应用(无需 QML 相关依赖) + # 在子 shell 中 cd 进仓库再执行:cargo 从 cwd 向上查找 .cargo/config.toml(离线 vendor 配置) + # 依赖它生效;--manifest-path 不参与配置查找,在 /project 下跑会走 crates.io 导致 CI 无外网时失败。 + # 必须用子 shell:否则 cwd 停留在 rofd 目录,后续 build/ 与 cmake .. 等相对路径全部错位 + (cd "$ROFD_SRC" && CARGO_TARGET_DIR=/tmp/rofd-build cargo build --release -p rofd-ffi) + # 安装到与 librofd-ffi0/librofd-ffi-dev deb 解包完全相同的布局(soname 由 rofd build.rs 固定为 librofd_ffi.so.0, + # deploy_dep 与主工程 CMake 的 find_path/find_library 依赖这些路径) + ROFD_FFI_VER=$(sed -n 's/^version = "\(.*\)"/\1/p' "$ROFD_SRC/crates/rofd-ffi/Cargo.toml" | head -1) + install -d -m 0755 $PREFIX/lib/${TRIPLET} $PREFIX/include + install -m 0755 /tmp/rofd-build/release/librofd_ffi.so $PREFIX/lib/${TRIPLET}/librofd_ffi.so.$ROFD_FFI_VER + ln -sf librofd_ffi.so.$ROFD_FFI_VER $PREFIX/lib/${TRIPLET}/librofd_ffi.so.0 + ln -sf librofd_ffi.so.0 $PREFIX/lib/${TRIPLET}/librofd_ffi.so + install -m 0644 "$ROFD_SRC/crates/rofd-ffi/include/rofd.h" $PREFIX/include/rofd.h + # 刷新 ld 缓存,保证后续 ldd/deploy_dep 能解析 $PREFIX 下 rofd 的运行时依赖(如 libjbig2dec) + if [ -n "$LINGLONG_LD_SO_CACHE" ]; then ldconfig -C "$LINGLONG_LD_SO_CACHE"; fi # 构建(CMake) rm -rf build && mkdir -p build && cd build @@ -33,6 +79,7 @@ build: | -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DCMAKE_INSTALL_LIBDIR=lib/${TRIPLET} \ -DCMAKE_PREFIX_PATH=${PREFIX} \ + -DROFD_ROOT=${PREFIX} \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}" make -j$(nproc) @@ -50,6 +97,11 @@ build: | libQt6WaylandClient.so # 定制插件不存在 libzpdcallback.so + # OFD 支持库,sources 方式源码构建(soname 为 librofd_ffi.so.0,deploy_dep 的 .so 通配 + # 会同时收编 .so/.so.0/.so.);libjbig2dec 为 rofd 默认 jbig2 特性的运行时依赖, + # runtime(webengine) 不提供,必须随包分发 + librofd_ffi.so + libjbig2dec.so ) # 生成.install 文件 From ac1d2d8af4e431ecf746eae18bd14efa60e02153 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Sun, 20 Sep 2026 13:44:48 +0800 Subject: [PATCH 41/63] fix(batchprint): send DBus notification with correct argument signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDBusInterface::call() with a QVariantList marshalled all args into one 'av' parameter, which the deepin notification daemon rejects, so every notification fell back to invisible stderr. Use QDBusMessage:: setArguments() to send the 8 separate parameters. Also update all language ts files with lupdate and fill zh_CN/zh_HK/zh_TW translations. QDBusInterface::call() 传入 QVariantList 时会把全部参数编码为单个 'av' 参数,被 deepin 通知服务拒绝,导致所有通知静默回退到不可见 的 stderr。改用 QDBusMessage::setArguments() 发送 8 个独立参数; 同时用 lupdate 更新全部语言 ts 文件并补充 zh_CN/zh_HK/zh_TW 翻译。 Log: 修复批量打印无打印机时无错误提示的问题 Influence: 批量打印的成功/失败/错误通知可正常弹出,通知文案支持简繁中文。 --- batch-print/notifyclient.cpp | 57 +- batch-print/notifyclient.h | 5 + tests/batch-print/ut_notifyclient.cpp | 47 ++ translations/deepin-reader.ts | 311 ++++++----- translations/deepin-reader_af.ts | 488 +++++++++++------ translations/deepin-reader_am_ET.ts | 488 +++++++++++------ translations/deepin-reader_ar.ts | 325 ++++++----- translations/deepin-reader_az.ts | 468 ++++++++++------ translations/deepin-reader_bg.ts | 488 +++++++++++------ translations/deepin-reader_bn.ts | 468 ++++++++++------ translations/deepin-reader_bo.ts | 309 ++++++----- translations/deepin-reader_br.ts | 488 +++++++++++------ translations/deepin-reader_ca.ts | 468 ++++++++++------ translations/deepin-reader_cs.ts | 375 ++++++++----- translations/deepin-reader_da.ts | 468 ++++++++++------ translations/deepin-reader_de.ts | 468 ++++++++++------ translations/deepin-reader_el.ts | 468 ++++++++++------ translations/deepin-reader_en_AU.ts | 756 +++++++++++++++----------- translations/deepin-reader_eo.ts | 488 +++++++++++------ translations/deepin-reader_es.ts | 373 ++++++++----- translations/deepin-reader_et.ts | 468 ++++++++++------ translations/deepin-reader_eu.ts | 488 +++++++++++------ translations/deepin-reader_fa.ts | 486 +++++++++++------ translations/deepin-reader_fi.ts | 317 ++++++----- translations/deepin-reader_fil.ts | 488 +++++++++++------ translations/deepin-reader_fr.ts | 468 ++++++++++------ translations/deepin-reader_gl_ES.ts | 468 ++++++++++------ translations/deepin-reader_he.ts | 468 ++++++++++------ translations/deepin-reader_hi_IN.ts | 468 ++++++++++------ translations/deepin-reader_hr.ts | 472 ++++++++++------ translations/deepin-reader_hu.ts | 466 ++++++++++------ translations/deepin-reader_hy.ts | 488 +++++++++++------ translations/deepin-reader_id.ts | 468 ++++++++++------ translations/deepin-reader_it.ts | 373 ++++++++----- translations/deepin-reader_ja.ts | 466 ++++++++++------ translations/deepin-reader_ka.ts | 488 +++++++++++------ translations/deepin-reader_km_KH.ts | 488 +++++++++++------ translations/deepin-reader_kn_IN.ts | 488 +++++++++++------ translations/deepin-reader_ko.ts | 466 ++++++++++------ translations/deepin-reader_ku.ts | 488 +++++++++++------ translations/deepin-reader_ku_IQ.ts | 488 +++++++++++------ translations/deepin-reader_ky.ts | 488 +++++++++++------ translations/deepin-reader_lo.ts | 484 +++++++++++------ translations/deepin-reader_lt.ts | 470 ++++++++++------ translations/deepin-reader_ml.ts | 488 +++++++++++------ translations/deepin-reader_mn.ts | 488 +++++++++++------ translations/deepin-reader_mr.ts | 488 +++++++++++------ translations/deepin-reader_ms.ts | 466 ++++++++++------ translations/deepin-reader_my.ts | 486 +++++++++++------ translations/deepin-reader_nb.ts | 468 ++++++++++------ translations/deepin-reader_ne.ts | 488 +++++++++++------ translations/deepin-reader_nl.ts | 468 ++++++++++------ translations/deepin-reader_pa.ts | 468 ++++++++++------ translations/deepin-reader_pl.ts | 470 ++++++++++------ translations/deepin-reader_pt.ts | 373 ++++++++----- translations/deepin-reader_pt_BR.ts | 373 ++++++++----- translations/deepin-reader_ro.ts | 470 ++++++++++------ translations/deepin-reader_ru.ts | 375 ++++++++----- translations/deepin-reader_si.ts | 468 ++++++++++------ translations/deepin-reader_sk.ts | 490 +++++++++++------ translations/deepin-reader_sl.ts | 472 ++++++++++------ translations/deepin-reader_sq.ts | 468 ++++++++++------ translations/deepin-reader_sr.ts | 470 ++++++++++------ translations/deepin-reader_sv.ts | 317 ++++++----- translations/deepin-reader_sw.ts | 488 +++++++++++------ translations/deepin-reader_ta.ts | 500 +++++++++++------ translations/deepin-reader_th.ts | 486 +++++++++++------ translations/deepin-reader_tr.ts | 466 ++++++++++------ translations/deepin-reader_ug.ts | 311 ++++++----- translations/deepin-reader_uk.ts | 470 ++++++++++------ translations/deepin-reader_ur.ts | 488 +++++++++++------ translations/deepin-reader_vi.ts | 466 ++++++++++------ translations/deepin-reader_zh_CN.ts | 462 +++++++++------- translations/deepin-reader_zh_HK.ts | 305 ++++++----- translations/deepin-reader_zh_TW.ts | 305 ++++++----- 75 files changed, 21602 insertions(+), 11205 deletions(-) diff --git a/batch-print/notifyclient.cpp b/batch-print/notifyclient.cpp index 8e3151956..be36f2a95 100644 --- a/batch-print/notifyclient.cpp +++ b/batch-print/notifyclient.cpp @@ -5,8 +5,7 @@ #include "notifyclient.h" #include "errormessages.h" -#include -#include +#include #include #include @@ -43,18 +42,13 @@ QString NotifyClient::buildBody(int total, int succeeded, const QStringList &fai return body; } -void NotifyClient::notifyResult(int total, int succeeded, const QStringList &failedFiles) +QDBusMessage NotifyClient::buildNotifyMessage(const QString &body) { - QString body = buildBody(total, succeeded, failedFiles); - - QDBusInterface iface(QStringLiteral("org.freedesktop.Notifications"), - QStringLiteral("/org/freedesktop/Notifications"), - QStringLiteral("org.freedesktop.Notifications")); - - if (!iface.isValid()) { - fprintf(stderr, "%s\n", body.toUtf8().constData()); - return; - } + QDBusMessage msg = QDBusMessage::createMethodCall( + QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("/org/freedesktop/Notifications"), + QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("Notify")); QVariantList args; args << QStringLiteral("deepin-reader"); @@ -65,36 +59,31 @@ void NotifyClient::notifyResult(int total, int succeeded, const QStringList &fai args << QStringList(); args << QVariantMap(); args << qint32(-1); + msg.setArguments(args); - QDBusMessage reply = iface.call(QStringLiteral("Notify"), args); - if (reply.type() == QDBusMessage::ErrorMessage) { - fprintf(stderr, "%s\n", body.toUtf8().constData()); - } + return msg; } -void NotifyClient::notifyError(const QString &body) +void NotifyClient::sendNotification(const QString &body) { - QDBusInterface iface(QStringLiteral("org.freedesktop.Notifications"), - QStringLiteral("/org/freedesktop/Notifications"), - QStringLiteral("org.freedesktop.Notifications")); - - if (!iface.isValid()) { + QDBusConnection bus = QDBusConnection::sessionBus(); + if (!bus.isConnected()) { fprintf(stderr, "%s\n", body.toUtf8().constData()); return; } - QVariantList args; - args << QStringLiteral("deepin-reader"); - args << quint32(0); - args << QStringLiteral("deepin-reader"); - args << ErrorMessages::notifyTitle(); - args << body; - args << QStringList(); - args << QVariantMap(); - args << qint32(-1); - - QDBusMessage reply = iface.call(QStringLiteral("Notify"), args); + QDBusMessage reply = bus.call(buildNotifyMessage(body)); if (reply.type() == QDBusMessage::ErrorMessage) { fprintf(stderr, "%s\n", body.toUtf8().constData()); } } + +void NotifyClient::notifyResult(int total, int succeeded, const QStringList &failedFiles) +{ + sendNotification(buildBody(total, succeeded, failedFiles)); +} + +void NotifyClient::notifyError(const QString &body) +{ + sendNotification(body); +} diff --git a/batch-print/notifyclient.h b/batch-print/notifyclient.h index d4880e4ba..719d65dd2 100644 --- a/batch-print/notifyclient.h +++ b/batch-print/notifyclient.h @@ -5,6 +5,7 @@ #ifndef NOTIFYCLIENT_H #define NOTIFYCLIENT_H +#include #include #include @@ -14,6 +15,10 @@ class NotifyClient static void notifyResult(int total, int succeeded, const QStringList &failedFiles); static void notifyError(const QString &body); static QString buildBody(int total, int succeeded, const QStringList &failedFiles); + static QDBusMessage buildNotifyMessage(const QString &body); + +private: + static void sendNotification(const QString &body); }; #endif // NOTIFYCLIENT_H diff --git a/tests/batch-print/ut_notifyclient.cpp b/tests/batch-print/ut_notifyclient.cpp index abad7969f..d0e6a02b8 100644 --- a/tests/batch-print/ut_notifyclient.cpp +++ b/tests/batch-print/ut_notifyclient.cpp @@ -6,7 +6,10 @@ #include "errormessages.h" #include +#include +#include #include +#include static int argc = 1; static char *argv[] = { const_cast("ut_notifyclient"), nullptr }; @@ -121,3 +124,47 @@ TEST_F(NotifyClientTest, NotifyErrorNoDefaultPrinterDoesNotCrash) { NotifyClient::notifyError(ErrorMessages::noDefaultPrinter()); SUCCEED(); } + +// Regression test for the "no error prompt without printer" bug: +// NotifyClient used to pass a QVariantList to QDBusInterface::call(), which +// marshalled the whole argument list as ONE 'av' parameter. The deepin +// notification daemon rejects signature 'av' with UnknownMethod, so every +// notification silently fell back to invisible stderr. The message must +// instead carry 8 separate arguments (signature susssasa{sv}i). +TEST_F(NotifyClientTest, BuildNotifyMessageHasEightSeparateArguments) { + QDBusMessage msg = NotifyClient::buildNotifyMessage( + QStringLiteral("test body")); + QVariantList args = msg.arguments(); + ASSERT_EQ(args.size(), 8); +} + +TEST_F(NotifyClientTest, BuildNotifyMessageArgumentTypesMatchSpec) { + QDBusMessage msg = NotifyClient::buildNotifyMessage( + QStringLiteral("test body")); + QVariantList args = msg.arguments(); + ASSERT_EQ(args.size(), 8); + + EXPECT_EQ(args.at(0).metaType().id(), QMetaType::QString); + EXPECT_EQ(args.at(1).metaType().id(), QMetaType::UInt); + EXPECT_EQ(args.at(2).metaType().id(), QMetaType::QString); + EXPECT_EQ(args.at(3).metaType().id(), QMetaType::QString); + EXPECT_EQ(args.at(4).metaType().id(), QMetaType::QString); + EXPECT_EQ(args.at(5).metaType().id(), QMetaType::QStringList); + EXPECT_EQ(args.at(6).metaType().id(), QMetaType::QVariantMap); + EXPECT_EQ(args.at(7).metaType().id(), QMetaType::Int); + EXPECT_FALSE(args.at(0).toString().isEmpty()); + EXPECT_EQ(args.at(4).toString(), QStringLiteral("test body")); + EXPECT_EQ(args.at(7).toInt(), -1); +} + +TEST_F(NotifyClientTest, BuildNotifyMessageTargetsNotificationService) { + QDBusMessage msg = NotifyClient::buildNotifyMessage( + QStringLiteral("test body")); + EXPECT_EQ(msg.service(), + QStringLiteral("org.freedesktop.Notifications")); + EXPECT_EQ(msg.path(), + QStringLiteral("/org/freedesktop/Notifications")); + EXPECT_EQ(msg.interface(), + QStringLiteral("org.freedesktop.Notifications")); + EXPECT_EQ(msg.member(), QStringLiteral("Notify")); +} diff --git a/translations/deepin-reader.ts b/translations/deepin-reader.ts index 3412543a8..67c5c1a59 100755 --- a/translations/deepin-reader.ts +++ b/translations/deepin-reader.ts @@ -9,7 +9,7 @@ Document Viewer - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -17,92 +17,97 @@ AttrScrollWidget - + Location Location - + Subject Subject - + Author Author - + Keywords Keywords - + Producer Producer - + Creator Creator - + Time created Time created - + Time modified Time modified - + Format Format - + Pages Pages - + Optimized Optimized - + Security Security - + Page size Page size - + File size File size - + + Warnings + + + + Basic info Basic info - + Unknown Unknown - + Yes Yes - + No No @@ -110,12 +115,12 @@ BookMarkWidget - + Add bookmark Add bookmark - + Are you sure you want to delete all bookmarks? Are you sure you want to delete all bookmarks? @@ -123,119 +128,119 @@ BrowserMenu - - - + + + Copy Copy - + Remove annotation Remove annotation - - - + + + Add annotation Add annotation - - - - + + + + Remove bookmark Remove bookmark - - - - + + + + Add bookmark Add bookmark - + Highlight Highlight - + Remove highlight Remove highlight - - + + Search Search - - + + Exit fullscreen Exit fullscreen - - + + Fullscreen Fullscreen - - + + Slide show Slide show - - + + First page First page - - + + Previous page Previous page - - + + Next page Next page - - + + Last page Last page - - + + Rotate left Rotate left - - + + Rotate right Rotate right - - + + Print Print - - + + Document info Document info @@ -243,7 +248,7 @@ Central - + Documents Documents @@ -251,49 +256,49 @@ CentralDocPage - + The format is not supported The format is not supported - + Open failed Open failed - + Please check if the file is damaged Please check if the file is damaged - + Conversion failed, please check if the file is damaged Conversion failed, please check if the file is damaged - + Save failed Save failed - + Saved successfully Saved successfully - + Save as Save as - - + + Invalid file name Invalid file name - - + + OK button OK @@ -307,12 +312,12 @@ Drag documents here - + Format supported: %1 Format supported: %1 - + Select File Select File @@ -320,20 +325,20 @@ DocSheet - - + + The bookmark has been removed The bookmark has been removed - - + + Please select the text Please select the text - - + + The annotation has been removed The annotation has been removed @@ -346,18 +351,18 @@ Encrypted file, please enter the password - + Password Password - + OK button OK - + Wrong password Wrong password @@ -365,22 +370,22 @@ EyeProtection - + No eye protection - + Classic eye protection - + Green eye protection - + Night eye protection @@ -388,7 +393,7 @@ EyeProtectionAction - + Eye protection mode @@ -396,12 +401,12 @@ FindWidget - + Previous Previous - + Next Next @@ -422,12 +427,12 @@ NotesWidget - + Add annotation Add annotation - + Are you sure you want to delete all annotations? Are you sure you want to delete all annotations? @@ -464,12 +469,12 @@ Restored to last reading position - + Jump to first page Jump to first page - + Close Close @@ -541,12 +546,12 @@ SearchResWidget - + No search results No search results - + %1 items found %1 items found @@ -810,23 +815,23 @@ SideBarImageListView - + Copy Copy - + Remove annotation Remove annotation - - + + Remove all Remove all - + Remove bookmark Remove bookmark @@ -834,7 +839,7 @@ SideBarImageViewModel - + Page %1 Page %1 @@ -842,12 +847,12 @@ SlidePlayWidget - + It is the first page It is the first page - + It is the last page It is the last page @@ -866,7 +871,7 @@ - + Save Save @@ -886,17 +891,17 @@ Magnifer - + Tools Tools - + Search Search - + Print Print @@ -904,7 +909,7 @@ TitleWidget - + Thumbnails Thumbnails @@ -917,33 +922,97 @@ Input limit reached + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - - - Batch print documents without UI. - Batch print documents without UI. - diff --git a/translations/deepin-reader_af.ts b/translations/deepin-reader_af.ts index ae38b50cb..95023ed43 100644 --- a/translations/deepin-reader_af.ts +++ b/translations/deepin-reader_af.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Dokumentviewer - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Dokumentviewer is 'n instrument vir lees van dokumentbestandde, wat PDF, DJVU, DOCX ens. ondersteun + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Lokasie - + Subject Onderwerp - + Author Auteur - + Keywords Sleutelwoorde - + Producer Produent - + Creator Skepper - + Time created Tyd van aanmaak - + Time modified Tyd van aanpassing - + Format Formaat - + Pages Bladerys - + Optimized Geoptimeer - + Security Veiligheid - + Page size Bladsy grootte - + File size Bestandsgrootte - + + Warnings + + + + Basic info Basiese inligting - + Unknown Onbekend - + Yes Ja - + No Nee @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Voeg bladmerk by - + Are you sure you want to delete all bookmarks? Wees seker jy wil alle bladmerke verwyder? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Kopieer - + Remove annotation Verwyder aantekening - + + + Add annotation Voeg aantekening by - + + + + Remove bookmark Verwyder bladmerk - + + + + Add bookmark Voeg bladmerk by - + Highlight Benadruk - + Remove highlight Verwyder benadrukking - + + Search Soek - + + Exit fullscreen Verlaat volledig scherm - + + Fullscreen Volledig scherm - + + Slide show Diashow - + + First page Eerste blad - + + Previous page Vorige blad - + + Next page Volgende blad - + + Last page Laatste blad - + + Rotate left Draai links - + + Rotate right Draai regs - + + Print Druk - + + Document info Dokumentinligting @@ -219,7 +248,7 @@ Central - + Documents Dokumente @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Die formaat is nie ondersteun nie - + Open failed Ouwen misluk - + Please check if the file is damaged Skakel asof die lêer beskadig is - + Conversion failed, please check if the file is damaged Konversie misluk, skakel asof die lêer beskadig is - + Save failed Opslaan misluk - + Saved successfully Opslaan suksesvol - + Save as Opslaan as - + + Invalid file name Ongeldige lêernaam - + + OK button OK @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Drag dokumente hier - + Format supported: %1 Formaat ondersteun: %1 - + Select File Kies lêer @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Die bladmerk is verwyder - + + Please select the text Skakel asseblief die teks - + + The annotation has been removed Die aantekening is verwyder @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Versleutelde lêer, asseblief voeg die woorde aan - + Password Woorde - + OK button OK - + Wrong password Verkeerde woordevoeging + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Vorige - + Next Volgende @@ -349,12 +414,12 @@ HandleMenu - + Select Text Kies Tekst - + Hand Tool Hand Werk @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Voeg aantekening by - + Are you sure you want to delete all annotations? Wees seker jy wil al aantekeninge skrap? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Ongeldige bladsy nommer @@ -383,7 +448,7 @@ ProgressDialog - + Converting Konvertering @@ -391,43 +456,61 @@ QObject - + Document not saved Dokument is nie gespeek nie + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - Sparen die veranderinge na "%1"? + + Save the changes to "%1"? + Sparen die veranderinge na "%1"? - + Cancel button Annuleer - + Discard button Verwerp - + Save button Sparen - + Cancel Annuleer - + Delete Verwijder @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Twee-bladsy weergawe - + 1:1 size 1:1 grootte - + Fit Page Pas Bladsy - + Fit Height Pas Hoogte - + Fit Width Pas Breedte @@ -463,36 +546,36 @@ SearchResWidget - + No search results Geen soekresultate - + %1 items found - '%1 items gevind' + '%1 items gevind' SecurityDialog - + This document is trying to connect to: Hierdie dokument probeer verbind met: - + If you trust the website, click Allow, otherwise click Block. As jy die webwerf vertrou, kliek Allow, anders kliek Block. - + Block button Blok - + Allow button Toestaan @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Miniature - + Catalog Katalog - + Bookmarks Bladsymerkers - + Annotations Aantekeninge @@ -524,188 +607,207 @@ ShortCutShow - + Settings Instellings - + Exit Verlaat - + Help Hulp - + Page up Blad oop - + Page down Blad af - + Open Open - + Zoom in Zoom in - + Zoom out Zoom uit - + Save as Stoor as - + + File + + + + + Display + + + + + Tools + Werktyge + + + + Edit + + + + Print Druk - + Save Stoor - + Thumbnails Miniature - + 1:1 size 1:1 grootte - + Fit height Pas hoogte - + Fit width Pas breedte - + Rotate left Draai links - + Rotate right Draai regs - + Move to the beginning Verplaats na die begin - + Move to the end Verplaats na die einde - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Kies teks - + Hand tool Handinstrument - + Add bookmark Voeg bladmerk by - + Delete Verwys - + Magnifier Vergrerger - + Slide show Diasshow - + Fullscreen Volskerm - + Copy Kopieer - + Cut Sny - + Paste Plak - + Undo Herlaat - + Select all Alles kies - + Display shortcuts Skrifteken toon - + Add annotation Notas toevoeg - + Highlight Benadruk - + Search Soek @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Kopieer - + Remove annotation Verwyder notas - + + Remove all Alles verwyder - + Remove bookmark Verwyder bladmerk @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Bladsy %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Dit is die eerste bladsy - + It is the last page Dit is die laaste bladsy @@ -757,47 +860,48 @@ TitleMenu - + New window Nuwe venster - + New tab Nuwe tab - + + Save Stoor - + Save as Stoor as - + Display in file manager Toon in lêerbeheer - + Magnifer Vergrader - + Tools Werktyge - + Search Druk - + Print Miniature @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Invoerlimiet bereik @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Dokumentlêerpad. + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Lêerpad - + + FilePath Miniaturelêerpad. - + ThumbnailPath Path. Genereer miniature. - + Generate thumbnail. Generate thumbnail. diff --git a/translations/deepin-reader_am_ET.ts b/translations/deepin-reader_am_ET.ts index 3287a5c9d..539abd05a 100644 --- a/translations/deepin-reader_am_ET.ts +++ b/translations/deepin-reader_am_ET.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer የፓምፓ የመረመር የተለያዩ አገልግሎት - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - የፓምፓ የመረመር የተለያዩ አገልግሎት የፓምፓ የመረመር አገልግሎት ነው፣ የፓምፓ የፌይል የመረመርን የደጋገመ የተለያዩ አገልግሎቶች ይ⽀持 ያደርጋል፡፡ PDF, DJVU, DOCX ይዘን ይ⽀持 ያደርጋል + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location ቦታ - + Subject መገለጫ - + Author ተ 작성 የተ - + Keywords ቁلم - + Producer ማምረት - + Creator ማምረት - + Time created የተፈጠረ ጊዜ - + Time modified የተለበስ ጊዜ - + Format መርتب - + Pages የገጽ - + Optimized መ ምርጫ - + Security ማስተ safely - + Page size የገጽ ክፍሎ - + File size የፌይል ክፍሎ - + + Warnings + + + + Basic info መ ምርጫ - + Unknown ያልታወቅ - + Yes አዎ - + No ለም @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark ማምረት አገልግሎት ይጨምር - + Are you sure you want to delete all bookmarks? እርስዎ የሚፈርስ ማምረት አገልግሎቶችን ይሰርዝ ይፈልጋል? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy ኮፔ ይጨምር - + Remove annotation ማምረት አገልግሎት ይሰርዝ - + + + Add annotation ማምረት አገልግሎት ይጨምር - + + + + Remove bookmark ማምረት አገልግሎት ይሰርዝ - + + + + Add bookmark ማምረት አገልግሎት ይጨምር - + Highlight ማስተ ምርጫ - + Remove highlight ማስተ ምርጫ ይሰርዝ - + + Search ፈልግ - + + Exit fullscreen ውድ የሚቀጥል - + + Fullscreen ፍሉሽcreen - + + Slide show ስไลድ ምሳ - + + First page መแรก ምሳ - + + Previous page በፊት ምሳ - + + Next page ከፊት ምሳ - + + Last page መጨረሻ ምሳ - + + Rotate left መግ紊乱 ምስ - + + Rotate right መግ紊乱 ምስ - + + Print ፕ린ት - + + Document info ድოክዩሜንት መረጃ @@ -219,7 +248,7 @@ Central - + Documents ድოክዩሜንቶች @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported የመልክት ማስተላለፍ ማያዝ የለበ - + Open failed ክፈል ማውጫ የለበ - + Please check if the file is damaged እባክዎ ምን አይነት የሆነ የሚወክል ምስ ማረጋገጥ የለበ - + Conversion failed, please check if the file is damaged ውስጥ ማለፊያ ማውጫ የለበ፣ እባክዎ ምን አይነት የሆነ የሚወክል ምስ ማረጋገጥ የለበ - + Save failed ሽეማ ማውጫ የለበ - + Saved successfully ሽეማ ይህ የተሳካ - + Save as ሽეማ ይህ የሚቀጥል - + + Invalid file name ሌላ ምስ ማስተላለፍ የለበ - + + OK button አይ @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here ድოክዩሜንቶች ለዚህ ማስገባት የለበ - + Format supported: %1 የመልክት የሚቀጥል: %1 - + Select File ምስ ማምረጋት @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed የመልክት ምስ ማስገባት የለበ - + + Please select the text እባክዎ ምስ ማምረጋት የለበ - + + The annotation has been removed የማስታወሻ ምስ ማስገባት የለበ @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password የመጓዝ ምስ፣ እባክዎ ምስ ማስገባት የለበ - + Password ምስ ማስገባት - + OK button አይ - + Wrong password პაროლი არასწორია + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous წინა - + Next შემდეგი @@ -349,12 +414,12 @@ HandleMenu - + Select Text ტექსტის არჩევა - + Hand Tool ხელის ინსტრუმენტი @@ -362,12 +427,12 @@ NotesWidget - + Add annotation ანნოტაցიის დამატება - + Are you sure you want to delete all annotations? თქვენ დარწმუნებული ხართ, რომ გსურთ წაშლა ყველა ანნოტაცია? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number გაუმართა გვერდის ნომერი @@ -383,7 +448,7 @@ ProgressDialog - + Converting კონვერტირება @@ -391,43 +456,61 @@ QObject - + Document not saved დოკუმენტი არ შეინახა + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - შეინახოთ ცვლებები "%1"-ში? + + Save the changes to "%1"? + შეინახოთ ცვლებები "%1"-ში? - + Cancel button გაუქმება - + Discard button გადახდი - + Save button შენახვა - + Cancel გაუქმება - + Delete წაშლა @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View ორი გვერდის ხედვა - + 1:1 size 1:1 ზომა - + Fit Page გვერდის შესასწორება - + Fit Height სიმაღლის შესასწორება - + Fit Width სიგანის შესასწორება @@ -463,36 +546,36 @@ SearchResWidget - + No search results ძებნის შედეგი არ არსებობს - + %1 items found - '%1 ელემენტი მოიძებნა' + '%1 ელემენტი მოიძებნა' SecurityDialog - + This document is trying to connect to: ამ დოკუმენტის სცადება შეემოწმოს შეერთება: - + If you trust the website, click Allow, otherwise click Block. თუ თქვენ გამოслуша ვებ გვერდს, დააწკაპულება ნებისმიერად, გარდა ამისა დააწკაპულება დღესასწაულად. - + Block button დაწყვიტება - + Allow button ნებისმიერად @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails სურათები - + Catalog კატალოგი - + Bookmarks მარკერები - + Annotations annotations @@ -524,188 +607,207 @@ ShortCutShow - + Settings Settings - + Exit გამოსვლა - + Help დახმარება - + Page up გვერდზე ზედა - + Page down გვერდზე ქვემოთ - + Open გახსნა - + Zoom in გადიდება - + Zoom out გადატანა - + Save as შენახვა როგორც - + + File + + + + + Display + + + + + Tools + ትዕዛዝ + + + + Edit + + + + Print დაბეჭდვა - + Save შენახვა - + Thumbnails სურათები - + 1:1 size 1:1 ზომა - + Fit height ზომის მითითება სიგრძის მიხედვით - + Fit width ზომის მითითება სიგანის მიხედვით - + Rotate left გაბრუნება მარცხნავ - + Rotate right გაბრუნება მარჯვნავ - + Move to the beginning გადატანა საწყისში - + Move to the end გადატანა ბოლოში - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text ტექსტის არჩევა - + Hand tool ხელის ინსტრუმენტი - + Add bookmark მარკერის დამატება - + Delete წაშლა - + Magnifier მაგნიტი - + Slide show სლაიდების ნახვა - + Fullscreen სრული ეკრანი - + Copy კოპირება - + Cut გადაკეტვა - + Paste ჩასმა - + Undo መመለስ - + Select all ሁሉንም ይምረጡ - + Display shortcuts ቀንብር የሚገልጽ የተጠቃ አዘጋጅ - + Add annotation ማärከ ይጨምሩ - + Highlight ማärከ ይጨምሩ - + Search ፈልጉ @@ -713,22 +815,23 @@ SideBarImageListView - + Copy ኮፔ ይህን - + Remove annotation ማärከ ይሰር - + + Remove all ሁሉንም ይሰር - + Remove bookmark ማärከ ይሰር @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 የገጽ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page እሱ የመጀመሪያ ቋንቋ ሳይ ነው - + It is the last page እሱ የመጨረሻ ቋንቋ ሳይ ነው @@ -757,47 +860,48 @@ TitleMenu - + New window አዲስ ምስክር - + New tab አዲስ ምስክር - + + Save ማከማ - + Save as ማከማ በመል ይህን - + Display in file manager አርክ በምስክር ይመል ይህን - + Magnifer ማግኝ - + Tools ትዕዛዝ - + Search ፈልጉ - + Print ማነሳ @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails ትይምቦን በመል ይህን @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached ግብዓት የመጨረሻ ደረጃ ይደርሰ + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. የፌይል ቋንቋ ሳይ ነው - + + FilePath የፌይል ቋንቋ - + ThumbnailPath Path. ትይምቦን ቋንቋ ሳይ ነው - + Generate thumbnail. ትይምቦን ይፈጠሩ diff --git a/translations/deepin-reader_ar.ts b/translations/deepin-reader_ar.ts index b967bff46..e924b9526 100755 --- a/translations/deepin-reader_ar.ts +++ b/translations/deepin-reader_ar.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ عارض المستندات - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location الموقع - + Subject الموضوع - + Author المؤلف - + Keywords كلمات مفتاحية - + Producer المُنتج - + Creator المنشئ - + Time created وقت الإنشاء - + Time modified وقت التعديل - + Format تهيئة - + Pages لصفحات - + Optimized محسّن - + Security الأمان - + Page size حجم الصفحة - + File size حجم الملف - + + Warnings + + + + Basic info المعلومات الأساسية - + Unknown غير معروف - + Yes نعم - + No لا @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark إضافة علامة مرجعية - + Are you sure you want to delete all bookmarks? هل أنت متأكد من أنك تريد حذف جميع العلامات المرجعية؟ @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy نسخ - + Remove annotation إزالة العلامة المرجعية - - - + + + Add annotation إضافة تعليق توضيحي - - - - + + + + Remove bookmark إزالة العلامة المرجعية - - - - + + + + Add bookmark إضافة علامة مرجعية - + Highlight تحديد - + Remove highlight إلغاء التحديد - - + + Search بحث - - + + Exit fullscreen الخروج من وضع ملئ الشاشة - - + + Fullscreen ملئ الشاشة - - + + Slide show عرض شرائحي - - + + First page الصفحة الأولى - - + + Previous page الصفحة السابقة - - + + Next page الصفحة التالية - - + + Last page الصفحة الاخيرة - - + + Rotate left تدوير لليسار - - + + Rotate right تدوير لليمين - - + + Print طباعة - - + + Document info معلومات المستند @@ -241,7 +248,7 @@ Central - + Documents المستندات @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported التنسيق غير مدعوم - + Open failed فشلت عملية الفتح - + Please check if the file is damaged نرجوا التحقق ما إذا كان الملف متضرر - + Conversion failed, please check if the file is damaged فشلت عملية التحويل، الرجاء التحقق ما إذا كان الملف تضرر - + Save failed فشل الحفظ - + Saved successfully تم الحفظ بنجاح - + Save as حفظ كـ - - + + Invalid file name اسم ملف غير صالح - - + + OK button حسناً @@ -305,12 +312,12 @@ اسحب المستندات هنا - + Format supported: %1 الصيغ المدعومة: 1% - + Select File اختر ملف @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed تم حذف العلامة المرجعية - - + + Please select the text نرجوا اختيار النص - - + + The annotation has been removed تم إزالة النص التوضيحي @@ -344,18 +351,18 @@ الملف مشفر، الرجاء إدخال كلمة المرور - + Password كلمة المرور - + OK button حسناً - + Wrong password كلمة المرور غير صحيحة @@ -363,22 +370,22 @@ EyeProtection - + No eye protection بدون حماية للعين - + Classic eye protection حماية كلاسيكية للعين - + Green eye protection حماية خضراء للعين - + Night eye protection حماية ليلية للعين @@ -386,7 +393,7 @@ EyeProtectionAction - + Eye protection mode وضع حماية العين @@ -394,12 +401,12 @@ FindWidget - + Previous السابق - + Next التالي @@ -420,12 +427,12 @@ NotesWidget - + Add annotation إضافة تعليق توضيحي - + Are you sure you want to delete all annotations? هل أنت متأكد من أنك تريد حذف جميع النصوص التوضيحية؟ @@ -462,12 +469,12 @@ تمت الاستعادة إلى آخر موضع قراءة - + Jump to first page الانتقال إلى الصفحة الأولى - + Close إغلاق @@ -539,12 +546,12 @@ SearchResWidget - + No search results لا يوجد نتائج لبحثك - + %1 items found تم إيجاد %1 عنصر @@ -808,23 +815,23 @@ SideBarImageListView - + Copy نسخ - + Remove annotation إزالة العلامة المرجعية - - + + Remove all حذف الكل - + Remove bookmark إزالة العلامة المرجعية @@ -832,7 +839,7 @@ SideBarImageViewModel - + Page %1 صفحة %1 @@ -840,12 +847,12 @@ SlidePlayWidget - + It is the first page إنها الصفحة الأولى - + It is the last page هذه هي الصفحة الأخيرة @@ -864,7 +871,7 @@ - + Save حفظ @@ -884,17 +891,17 @@ مكبر الشاشة - + Tools الأدوات - + Search بحث - + Print طباعة @@ -902,7 +909,7 @@ TitleWidget - + Thumbnails الصور المصغرة @@ -915,33 +922,105 @@ تم الوصول لحد المدخلات + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. مسار ملف المستند. - - + + FilePath مسار الملف. - + ThumbnailPath Path. مسار الصورة المصغرة. - + Generate thumbnail. إنشاء صورة مصغرة. - - - Batch print documents without UI. - طباعة المستندات دفعة واحدة بدون واجهة. - - \ No newline at end of file + diff --git a/translations/deepin-reader_az.ts b/translations/deepin-reader_az.ts index c15df601b..e400a2ac2 100644 --- a/translations/deepin-reader_az.ts +++ b/translations/deepin-reader_az.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Sənədlərə baxış - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Məkan - + Subject Mövzu - + Author Müəllif - + Keywords Açar sözlər - + Producer İstehsalçı - + Creator Yaradıcı - + Time created Yaradılma vaxtı - + Time modified Dəyişdirilmə vaxtı - + Format Format - + Pages Səhifələr - + Optimized Optimallaşdırılmış - + Security Təhlükəsizlik - + Page size Səhifənin ölçüsü - + File size Faylın ölçüsü - + + Warnings + + + + Basic info Baza məlumatı - + Unknown Naməlum - + Yes Bəli - + No Xeyr @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Əlfəcin əlavə edin - + Are you sure you want to delete all bookmarks? Bütün əlfəcinləri silmək istədiyinizə əminsiniz? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopyalayın - + Remove annotation Açıqlamanı silin - - - + + + Add annotation Aşıqlama əlavə edin - - - - + + + + Remove bookmark Əlfəcini silin - - - - + + + + Add bookmark Əlfəcin əlavə edin - + Highlight Vurğulamaq - + Remove highlight Vurğulamanı silin - - + + Search Axtarış - - + + Exit fullscreen Tam ekrandan çıxış - - + + Fullscreen Tam ekran - - + + Slide show Slayd-şou - - + + First page Birinci səhifə - - + + Previous page Əvvəlki səhifə - - + + Next page Növbəti səhifə - - + + Last page Sonuncu səhifə - - + + Rotate left Sola döndərin - - + + Rotate right Sağa döndərin - - + + Print Çap - - + + Document info Sənəd məlumatı @@ -241,7 +248,7 @@ Central - + Documents Sənədlər @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Format dəstəklənmir - + Open failed Açıla bilmədi - + Please check if the file is damaged Lütfən yoxlayın, fayl zədələnib ya yox - + Conversion failed, please check if the file is damaged Çevrilmə alınmadı, faylın zədəli olub olmadığını yoxlayın - + Save failed Saxlanıla bilmədi - + Saved successfully Uğurla saxlanıldı - + Save as Belə saxlayın - - + + Invalid file name Səhv fayl adı - - + + OK button OK @@ -305,12 +312,12 @@ Sənədi buraya atın - + Format supported: %1 Dəstəklənən format: %1 - + Select File Fayl seçin @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Əlfəcin silindi - - + + Please select the text Lütfən mətn seçin - - + + The annotation has been removed Açıqlamalar silindi @@ -344,31 +351,62 @@ Şifrələnmiş fayl, lütfən şifrəni daxil edin - + Password Şifrə - + OK button OK - + Wrong password Səhv şifrə + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Əvvəlki - + Next Növbəti @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Açıqlama əlavə edin - + Are you sure you want to delete all annotations? Bütün açıqlamaları silmək istədiyinizə əminsiniz? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Yalnış səhifə nömrəsi @@ -423,38 +461,56 @@ Sənəd saxlanılmadı + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Dəyişikliklər "%1" tərkibində saxlanılsın? - + Cancel button İmtina - + Discard button Ləğv edin - + Save button Saxlayın - + Cancel İmtina - + Delete Silin @@ -490,12 +546,12 @@ SearchResWidget - + No search results Axtarış nəticələri yoxdur - + %1 items found %1 element tapıldı @@ -551,188 +607,207 @@ ShortCutShow - + Settings Ayarlar - + Exit Çıxış - + Help Kömək - + Page up Səhifə yuxarı - + Page down Səhifə aşağı - + Open Açın - + Zoom in Böyütmək - + Zoom out Kiçiltmək - + Save as Belə saxlayın - + + File + + + + + Display + + + + + Tools + Alətlər + + + + Edit + + + + Print Çap - + Save Saxlayın - + Thumbnails Miniatürlər - + 1:1 size 1:1 ölçü - + Fit height Hündürlüyünə sığışdırın - + Fit width Eninə doldurun - + Rotate left Sola döndərin - + Rotate right Sağa döndərin - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Başlanğıca köçürün - + Move to the end Sona köşürün - + Select text Mətni seçin - + Hand tool İş aləti - + Add bookmark Əlfəcin əlavə edinƏlfəcin əlavə edin - + Delete Silin - + Magnifier Böyüdücü - + Slide show Slayd-şou - + Fullscreen Tam ekran - + Copy Kopyalayın - + Cut Kəsmək - + Paste Yerləşdirin - + Undo Geriyə - + Select all Hamısını seçin - + Display shortcuts Qısayolları göstərmək - + Add annotation Açıqlama əlavə edin - + Highlight Vurğulamaq - + Search Axtarış @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopyalayın - + Remove annotation Açıqlamanı silin - - + + Remove all Hamısını silin - + Remove bookmark Əlfəcini silin @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Səhifə %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Bu ilk səhifədir - + It is the last page Bu sonuncu səhifədir @@ -785,48 +860,48 @@ TitleMenu - + New window Yeni pəncərə - + New tab Yeni vərəq - - + + Save Saxlayın - + Save as Belə saxlayın - + Display in file manager Fayl menecerində göstərmək - + Magnifer Böyüdücü - + Tools Alətlər - + Search Axtarış - + Print Çap @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniatürlər @@ -847,28 +922,97 @@ Daxiletmə limiti bitdi + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Sənəd faylının yolu. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath yolu - + Generate thumbnail. Miniatürlər yaratmaq - \ No newline at end of file + diff --git a/translations/deepin-reader_bg.ts b/translations/deepin-reader_bg.ts index c0d4110b4..1891fd8ce 100644 --- a/translations/deepin-reader_bg.ts +++ b/translations/deepin-reader_bg.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Документен прегледчик - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Документен прегледчик е инструмент за четене на документни файлове, като PDF, DJVU, DOCX и др. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Локация - + Subject Тема - + Author Автор - + Keywords Ключови думи - + Producer Производител - + Creator Създател - + Time created Време на създаване - + Time modified Време на модифициране - + Format Формат - + Pages Страници - + Optimized Оптимизиран - + Security Сигурност - + Page size Размер на страницата - + File size Размер на файла - + + Warnings + + + + Basic info Основна информация - + Unknown Неизвестно - + Yes Да - + No Не @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Добави бележка - + Are you sure you want to delete all bookmarks? Сигурни ли сте, че искате да изтриете всички бележки? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Копирай - + Remove annotation Премахни бележка - + + + Add annotation Добави бележка - + + + + Remove bookmark Премахни бележка - + + + + Add bookmark Добави бележка - + Highlight Опозиционно - + Remove highlight Премахни опозиционно - + + Search Търси - + + Exit fullscreen Изход от пълноекран - + + Fullscreen Пълноекран - + + Slide show Слайд шоу - + + First page Първа страница - + + Previous page Предишна страница - + + Next page Следваща страница - + + Last page Последна страница - + + Rotate left Обърни наляво - + + Rotate right Обърни надясно - + + Print Печат - + + Document info Информация за докумената @@ -219,7 +248,7 @@ Central - + Documents Документи @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Форматът не е поддържан - + Open failed Отваряне неуспешно - + Please check if the file is damaged Моля, проверете дали файлът е повреден - + Conversion failed, please check if the file is damaged Преобразуването неуспешно, моля проверете дали файлът е повреден - + Save failed Запис неуспешен - + Saved successfully Успешно запазен - + Save as Запази като - + + Invalid file name Невалиден име на файл - + + OK button Да @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Потеглете документи тук - + Format supported: %1 Поддържан формат: %1 - + Select File Изберете файл @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Закачката е премахната - + + Please select the text Моля, изберете текста - + + The annotation has been removed Анотацията е премахната @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Шифрован файл, моля въведете паролата - + Password Парола - + OK button Да - + Wrong password Грешен парола + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Предишна - + Next Следваща @@ -349,12 +414,12 @@ HandleMenu - + Select Text Избери текст - + Hand Tool Ръчна инструмент @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Добави бележка - + Are you sure you want to delete all annotations? Сигурни ли сте, че искате да изтриете всички бележки? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Невалиден номер на страница @@ -383,7 +448,7 @@ ProgressDialog - + Converting Преобразуване @@ -391,43 +456,61 @@ QObject - + Document not saved Документът не е запазен + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - Искате ли да запазите промените в "%1"? + + Save the changes to "%1"? + Искате ли да запазите промените в "%1"? - + Cancel button Отказ - + Discard button Изхвърли - + Save button Запази - + Cancel Отказ - + Delete Изтрий @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Вид на две страници - + 1:1 size 1:1 размер - + Fit Page П过去 страница - + Fit Height П过去 височина - + Fit Width П过去 ширина @@ -463,36 +546,36 @@ SearchResWidget - + No search results Няма резултати от търсене - + %1 items found - '%1 елемента намерени' + '%1 елемента намерени' SecurityDialog - + This document is trying to connect to: Този документ опитва да се свърже с: - + If you trust the website, click Allow, otherwise click Block. Ако доверявате уебсайта, кликнете Allow, в противен случай кликнете Block. - + Block button Блокирай - + Allow button Разрешавай @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Превюта - + Catalog Каталог - + Bookmarks Маркери - + Annotations Анотации @@ -524,188 +607,207 @@ ShortCutShow - + Settings Настройки - + Exit Изход - + Help Помощ - + Page up Страница нагоре - + Page down Страница надолу - + Open Отвори - + Zoom in Увеличи - + Zoom out Намали - + Save as Запази като - + + File + + + + + Display + + + + + Tools + Инструменти + + + + Edit + + + + Print Печат - + Save Запази - + Thumbnails Миниатюри - + 1:1 size 1:1 размер - + Fit height Приpaste височина - + Fit width Приpaste широчина - + Rotate left Повъртете на ляво - + Rotate right Повъртете на дясно - + Move to the beginning Преместете към началото - + Move to the end Преместете към края - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Избери текст - + Hand tool Ръчно инструмент - + Add bookmark Добави закладка - + Delete Изтрий - + Magnifier Магнител - + Slide show Слайд шоу - + Fullscreen Пълноекран - + Copy Копирай - + Cut Разрежи - + Paste Постави - + Undo Отмена - + Select all Избери всичко - + Display shortcuts Покажи кратки пътища - + Add annotation Добави бележка - + Highlight Избери - + Search Търси @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Копиране - + Remove annotation Премахни бележка - + + Remove all Премахни всичко - + Remove bookmark Премахни маркера @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Страница %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Това е първата страница - + It is the last page Това е последната страница @@ -757,47 +860,48 @@ TitleMenu - + New window Нова прозореца - + New tab Нова вкладка - + + Save Запази - + Save as Запази като - + Display in file manager Покажи в файловия менеджер - + Magnifer Магнител - + Tools Инструменти - + Search Търси - + Print Печат @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Преглед на миниатюри @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Достигнат е лимитът на въведения текст + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Път до документа - + + FilePath Път до файл - + ThumbnailPath Path. Път до миниатюра - + Generate thumbnail. Генериране на миниатюра diff --git a/translations/deepin-reader_bn.ts b/translations/deepin-reader_bn.ts index bfe126dfb..3cd20442d 100644 --- a/translations/deepin-reader_bn.ts +++ b/translations/deepin-reader_bn.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ পাঠ্যপুস্তক দর্শক - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location স্থান - + Subject শাস্ত্র - + Author লেখক - + Keywords শব্দগুলি - + Producer প্রদর্শনকারী - + Creator প্রবর্তক - + Time created তৈরি করা সময় - + Time modified সময় পরিবর্তন করা - + Format রূপ - + Pages পাতা - + Optimized অভ্যন্তরীণ - + Security সুরক্ষা - + Page size পাতা আকার - + File size ফাইল আকার - + + Warnings + + + + Basic info ভিত্তি তথ্য - + Unknown অজানা - + Yes হ্যাঁ - + No না @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark বইমার্ক যোগ করুন - + Are you sure you want to delete all bookmarks? আপনি সত্যিই আপনার সব বইমার্ক থামানো চান? @@ -122,119 +129,119 @@ BrowserMenu - - - + + + Copy কopi - + Remove annotation মার্কার পরিষেবা বাদ দিন - - - + + + Add annotation মার্কার যোগ করুন - - - - + + + + Remove bookmark বইমার্ক মুছে ফেলুন - - - - + + + + Add bookmark বইমার্ক যোগ করুন - + Highlight আলোচনা - + Remove highlight আলোচনা মুছে ফেলুন - - + + Search অনুসন্ধান - - + + Exit fullscreen ফুল স্কিন থেকে বের হো - - + + Fullscreen ফুল স্কিন - - + + Slide show প্রেzent সাইল - - + + First page প্রথম পাতা - - + + Previous page পূর্বোক্ত পাতা - - + + Next page পরবর্তী পাতা - - + + Last page সর্বশেষ পাতা - - + + Rotate left বামে ঘূর্ণিত করুন - - + + Rotate right ডানে ঘূর্ণিত করুন - - + + Print প্রিন্ট করুন - - + + Document info প্রতিবেদন তথ্য @@ -242,7 +249,7 @@ Central - + Documents প্রতিবেদন @@ -250,49 +257,49 @@ CentralDocPage - + The format is not supported ফর্ম্যাট সমর্থিত নয় - + Open failed বন্ধ হয়ে গেছে - + Please check if the file is damaged ফাইলটি বাটা আছে কিনা পরীক্ষা করুন - + Conversion failed, please check if the file is damaged পরিবর্তন সমর্থিত নয়, ফাইলটি বাটা আছে কিনা পরীক্ষা করুন - + Save failed সংরক্ষণ সমর্থিত নয় - + Saved successfully সফলভাবে সংরক্ষিত - + Save as অন্য নামে সংরক্ষণ করুন - - + + Invalid file name অকৃত্রিম ফাইল নাম - - + + OK button হ্যাঁ @@ -306,12 +313,12 @@ ডকুমেন্ট গুলি এখানে টানুন - + Format supported: %1 যে ফরমেট সমর্থিত: %1 - + Select File ফাইল নির্বাচন করুন @@ -319,20 +326,20 @@ DocSheet - - + + The bookmark has been removed আপনার বুকমার্ক অপসারণ করা হয়েছে - - + + Please select the text দয়া করে টেক্সট নির্বাচন করুন - - + + The annotation has been removed আপনার অ্যানোটেশন অপসারণ করা হয়েছে @@ -345,31 +352,62 @@ কী সম্প্রসারিত ফাইল, দয়া করে কী লিখুন - + Password কী - + OK button হ্যাঁ - + Wrong password ভুল কী + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous পূর্ববর্তী - + Next পরবর্তী @@ -390,12 +428,12 @@ NotesWidget - + Add annotation নোট যোগ করুন - + Are you sure you want to delete all annotations? আপনি সব অ্যানোটেশন মুছে ফেলতে চান কি? @@ -403,7 +441,7 @@ PagingWidget - + Invalid page number অবৈধ পেজ নম্বর @@ -424,38 +462,56 @@ ডকুমেন্ট সংরক্ষণ করা হয়নি + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? "%1" ফাইলে পরিবর্তনগুলি সংরক্ষণ করতে চান কি? - + Cancel button বাতিল - + Discard button বাতিল করুন - + Save button পরিসংখ্যান - + Cancel বাতিল - + Delete পারিবারিক মুছে ফেলুন @@ -491,12 +547,12 @@ SearchResWidget - + No search results নাই সার্চ ফলাফল - + %1 items found %1 উপাত্ত পাওয়া গেছে @@ -552,188 +608,207 @@ ShortCutShow - + Settings সেটিংস - + Exit বের হওয়া - + Help সাহায্য - + Page up পাতার উপরে - + Page down পাতার নিচে - + Open নিখুঁত করুন - + Zoom in বৃদ্ধি করুন - + Zoom out কমান - + Save as পরিবর্তে সেভ করুন - + + File + + + + + Display + + + + + Tools + ব্যবস্থাপনা + + + + Edit + + + + Print প্রিন্ট - + Save সংরক্ষণ - + Thumbnails থামবন্স - + 1:1 size 1:1 আকার - + Fit height উচ্চতায় সুষম রাখুন - + Fit width প্রস্থে সুষম রাখুন - + Rotate left বামে ঘুরান - + Rotate right ডানে ঘুরান - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning শুরুর দিকে সরান - + Move to the end শেষের দিকে সরান - + Select text টেক্সট নির্বাছন করুন - + Hand tool হাতের টুল - + Add bookmark বুকমার্ক যোগ করুন - + Delete পাতাটি মুছে ফেলুন - + Magnifier বিশদবুক্স - + Slide show ছবি প্রদর্শন - + Fullscreen ফুল স্কিউন্স - + Copy কপি করুন - + Cut কাট করুন - + Paste পেস্ট করুন - + Undo রিবায়ে করুন - + Select all সব নির্বাছন করুন - + Display shortcuts শটকুট দেখান - + Add annotation নোট যোগ করুন - + Highlight অনুক্ষেপ করুন - + Search অনুসন্ধান @@ -741,23 +816,23 @@ SideBarImageListView - + Copy কপি - + Remove annotation অন্মাল পাড়ো - - + + Remove all সব পাড়ো - + Remove bookmark বইমার্ক পাড়ো @@ -765,7 +840,7 @@ SideBarImageViewModel - + Page %1 %1 পাতা @@ -773,12 +848,12 @@ SlidePlayWidget - + It is the first page এটি প্রথম পাতা - + It is the last page এটি শেষ পাতা @@ -786,48 +861,48 @@ TitleMenu - + New window নতুন বার্টন - + New tab নতুন টাব - - + + Save পরিসংখ্যান - + Save as কেমন করে পরিসংখ্যান - + Display in file manager ফাইল ম্যানেজারে প্রদর্শন - + Magnifer মাগনিফায়ার - + Tools ব্যবস্থাপনা - + Search অনুসন্ধান - + Print প্রিন্ট @@ -835,7 +910,7 @@ TitleWidget - + Thumbnails থিম্বনাইল @@ -848,28 +923,97 @@ ইনপুটের সীমা পৌঁছাল + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. পাঠ্যপত্র ফাইল পথ। - - + + FilePath ফাইল পথ - + ThumbnailPath Path. থিম্বনাইল পথ। - + Generate thumbnail. থিম্বনাইল তৈরি করুন। - \ No newline at end of file + diff --git a/translations/deepin-reader_bo.ts b/translations/deepin-reader_bo.ts index 64ab81e50..6e30bcd50 100644 --- a/translations/deepin-reader_bo.ts +++ b/translations/deepin-reader_bo.ts @@ -9,7 +9,7 @@ ཡིག་ཚགས་ལྟ་ཆས། - + Document Viewer is a tool for reading document files, supporting %1. @@ -17,92 +17,97 @@ AttrScrollWidget - + Location གནས་ས། - + Subject བརྗོད་བྱ། - + Author རྩོམ་པ་པོ། - + Keywords གནད་ཚིག - + Producer བཟོ་མཁན། - + Creator གཏོད་མཁན། - + Time created དུ་གཏོད་པ། - + Time modified དུ་བཅོས་པ། - + Format རྣམ་བཞག - + Pages ཤོག་གྲངས། - + Optimized ལེགས་སྒྱུར། - + Security བདེ་འཇགས་རང་བཞིན། - + Page size ཤོག་ངོས་ཆེ་ཆུང་། - + File size ཡིག་ཆ་ཆེ་ཆུང་། - + + Warnings + + + + Basic info གཞི་རྩའི་ཆ་འཕྲིན། - + Unknown མི་ཤེས། - + Yes རེད། - + No མ་རེད། @@ -110,12 +115,12 @@ BookMarkWidget - + Add bookmark ཤོག་འཛར་སྣོན་པ། - + Are you sure you want to delete all bookmarks? ཁྱེད་ཀྱིས་ཤོག་འཛར་ཚང་མ་སུབ་རྒྱུ་གཏན་འཁེལ་ལམ། @@ -123,119 +128,119 @@ BrowserMenu - - - + + + Copy པར་སློག - + Remove annotation མཆན་སུབ་པ། - - - + + + Add annotation མཆན་སྣོན་པ། - - - - + + + + Remove bookmark ཤོག་འཛར་སུབ་པ། - - - - + + + + Add bookmark ཤོག་འཛར་སྣོན་པ། - + Highlight ཆེས་གསལ། - + Remove highlight ཆེས་གསལ་འདོར་བ། - - + + Search འཚོལ་ཞིབ། - - + + Exit fullscreen ཡོལ་གང་ནས་ཕྱིར་འབུད་པ། - - + + Fullscreen ཡོལ་གང་། - - + + Slide show སྒྲོན་བརྙན་སྤྱིན་ཤོག་གཏོང་བ། - - + + First page ཤོག་ལྷེ་དང་པོ། - - + + Previous page ཤོག་ལྷེ་གོང་མ། - - + + Next page ཤོག་ལྷེ་རྗེས་མ། - - + + Last page ཤོག་ལྷེ་མཇུག་ཤོས། - - + + Rotate left གཡོན་དུ་སྐོར་བ། - - + + Rotate right གཡས་སུ་སྐོར་བ། - - + + Print པར་འདེབས། - - + + Document info ཡིག་ཚགས་ཆ་འཕྲིན། @@ -243,7 +248,7 @@ Central - + Documents ཡིག་ཚགས་ཡིག་ཆ། @@ -251,49 +256,49 @@ CentralDocPage - + The format is not supported ཡིག་ཆ་འདིའི་རྣམ་བཞག་ལ་རྒྱབ་སྐྱོར་མི་བྱེད། - + Open failed ཁ་ཕྱེ་མ་ཐུབ། - + Please check if the file is damaged ཡིག་ཆར་སྐྱོན་ཡོད་མེད་རྟོག་ཞིབ་གནང་རོགས། - + Conversion failed, please check if the file is damaged བརྗེ་ཐུབ་མ་སོང་། ཡིག་ཆར་སྐྱོན་ཤོར་ཡོད་མེད་ཞིབ་བཤེར་བྱོས། - + Save failed ཉར་མི་ཐུབ། - + Saved successfully ཉར་ཐུབ་པ། - + Save as གཞན་ཉར། - - + + Invalid file name གོ་ཆོད་པའི་ཡིག་ཆའི་མིང་འཇུག་རོགས། - - + + OK button གཏན་འཁེལ། @@ -307,12 +312,12 @@ ཡིག་ཆ་འདི་རུ་སྤོ་རྒྱུ། - + Format supported: %1 རྒྱབ་སྐྱོར་རྣམ་བཞག་%1 - + Select File ཡིག་ཆ་འདེམས་པ། @@ -320,20 +325,20 @@ DocSheet - - + + The bookmark has been removed ཤོག་འཛར་སུབ་ཟིན། - - + + Please select the text ཡིག་ཆ་འདེམས་རོགས། - - + + The annotation has been removed མཆན་སུབ་ཟིན། @@ -346,18 +351,18 @@ ཡིག་ཚགས་འདིར་གསང་སྡོམ་བྱས་ཟིན་པས། གསང་ཨང་འཇུག་རོགས། - + Password གསང་ཨང་། - + OK button གཏན་འཁེལ། - + Wrong password གསང་ཨང་ནོར་བ། @@ -365,22 +370,22 @@ EyeProtection - + No eye protection མིག་སྲུང་མེད། - + Classic eye protection སྲོལ་རྒྱུན་མིག་སྲུང་། - + Green eye protection ལྗང་ཁུའི་མིག་སྲུང་། - + Night eye protection མཚན་མོའི་མིག་སྲུང་། @@ -388,7 +393,7 @@ EyeProtectionAction - + Eye protection mode མིག་སྲུང་བྱེད་སྟངས། @@ -396,12 +401,12 @@ FindWidget - + Previous གོང་མ། - + Next རྗེས་མ། @@ -422,12 +427,12 @@ NotesWidget - + Add annotation མཆན་སྣོན་པ། - + Are you sure you want to delete all annotations? ཁྱེད་ཀྱིས་མཆན་ཚང་མ་སུབ་རྒྱུ་གཏན་འཁེལ་ལམ། @@ -464,12 +469,12 @@ སྔོན་མའི་ལྟ་ཀློག་གནས་སར་བསྐྱར་གསོ་བྱས་པ། - + Jump to first page ཤོག་ལྷེ་དང་པོར་མཆོང་། - + Close ཁ་རྒྱོབ། @@ -541,12 +546,12 @@ SearchResWidget - + No search results འཚོལ་ཞིབ་བྱས་འབྲས་མེད། - + %1 items found འཚོལ་ཞིབ་བྱས་འབྲས་%1 @@ -810,23 +815,23 @@ SideBarImageListView - + Copy པར་སློག - + Remove annotation མཆན་སུབ་པ། - - + + Remove all ཚང་མ་སུབ་པ། - + Remove bookmark ཤོག་འཛར་སུབ་པ། @@ -834,7 +839,7 @@ SideBarImageViewModel - + Page %1 ཤོག་ལྷེ་%1པ། @@ -842,12 +847,12 @@ SlidePlayWidget - + It is the first page ཤོག་ངོས་དང་པོ་ཡིན་པ། - + It is the last page ཤོག་ངོས་མཐའ་མ་ཡིན་པ། @@ -866,7 +871,7 @@ - + Save ཉར་བ། @@ -886,17 +891,17 @@ ཆེ་ཤེལ། - + Tools ཡོ་བྱད། - + Search འཚོལ་ཞིབ། - + Print པར་འདེབས། @@ -904,7 +909,7 @@ TitleWidget - + Thumbnails བསྡུས་རིས། @@ -917,33 +922,95 @@ འཇུག་ཚད་མཐོ་ཤོས་ལ་སླེབས་འདུག + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - - - Batch print documents without UI. - Batch print documents without UI. - diff --git a/translations/deepin-reader_br.ts b/translations/deepin-reader_br.ts index 73976435b..1411c4fdb 100644 --- a/translations/deepin-reader_br.ts +++ b/translations/deepin-reader_br.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer مُراجعة المستند - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - مُراجعة المستند هو أداة لقراءة ملفات المستندات، ويدعم التنسيقات مثل PDF، DJVU، DOCX وغيرها. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location المكان - + Subject الموضوع - + Author المؤلف - + Keywords الكلمات المفتاحية - + Producer المُنتج - + Creator المُنشئ - + Time created وقت الإنشاء - + Time modified وقت التعديل - + Format التنسيق - + Pages الصفحات - + Optimized المُحسّن - + Security الأمان - + Page size حجم الصفحة - + File size حجم الملف - + + Warnings + + + + Basic info المعلومات الأساسية - + Unknown غير معروف - + Yes نعم - + No لا @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark أضف ملاحظة - + Are you sure you want to delete all bookmarks? هل أنت متأكد أنك تريد حذف جميع الملاحظات؟ @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy نسخ - + Remove annotation إزالة التعليق - + + + Add annotation أضف تعليق - + + + + Remove bookmark إزالة الملاحظة - + + + + Add bookmark أضف ملاحظة - + Highlight أبرز - + Remove highlight إزالة الارتفاع - + + Search البحث - + + Exit fullscreen الخروج من الوضع الكامل الشاشة - + + Fullscreen وضع كامل الشاشة - + + Slide show عرض الشرائح - + + First page الصفحة الأولى - + + Previous page الصفحة السابقة - + + Next page الصفحة التالية - + + Last page الصفحة الأخيرة - + + Rotate left التدوير إلى اليسار - + + Rotate right التدوير إلى اليمين - + + Print طباعة - + + Document info معلومات الوثيقة @@ -219,7 +248,7 @@ Central - + Documents الوثائق @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported التنسيق غير مدعوم - + Open failed فشل في الفتح - + Please check if the file is damaged يرجى التحقق من أن الملف ليس تالفًا - + Conversion failed, please check if the file is damaged فشل التحويل، يرجى التحقق من أن الملف ليس تالفًا - + Save failed فشل في الحفظ - + Saved successfully تم الحفظ بنجاح - + Save as احفظ باسم - + + Invalid file name اسم الملف غير صحيح - + + OK button موافق @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here اسحب الوثائق هنا - + Format supported: %1 التنسيق المدعوم: %1 - + Select File اختر ملفًا @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed تم إزالة الت bookmark - + + Please select the text يرجى اختيار النص - + + The annotation has been removed تم إزالة التعليق @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password ملف مشفر، يرجى إدخال كلمة المرور - + Password كلمة المرور - + OK button موافق - + Wrong password كلمة مرور خاطئة + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous السابق - + Next التالي @@ -349,12 +414,12 @@ HandleMenu - + Select Text تحديد النص - + Hand Tool أداة اليد @@ -362,12 +427,12 @@ NotesWidget - + Add annotation إضافة ملاحظة - + Are you sure you want to delete all annotations? هل أنت متأكد أنك تريد حذف جميع الملاحظات؟ @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number رقم صفحة غير صحيح @@ -383,7 +448,7 @@ ProgressDialog - + Converting جارٍ التحويل @@ -391,43 +456,61 @@ QObject - + Document not saved الوثيقة غير محفوظة + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - هل ترغب في حفظ التعديلات في "%1"؟ + + Save the changes to "%1"? + هل ترغب في حفظ التعديلات في "%1"؟ - + Cancel button إلغاء - + Discard button الإعفاء - + Save button حفظ - + Cancel إلغاء - + Delete حذف @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View عرض الصفحةين - + 1:1 size حجم 1:1 - + Fit Page لملء الصفحة - + Fit Height لملء الارتفاع - + Fit Width لملء العرض @@ -463,36 +546,36 @@ SearchResWidget - + No search results لا توجد نتائج بحث - + %1 items found - '%1 عنصر تم العثور عليه' + '%1 عنصر تم العثور عليه' SecurityDialog - + This document is trying to connect to: هذا الوثيقة محاولة الاتصال بـ: - + If you trust the website, click Allow, otherwise click Block. إذا كنت تثق بالموقع، اضغط على السماح، وإلا اضغط على الحظر. - + Block button حظر - + Allow button سماح @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails صور مصغرة - + Catalog فهرس - + Bookmarks ملاحظات - + Annotations التعليقات @@ -524,188 +607,207 @@ ShortCutShow - + Settings الإعدادات - + Exit الخروج - + Help مساعدة - + Page up الصفحة إلى الأعلى - + Page down الصفحة إلى الأسفل - + Open فتح - + Zoom in تكبير - + Zoom out تصغير - + Save as حفظ كـ - + + File + + + + + Display + + + + + Tools + أدوات + + + + Edit + + + + Print طباعة - + Save حفظ - + Thumbnails الصور المصغرة - + 1:1 size الحجم 1:1 - + Fit height ملاءمة الارتفاع - + Fit width ملاءمة العرض - + Rotate left التدوير إلى اليسار - + Rotate right التدوير إلى اليمين - + Move to the beginning الانتقال إلى البداية - + Move to the end الانتقال إلى نهاية - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text اختيار النص - + Hand tool أداة اليد - + Add bookmark إضافة ملاحظة - + Delete حذف - + Magnifier تكبير - + Slide show عرض الشرائح - + Fullscreen وضع الشاشة الكاملة - + Copy نسخ - + Cut قص - + Paste لصق - + Undo الإلغاء - + Select all حدد الكل - + Display shortcuts عرض المفاتيح القصيرة - + Add annotation أضف ملاحظة - + Highlight أبرز - + Search بحث @@ -713,22 +815,23 @@ SideBarImageListView - + Copy نسخ - + Remove annotation إزالة الملاحظة - + + Remove all إزالة جميعها - + Remove bookmark إزالة الت bookmark @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 الصفحة %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page هي الصفحة الأولى - + It is the last page هي الصفحة الأخيرة @@ -757,47 +860,48 @@ TitleMenu - + New window نافذة جديدة - + New tab タブ جديد - + + Save احفظ - + Save as احفظ باسم - + Display in file manager عرض في مدير الملفات - + Magnifer تكبير - + Tools أدوات - + Search بحث - + Print طباعة @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails صور مصغرة @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached تم الوصول إلى حد الإدخال + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. مسار ملف المستند - + + FilePath مسار الملف - + ThumbnailPath Path. مسار صورة مصغرة - + Generate thumbnail. إنشاء صورة مصغرة. diff --git a/translations/deepin-reader_ca.ts b/translations/deepin-reader_ca.ts index 5bbcadd4e..cc448861c 100755 --- a/translations/deepin-reader_ca.ts +++ b/translations/deepin-reader_ca.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Visualitzador de documents - + Document Viewer is a tool for reading document files, supporting %1. El Visualitzador de documents és una eina per llegir fitxers de documents que admet %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Ubicació - + Subject Assumpte - + Author Autor - + Keywords Paraules clau - + Producer Productor - + Creator Creador - + Time created Hora de creació - + Time modified Hora de modificació - + Format Format - + Pages Pàgines - + Optimized Optimitzat - + Security Seguretat - + Page size Mida de la pàgina - + File size Mida del fitxer - + + Warnings + + + + Basic info Informació bàsica - + Unknown Desconegut - + Yes Sí - + No No @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Afegeix un marcador - + Are you sure you want to delete all bookmarks? Segur que voleu eliminar tots els marcadors? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copia-ho - + Remove annotation Elimina l'anotació - - - + + + Add annotation Afegiu-hi una anotació - - - - + + + + Remove bookmark Elimina'n el punt de lectura - - - - + + + + Add bookmark Afegeix un marcador - + Highlight Destaca - + Remove highlight Elimina'n el realçament - - + + Search Cerca - - + + Exit fullscreen Surt de la pantalla completa - - + + Fullscreen Pantalla completa - - + + Slide show Presentació - - + + First page Primera pàgina - - + + Previous page Pàgina anterior - - + + Next page Pàgina següent - - + + Last page Darrera pàgina - - + + Rotate left Gira cap a l'esquerra - - + + Rotate right Gira cap a la dreta - - + + Print Imprimeix-lo - - + + Document info Informació del document @@ -241,7 +248,7 @@ Central - + Documents Documents @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported El format no s'admet. - + Open failed N'ha fallat l'obertura. - + Please check if the file is damaged Si us plau, comproveu si el fitxer està malmès. - + Conversion failed, please check if the file is damaged Ha fallat la conversió. Si us plau, comproveu si el fitxer està malmès. - + Save failed Ha fallat desar-lo. - + Saved successfully S'ha desat correctament. - + Save as Desa-ho com a... - - + + Invalid file name Nom del fitxer no vàlid - - + + OK button D'acord @@ -305,12 +312,12 @@ Arrossegueu documents aquí. - + Format supported: %1 Format admès: %1 - + Select File Seleccioneu el fitxer @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed S'ha eliminat el punt de lectura. - - + + Please select the text Seleccioneu el text - - + + The annotation has been removed S'ha eliminat l'anotació. @@ -344,31 +351,62 @@ Fitxer encriptat, si us plau, escriviu la contrasenya. - + Password Contrasenya - + OK button D'acord - + Wrong password Contrasenya incorrecta + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Anterior - + Next Següent @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Afegiu-hi una anotació - + Are you sure you want to delete all annotations? Segur que voleu eliminar totes les anotacions? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Número de pàgina no vàlid @@ -423,38 +461,56 @@ Document no desat + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Voleu desar els canvis a %1? - + Cancel button Cancel·la - + Discard button Descarta-ho - + Save button Desa-ho - + Cancel Cancel·la - + Delete Suprimeix @@ -490,12 +546,12 @@ SearchResWidget - + No search results No hi ha cap resultat de la cerca. - + %1 items found %1 elements trobats @@ -551,188 +607,207 @@ ShortCutShow - + Settings Configuració - + Exit Surt - + Help Ajuda - + Page up Pàgina amunt - + Page down Pàgina avall - + Open Obre'l - + Zoom in Apropa - + Zoom out Allunya - + Save as Desa-ho com a... - + + File + + + + + Display + + + + + Tools + Eines + + + + Edit + + + + Print Imprimeix-lo - + Save Desa-ho - + Thumbnails Miniatures - + 1:1 size Mida d'1:1 - + Fit height Ajusta a l'alçada - + Fit width Ajusta a l'amplada - + Rotate left Gira cap a l'esquerra - + Rotate right Gira cap a la dreta - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Mou al principi - + Move to the end Mou fins al final - + Select text Selecciona el text - + Hand tool Eina de mà - + Add bookmark Afegeix un marcador - + Delete Suprimeix - + Magnifier Lupa - + Slide show Presentació - + Fullscreen Pantalla completa - + Copy Copia-ho - + Cut Retalla - + Paste Enganxa - + Undo Desfés - + Select all Selecciona-ho tot - + Display shortcuts Mostra les dreceres - + Add annotation Afegiu-hi una anotació - + Highlight Destaca - + Search Cerca @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Copia-ho - + Remove annotation Elimina l'anotació - - + + Remove all Elimina-ho tot - + Remove bookmark Elimina'n el punt de lectura @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Pàgina %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page És la primera pàgina - + It is the last page És la darrera pàgina @@ -785,48 +860,48 @@ TitleMenu - + New window Finestra nova - + New tab Pestanya nova - - + + Save Desa-ho - + Save as Desa-ho com a... - + Display in file manager Mostra'l al gestor de fitxers - + Magnifer Lupa - + Tools Eines - + Search Cerca - + Print Imprimeix-lo @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniatures @@ -847,28 +922,97 @@ S'ha arribat al límit d'entrada. + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Camí del fitxer del document. - - + + FilePath Camí del fitxer - + ThumbnailPath Path. Camí de la miniatura - + Generate thumbnail. Genera'n la miniatura - \ No newline at end of file + diff --git a/translations/deepin-reader_cs.ts b/translations/deepin-reader_cs.ts index 3caa21203..d4370f360 100755 --- a/translations/deepin-reader_cs.ts +++ b/translations/deepin-reader_cs.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Prohlížeč dokumentů - + Document Viewer is a tool for reading document files, supporting %1. Prohlížeč dokumentů je nástroj pro čtení souborů dokumentů, podporující %1 @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Pozice - + Subject Předmět - + Author Autor - + Keywords Klíčová slova - + Producer Vytvořeno v - + Creator Autor - + Time created Vytvořeno - + Time modified Změněno - + Format Formát - + Pages Stránek - + Optimized Optimalizováno - + Security Zabezpečení - + Page size Velikost stránky - + File size Velikost souboru - + + Warnings + + + + Basic info Základní údaje - + Unknown Neznámý - + Yes Ano - + No Ne @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Přidat záložku - + Are you sure you want to delete all bookmarks? Opravdu chcete smazat veškeré záložky? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Zkopírovat - + Remove annotation Odstranit poznámku - - - + + + Add annotation Přidat poznámku - - - - + + + + Remove bookmark Odstranit záložku - - - - + + + + Add bookmark Přidat záložku - + Highlight Zvýraznit - + Remove highlight Odstranit zvýraznění - - + + Search Hledat - - + + Exit fullscreen Opustit celou obrazovku - - + + Fullscreen Celá obrazovka - - + + Slide show Prezentace - - + + First page První stránka - - + + Previous page Předchozí stránka - - + + Next page Další stránka - - + + Last page Poslední stránka - - + + Rotate left Otočit doleva - - + + Rotate right Otočit doprava - - + + Print Tisk - - + + Document info Informace o dokumentu @@ -241,7 +248,7 @@ Central - + Documents Dokumenty @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Daný formát není podporován - + Open failed Nepodařilo se otevřít - + Please check if the file is damaged Zkontrolujte, zda soubor není poškozen - + Conversion failed, please check if the file is damaged Převod se nezdařil – zkontrolujte, zda soubor není poškozený - + Save failed Ukládání se nezdařilo - + Saved successfully Úspěšně uloženo - + Save as Uložit jako - - + + Invalid file name Neplatný název souboru - - + + OK button OK @@ -305,12 +312,12 @@ Dokumenty přetáhněte sem - + Format supported: %1 Podporovaný formát: %1 - + Select File Vybrat soubor @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Záložka byla odstraněna - - + + Please select the text Vyberte text - - + + The annotation has been removed Poznámka byla odstraněna @@ -344,31 +351,62 @@ Šifrovaný soubor – zadejte prosím heslo - + Password Heslo - + OK button OK - + Wrong password Nesprávné heslo + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Předchozí - + Next Další @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Přidat poznámku - + Are you sure you want to delete all annotations? Opravdu chcete smazat všechny anotace? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Neplatné číslo stránky @@ -423,38 +461,56 @@ Dokument neuložen + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Uložit změny do „%1“? - + Cancel button Zrušit - + Discard button Zahodit - + Save button Uložit - + Cancel Zrušit - + Delete Smazat @@ -490,12 +546,12 @@ SearchResWidget - + No search results Nic nenalezeno - + %1 items found nalezeno %1 položek @@ -759,23 +815,23 @@ SideBarImageListView - + Copy Zkopírovat - + Remove annotation Odstranit poznámku - - + + Remove all Odebrat vše - + Remove bookmark Odstranit záložku @@ -783,7 +839,7 @@ SideBarImageViewModel - + Page %1 Strana %1 @@ -791,12 +847,12 @@ SlidePlayWidget - + It is the first page Je to první strana - + It is the last page Je to poslední strana @@ -804,48 +860,48 @@ TitleMenu - + New window Nové okno - + New tab Nová karta - - + + Save Uložit - + Save as Uložit jako - + Display in file manager Zobrazit ve správci souborů - + Magnifer Lupa - + Tools Nástroje - + Search Hledat - + Print Tisk @@ -853,7 +909,7 @@ TitleWidget - + Thumbnails Náhledy @@ -866,28 +922,99 @@ Narazilo se na limit vstupu + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Popis umístění souboru s dokumentem. - - + + FilePath Popis umístění souboru - + ThumbnailPath Path. Popis umístění náhledu. - + Generate thumbnail. Vytvořit náhled. - \ No newline at end of file + diff --git a/translations/deepin-reader_da.ts b/translations/deepin-reader_da.ts index c4d09356f..e6de0b60a 100755 --- a/translations/deepin-reader_da.ts +++ b/translations/deepin-reader_da.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumentfremviser - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Placering - + Subject Emne - + Author Forfatter - + Keywords Nøgleord - + Producer Producent - + Creator Skaber - + Time created Oprettelsestidspunkt - + Time modified Ændringstidspunkt - + Format Format - + Pages Sider - + Optimized Optimeret - + Security Sikkerhed - + Page size Sidestøttelse - + File size Filstørrelse - + + Warnings + + + + Basic info Grundlæggende information - + Unknown Ukendt - + Yes Ja - + No Nej @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Tilføj bogmærke - + Are you sure you want to delete all bookmarks? Er du sikker på, at du vil slette alle bogmærker? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopiér - + Remove annotation Fjern annotering - - - + + + Add annotation Tilføj annotering - - - - + + + + Remove bookmark Fjern bogmærke - - - - + + + + Add bookmark Tilføj bogmærke - + Highlight Fremhæv - + Remove highlight Fjern fremhævning - - + + Search Søg - - + + Exit fullscreen Afslut fuldskærm - - + + Fullscreen Fuldskærm - - + + Slide show Slideshow - - + + First page Første side - - + + Previous page Forrige side - - + + Next page Næste side - - + + Last page Sidste side - - + + Rotate left Drej til venstre - - + + Rotate right Drej til højre - - + + Print Udskriv - - + + Document info Dokumentinformation @@ -241,7 +248,7 @@ Central - + Documents Dokumenter @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Formatet understøttes ikke - + Open failed Åbning mislykkedes - + Please check if the file is damaged Tjek venligst om filen er beskadiget - + Conversion failed, please check if the file is damaged Konvertering mislykkedes, tjek venligst om filen er skadet - + Save failed Kunne ikke gemme - + Saved successfully Gemt - + Save as Gem som - - + + Invalid file name Ugyldigt filnavn - - + + OK button OK @@ -305,12 +312,12 @@ Træk dokumenter her - + Format supported: %1 Støttet format: %1 - + Select File Vælg fil @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Bogmærket er fjernet - - + + Please select the text Vælg venligst teksten - - + + The annotation has been removed Annoteringen er fjernet @@ -344,31 +351,62 @@ Krypteret fil, indtast venligst adgangskode - + Password Adgangskode - + OK button OK - + Wrong password Forkert adgangskode + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Forrige - + Next Næste @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Tilføj annotering - + Are you sure you want to delete all annotations? Er du sikker på, at du vil slette alle noter? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Ugyldigt sidetal @@ -423,38 +461,56 @@ Dokument ikke gemt + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Gem ændringerne til "%1"? - + Cancel button Annuller - + Discard button Forkast - + Save button Gem - + Cancel Annuller - + Delete Slet @@ -490,12 +546,12 @@ SearchResWidget - + No search results Ingen søgeresultater - + %1 items found %1 elementer fundet @@ -551,188 +607,207 @@ ShortCutShow - + Settings Indstillinger - + Exit Afslut - + Help Hjælp - + Page up Side op - + Page down Side ned - + Open Åbn - + Zoom in Zoom ind - + Zoom out Zoom ud - + Save as Gem som - + + File + + + + + Display + + + + + Tools + Værktøjer + + + + Edit + + + + Print Udskriv - + Save Gem - + Thumbnails Miniaturer - + 1:1 size 1:1 størrelse - + Fit height Tilpas højde - + Fit width Tilpas bredde - + Rotate left Drej til venstre - + Rotate right Drej til højre - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Flyt til starten - + Move to the end Flyt til slutningen - + Select text Vælg tekst - + Hand tool Håndværktøj - + Add bookmark Tilføj bogmærke - + Delete Slet - + Magnifier Forstørrelsesglas - + Slide show Slideshow - + Fullscreen Fuldskærm - + Copy Kopiér - + Cut Klip - + Paste Indsæt - + Undo Fortryd - + Select all Vælg alt - + Display shortcuts Vis genveje - + Add annotation Tilføj annotering - + Highlight Fremhæv - + Search Søg @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopiér - + Remove annotation Fjern annotering - - + + Remove all Fjern alt - + Remove bookmark Fjern bogmærke @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Side %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Det er den første side - + It is the last page Det er den sidste side @@ -785,48 +860,48 @@ TitleMenu - + New window Nyt vindue - + New tab Nyt faneblad - - + + Save Gem - + Save as Gem som - + Display in file manager Vis i filhåndtering - + Magnifer Forstørrelsesglas - + Tools Værktøjer - + Search Søg - + Print Udskriv @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturer @@ -847,28 +922,97 @@ Inputgrænse nået + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumentfilsti. - - + + FilePath Filsti - + ThumbnailPath Path. ThumbnailPath-sti. - + Generate thumbnail. Generer thumbnail. - \ No newline at end of file + diff --git a/translations/deepin-reader_de.ts b/translations/deepin-reader_de.ts index 5f318b941..f49665f1a 100755 --- a/translations/deepin-reader_de.ts +++ b/translations/deepin-reader_de.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumentbetrachter - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Ort - + Subject Betreff - + Author Autor - + Keywords Schlagwörter - + Producer Produzent - + Creator Ersteller - + Time created Erstellungszeit - + Time modified Änderungszeit - + Format Format - + Pages Seiten - + Optimized Optimiert - + Security Sicherheit - + Page size Seitengröße - + File size Dateigröße - + + Warnings + + + + Basic info Basisinformationen - + Unknown Unbekannt - + Yes Ja - + No Nein @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Lesezeichen hinzufügen - + Are you sure you want to delete all bookmarks? Sind Sie sicher, dass Sie alle Lesezeichen löschen möchten? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopieren - + Remove annotation Anmerkung entfernen - - - + + + Add annotation Anmerkung hinzufügen - - - - + + + + Remove bookmark Lesezeichen entfernen - - - - + + + + Add bookmark Lesezeichen hinzufügen - + Highlight Hervorheben - + Remove highlight Hervorhebung entfernen - - + + Search Suchen - - + + Exit fullscreen Vollbild beenden - - + + Fullscreen Vollbild - - + + Slide show Diaschau - - + + First page Erste Seite - - + + Previous page Vorherige Seite - - + + Next page Nächste Seite - - + + Last page Letzte Seite - - + + Rotate left Nach links drehen - - + + Rotate right Nach rechts drehen - - + + Print Drucken - - + + Document info Dokumentinformationen @@ -241,7 +248,7 @@ Central - + Documents Dokumente @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Das Format wird nicht unterstützt - + Open failed Öffnen fehlgeschlagen - + Please check if the file is damaged Bitte prüfen Sie, ob die Datei beschädigt ist - + Conversion failed, please check if the file is damaged Konvertierung fehlgeschlagen, bitte prüfen Sie, ob die Datei beschädigt ist - + Save failed Speichern fehlgeschlagen - + Saved successfully Erfolgreich gespeichert - + Save as Speichern unter - - + + Invalid file name Ungültiger Dateiname - - + + OK button OK @@ -305,12 +312,12 @@ Dokumente hierher ziehen - + Format supported: %1 Format unterstützt: %1 - + Select File Datei auswählen @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Das Lesezeichen wurde entfernt - - + + Please select the text Bitte wählen Sie den Text aus - - + + The annotation has been removed Die Anmerkung wurde entfernt @@ -344,31 +351,62 @@ Verschlüsselte Datei, bitte geben Sie das Passwort ein - + Password Passwort - + OK button OK - + Wrong password Falsches Passwort + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Vorherige - + Next Nächste @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Anmerkung hinzufügen - + Are you sure you want to delete all annotations? Sind Sie sicher, dass Sie alle Lesezeichen löschen möchten? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Ungültige Seitennummer @@ -423,38 +461,56 @@ Dokument nicht gespeichert + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Änderungen zu „%1“ speichern? - + Cancel button Abbrechen - + Discard button Verwerfen - + Save button Speichern - + Cancel Abbrechen - + Delete Löschen @@ -490,12 +546,12 @@ SearchResWidget - + No search results Keine Suchergebnisse - + %1 items found %1 Elemente gefunden @@ -551,188 +607,207 @@ ShortCutShow - + Settings Einstellungen - + Exit Beenden - + Help Hilfe - + Page up Bild auf - + Page down Bild ab - + Open Öffnen - + Zoom in Hineinzoomen - + Zoom out Herauszoomen - + Save as Speichern als - + + File + + + + + Display + + + + + Tools + Werkzeuge + + + + Edit + + + + Print Drucken - + Save Speichern - + Thumbnails Vorschaubilder - + 1:1 size Größe 1:1 - + Fit height Höhe anpassen - + Fit width Breite anpassen - + Rotate left Nach links drehen - + Rotate right Nach rechts drehen - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Zum Anfang springen - + Move to the end Zum Ende springen - + Select text Text auswählen - + Hand tool Handwerkzeug - + Add bookmark Lesezeichen hinzufügen - + Delete Löschen - + Magnifier Lupe - + Slide show Diaschau - + Fullscreen Vollbild - + Copy Kopieren - + Cut Ausschneiden - + Paste Einfügen - + Undo Rückgängig - + Select all Alles auswählen - + Display shortcuts Tastaturkombinationen anzeigen - + Add annotation Anmerkung hinzufügen - + Highlight Hervorheben - + Search Suchen @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopieren - + Remove annotation Anmerkung entfernen - - + + Remove all Alle entfernen - + Remove bookmark Lesezeichen entfernen @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Seite %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Es ist die erste Seite - + It is the last page Es ist die letzte Seite @@ -785,48 +860,48 @@ TitleMenu - + New window Neues Fenster - + New tab Neuer Tab - - + + Save Speichern - + Save as Speichern als - + Display in file manager Im Dateimanager anzeigen - + Magnifer Lupe - + Tools Werkzeuge - + Search Suchen - + Print Drucken @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Vorschaubilder @@ -847,28 +922,97 @@ Eingabelimit erreicht + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Vorschaubild generieren. - \ No newline at end of file + diff --git a/translations/deepin-reader_el.ts b/translations/deepin-reader_el.ts index 94aa81efb..e1f7bd54c 100644 --- a/translations/deepin-reader_el.ts +++ b/translations/deepin-reader_el.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Αναγνώστης Αρχείων - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Τοποθεσία - + Subject Θέμα - + Author Συγγραφέας - + Keywords Λέξεις Κλειδιά - + Producer Παραγωγός - + Creator Δημιουργός - + Time created Ώρα Δημιουργίας - + Time modified Ώρα Επεξεργασίας - + Format Φόρματ - + Pages Σελίδες - + Optimized Επιτυχημένη Προσαρμογή - + Security Ασφάλεια - + Page size Μέγεθος Σελίδας - + File size Μέγεθος Αρχείου - + + Warnings + + + + Basic info Βασικές Πληροφορίες - + Unknown Άγνωστο - + Yes Ναι - + No Όχι @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Προσθήκη Σημειωματικού - + Are you sure you want to delete all bookmarks? Είστε σίγουροι ότι θέλετε να διαγράψετε όλα τα σημειωματικά; @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Αντιγραφή - + Remove annotation Αφαίρεση Ανάγνωσης - - - + + + Add annotation Προσθήκη Ανάγνωσης - - - - + + + + Remove bookmark Αφαίρεση Σημειωματικού - - - - + + + + Add bookmark Προσθήκη Σημειωματικού - + Highlight Επισημάνσεις - + Remove highlight Αφαίρεση Επισημάνσεων - - + + Search Αναζήτηση - - + + Exit fullscreen Έξοδος από την πλήρη οθόνη - - + + Fullscreen Πλήρης οθόνη - - + + Slide show Παρουσίαση διαφανειών - - + + First page Πρώτη σελίδα - - + + Previous page Προηγούμενη σελίδα - - + + Next page Επόμενη σελίδα - - + + Last page Τελευταία σελίδα - - + + Rotate left Εστίαση αριστερά - - + + Rotate right Εστίαση δεξιά - - + + Print Εκτύπωση - - + + Document info Πληροφορίες έγγραφου @@ -241,7 +248,7 @@ Central - + Documents Έγγραφα @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Το μορφός δεν υποστηρίζεται - + Open failed Αποτυχία ανοίγματος - + Please check if the file is damaged Παρακαλώ ελέγξτε αν το αρχείο έχει υποστεί ζημιά - + Conversion failed, please check if the file is damaged Η μετατροπή απέτυχε, παρακαλώ ελέγξτε αν το αρχείο έχει υποστεί ζημιά - + Save failed Η αποθήκευση απέτυχε - + Saved successfully Αποθηκεύτηκε επιτυχώς - + Save as Αποθήκευση ως - - + + Invalid file name Μη έγκυρο όνομα αρχείου - - + + OK button Είναι ΟΚ @@ -305,12 +312,12 @@ Σύρετε τα έγγραφα εδώ - + Format supported: %1 Μορφός υποστηρίζεται: %1 - + Select File Επιλογή Αρχείου @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Το σύμβολο προσκόμισης έχει αφαιρεθεί - - + + Please select the text Παρακαλώ επιλέξτε το κείμενο - - + + The annotation has been removed Η σημειωματική έχει αφαιρεθεί @@ -344,31 +351,62 @@ Κρυπτογραφημένο αρχείο, παρακαλώ εισάγετε τον κωδικό - + Password Κωδικός - + OK button Είναι ΟΚ - + Wrong password Λάθος κωδικός πρόσβασης + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Προηγούμενο - + Next Επόμενο @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Προσθήκη σχολίου - + Are you sure you want to delete all annotations? Είστε σίγουροι ότι θέλετε να διαγράψετε όλα τα σχόλια; @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Μη έγκυρος αριθμός σελίδας @@ -423,38 +461,56 @@ Ο έγγραφος δεν έχει αποθηκευτεί + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Θέλετε να αποθηκευτεί το αρχείο "%1"; - + Cancel button Ακύρωση - + Discard button Αποδοχή - + Save button Αποθήκευση - + Cancel Ακύρωση - + Delete Διαγραφή @@ -490,12 +546,12 @@ SearchResWidget - + No search results Δεν βρέθηκαν αποτελέσματα αναζήτησης - + %1 items found '%1 αντικείμενα βρέθηκαν' @@ -551,188 +607,207 @@ ShortCutShow - + Settings Ρυθμίσεις - + Exit Έξοδος - + Help Βοήθεια - + Page up Σελίδα προς τα πάνω - + Page down Σελίδα προς τα κάτω - + Open Άνοιγμα - + Zoom in Επενδύσεις - + Zoom out Επεκτείνεις - + Save as Αποθήκευση ως - + + File + + + + + Display + + + + + Tools + Εργαλεία + + + + Edit + + + + Print Εκτύπωση - + Save Αποθήκευση - + Thumbnails Προβολές - + 1:1 size 1:1 μέγεθος - + Fit height Προσαρμογή ύψους - + Fit width Προσαρμογή πλάτους - + Rotate left Στροφή αριστερά - + Rotate right Στροφή δεξιά - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Μετακίνηση στην αρχή - + Move to the end Μετακίνηση στο τέλος - + Select text Επιλογή κειμένου - + Hand tool Εργαλείο χειρού - + Add bookmark Προσθήκη επισκεπτικού σημείου - + Delete Διαγραφή - + Magnifier Μικροσκόπιο - + Slide show Παρουσίαση διαφανειών - + Fullscreen Πλήρης οθόα - + Copy Αντιγραφή - + Cut Κόψιμο - + Paste Επικόλληση - + Undo Αναστροφή - + Select all Επιλογή όλων - + Display shortcuts Εμφάνιση συντομεύσεων - + Add annotation Προσθήκη σχολίου - + Highlight Επισημάνση - + Search Αναζήτηση @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Αντιγραφή - + Remove annotation Αφαίρεση σχολίου - - + + Remove all Αφαίρεση όλων - + Remove bookmark Αφαίρεση επισημάνσεως @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Σελίδα %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Είναι η πρώτη σελίδα - + It is the last page Είναι η τελευταία σελίδα @@ -785,48 +860,48 @@ TitleMenu - + New window Νέο παράθυρο - + New tab Νέο καρτελάκι - - + + Save Αποθήκευση - + Save as Αποθήκευση ως - + Display in file manager Εμφάνιση στο διαχειριστή αρχείων - + Magnifer Μεγεθυντήριο - + Tools Εργαλεία - + Search Αναζήτηση - + Print Εκτύπωση @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Προβολές @@ -847,28 +922,97 @@ Φτάσε η προσωρινή όριο εισόδου + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Διαδρομή αρχείου εγγράφου - - + + FilePath Διαδρομή Αρχείου - + ThumbnailPath Path. Διαδρομή Προβολής - + Generate thumbnail. Δημιουργία προβολής. - \ No newline at end of file + diff --git a/translations/deepin-reader_en_AU.ts b/translations/deepin-reader_en_AU.ts index 17a89712e..1385aba22 100644 --- a/translations/deepin-reader_en_AU.ts +++ b/translations/deepin-reader_en_AU.ts @@ -1,300 +1,307 @@ - + + + Application Document Viewer - + - + Document Viewer is a tool for reading document files, supporting %1. - + AttrScrollWidget - + Location - + - + Subject - + - + Author - + - + Keywords Keywords - + Producer - + - + Creator - + - + Time created - + - + Time modified - + - + Format - + - + Pages - + - + Optimized Optimized - + Security - + - + Page size - + - + File size - + + + + + Warnings + - + Basic info Basic infos - + Unknown - + - + Yes - + - + No - + BookMarkWidget - + Add bookmark - + - + Are you sure you want to delete all bookmarks? - + BrowserMenu - - - + + + Copy - + - + Remove annotation - + - - - + + + Add annotation - + - - - - + + + + Remove bookmark - + - - - - + + + + Add bookmark - + - + Highlight - + - + Remove highlight - + - - + + Search - + - - + + Exit fullscreen - + - - + + Fullscreen - + - - + + Slide show - + - - + + First page - + - - + + Previous page - + - - + + Next page - + - - + + Last page - + - - + + Rotate left - + - - + + Rotate right - + - - + + Print - + - - + + Document info - + Central - + Documents - + CentralDocPage - + The format is not supported - + - + Open failed - + - + Please check if the file is damaged - + - + Conversion failed, please check if the file is damaged - + - + Save failed - + - + Saved successfully - + - + Save as - + - - + + Invalid file name - + - - + + OK button - + @@ -302,38 +309,38 @@ Drag documents here - + - + Format supported: %1 - + - + Select File - + DocSheet - - + + The bookmark has been removed - + - - + + Please select the text - + - - + + The annotation has been removed - + @@ -341,36 +348,67 @@ Encrypted file, please enter the password - + - + Password - + - + OK button - + - + Wrong password - + + + + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + FindWidget - + Previous Previous - + Next - + @@ -378,33 +416,33 @@ Select Text - + Hand Tool - + NotesWidget - + Add annotation - + - + Are you sure you want to delete all annotations? - + PagingWidget - + Invalid page number - + @@ -412,7 +450,7 @@ Converting - + @@ -420,43 +458,61 @@ Document not saved - + + + + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + SaveDialog - + Save the changes to "%1"? - + - + Cancel button - + - + Discard button - + - + Save button - + - + Cancel - + - + Delete - + @@ -464,40 +520,40 @@ Two-Page View - + 1:1 size - + Fit Page - + Fit Height - + Fit Width - + SearchResWidget - + No search results - + - + %1 items found - + @@ -505,24 +561,24 @@ This document is trying to connect to: - + If you trust the website, click Allow, otherwise click Block. - + Block button - + Allow button - + @@ -530,313 +586,332 @@ Thumbnails - + Catalog - + Bookmarks - + Annotations - + ShortCutShow - + Settings - + - + Exit - + - + Help - + - + Page up - + - + Page down - + - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Open - + - + Zoom in - + - + Zoom out - + - + Save as - + + + + + File + + + + + Display + + + + + Tools + + + + + Edit + - + Print - + - + Save - + - + Thumbnails - + - + 1:1 size - + - + Fit height - + - + Fit width - + - + Rotate left - + - + Rotate right - + - + Move to the beginning - + - + Move to the end - + - + Select text - + - + Hand tool - + - + Add bookmark - + - + Delete - + - + Magnifier - + - + Slide show - + - + Fullscreen - + - + Copy - + - + Cut - + - + Paste - + - + Undo - + - + Select all - + - + Display shortcuts - + - + Add annotation - + - + Highlight - + - + Search - + SideBarImageListView - + Copy - + - + Remove annotation - + - - + + Remove all - + - + Remove bookmark - + SideBarImageViewModel - + Page %1 - + SlidePlayWidget - + It is the first page - + - + It is the last page - + TitleMenu - + New window - + - + New tab - + - - + + Save - + - + Save as - + - + Display in file manager - + - + Magnifer - + - + Tools - + - + Search - + - + Print - + TitleWidget - + Thumbnails - + @@ -844,31 +919,100 @@ Input limit reached - + + + + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + main - + Document File Path. - + - - + + FilePath - + - + ThumbnailPath Path. - + - + Generate thumbnail. - + - \ No newline at end of file + diff --git a/translations/deepin-reader_eo.ts b/translations/deepin-reader_eo.ts index 6b9577422..cdd3aed76 100644 --- a/translations/deepin-reader_eo.ts +++ b/translations/deepin-reader_eo.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Dokumento-vizor - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Dokumento-vizor estas ilo por legi dokumentajn dosieron, kiu subtenas PDF, DJVU, DOCX kaj aliajn. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Loko - + Subject Temo - + Author Aŭtoro - + Keywords Klavo-vortoj - + Producer Produktoro - + Creator Kreinto - + Time created Tempo kiam ĝi estis kreita - + Time modified Tempo kiam ĝi estis modifita - + Format Formato - + Pages Pagaĵoj - + Optimized Optimizita - + Security Sekureco - + Page size Pagaĵo-taŭgo - + File size Dosiero-taŭgo - + + Warnings + + + + Basic info Baza informo - + Unknown Neniu - + Yes Ĵes - + No Ne @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Aldoni markon - + Are you sure you want to delete all bookmarks? Ĉu vi certe volas forigi ĉiujn markojn? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Kopii - + Remove annotation Forigi noton - + + + Add annotation Aldoni noton - + + + + Remove bookmark Forigi markon - + + + + Add bookmark Aldoni markon - + Highlight Marki - + Remove highlight Forigi markon - + + Search Serĉi - + + Exit fullscreen Ŝalti for - + + Fullscreen Ekranplena - + + Slide show Diapositivo - + + First page Unua paĝo - + + Previous page Pretendo paĝo - + + Next page Sekva paĝo - + + Last page Lasta paĝo - + + Rotate left Turni maldekstra - + + Rotate right Turni dekstra - + + Print Preni - + + Document info Dokumenta informo @@ -219,7 +248,7 @@ Central - + Documents Dokumentoj @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported La formato ne estas subtenata - + Open failed Mal sukcesa malaperi - + Please check if the file is damaged Bonvolu kontrolu, ĉu la dosiero estas danĝera - + Conversion failed, please check if the file is damaged Konvertiĝo malsukcesis, bonvolu kontrolu, ĉu la dosiero estas danĝera - + Save failed Konservi malsukcesis - + Saved successfully Konservi sukcese - + Save as Konservi kiel - + + Invalid file name Nevalida dosieronomo - + + OK button OK @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Traktu dokumentojn ĉi tie - + Format supported: %1 Formato subtenata: %1 - + Select File Elekti dosieron @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed La marko estis forĵetita - + + Please select the text Bonvolu elekti la tekston - + + The annotation has been removed La komento estis forĵetita @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Ŝifrita dosiero, bonvolu entre la pasvorto - + Password Pasvorto - + OK button OK - + Wrong password Malajusta pasvorto + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Antaŭa - + Next Sekva @@ -349,12 +414,12 @@ HandleMenu - + Select Text Selekti tekston - + Hand Tool Mano-ilo @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Aldoni noton - + Are you sure you want to delete all annotations? Ĉu vi certe volas forigi ĉiujn notojn? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Nevalida paĝnumero @@ -383,7 +448,7 @@ ProgressDialog - + Converting Konvertante @@ -391,43 +456,61 @@ QObject - + Document not saved Dokumento ne konserviĝis + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - Konservi la ŝanĝojn en "%1"? + + Save the changes to "%1"? + Konservi la ŝanĝojn en "%1"? - + Cancel button Anuligi - + Discard button Forigi - + Save button Konservi - + Cancel Anuligi - + Delete Forigi @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Du-paĝa vido - + 1:1 size 1:1 grandeco - + Fit Page Adapti paĝon - + Fit Height Adapti altecon - + Fit Width Adapti larĝon @@ -463,36 +546,36 @@ SearchResWidget - + No search results Neniu serĉrezulto - + %1 items found - '%1 artikoloj troviĝis' + '%1 artikoloj troviĝis' SecurityDialog - + This document is trying to connect to: Tiu dokumento provas konekti al: - + If you trust the website, click Allow, otherwise click Block. Se vi kredas la retpaĝon, klaku Permesi, alie klaku Bloki. - + Block button Bloki - + Allow button Permesi @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Miniaturej - + Catalog Katalogo - + Bookmarks Markoj - + Annotations Anotacioj @@ -524,188 +607,207 @@ ShortCutShow - + Settings Agordoj - + Exit Eliri - + Help Helpo - + Page up Paĝo supre - + Page down Paĝo malsupre - + Open Malfermi - + Zoom in Zoomi pli - + Zoom out Zoomi malpli - + Save as Konservi kiel - + + File + + + + + Display + + + + + Tools + Iloj + + + + Edit + + + + Print Preni - + Save Konservi - + Thumbnails Miniaturoj - + 1:1 size 1:1 grandeco - + Fit height Adapti altecon - + Fit width Adapti larĝon - + Rotate left Turi maldekstren - + Rotate right Turi dekstren - + Move to the beginning Movi al komenco - + Move to the end Movi al fino - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Elekti tekston - + Hand tool Mano-instrumento - + Add bookmark Aldoni markon - + Delete Forigi - + Magnifier Mikroskopo - + Slide show Prezentado - + Fullscreen Tuta ekranaro - + Copy Kopii - + Cut Forigi - + Paste Primi - + Undo Malfari - + Select all Selekti ĉiutan - + Display shortcuts Montri skurtojn - + Add annotation Aldoni komentaron - + Highlight Marki - + Search Serĉi @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Kopii - + Remove annotation Forigi komentaron - + + Remove all Forigi ĉiutan - + Remove bookmark Forigi markon @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Paĝo %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Ĉi tiu estas la unua paĝo - + It is the last page Ĉi tiu estas la lasta paĝo @@ -757,47 +860,48 @@ TitleMenu - + New window Nova fenestro - + New tab Nova tabo - + + Save Konservi - + Save as Konservi kiel - + Display in file manager Montri en dosieradministrilo - + Magnifer Mikroskopo - + Tools Iloj - + Search Serĉi - + Print Mallapigi @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturoj @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Limigo de enigo atingita + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dosierpado de dokumento. - + + FilePath Dosierpado - + ThumbnailPath Path. Miniaturpado. - + Generate thumbnail. Kreu miniaturon. diff --git a/translations/deepin-reader_es.ts b/translations/deepin-reader_es.ts index 9a73d6577..315f1035a 100755 --- a/translations/deepin-reader_es.ts +++ b/translations/deepin-reader_es.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Visor de documentos - + Document Viewer is a tool for reading document files, supporting %1. Visor de documentos de Deepin es una herramienta para leer documentos, soporta %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Ubicación - + Subject Asunto - + Author Autor - + Keywords Palabras clave - + Producer Productor - + Creator Creador - + Time created Fecha de creación - + Time modified Fecha de modificación - + Format Formato - + Pages Páginas - + Optimized Optimizado - + Security Seguridad - + Page size Tamaño de página - + File size Tamaño de archivo - + + Warnings + + + + Basic info Información básica - + Unknown Desconocido - + Yes Sí - + No No @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Añadir marcador - + Are you sure you want to delete all bookmarks? ¿Está seguro de quitar todos los marcadores? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copiar - + Remove annotation Borrar anotación - - - + + + Add annotation Añadir anotación - - - - + + + + Remove bookmark Quitar marcador - - - - + + + + Add bookmark Añadir marcador - + Highlight Resaltar - + Remove highlight Quitar resaltado - - + + Search Buscar - - + + Exit fullscreen Salir de la pantalla completa - - + + Fullscreen Pantalla completa - - + + Slide show Presentación - - + + First page Primera página - - + + Previous page Página anterior - - + + Next page Siguiente página - - + + Last page Última página - - + + Rotate left Girar a la izquierda - - + + Rotate right Girar a la derecha - - + + Print Imprimir - - + + Document info Información del documento @@ -241,7 +248,7 @@ Central - + Documents Documentos @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported El formato no es compatible - + Open failed Error al abrir - + Please check if the file is damaged Por favor verifique si el archivo esta dañado - + Conversion failed, please check if the file is damaged La conversión falló, verifique si el archivo esta dañado - + Save failed Error al guardar - + Saved successfully Guardado con éxito - + Save as Guardar como - - + + Invalid file name Nombre de archivo inválido - - + + OK button Aceptar @@ -305,12 +312,12 @@ Arrastre los documentos aquí - + Format supported: %1 Formato admitido: %1 - + Select File Seleccionar archivo @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed El marcador fue eliminado - - + + Please select the text Por favor seleccione el texto - - + + The annotation has been removed La anotación fue borrada @@ -344,31 +351,62 @@ Archivo cifrado, por favor ingrese la contraseña - + Password Contraseña - + OK button Aceptar - + Wrong password Contraseña incorrecta + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Anterior - + Next Siguiente @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Añadir anotación - + Are you sure you want to delete all annotations? ¿Está seguro de borrar todas las anotaciones? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Número de página inválido @@ -423,38 +461,56 @@ No se guardó el documento + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? ¿Desea guardar los cambios a "%1"? - + Cancel button Cancelar - + Discard button Descartar - + Save button Guardar - + Cancel Cancelar - + Delete Borrar @@ -490,12 +546,12 @@ SearchResWidget - + No search results No hay resultados de búsqueda - + %1 items found %1 elementos encontrados @@ -759,23 +815,23 @@ SideBarImageListView - + Copy Copiar - + Remove annotation Borrar anotación - - + + Remove all Borrar todas - + Remove bookmark Quitar marcador @@ -783,7 +839,7 @@ SideBarImageViewModel - + Page %1 Página %1 @@ -791,12 +847,12 @@ SlidePlayWidget - + It is the first page Esta es la primer pagina - + It is the last page Esta es la ultima pagina @@ -804,48 +860,48 @@ TitleMenu - + New window Nueva ventana - + New tab Nueva pestaña - - + + Save Guardar - + Save as Guardar como - + Display in file manager Mostrar en el administrador de archivos - + Magnifer Lupa - + Tools Herramientas - + Search Buscar - + Print Imprimir @@ -853,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturas @@ -866,28 +922,97 @@ Límite de entrada alcanzado + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Documento Archivo Ruta. - - + + FilePath ArchivoRuta - + ThumbnailPath Path. MiniaturaRuta Ruta. - + Generate thumbnail. Generar miniatura. - \ No newline at end of file + diff --git a/translations/deepin-reader_et.ts b/translations/deepin-reader_et.ts index f5855389f..e2df3710b 100644 --- a/translations/deepin-reader_et.ts +++ b/translations/deepin-reader_et.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumenti vaade - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Asukoht - + Subject Teema - + Author Autor - + Keywords Avastusvõtmed - + Producer Tööalustaja - + Creator Looja - + Time created Loojaaeg - + Time modified Muutuja aeg - + Format Vorming - + Pages Lehed - + Optimized Optimeeritud - + Security Tõenäosus - + Page size Lehe suurus - + File size Faili suurus - + + Warnings + + + + Basic info Tõlgendus - + Unknown Tundmatu - + Yes Jah - + No Ei @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Lisa merkki - + Are you sure you want to delete all bookmarks? Oled kindel, et tahad kustutada kõik märkmed? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopeeri - + Remove annotation Eemalda kommentaar - - - + + + Add annotation Lisa kommentaar - - - - + + + + Remove bookmark Eemalda merkku - - - - + + + + Add bookmark Lisa merkku - + Highlight Pöörde - + Remove highlight Eemalda pöörde - - + + Search Otsing - - + + Exit fullscreen Välju kogumise ruumist - - + + Fullscreen Kogumine ruumis - - + + Slide show Näidatud esitus - - + + First page Esimene leht - - + + Previous page Eelmine leht - - + + Next page Järgmine leht - - + + Last page Viimane leht - - + + Rotate left Vordse jooksul - - + + Rotate right Vordse vastand - - + + Print Vabandustega - - + + Document info Dokumenti info @@ -241,7 +248,7 @@ Central - + Documents Dokumentid @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Vormingut ei toetata - + Open failed Avamine ebaõnnestus - + Please check if the file is damaged Palun kontrolli, kas fail on vahetunud - + Conversion failed, please check if the file is damaged Konvertoimine ebaõnnestus, palun kontrolli, kas fail on vahetunud - + Save failed Salvestamine ebaõnnestus - + Saved successfully Salvestatud - + Save as Salvesta kui - - + + Invalid file name Vigane failinimi - - + + OK button OK @@ -305,12 +312,12 @@ Tasuta dokumente siia - + Format supported: %1 Sisestatud vorming: %1 - + Select File Vali fail @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Maark on eemaldatud - - + + Please select the text Vali tekst - - + + The annotation has been removed Märk on eemaldatud @@ -344,31 +351,62 @@ Krüptitud fail, sisesta parool - + Password Parool - + OK button OK - + Wrong password Vale parool + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Eelmine - + Next Järgmine @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Lisage märk - + Are you sure you want to delete all annotations? Oled kindel, et soovid kustutada kõik märkused? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Vigane lehe number @@ -423,38 +461,56 @@ Dokumenti ei salvestatud + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Salvestada muudatused "%1"? - + Cancel button Cancel - + Discard button Väljasta - + Save button Salvesta - + Cancel Cancel - + Delete Kustuta @@ -490,12 +546,12 @@ SearchResWidget - + No search results Otsingutulemeid ei leitud - + %1 items found %1 üksikut leitud @@ -551,188 +607,207 @@ ShortCutShow - + Settings Seaded - + Exit Välju - + Help Abi - + Page up Lehe üles - + Page down Lehe alla - + Open Ava - + Zoom in Suurendage - + Zoom out Vähendage - + Save as Salvesta kui - + + File + + + + + Display + + + + + Tools + Tööriistad + + + + Edit + + + + Print Vabatach - + Save Salvesta - + Thumbnails Pildikatsed - + 1:1 size 1:1 suurus - + Fit height Päise mõõduga - + Fit width Laia mõõduga - + Rotate left Väiksemas suunas tooaleta - + Rotate right Suuremas suunas tooaleta - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Liiguta algusesse - + Move to the end Liiguta lõpusse - + Select text Vali tekst - + Hand tool Kohtumine tööriist - + Add bookmark Lisage merkkinähtus - + Delete Kustuta - + Magnifier Suurendaja - + Slide show Väljundpaanikord - + Fullscreen Kokkuväline ekraan - + Copy Kopeeri - + Cut Keskeeri - + Paste Liiguta - + Undo Tühista - + Select all Vali kõik - + Display shortcuts Näita pikaleta - + Add annotation Lisa kommentaar - + Highlight Pöörde väljastus - + Search Otsing @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopeeri - + Remove annotation Eemalda merkki - - + + Remove all Kustuta kõik - + Remove bookmark Eemalda merk @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Leht %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page See on esimene leht - + It is the last page See on viimane leht @@ -785,48 +860,48 @@ TitleMenu - + New window Uus akna - + New tab Uus viktor - - + + Save Salvesta - + Save as Salvesta kui - + Display in file manager Näita failipäringus - + Magnifer Suurendaja - + Tools Tööriistad - + Search Otsing - + Print Võtmine @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniküpsised @@ -847,28 +922,97 @@ Sisestus piiratajus jõudis + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumenti failipfad. - - + + FilePath Failipfad - + ThumbnailPath Path. Miniküpsise failipfad. - + Generate thumbnail. Genereeri miniküpsise. - \ No newline at end of file + diff --git a/translations/deepin-reader_eu.ts b/translations/deepin-reader_eu.ts index 0cfa3aa3a..989bee148 100644 --- a/translations/deepin-reader_eu.ts +++ b/translations/deepin-reader_eu.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Ikurriko Ikurriko - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Ikurriko ikurriko teknologia dokumentu fitxategiak irakurtzeko, PDF, DJVU, DOCX eta besteak onartzen du. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Kontua - + Subject Gaiak - + Author Egilea - + Keywords Gakuska - + Producer Sortzailea - + Creator Sortzailea - + Time created Sortze denbora - + Time modified Aldatze denbora - + Format Formatua - + Pages Orriak - + Optimized Optimizatua - + Security Inongo - + Page size Orriaren tamaina - + File size Fitxategiaren tamaina - + + Warnings + + + + Basic info Oinarrizko informazioa - + Unknown Ezezaguna - + Yes Bai - + No Ez @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Marka bat gehitu - + Are you sure you want to delete all bookmarks? Marka guztiak ezabatu nahi duzula egiaztotu? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Kopiatu - + Remove annotation Anotazioa kendu - + + + Add annotation Anotazioa gehitu - + + + + Remove bookmark Marka kendu - + + + + Add bookmark Marka bat gehitu - + Highlight Markatzea - + Remove highlight Markatzea kendu - + + Search Bilatu - + + Exit fullscreen Ir atertza - + + Fullscreen Pantaila osoa - + + Slide show Slide show - + + First page Lehen orri - + + Previous page Aurreko orri - + + Next page Hurrengo orri - + + Last page Azken orri - + + Rotate left Izquierda - + + Rotate right Dekirira - + + Print Inprimatu - + + Document info Dokumentuaren informazioa @@ -219,7 +248,7 @@ Central - + Documents Dokumentuak @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Formatua ez dago onartua - + Open failed Ireki ezezaguna - + Please check if the file is damaged Egiaztatu fitxategia ez dago ezarrigarria - + Conversion failed, please check if the file is damaged Konbertsioa ezezaguna, egiaztatu fitxategia ez dago ezarrigarria - + Save failed Gorde ezezaguna - + Saved successfully Gorde da ezaguna - + Save as Gorde gisa - + + Invalid file name Fitxategi izena ez dago zuzena - + + OK button Onartu @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Gorako dokumentuak hemen - + Format supported: %1 Formatua onartua da: %1 - + Select File Aukeratu Fitxategia @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Marka ez dago ezarrigarria - + + Please select the text Aukeratu testua - + + The annotation has been removed Anotazioa ez dago ezarrigarria @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Kriptatutako fitxategia, pasahitza sartu - + Password Pasahitza - + OK button Onartu - + Wrong password Pasahitza okerra + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Aurrekoa - + Next Hurrekoa @@ -349,12 +414,12 @@ HandleMenu - + Select Text Testua aukeratu - + Hand Tool Herritza tresna @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Anotazioa gehitu - + Are you sure you want to delete all annotations? Zuhaitz ezazu anotazio guztiak ezabatu nahi dituzu? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Orri zenbaki arrunta @@ -383,7 +448,7 @@ ProgressDialog - + Converting Konbertitzen @@ -391,43 +456,61 @@ QObject - + Document not saved Dokumentua ez da gorde + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1"-ra aldaketa gorde nahi duzu? + + Save the changes to "%1"? + "%1"-ra aldaketa gorde nahi duzu? - + Cancel button Utzi - + Discard button Ezabatu - + Save button Gorde - + Cancel Utzi - + Delete Ezabatu @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Bi orri ikuspegia - + 1:1 size 1:1 tamaina - + Fit Page Orriaren tamaina - + Fit Height Alturaaren tamaina - + Fit Width Zabaleraaren tamaina @@ -463,36 +546,36 @@ SearchResWidget - + No search results Bilaketa emaitza bat ere ez da - + %1 items found - '%1 elementu aurkitu da' + '%1 elementu aurkitu da' SecurityDialog - + This document is trying to connect to: Dokumentu hau konektatzen saiatzen da: - + If you trust the website, click Allow, otherwise click Block. Webgunea zaharraren aldeko izan nahi baduzu, klikatu - + Block button Blokeatu - + Allow button Onartu @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Miniatjurak - + Catalog Katalogoa - + Bookmarks Markak - + Annotations Anotazioi @@ -524,188 +607,207 @@ ShortCutShow - + Settings Ezarpenak - + Exit Irten - + Help Laguntza - + Page up Orriko aurrera - + Page down Orriko atzera - + Open Ireki - + Zoom in Mundua handitzea - + Zoom out Mundua txikitu - + Save as Gorde hobe - + + File + + + + + Display + + + + + Tools + Eragileak + + + + Edit + + + + Print Inprimatu - + Save Gorde - + Thumbnails Minibilduma - + 1:1 size 1:1 neurria - + Fit height Gaita altuera - + Fit width Gaita zabalera - + Rotate left Kontsultatu ezker - + Rotate right Kontsultatu hamaikoa - + Move to the beginning Hasieratik mugitu - + Move to the end Aitzaritik mugitu - + Scroll up one line Korritu lerro bat gora - + Scroll down one line Korritu lerro bat behera - - + Select text Testua aukeratu - + Hand tool Oinarrizko tresna - + Add bookmark Marka gehitu - + Delete Ezabatu - + Magnifier Zerrendatzea - + Slide show Slide show - + Fullscreen Pantaila osoa - + Copy Kopiatu - + Cut Kendu - + Paste Itsas - + Undo Atertza - + Select all Aukeratu dena - + Display shortcuts Erakutsi sartutakoak - + Add annotation Gehitu anotazioa - + Highlight Markatu - + Search Bilatu @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Kopiatu - + Remove annotation Kendu anotazioa - + + Remove all Kendu dena - + Remove bookmark Kendu marka @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Orri %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Era da lehen orri - + It is the last page Era da azken orri @@ -757,47 +860,48 @@ TitleMenu - + New window Berriro egineko lehio - + New tab Berriro egineko fitxa - + + Save Gorde - + Save as Gorde izen berean - + Display in file manager Erakutsi fitxategi kudeatzailean - + Magnifer Biribila - + Tools Eragileak - + Search Bilatu - + Print Inprimatu @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Miniatjurak @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Sartutako muga ezarria + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumentuaren fitxategi bidea. - + + FilePath Bidea - + ThumbnailPath Path. Miniatjuraren bidea. - + Generate thumbnail. Sortu miniatjuraren. diff --git a/translations/deepin-reader_fa.ts b/translations/deepin-reader_fa.ts index 2c3636092..9a61364ba 100644 --- a/translations/deepin-reader_fa.ts +++ b/translations/deepin-reader_fa.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer نمایشگر دُکُمَنت - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - نمایشگر دُکُمَنت ابزاری برای خواندن فایل‌های دُکُمَنت است که پشتیبانی از فرمت‌های PDF، DJVU، DOCX و غیره را دارد. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location محل - + Subject موضوع - + Author نویسنده - + Keywords کلمات کلیدی - + Producer تولیدکننده - + Creator سازنده - + Time created زمان ایجاد - + Time modified زمان ویرایش - + Format فرمت - + Pages صفحات - + Optimized بهینه‌سازی شده - + Security امنیت - + Page size اندازه صفحه - + File size اندازه فایل - + + Warnings + + + + Basic info اطلاعات اساسی - + Unknown ناشناخته - + Yes بله - + No خیر @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark اضافه کردن نشانه - + Are you sure you want to delete all bookmarks? آیا مطمئن هستید که می‌خواهید تمام نشانه‌ها را حذف کنید؟ @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy کپی - + Remove annotation حذف نوت - + + + Add annotation اضافه کردن نوت - + + + + Remove bookmark حذف نشانه - + + + + Add bookmark اضافه کردن نشانه - + Highlight اشاره - + Remove highlight حذف اشاره - + + Search جستجو - + + Exit fullscreen خارج حالت پرکردن - + + Fullscreen حالت پرکردن - + + Slide show نمایش اسلاید - + + First page صفحه اول - + + Previous page صفحه قبلی - + + Next page صفحه بعدی - + + Last page صفحه آخر - + + Rotate left چرخاندن به چپ - + + Rotate right چرخاندن به راست - + + Print چاپ - + + Document info اطلاعات فایل @@ -219,7 +248,7 @@ Central - + Documents فایل ها @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported فرمت پشتیبانی نمی شود - + Open failed باز کردن شکست خورد - + Please check if the file is damaged لطفاً بررسی کنید فایل آسیب دیده است یا خیر - + Conversion failed, please check if the file is damaged تبدیل فاش شد، لطفاً بررسی کنید فایل آسیب دیده است یا خیر - + Save failed ذخیره شکست خورد - + Saved successfully موفقیت آمیز ذخیره شد - + Save as ذخیره به عنوان - + + Invalid file name نام فایل نامعتبر است - + + OK button تایید @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here فایل ها را اینجا بکشید - + Format supported: %1 فرمت پشتیبانی شده: %1 - + Select File فایل انتخاب کنید @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed نشانه گذاری حذف شد - + + Please select the text لطفاً متن انتخاب کنید - + + The annotation has been removed توضیح حذف شد @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password فایل مرموز است، لطفاً رمز عبور را وارد کنید - + Password رمز عبور - + OK button تایید - + Wrong password کلمه عبور اشتباه است + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous قبلی - + Next بعدی @@ -349,12 +414,12 @@ HandleMenu - + Select Text متن را انتخاب کنید - + Hand Tool اصلی @@ -362,12 +427,12 @@ NotesWidget - + Add annotation توضیح اضافه کنید - + Are you sure you want to delete all annotations? آیا مطمئن هستید که می‌خواهید تمام توضیحات را حذف کنید؟ @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number شماره صفحه معتبر نمی‌باشد @@ -383,7 +448,7 @@ ProgressDialog - + Converting تبدیل @@ -391,43 +456,61 @@ QObject - + Document not saved فایل امضاء نشده است + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - تغییرات را در "%1" ذخیره کنید؟ + + Save the changes to "%1"? + تغییرات را در "%1" ذخیره کنید؟ - + Cancel button لغو - + Discard button حذف - + Save button ذخیره - + Cancel لغو - + Delete حذف @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View نمایش دو صفحه‌ای - + 1:1 size اندازه 1:1 - + Fit Page صفحه را بکشید - + Fit Height ارتفاع را بکشید - + Fit Width عرض را بکشید @@ -463,36 +546,36 @@ SearchResWidget - + No search results نتیجه‌ی جستجویی یافت نشد - + %1 items found - '%1 مورد یافت شد' + '%1 مورد یافت شد' SecurityDialog - + This document is trying to connect to: این فایل در حال اتصال به: - + If you trust the website, click Allow, otherwise click Block. اگر سایت را امن می‌دانید، روی اجازه کلیک کنید، در غیر این صورت روی مسدود کردن کلیک کنید. - + Block button مسدود کردن - + Allow button اجازه دادن @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails تصاویر کوچک - + Catalog فهرست - + Bookmarks نشانک‌ها - + Annotations توضيحات @@ -524,188 +607,207 @@ ShortCutShow - + Settings تنظیمات - + Exit خروج - + Help کمک - + Page up صفحه بالا - + Page down صفحه پایین - + Open باز کردن - + Zoom in بزرگ کردن - + Zoom out کوچک کردن - + Save as ذخیره به عنوان - + + File + + + + + Display + + + + + Tools + ابزارها + + + + Edit + + + + Print چاپ - + Save ذخیره - + Thumbnails تصاویر کوچک - + 1:1 size اندازه ۱:۱ - + Fit height مطابق ارتفاع - + Fit width مطابق عرض - + Rotate left چرخاندن به چپ - + Rotate right چرخاندن به راست - + Move to the beginning به ابتدای حرکت کن - + Move to the end به انتهای حرکت کن - + Scroll up one line یک خط به بالا بروید - + Scroll down one line یک خط به پایین بروید - - + Select text متن را انتخاب کن - + Hand tool ابزار دست - + Add bookmark bookmark اضافه کن - + Delete حذف - + Magnifier مagnifier - + Slide show نمایش اسلاید - + Fullscreen تمام صفحه - + Copy کپی - + Cut کتر - + Paste پست - + Undo انصراف - + Select all انتخاب همه - + Display shortcuts نمایش کوتاه‌تر - + Add annotation افزودن نظر - + Highlight اهمیت بخشی - + Search جستجو @@ -713,22 +815,23 @@ SideBarImageListView - + Copy کپی - + Remove annotation حذف نظر - + + Remove all حذف همه - + Remove bookmark حذف نشانک @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 صفحه %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page این اولین صفحه است - + It is the last page این آخرین صفحه است @@ -757,47 +860,48 @@ TitleMenu - + New window پنجره جدید - + New tab تیب جدید - + + Save ذخیره - + Save as ذخیره به عنوان - + Display in file manager نمایش در مدیر فایل - + Magnifer مagnifier - + Tools ابزارها - + Search چاپ - + Print تصاویر کوچک @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails حد ورود پایان یافت @@ -813,30 +917,98 @@ TransparentTextEdit - + Input limit reached مسیر فایل مستند + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. مسیر فایل - + + FilePath مسیر پسوند تصویر کوچک - + ThumbnailPath Path. تولید تصویر کوچک. - + Generate thumbnail. diff --git a/translations/deepin-reader_fi.ts b/translations/deepin-reader_fi.ts index edb841b18..3826d01b0 100755 --- a/translations/deepin-reader_fi.ts +++ b/translations/deepin-reader_fi.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Asiakirjat - + Document Viewer is a tool for reading document files, supporting %1. Asiakirjat on työkalu asiakirjojen lukemiseen, tukee %1:tä. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Sijainti - + Subject Aihe - + Author Tekijä - + Keywords Avainsanat - + Producer Tuottaja - + Creator Luoja - + Time created Luontiaika - + Time modified Muokattu - + Format Formaatti - + Pages Sivut - + Optimized Optimoitu - + Security Turvallisuus - + Page size Sivun koko - + File size Tiedoston koko - + + Warnings + + + + Basic info Perustiedot - + Unknown Tuntematon - + Yes Kyllä - + No Ei @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Lisää kirjanmerkki - + Are you sure you want to delete all bookmarks? Haluatko varmasti poistaa kaikki kirjanmerkit? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopioi - + Remove annotation Poista merkinnät - - - + + + Add annotation Lisää merkinnät - - - - + + + + Remove bookmark Poista kirjanmerkki - - - - + + + + Add bookmark Lisää kirjanmerkki - + Highlight Korostus - + Remove highlight Poista korostus - - + + Search Etsi - - + + Exit fullscreen Poistu koko näytöstä - - + + Fullscreen Kokonäyttö - - + + Slide show Diaesitys - - + + First page Ensimmäinen sivu - - + + Previous page Edellinen sivu - - + + Next page Seuraava sivu - - + + Last page Viimeinen sivu - - + + Rotate left Käännä vasemmalle - - + + Rotate right Käännä oikealle - - + + Print Tulosta - - + + Document info Asiakirjan tiedot @@ -241,7 +248,7 @@ Central - + Documents Asiakirjat @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Muotoa ei tueta - + Open failed Avaaminen epäonnistui - + Please check if the file is damaged Tarkista, onko tiedosto vaurioitunut - + Conversion failed, please check if the file is damaged Muuntaminen epäonnistui. Tarkista, onko tiedosto vaurioitunut - + Save failed Tallennus epäonnistui - + Saved successfully Tallennettu onnistuneesti - + Save as Tallenna nimellä - - + + Invalid file name Virheellinen tiedostonimi - - + + OK button OK @@ -305,12 +312,12 @@ Vedä asiakirjat tähän - + Format supported: %1 Tuettu muoto: %1 - + Select File Valitse tiedosto @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Kirjanmerkki on poistettu - - + + Please select the text Valitse teksti - - + + The annotation has been removed Merkinnät on poistettu @@ -344,18 +351,18 @@ Salattu tiedosto, anna salasana - + Password Salasana - + OK button OK - + Wrong password Väärä salasana @@ -363,22 +370,22 @@ EyeProtection - + No eye protection Ei yövaloa - + Classic eye protection Yövalo klassinen - + Green eye protection Yövalo vihreä - + Night eye protection Yövalo @@ -386,7 +393,7 @@ EyeProtectionAction - + Eye protection mode Yövalotilat @@ -394,12 +401,12 @@ FindWidget - + Previous Edellinen - + Next Seuraava @@ -420,12 +427,12 @@ NotesWidget - + Add annotation Lisää merkinnät - + Are you sure you want to delete all annotations? Haluatko varmasti poistaa kaikki huomautukset? @@ -462,12 +469,12 @@ Palautettu edelliseen lukuasentoon - + Jump to first page Siirry alkuun - + Close Sulje @@ -539,12 +546,12 @@ SearchResWidget - + No search results Ei hakutuloksia - + %1 items found %1 löydetyt kohteet @@ -808,23 +815,23 @@ SideBarImageListView - + Copy Kopioi - + Remove annotation Poista merkinnät - - + + Remove all Poista kaikki - + Remove bookmark Poista kirjanmerkki @@ -832,7 +839,7 @@ SideBarImageViewModel - + Page %1 Sivu %1 @@ -840,12 +847,12 @@ SlidePlayWidget - + It is the first page Ensimmäinen sivu - + It is the last page Viimeinen sivu @@ -864,7 +871,7 @@ - + Save Tallenna @@ -884,17 +891,17 @@ Suurennuslasi - + Tools Työkalut - + Search Etsi - + Print Tulosta @@ -902,7 +909,7 @@ TitleWidget - + Thumbnails Esikatselukuvat @@ -915,33 +922,97 @@ Merkkiraja ylitetty + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Asiakirjan tiedoston polku. - - + + FilePath Polku - + ThumbnailPath Path. Esikatselukuvan polku. - + Generate thumbnail. Luo esikatselukuva. - - - Batch print documents without UI. - Erätulostus ilman käyttöliittymää. - - \ No newline at end of file + diff --git a/translations/deepin-reader_fil.ts b/translations/deepin-reader_fil.ts index 0ddf96aa7..42c878ded 100644 --- a/translations/deepin-reader_fil.ts +++ b/translations/deepin-reader_fil.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Mga Viewer ng Dokumento - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Ang Document Viewer ay isang tool para basahin ang mga file ng dokumento, naglalaman ng PDF, DJVU, DOCX atbp. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Lokasyon - + Subject Paksa - + Author May-akda - + Keywords Pangunahing Salita - + Producer Prodyuser - + Creator Tagagawa - + Time created Oras ng Pagbuo - + Time modified Oras ng Pagbabago - + Format Formato - + Pages Mga Pahina - + Optimized Napapanahon - + Security Kasiguridadan - + Page size Laki ng Pahina - + File size Laki ng File - + + Warnings + + + + Basic info Mga Detalye - + Unknown Di kilala - + Yes Oo - + No Hindi @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Idagdag ang bookmark - + Are you sure you want to delete all bookmarks? Sigurado ka ba na nais mong i-delete ang lahat ng bookmarks? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Kopyahin - + Remove annotation Tanggalin ang anotasyon - + + + Add annotation Idagdag ang anotasyon - + + + + Remove bookmark Tanggalin ang bookmark - + + + + Add bookmark Idagdag ang bookmark - + Highlight Pakinabang - + Remove highlight Tanggalin ang pakinabang - + + Search Hanapin - + + Exit fullscreen Maglabas sa fullscreen - + + Fullscreen Fullscreen - + + Slide show Slide show - + + First page Unang pahina - + + Previous page Nangunguna pahina - + + Next page Susunod na pahina - + + Last page Huling pahina - + + Rotate left Ilipat para sa kaliwa - + + Rotate right Ilipat para sa kanan - + + Print Print - + + Document info Impormasyon ng dokumento @@ -219,7 +248,7 @@ Central - + Documents Dokumento @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Ang format ay hindi suportado - + Open failed Nagkaroon ng error sa pagbukas - + Please check if the file is damaged Suriin kung ang file ay naiiba - + Conversion failed, please check if the file is damaged Nagkaroon ng error sa konwersyon, suriin kung ang file ay naiiba - + Save failed Nagkaroon ng error sa pag-save - + Saved successfully Nakasave na nang walang error - + Save as I-save bilang - + + Invalid file name Mali ang pangalan ng file - + + OK button Opo @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Ilipat ang mga dokumento dito - + Format supported: %1 Format na suportado: %1 - + Select File Piliin ang File @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Nakalatag na bookmark - + + Please select the text Piliin muna ang teksto - + + The annotation has been removed Nakalatag na anotasyon @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Nakakakodigo na file, mangyaring ipasok ang password - + Password Password - + OK button Opo - + Wrong password Mali password + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Mga nakaraan - + Next Mga susunod @@ -349,12 +414,12 @@ HandleMenu - + Select Text Pumili ng Teksto - + Hand Tool Tool na kamay @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Idagdag ang anotasyon - + Are you sure you want to delete all annotations? Sigurado ka bang nais mong alisin ang lahat ng mga anotasyon? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Mali ang bilang ng pahina @@ -383,7 +448,7 @@ ProgressDialog - + Converting Konwertir @@ -391,43 +456,61 @@ QObject - + Document not saved Dokumento ay hindi inilagay + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - I-save ang mga pagbabago sa "%1"? + + Save the changes to "%1"? + I-save ang mga pagbabago sa "%1"? - + Cancel button Bawal - + Discard button Iwan - + Save button I-save - + Cancel Bawal - + Delete Alisin @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Pangangalakal ng dalawang pahina - + 1:1 size 1:1 laki - + Fit Page Magkakapareho ng pahina - + Fit Height Magkakapareho ng laki - + Fit Width Magkakapareho ng lapad @@ -463,36 +546,36 @@ SearchResWidget - + No search results Walang mga resulta ng paghahanap - + %1 items found - '%1 mga item ay nakahanap' + '%1 mga item ay nakahanap' SecurityDialog - + This document is trying to connect to: Ang dokumento ay nagsisimulang konektahin sa: - + If you trust the website, click Allow, otherwise click Block. Kung nagsisimula ka bang magkakaroon ng paniniwala sa website, i-click ang Allow, kung hindi, i-click ang Block. - + Block button Bawal - + Allow button Pahintulot @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Thumbnail - + Catalog Katalogo - + Bookmarks Mga bookmark - + Annotations Mga Anotasyon @@ -524,188 +607,207 @@ ShortCutShow - + Settings Mga Pараметро - + Exit Mag-exit - + Help Tulong - + Page up Pahina up - + Page down Pahina down - + Open Bukas - + Zoom in Zoom in - + Zoom out Zoom out - + Save as I-save bilang - + + File + + + + + Display + + + + + Tools + Mga tool + + + + Edit + + + + Print Print - + Save I-save - + Thumbnails Mga thumbnails - + 1:1 size 1:1 laki - + Fit height Mag-fit sa taas - + Fit width Mag-fit sa lapad - + Rotate left I-rotate para sa kaliwa - + Rotate right I-rotate para sa kanan - + Move to the beginning I-move sa simula - + Move to the end I-move sa wakas - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Pumili ng teksto - + Hand tool Kahon ng kamay - + Add bookmark Idagdag ang bookmark - + Delete Tanggalin - + Magnifier Magnifier - + Slide show Slide show - + Fullscreen Fullscreen - + Copy Kopyahin - + Cut I-cut - + Paste I-paste - + Undo Ibalik - + Select all Pumili lahat - + Display shortcuts Ipakita ang mga shortcut - + Add annotation Idagdag ang anotasyon - + Highlight Pangalawang tala - + Search Hanapin @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Kopyahin - + Remove annotation Alisin ang anotasyon - + + Remove all Alisin lahat - + Remove bookmark Alisin ang bookmark @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Pahina %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Ito ang unang pahina - + It is the last page Ito ang huling pahina @@ -757,47 +860,48 @@ TitleMenu - + New window Bagong window - + New tab Bagong tab - + + Save I-save - + Save as I-save bilang - + Display in file manager Ipakita sa file manager - + Magnifer Magnifier - + Tools Mga tool - + Search Hanapin - + Print I-print @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Thumbnail @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Limitasyon ng input ay nakaabot na + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Pahina ng Paggawa ng File - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Pahina - + Generate thumbnail. Igawa ang thumbnail. diff --git a/translations/deepin-reader_fr.ts b/translations/deepin-reader_fr.ts index 5dc0dff1f..7c06537e4 100755 --- a/translations/deepin-reader_fr.ts +++ b/translations/deepin-reader_fr.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Visionneuse de documents - + Document Viewer is a tool for reading document files, supporting %1. Le visualisateur de documents est un outil permettant de lire des fichiers de documents, prenant en charge %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Emplacement - + Subject Sujet - + Author Auteur - + Keywords Mots clés - + Producer Producteur - + Creator Créateur - + Time created Heure de création - + Time modified Heure de modification - + Format Format - + Pages Pages - + Optimized Optimisé - + Security Sécurité - + Page size Taille de la page - + File size Taille du fichier - + + Warnings + + + + Basic info Info de base - + Unknown Inconnu - + Yes Oui - + No Non @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Ajouter un signet - + Are you sure you want to delete all bookmarks? Voulez-vous vraiment supprimer tous les signets ? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copier - + Remove annotation Supprimer l'annotation - - - + + + Add annotation Ajouter une annotation - - - - + + + + Remove bookmark Supprimer le signet - - - - + + + + Add bookmark Ajouter un signet - + Highlight Mettre en évidence - + Remove highlight Supprimer la surbrillance - - + + Search Rechercher - - + + Exit fullscreen Quitter le plein écran - - + + Fullscreen Plein écran - - + + Slide show Diaporama - - + + First page Première page - - + + Previous page Page précédente - - + + Next page Page suivante - - + + Last page Dernière page - - + + Rotate left Rotation à gauche - - + + Rotate right Rotation à droite - - + + Print Imprimer - - + + Document info Informations sur le document @@ -241,7 +248,7 @@ Central - + Documents Documents @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Le format n'est pas pris en charge - + Open failed Échec de l'ouverture - + Please check if the file is damaged Veuillez vérifier si le fichier a été endommagé ou corrompu - + Conversion failed, please check if the file is damaged Échec de conversion, veuillez vérifier si le fichier a été endommagé ou corrompu - + Save failed Échec de la sauvegarde - + Saved successfully Enregistré avec succès - + Save as Enregistrer sous - - + + Invalid file name Nom de fichier invalide - - + + OK button OK @@ -305,12 +312,12 @@ Faites glisser des documents ici - + Format supported: %1 Format supporté : %1 - + Select File Sélectionner un fichier @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Le signet a été supprimé - - + + Please select the text Veuillez sélectionner le texte - - + + The annotation has been removed L'annotation a été supprimée @@ -344,31 +351,62 @@ Fichier crypté, veuillez saisir le mot de passe - + Password Mot de passe - + OK button OK - + Wrong password Mauvais mot de passe + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Précédent - + Next Suivant @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Ajouter une annotation - + Are you sure you want to delete all annotations? Voulez-vous vraiment supprimer toutes les annotations ? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Numéro de page invalide @@ -423,38 +461,56 @@ Document non sauvegardé + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Enregistrer les modifications dans "%1" ? - + Cancel button Annuler - + Discard button Abandonner - + Save button Enregistrer - + Cancel Annuler - + Delete Supprimer @@ -490,12 +546,12 @@ SearchResWidget - + No search results Aucun résultat trouvé - + %1 items found %1 éléments trouvés @@ -551,188 +607,207 @@ ShortCutShow - + Settings Paramètres - + Exit Quitter - + Help Aide - + Page up Page précédente - + Page down Page suivante - + Open Ouvrir - + Zoom in Zoom avant - + Zoom out Zoom arrière - + Save as Enregistrer sous - + + File + + + + + Display + + + + + Tools + Outils + + + + Edit + + + + Print Imprimer - + Save Enregistrer - + Thumbnails Vignettes - + 1:1 size Taille 1:1 - + Fit height Ajuster la hauteur - + Fit width Ajuster la largeur - + Rotate left Rotation à gauche - + Rotate right Rotation à droite - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Aller au début - + Move to the end Aller à la fin - + Select text Sélectionner du texte - + Hand tool Outil main - + Add bookmark Ajouter un signet - + Delete Supprimer - + Magnifier Loupe - + Slide show Diaporama - + Fullscreen Plein écran - + Copy Copier - + Cut Couper - + Paste Coller - + Undo Annuler - + Select all Tout sélectionner - + Display shortcuts Afficher les raccourcis - + Add annotation Ajouter une annotation - + Highlight Mettre en évidence - + Search Rechercher @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Copier - + Remove annotation Supprimer l'annotation - - + + Remove all Tout supprimer - + Remove bookmark Supprimer le signet @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Page %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page C'est la première page - + It is the last page C'est la dernière page @@ -785,48 +860,48 @@ TitleMenu - + New window Nouvelle fenêtre - + New tab Nouvel onglet - - + + Save Enregistrer - + Save as Enregistrer sous - + Display in file manager Afficher dans le gestionnaire de fichiers - + Magnifer Loupe - + Tools Outils - + Search Rechercher - + Print Imprimer @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Vignettes @@ -847,28 +922,97 @@ Limite d'entrée atteinte + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Chemin d'accès du document. - - + + FilePath Chemin du fichier - + ThumbnailPath Path. Chemin de la vignette. - + Generate thumbnail. Générer une vignette. - \ No newline at end of file + diff --git a/translations/deepin-reader_gl_ES.ts b/translations/deepin-reader_gl_ES.ts index 91ce7d066..7da4931ec 100755 --- a/translations/deepin-reader_gl_ES.ts +++ b/translations/deepin-reader_gl_ES.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Visor de documentos - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Localización - + Subject Asunto - + Author Autor - + Keywords Palabras clave - + Producer Produtor - + Creator Creador - + Time created Tempo creado - + Time modified Tempo modificado - + Format Formato - + Pages Páxinas - + Optimized Optimizado - + Security Securidade - + Page size Tamaño da páxina - + File size Tamaño do ficheiro - + + Warnings + + + + Basic info Información básica - + Unknown Descoñecido - + Yes Si - + No Non @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Engadir marcador - + Are you sure you want to delete all bookmarks? Estás seguro de que queres eliminar todos os marcadores? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copiar - + Remove annotation Eliminar anotación - - - + + + Add annotation Engadir anotacións - - - - + + + + Remove bookmark Eliminar marcador - - - - + + + + Add bookmark Engadir marcador - + Highlight Resaltar - + Remove highlight Eliminar o resaltado - - + + Search Buscar - - + + Exit fullscreen Saír da pantalla completa - - + + Fullscreen Pantalla completa - - + + Slide show Presentación de diapositivas - - + + First page Primeira páxina - - + + Previous page Anterior páxina - - + + Next page Posterior páxina - - + + Last page Última páxina - - + + Rotate left Xirar á esquerda - - + + Rotate right Xirar á dereita - - + + Print Imprimir - - + + Document info Información do documento @@ -241,7 +248,7 @@ Central - + Documents Documentos @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported O formato non é soportado - + Open failed Erro ao abrir - + Please check if the file is damaged Comprobe se o ficheiro está dañado - + Conversion failed, please check if the file is damaged Produciuse un erro na conversión. Comprobe se o ficheiro está danado - + Save failed Erro ao gardar - + Saved successfully Gardado con éxito - + Save as Gardar como - - + + Invalid file name Nome do ficheiro non válido - - + + OK button Aceptar @@ -305,12 +312,12 @@ Arrastrar documentos aquí - + Format supported: %1 Formato soportado: %1 - + Select File Seleccionar ficheiro @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed O marcador eliminouse - - + + Please select the text Seleccione o texto - - + + The annotation has been removed A anotación eliminouse @@ -344,31 +351,62 @@ Ficheiro cifrado, introduza o contrasinal - + Password Contrasinal - + OK button Aceptar - + Wrong password Contrasinal incorrecto + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Anterior - + Next Seguinte @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Engadir anotacións - + Are you sure you want to delete all annotations? Estás seguro de que queres eliminar todas as anotacións? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Número da páxina non válido @@ -423,38 +461,56 @@ Documento non gardado + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Gardar os cambios en "%1"? - + Cancel button Cancelar - + Discard button Descartar - + Save button Gardar - + Cancel Cancelar - + Delete Eliminar @@ -490,12 +546,12 @@ SearchResWidget - + No search results Sen resultados de busca - + %1 items found %1 elementos atopados @@ -551,188 +607,207 @@ ShortCutShow - + Settings Configuracións - + Exit Saír - + Help Axuda - + Page up Mover cara arriba polas páxinas - + Page down Mover cara abaixo polas páxinas - + Open Abrir - + Zoom in Ampliar - + Zoom out Afastar - + Save as Gardar como - + + File + + + + + Display + + + + + Tools + Ferramentas + + + + Edit + + + + Print Imprimir - + Save Gardar - + Thumbnails Miniaturas - + 1:1 size 1:1 tamaño - + Fit height Altura axustada - + Fit width Ancho axustado - + Rotate left Xirar á esquerda - + Rotate right Xirar á dereita - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Mover ao principio - + Move to the end Mover ao final - + Select text Seleccionar texto - + Hand tool Ferramentas manuais - + Add bookmark Engadir marcador - + Delete Eliminar - + Magnifier Lupa - + Slide show Presentación de diapositivas - + Fullscreen Pantalla completa - + Copy Copiar - + Cut Cortar - + Paste Pegar - + Undo Desfacer - + Select all Seleccionar todo - + Display shortcuts Amosar atallos - + Add annotation Engadir anotacións - + Highlight Resaltar - + Search Buscar @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Copiar - + Remove annotation Eliminar anotación - - + + Remove all Eliminar todo - + Remove bookmark Eliminar marcador @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Páxina %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page É a primeira páxina - + It is the last page É a última páxina @@ -785,48 +860,48 @@ TitleMenu - + New window Nova xanela - + New tab Nova lapela - - + + Save Gardar - + Save as Gardar como - + Display in file manager Amosar no xestor de ficheiros - + Magnifer Lupa - + Tools Ferramentas - + Search Buscar - + Print Imprimir @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturas @@ -847,28 +922,97 @@ Límite de entrada alcanzado + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Ruta do ficheiro do documento. - - + + FilePath Ruta do Ficheiro - + ThumbnailPath Path. Ruta de ruta en miniatura. - + Generate thumbnail. Xerar miniatura. - \ No newline at end of file + diff --git a/translations/deepin-reader_he.ts b/translations/deepin-reader_he.ts index fdab7fd0c..ff7790068 100644 --- a/translations/deepin-reader_he.ts +++ b/translations/deepin-reader_he.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ מ%; - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location מיקום - + Subject נושא - + Author מחבר - + Keywords מונחים מפתח - + Producer מפיק - + Creator מחבר - + Time created זמן יצירה - + Time modified זמן שינוי - + Format פורמט - + Pages stron - + Optimized מובנה - + Security בטיחות - + Page size גודל עמוד - + File size גודל קובץ - + + Warnings + + + + Basic info מידע בסיסי - + Unknown לא ידוע - + Yes כן - + No לא @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark הוסף מדפסת - + Are you sure you want to delete all bookmarks? האם אתה בטוח שברצונך 删除 @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy העתק - + Remove annotation מחק הערות - - - + + + Add annotation הוסף הערות - - - - + + + + Remove bookmark מחק סימן עניין - - - - + + + + Add bookmark הוספת סימן עניין - + Highlight הIGHLIGHT - + Remove highlight הסרת הדגשה - - + + Search חיפוש - - + + Exit fullscreen יציאה מהשופט - - + + Fullscreen מסך מלא - - + + Slide show הצגה מתקדמת - - + + First page الصفحة הראשונה - - + + Previous page الصفحة הקודמת - - + + Next page الصفحة הבאה - - + + Last page الصفحة האחרונה - - + + Rotate left שפוך שמאלה - - + + Rotate right שפוך ימינה - - + + Print דruk - - + + Document info מידע על מסמך @@ -241,7 +248,7 @@ Central - + Documents מסמכים @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported הפורמט אינו נתמך - + Open failed פתיחה נכשלה - + Please check if the file is damaged אנא בדקו אם הקובץ נפגש נזק - + Conversion failed, please check if the file is damaged הconverting נכשלה, אנא בדקו אם הקובץ נפגש נזק - + Save failed שמירת הקובץ נכשלה - + Saved successfully ה虞 נשמרה בהצלחה - + Save as שמור כ - - + + Invalid file name שם קובץ לא חוקי - - + + OK button בסדר @@ -305,12 +312,12 @@ גרור מסמכים לכאן - + Format supported: %1 פורמט נתמך: %1 - + Select File בחר קובץ @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed הסימן במחברת נמחק - - + + Please select the text אנא בחר טקסט - - + + The annotation has been removed הסימן הוסר @@ -344,31 +351,62 @@ קובץ מוצפן, אנא הזינו סיסמה - + Password סיסמה - + OK button בסדר - + Wrong password סיסמה שגויה + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous הקודם - + Next הבא @@ -389,12 +427,12 @@ NotesWidget - + Add annotation הוסף הערות - + Are you sure you want to delete all annotations? האם אתה בטוח שברצונך למחוק את כל הערותיך? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number מספר עמוד לא חוקי @@ -423,38 +461,56 @@ המסמך לא נשמר + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? האם לשמור את השינויים ב "%1"? - + Cancel button لغا - + Discard button למחוק - + Save button שמור - + Cancel לغا - + Delete מחק @@ -490,12 +546,12 @@ SearchResWidget - + No search results אין תוצאות חיפוש - + %1 items found '%1 פריטים נמצאו' @@ -551,188 +607,207 @@ ShortCutShow - + Settings הגדרות - + Exit יציאה - + Help עזרה - + Page up עמוד למעלה - + Page down עמוד למטה - + Open פתיחה - + Zoom in התאמה מוקדמת - + Zoom out התאמה מוקדמת פחות - + Save as שמור כ - + + File + + + + + Display + + + + + Tools + כלי + + + + Edit + + + + Print הדפס - + Save שמור - + Thumbnails תבניות - + 1:1 size גודל 1:1 - + Fit height אף לגובה - + Fit width אף לרוחב - + Rotate left שפוך שמאלה - + Rotate right שפוך ימינה - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning ה yalלה תחילת - + Move to the end ה yalלה סוף - + Select text בחר טקסט - + Hand tool כלי יד - + Add bookmark הוספת סימן עניין - + Delete מחק - + Magnifier מגניפיקטור - + Slide show הצגה מתקדמת - + Fullscreen מסך מלא - + Copy קopi - + Cut קוט - + Paste העתק - + Undo בטל - + Select all בחר הכל - + Display shortcuts הצגת מקצבי תקני - + Add annotation הוספת הערות - + Highlight הIGHLIGHT - + Search חיפוש @@ -740,23 +815,23 @@ SideBarImageListView - + Copy העתק - + Remove annotation מחק הערות - - + + Remove all מחק הכל - + Remove bookmark מחק סימן עניין @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 صفה %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page זו הصفה הראשונה - + It is the last page זו הصفה האחרונה @@ -785,48 +860,48 @@ TitleMenu - + New window חלון חדש - + New tab תא חדש - - + + Save שמור - + Save as שמור כ - + Display in file manager הצג במנהל קבצים - + Magnifer מרחב - + Tools כלי - + Search חיפוש - + Print דruk @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails תבניות @@ -847,28 +922,97 @@ גבול הכניסה נגזר + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. נתיב קובץ מסמך. - - + + FilePath נתיב קובץ - + ThumbnailPath Path. נתיב נתיב תבנית. - + Generate thumbnail. צור תבנית. - \ No newline at end of file + diff --git a/translations/deepin-reader_hi_IN.ts b/translations/deepin-reader_hi_IN.ts index ad4d95508..bda767a0e 100644 --- a/translations/deepin-reader_hi_IN.ts +++ b/translations/deepin-reader_hi_IN.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ प्रलेख प्रदर्शक - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location स्थान - + Subject विषय - + Author रचयिता - + Keywords वर्गीकरण शब्द - + Producer उत्पादक - + Creator निर्माता - + Time created निर्माण समय - + Time modified परिवर्तन समय - + Format प्रारूप - + Pages पृष्ठ - + Optimized अनुकूलित - + Security सुरक्षा - + Page size पृष्ठ आकार - + File size पूर्ण आकार - + + Warnings + + + + Basic info सामान्य जानकारी - + Unknown अज्ञात - + Yes हाँ - + No नहीं @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark पृष्ठ-स्मृति जोड़ें - + Are you sure you want to delete all bookmarks? क्या आप निश्चित ही सभी पृष्ठ-स्मृति हटाना चाहते हैं? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy कॉपी करें - + Remove annotation व्याख्या हटाएँ - - - + + + Add annotation व्याख्या जोड़ें - - - - + + + + Remove bookmark पृष्ठ-स्मृति हटाएँ - - - - + + + + Add bookmark पृष्ठ-स्मृति जोड़ें - + Highlight चिन्हित करें - + Remove highlight अचिन्हित करें - - + + Search खोजें - - + + Exit fullscreen पूर्ण स्क्रीन निरस्त - - + + Fullscreen पूर्ण स्क्रीन - - + + Slide show स्लाइड शो - - + + First page प्रथम पृष्ठ - - + + Previous page पिछला पृष्ठ - - + + Next page अगला पृष्ठ - - + + Last page अंतिम पृष्ठ - - + + Rotate left बाएं घुमाएँ - - + + Rotate right दाएं घुमाएँ - - + + Print प्रिंट करें - - + + Document info प्रलेख जानकारी @@ -241,7 +248,7 @@ Central - + Documents प्रलेख @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported असमर्थित प्रारूप - + Open failed खोलना विफल - + Please check if the file is damaged सुनिश्चित करें कि फाइल उचित है - + Conversion failed, please check if the file is damaged परिवर्तन विफल, कृपया सुनिश्चित करें कि फाइल उचित है - + Save failed संचित करना विफल - + Saved successfully संचित करना सफल - + Save as ऐसे संचित करें - - + + Invalid file name अमान्य फाइल नाम - - + + OK button ठीक है @@ -305,12 +312,12 @@ माउस द्वारा यहाँ प्रलेख ड्रैग करें - + Format supported: %1 समर्थित प्रारूप : %1 - + Select File फाइल चयन @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed पृष्ठ-स्मृति हटाई गई - - + + Please select the text कृपया लेख चुनें - - + + The annotation has been removed व्याख्या हटाई गई @@ -344,31 +351,62 @@ एन्क्रिप्टेड फाइल, कूटशब्द दर्ज करें - + Password कूटशब्द - + OK button ठीक है - + Wrong password गलत कूटशब्द + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous पिछला - + Next अगला @@ -389,12 +427,12 @@ NotesWidget - + Add annotation व्याख्या जोड़ें - + Are you sure you want to delete all annotations? क्या आप निश्चित ही सभी व्याख्यान हटाना चाहते हैं? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number अमान्य पृष्ठ संख्या @@ -423,38 +461,56 @@ प्रलेख संचित करना विफल + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? परिवर्तनों को "%1" में संचित करें? - + Cancel button रद्द करें - + Discard button निरस्त करें - + Save button संचित करें - + Cancel रद्द करें - + Delete हटाएँ @@ -490,12 +546,12 @@ SearchResWidget - + No search results कोई परिणाम नहीं - + %1 items found %1 वस्तुएँ मिली @@ -551,188 +607,207 @@ ShortCutShow - + Settings सेटिंग्स - + Exit बंद करें - + Help सहायता - + Page up पृष्ठ ऊपर करें - + Page down पृष्ठ नीचे करें - + Open खोलें - + Zoom in आकार बढ़ाएँ - + Zoom out आकार घटाएँ - + Save as ऐसे संचित करें - + + File + + + + + Display + + + + + Tools + साधन + + + + Edit + + + + Print प्रिंट करें - + Save संचित करें - + Thumbnails लघुछवि - + 1:1 size 1:1 अनुपात - + Fit height ऊँचाई अनुरूप - + Fit width चौड़ाई अनुरूप - + Rotate left बाएं घुमाएँ - + Rotate right दाएं घुमाएँ - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning शुरूआत में ले जाएं - + Move to the end अंत में ले जाएं - + Select text लेख चयन - + Hand tool हस्त साधन - + Add bookmark पृष्ठ-स्मृति जोड़ें - + Delete हटाएँ - + Magnifier आवर्धक - + Slide show स्लाइड शो - + Fullscreen पूर्ण स्क्रीन - + Copy कॉपी करें - + Cut कट करें - + Paste पेस्ट करें - + Undo पूर्ववत करें - + Select all सारा चयनित - + Display shortcuts शॉर्टकट दिखाएँ - + Add annotation व्याख्या जोड़ें - + Highlight चिन्हित करें - + Search खोजें @@ -740,23 +815,23 @@ SideBarImageListView - + Copy कॉपी करें - + Remove annotation व्याख्या हटाएँ - - + + Remove all सभी हटाएँ - + Remove bookmark पृष्ठ-स्मृति हटाएँ @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 पृष्ठ %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page यह पहली पृष्ठ है - + It is the last page यह अंतिम पृष्ठ है @@ -785,48 +860,48 @@ TitleMenu - + New window नई विंडो - + New tab नया टैब - - + + Save संचित करें - + Save as ऐसे संचित करें - + Display in file manager फाइल प्रबंधक में दिखाएँ - + Magnifer आवर्धक - + Tools साधन - + Search खोजें - + Print प्रिंट करें @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails लघुछवि @@ -847,28 +922,97 @@ इनपुट सीमा समाप्त + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - \ No newline at end of file + diff --git a/translations/deepin-reader_hr.ts b/translations/deepin-reader_hr.ts index f9bd38ce9..bbaf8a6de 100644 --- a/translations/deepin-reader_hr.ts +++ b/translations/deepin-reader_hr.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,100 +9,105 @@ Preglednik dokumenata - + Document Viewer is a tool for reading document files, supporting %1. - + AttrScrollWidget - + Location Lokacija - + Subject Tema - + Author Autor - + Keywords Ključne riječi - + Producer Proizvođač - + Creator Tvorac - + Time created Vrijeme stvaranja - + Time modified Vrijeme izmjene - + Format Format - + Pages Stranice - + Optimized Optimizirano - + Security Sigurnost - + Page size Veličina stranice - + File size Veličina datoteke - + + Warnings + + + + Basic info Osnovne informacije - + Unknown Nepoznato - + Yes Da - + No Ne @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Dodaj zabilješku - + Are you sure you want to delete all bookmarks? Jeste li sigurni da želite ukloniti sve zabilješke? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopiraj - + Remove annotation Ukloni napomenu - - - + + + Add annotation Dodaj napomenu - - - - + + + + Remove bookmark Ukloni zabilješku - - - - + + + + Add bookmark Dodaj zabilješku - + Highlight Istakni - + Remove highlight Ukloni naglasak - - + + Search Traži - - + + Exit fullscreen Izađi iz punog zaslona - - + + Fullscreen Cijeli zaslon - - + + Slide show Klizni prikaz - - + + First page Prva stranica - - + + Previous page Prethodna stranica - - + + Next page Slijedeća stranica - - + + Last page Zadnja stranica - - + + Rotate left Rotiraj ulijevo - - + + Rotate right Rotiraj udesno - - + + Print Ispis - - + + Document info Informacije o dokumentu @@ -241,7 +248,7 @@ Central - + Documents Dokumenti @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Format nije podržan - + Open failed Otvorenje nije uspelo - + Please check if the file is damaged Molim provjerite je li datoteka oštećena - + Conversion failed, please check if the file is damaged Konverzija nije uspela, молим проверите да ли је датотека повређена - + Save failed Neuspjelo spremanje - + Saved successfully Uspješno spremljeno - + Save as Spremi kao - - + + Invalid file name Neispravno ime datoteke - - + + OK button U redu @@ -305,12 +312,12 @@ Povucite dokumente ovdje - + Format supported: %1 Format je podržan: %1 - + Select File Odaberi datoteku @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Ova je zabilješka uklonjena - - + + Please select the text Molim odaberite tekst - - + + The annotation has been removed Напомена је уклоњена @@ -344,31 +351,62 @@ Шифрована датотека, молим унесите лозинку - + Password Lozinka - + OK button U redu - + Wrong password Pogrešna lozinka + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Prethodno - + Next Slijedeće @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Dodaj napomenu - + Are you sure you want to delete all annotations? Сигурни сте да желите обришите све напомене? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Neispravan broj stranice @@ -423,38 +461,56 @@ Dokument nije spremljen + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Сачувати промене у "%1"? - + Cancel button Otkaži - + Discard button Odbaci - + Save button Spremi - + Cancel Otkaži - + Delete Izbriši @@ -490,12 +546,12 @@ SearchResWidget - + No search results Nema rezultata pretrage - + %1 items found '%1 stavki pronađene' @@ -551,188 +607,207 @@ ShortCutShow - + Settings Postavke - + Exit Izlaz - + Help Pomoć - + Page up Stranica gore - + Page down Stranica dolje - + Open Otvori - + Zoom in Povećaj - + Zoom out Smanji - + Save as Spremi kao - + + File + + + + + Display + + + + + Tools + Alati + + + + Edit + + + + Print Ispis - + Save Spremi - + Thumbnails Miniaturice - + 1:1 size 1:1 veličina - + Fit height Prilagodi висину - + Fit width Prilagodi ширину - + Rotate left Rotiraj ulijevo - + Rotate right Rotiraj udesno - + Scroll up one line Pomakni jedan redak gore - + Scroll down one line Pomakni jedan redak dolje - - + Move to the beginning Премести на почетак - + Move to the end Pomakni na kraj - + Select text Odaberi tekst - + Hand tool Ručni alat - + Add bookmark Dodaj zabilješku - + Delete Izbriši - + Magnifier Povećalo - + Slide show Klizni prikaz - + Fullscreen Cijeli zaslon - + Copy Kopiraj - + Cut Izreži - + Paste Zalijepi - + Undo Povuči - + Select all Odaberi sve - + Display shortcuts Prikaži prečace - + Add annotation Dodaj napomenu - + Highlight Istakni - + Search Traži @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopiraj - + Remove annotation Ukloni napomenu - - + + Remove all Ukloni sve - + Remove bookmark Ukloni zabilješku @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Stranica %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page To je prva stranica - + It is the last page To je zadnja stranica @@ -785,48 +860,48 @@ TitleMenu - + New window Novi prozor - + New tab Nova kartica - - + + Save Spremi - + Save as Spremi kao - + Display in file manager Prikaži u upravitelju datotekama - + Magnifer Povećalo - + Tools Alati - + Search Traži - + Print Ispis @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Pretpreglednice @@ -847,28 +922,99 @@ Dostignut je limit unosa + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Put do dokumenta - - + + FilePath Put do datoteke - + ThumbnailPath Path. Put do pretpreglednice - + Generate thumbnail. Generiraj pretpreglednicu. - \ No newline at end of file + diff --git a/translations/deepin-reader_hu.ts b/translations/deepin-reader_hu.ts index a749b5e01..ba02323fb 100755 --- a/translations/deepin-reader_hu.ts +++ b/translations/deepin-reader_hu.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumentum Megjelenítő - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Hely - + Subject Tárgy - + Author Szerző - + Keywords Kulcsszavak - + Producer Előállító - + Creator Alkotó - + Time created Létrehozás ideje - + Time modified Módosítás ideje - + Format Formátum - + Pages Oldalak - + Optimized Optimalizált - + Security Biztonság - + Page size Oldalméret - + File size Fájlméret - + + Warnings + + + + Basic info Alapvető információk - + Unknown Ismeretlen - + Yes Igen - + No Nem @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Könyvjelző hozzáadása - + Are you sure you want to delete all bookmarks? Valóban törölni akarja az összes könyvjelzőt? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Másolás - + Remove annotation Kommentár eltávolítása - - - + + + Add annotation Kommentár hozzáadása - - - - + + + + Remove bookmark Könyvjelző eltávolítása - - - - + + + + Add bookmark Könyvjelző hozzáadása - + Highlight Kiemelés - + Remove highlight Kiemelés eltávolítása - - + + Search Keresés - - + + Exit fullscreen Kilépés a teljes képernyőből - - + + Fullscreen Teljes képernyő - - + + Slide show Diavetítés - - + + First page Első oldal - - + + Previous page Előző oldal - - + + Next page Következő oldal - - + + Last page Utolsó oldal - - + + Rotate left Elforgatás balra - - + + Rotate right Elforgatás jobbra - - + + Print Nyomtatás - - + + Document info Dokumentum információi @@ -241,7 +248,7 @@ Central - + Documents Dokumentumok @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported A formátum nem támogatott - + Open failed A megnyitás sikertelen - + Please check if the file is damaged Kérjük ellenőrizze, hogy a fájl megsérült-e - + Conversion failed, please check if the file is damaged A konvertálás sikertelen, kérjük ellenőrizze, hogy a fájl megsérült-e - + Save failed A mentés sikertelen - + Saved successfully A mentés sikeres - + Save as Mentés másként - - + + Invalid file name Érvénytelen fájlnév - - + + OK button OK @@ -305,12 +312,12 @@ Húzza ide a dokumentumokat - + Format supported: %1 Támogatott formátumok: %1 - + Select File Fájl kiválasztása @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Könyvjelző eltávolítva - - + + Please select the text Kérjük jelölje ki a szöveget - - + + The annotation has been removed Kommentár eltávolítva @@ -344,31 +351,62 @@ Titkosított fájl, kérjük írja be a jelszót - + Password Jelszó - + OK button OK - + Wrong password Hibás jelszó + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Előző - + Next Következő @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Kommentár hozzáadása - + Are you sure you want to delete all annotations? Valóban törölni akarja az összes kommentárt? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Érvénytelen oldalszám @@ -423,38 +461,56 @@ A dokumentum nem került mentésre + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Elmenti a "%1" módosításait? - + Cancel button Mégsem - + Discard button Elvetés - + Save button Mentés - + Cancel Mégsem - + Delete Törlés @@ -490,12 +546,12 @@ SearchResWidget - + No search results Nincs találat - + %1 items found %1 találat @@ -551,188 +607,207 @@ ShortCutShow - + Settings Beállítások - + Exit Kilépés - + Help Segítség - + Page up Előző oldal - + Page down Következő oldal - + Open Megnyitás - + Zoom in Nagyítás - + Zoom out Kicsinyítés - + Save as Mentés másként - + + File + + + + + Display + + + + + Tools + Eszközök + + + + Edit + + + + Print Nyomtatás - + Save Mentés - + Thumbnails Bélyegképek - + 1:1 size 1:1 méret - + Fit height Magasság illesztése - + Fit width Szélesség illesztése - + Rotate left Elforgatás balra - + Rotate right Elforgatás jobbra - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Ugrás az elejére - + Move to the end Ugrás a végére - + Select text Szöveg kijelölése - + Hand tool Kéz eszköz - + Add bookmark Könyvjelző hozzáadása - + Delete Törlés - + Magnifier Nagyító - + Slide show Diavetítés - + Fullscreen Teljes képernyő - + Copy Másolás - + Cut Kivágás - + Paste Beillesztés - + Undo Visszavonás - + Select all Összes kijelölése - + Display shortcuts Gyorsbillentyűk megjelenítése - + Add annotation Kommentár hozzáadása - + Highlight Kiemelés - + Search Keresés @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Másolás - + Remove annotation Kommentár eltávolítása - - + + Remove all Összes eltávolítása - + Remove bookmark Könyvjelző eltávolítása @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 %1 oldal @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Ez az első oldal - + It is the last page Ez az utolsó oldal @@ -785,48 +860,48 @@ TitleMenu - + New window Új ablak - + New tab Új lap - - + + Save Mentés - + Save as Mentés másként - + Display in file manager Megjelenítés a fájlkezelőben - + Magnifer Nagyító - + Tools Eszközök - + Search Keresés - + Print Nyomtatás @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Bélyegképek @@ -847,28 +922,95 @@ Beviteli limit elérve + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumentum fájl elérési útja - - + + FilePath Fájl elérési útja - + ThumbnailPath Path. Bélyegkép elérési útja - + Generate thumbnail. Miniatűr létrehozása. - \ No newline at end of file + diff --git a/translations/deepin-reader_hy.ts b/translations/deepin-reader_hy.ts index 8c443ea72..487b413d6 100644 --- a/translations/deepin-reader_hy.ts +++ b/translations/deepin-reader_hy.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Տեսանյութի դիտարան - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Տեսանյութի դիտարան հաշվարկային փայերի ընթերցման ապահովագրություն է, որը համարժեք է PDF, DJVU, DOCX և այլնի համար + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Բացասական տեղում - + Subject Առարկություն - + Author Հեղինակ - + Keywords Հարցադրումներ - + Producer Ներբեռող - + Creator Ստեղծող - + Time created Ստեղծման ժամանակ - + Time modified Փոխարկման ժամանակ - + Format Ձևաչափ - + Pages Էջեր - + Optimized Օպտիմալացված - + Security Անվտանգություն - + Page size Էջի չափ - + File size Ֆայլի չափ - + + Warnings + + + + Basic info Ծագման տվյալներ - + Unknown Անհայտ - + Yes Այո - + No Ոչ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Ավելացնել նշանակալիք - + Are you sure you want to delete all bookmarks? Դու համոզված ես, որ ցանկանում ես ջանքերը բոլորը ջանքերը ջնջել? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Կապել - + Remove annotation Հեռացնել նշանակումը - + + + Add annotation Ավելացնել նշանակումը - + + + + Remove bookmark Հեռացնել նշանակալիքը - + + + + Add bookmark Ավելացնել նշանակալիքը - + Highlight Լուսաբանում - + Remove highlight Հեռացնել լուսաբանումը - + + Search Որոնում - + + Exit fullscreen Ելք ամբողջական տեսքի - + + Fullscreen Ամբողջական տեսք - + + Slide show Սլայդ ցուցադրություն - + + First page Առաջին էջը - + + Previous page Նախորդ էջը - + + Next page Հաջորդ էջը - + + Last page Վերջին էջը - + + Rotate left Չափազանց ձախ - + + Rotate right Չափազանց աջ - + + Print Տպել - + + Document info Փաստաթուղթի տվյալները @@ -219,7 +248,7 @@ Central - + Documents Փաստաթուղթներ @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Ձևը չի ստացվում - + Open failed Բացումը հնարավոր չէ - + Please check if the file is damaged Խնդրում ենք ստուգեք, թե արդյունքը վնասված է - + Conversion failed, please check if the file is damaged Փոխակերպումը հնարավոր չէ, խնդրում ենք ստուգեք, թե արդյունքը վնասված է - + Save failed Պահպանումը հնարավոր չէ - + Saved successfully Հաջողությամբ պահպանված է - + Save as Պահպանել որպես - + + Invalid file name Անվավեր անվանում - + + OK button Այո @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Փոխանցեք փաստաթուղթները այստեղ - + Format supported: %1 Աջակցվող ձևը: %1 - + Select File Ընտրեք անվանումը @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Հանդիպակաց նշանը հեռացված է - + + Please select the text Խնդրում ենք ընտրեք տexterը - + + The annotation has been removed Նկարագրությունը հեռացված է @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Գաղտնի անվանու տեսքը, խնդրում ենք մուտքագրեք գաղտնաբառը - + Password Գաղտնաբառ - + OK button Այո - + Wrong password Գատակ գաղտնաբառ + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Նախորդ - + Next Հաջորդ @@ -349,12 +414,12 @@ HandleMenu - + Select Text Ընտրել տեքստ - + Hand Tool Հանդի գործիք @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Ավելացնել մեկնաբանություն - + Are you sure you want to delete all annotations? Անհանգստացրեք, որ ցանկանում եք ջնջել բոլոր մեկնաբանությունները? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Սխալ էջի համար @@ -383,7 +448,7 @@ ProgressDialog - + Converting Փոխակերպում @@ -391,43 +456,61 @@ QObject - + Document not saved Փաստաթուղթը չի պահպանվել + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - Պահպանել փոփոխությունները "%1"-ին? + + Save the changes to "%1"? + Պահպանել փոփոխությունները "%1"-ին? - + Cancel button Չեղարկել - + Discard button Հնարավորություն չունի - + Save button Պահպանել - + Cancel Չեղարկել - + Delete Ջնջել @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Երկու էջի տեսանկյուն - + 1:1 size 1:1 չափ - + Fit Page Անկեղծ էջ - + Fit Height Անկեղծ բարձրություն - + Fit Width Անկեղծ լայնություն @@ -463,36 +546,36 @@ SearchResWidget - + No search results Ոչ ոք չի գտնվել որոնումում - + %1 items found - '%1 տարր գտնվել է' + '%1 տարր գտնվել է' SecurityDialog - + This document is trying to connect to: Այս փաստաթուղթը փորձում է հաղորդակցվել հետևյալ հարթականի հետ: - + If you trust the website, click Allow, otherwise click Block. Եթե դուք վստահ եք կայքին, սեղմեք Allow, հակառակ դեպքում սեղմեք Block. - + Block button Փակել - + Allow button Հաստատել @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Փոքր պատկերներ - + Catalog Կատալոգ - + Bookmarks Հանձնաժողովներ - + Annotations Բացատրություններ @@ -524,188 +607,207 @@ ShortCutShow - + Settings Կարգավորություններ - + Exit Ելք - + Help Օգնություն - + Page up Էջ վերև - + Page down Էջ ներքև - + Open Բացել - + Zoom in Բարձրացնել - + Zoom out Նվազել - + Save as Պահպանել որպես - + + File + + + + + Display + + + + + Tools + Օրինակներ + + + + Edit + + + + Print Տպել - + Save Պահպանել - + Thumbnails Փոքրիկ նկարներ - + 1:1 size 1:1 չափաբաժին - + Fit height Համապատասխանեցնել բարձրությամբ - + Fit width Համապատասխանեցնել լայնությամբ - + Rotate left Շարժել ձախ - + Rotate right Շարժել աջ - + Move to the beginning Շարժել սկզբին - + Move to the end Շարժել վերջին - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Ընտրել տեքստը - + Hand tool Ծակի գործիքը - + Add bookmark Ավելացնել նշանակումը - + Delete Ջանատել - + Magnifier Մագնիտակը - + Slide show Սլայդ ցուցադրություն - + Fullscreen Ընդամենը ցուցադրել - + Copy Կապակցել - + Cut Կտրել - + Paste Փոխադրել - + Undo Վերացնել - + Select all Ընտրել բոլորը - + Display shortcuts Ցույց տալ կրճատականները - + Add annotation Ավելացնել նշանակումը - + Highlight Բացահայտել - + Search Որոնել @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Կոպիավորել - + Remove annotation Հեռացնել նշանակումը - + + Remove all Հեռացնել բոլորը - + Remove bookmark Հեռացնել նշանակումը @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Էջ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Այն առաջին էջն է - + It is the last page Այն վերջին էջն է @@ -757,47 +860,48 @@ TitleMenu - + New window Նոր պատուհան - + New tab Նոր ստուգաթուղթ - + + Save Պահպանել - + Save as Պահպանել որպես - + Display in file manager Ցույց տալ ֆայլերի մարզինում - + Magnifer Մագնիֆիեր - + Tools Օրինակներ - + Search Տպել - + Print Փոքրիկ պատկերներ @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Մուտքագրման սահմանը ստիպադրվել է @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Փաստաթուղթի ֆайլի ճանապարհ + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Ֆայլի ճանապարհ - + + FilePath Փոքրիկ պատկերի ճանապարհ - + ThumbnailPath Path. Ստեղծել փոքրիկ պատկեր - + Generate thumbnail. Generate thumbnail. diff --git a/translations/deepin-reader_id.ts b/translations/deepin-reader_id.ts index 55832368f..81074c1c2 100644 --- a/translations/deepin-reader_id.ts +++ b/translations/deepin-reader_id.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,100 +9,105 @@ Penampil Dokumen - + Document Viewer is a tool for reading document files, supporting %1. - + AttrScrollWidget - + Location Lokasi - + Subject Subjek - + Author Penulis - + Keywords Kata kunci - + Producer Pembuat - + Creator Pembuat - + Time created Tanggal dibuat - + Time modified Waktu diubah - + Format Format - + Pages Halaman - + Optimized Dioptimalkan - + Security Keamanan - + Page size Ukuran halaman - + File size Ukuran berkas - + + Warnings + + + + Basic info Informasi dasar - + Unknown Tidak diketahui - + Yes Ya - + No Tidak @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Tambahkan bookmark - + Are you sure you want to delete all bookmarks? Apakah Anda yakin ingin menghapus semua bookmark? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Salin - + Remove annotation Hapus notasi - - - + + + Add annotation Tambah anotasi - - - - + + + + Remove bookmark Hapus bookmark - - - - + + + + Add bookmark Tambahkan bookmark - + Highlight Tekanan - + Remove highlight Hapus tekanan - - + + Search Cari - - + + Exit fullscreen Keluar dari tampilan penuh - - + + Fullscreen Layar penuh - - + + Slide show Slide show - - + + First page Halaman pertama - - + + Previous page Halaman sebelumnya - - + + Next page Halaman selanjutnya - - + + Last page Halaman terakhir - - + + Rotate left Putar ke kiri - - + + Rotate right Putar ke kanan - - + + Print Cetak - - + + Document info Informasi dokumen @@ -241,7 +248,7 @@ Central - + Documents Dokumen @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Format tidak didukung - + Open failed Gagal membuka - + Please check if the file is damaged Silakan periksa apakah berkas rusak - + Conversion failed, please check if the file is damaged Pengubahan gagal, silakan periksa apakah berkas rusak - + Save failed Gagal menyimpan - + Saved successfully Berhasil disimpan - + Save as Simpan sebagai - - + + Invalid file name Nama berkas tidak valid - - + + OK button Oke @@ -305,12 +312,12 @@ Tarik dokumen di sini - + Format supported: %1 Format yang didukung: %1 - + Select File Pilih Berkas @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Bookmark telah dihapus - - + + Please select the text Silakan pilih teks - - + + The annotation has been removed Anotasi telah dihapus @@ -344,31 +351,62 @@ Berkas terenkripsi, silakan masukkan kata sandi - + Password Kata sandi - + OK button Oke - + Wrong password Kata sandi salah + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Sebelumnya - + Next Selanjutnya @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Tambah anotasi - + Are you sure you want to delete all annotations? Apakah Anda yakin ingin menghapus semua anotasi? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Nomor halaman tidak valid @@ -423,38 +461,56 @@ Dokumen tidak disimpan + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Simpan perubahan ke "%1"? - + Cancel button Batal - + Discard button Buang - + Save button Simpan - + Cancel Batal - + Delete Hapus @@ -490,12 +546,12 @@ SearchResWidget - + No search results Tidak ada hasil pencarian - + %1 items found '%1 item ditemukan' @@ -551,188 +607,207 @@ ShortCutShow - + Settings Pengaturan - + Exit Keluar - + Help Bantuan - + Page up Halaman ke atas - + Page down Halaman ke bawah - + Open Buka - + Zoom in Zoom masuk - + Zoom out Zoom keluar - + Save as Simpan sebagai - + + File + + + + + Display + + + + + Tools + Alat + + + + Edit + + + + Print Cetak - + Save Simpan - + Thumbnails Pratinjau - + 1:1 size ukuran 1:1 - + Fit height Pas tinggi - + Fit width Pas lebar - + Rotate left Putar ke kiri - + Rotate right Putar ke kanan - + Scroll up one line Gulir satu baris ke atas - + Scroll down one line Gulir satu baris ke bawah - - + Move to the beginning Pindah ke awal - + Move to the end Pindah ke akhir - + Select text Pilih teks - + Hand tool Alat tangan - + Add bookmark Tambah bookmark - + Delete Hapus - + Magnifier Peng放大 - + Slide show Slide show - + Fullscreen Layar penuh - + Copy Salin - + Cut Potong - + Paste Tempel - + Undo Batal - + Select all Pilih semua - + Display shortcuts Tampilkan pintasan - + Add annotation Tambah anotasi - + Highlight Tekanan - + Search Cari @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Salin - + Remove annotation Hapus notasi - - + + Remove all Hapus semua - + Remove bookmark Hapus bookmark @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Halaman %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Ini adalah halaman pertama - + It is the last page Ini adalah halaman terakhir @@ -785,48 +860,48 @@ TitleMenu - + New window Jendela baru - + New tab Tab baru - - + + Save Simpan - + Save as Simpan sebagai - + Display in file manager Tampilkan di pengelola file - + Magnifer Peng放大 - + Tools Alat - + Search Cari - + Print Cetak @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Pratinjau @@ -847,28 +922,95 @@ Batas masukan tercapai + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Lokasi File Dokumen. - - + + FilePath Lokasi File - + ThumbnailPath Path. Lokasi Pratinjau. - + Generate thumbnail. Buat pratinjau. - \ No newline at end of file + diff --git a/translations/deepin-reader_it.ts b/translations/deepin-reader_it.ts index 1178b8ced..77a80cf9e 100755 --- a/translations/deepin-reader_it.ts +++ b/translations/deepin-reader_it.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Lettore documenti - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Posizione - + Subject Soggetto - + Author Autore - + Keywords Parole chiave - + Producer Produttore - + Creator Creatore - + Time created Data creazione - + Time modified Data modifica - + Format Formato - + Pages Pagine - + Optimized Ottimizzato - + Security Sicurezza - + Page size Dimensione pagina - + File size Dimensione file - + + Warnings + + + + Basic info Info base - + Unknown Sconosciuto - + Yes Si - + No No @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Aggiungi segnalibro - + Are you sure you want to delete all bookmarks? Sicuro di voler eliminare tutti i segnalibri? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copia - + Remove annotation Rimuovi annotazione - - - + + + Add annotation Aggiungi nota - - - - + + + + Remove bookmark Rimuovi segnalibro - - - - + + + + Add bookmark Aggiungi segnalibro - + Highlight Evidenzia - + Remove highlight Rimuovi evidenziazione - - + + Search Cerca - - + + Exit fullscreen Esci dalla modalità schermo intero - - + + Fullscreen Schermo intero - - + + Slide show Presentazione - - + + First page Prima pagina - - + + Previous page Pagina precedente - - + + Next page Pagina successiva - - + + Last page Ultima pagina - - + + Rotate left Ruota a sinistra - - + + Rotate right Ruota a destra - - + + Print Stampa - - + + Document info Info documento @@ -241,7 +248,7 @@ Central - + Documents Documenti @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Il formato non è supportato - + Open failed Apertura fallita - + Please check if the file is damaged Verifica se il file è danneggiato - + Conversion failed, please check if the file is damaged Conversione fallita, verifica che il file non sia danneggiato - + Save failed Salvataggio fallito - + Saved successfully Salvataggio riuscito - + Save as Salva come - - + + Invalid file name Nome file non valido - - + + OK button OK @@ -305,12 +312,12 @@ Trascina i documenti qui - + Format supported: %1 Formato supportato: %1 - + Select File Seleziona file @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Il segnalibro è stato rimosso - - + + Please select the text Seleziona il testo - - + + The annotation has been removed L'annotazione è stata rimossa @@ -344,31 +351,62 @@ File crittografato, inserisci la password - + Password Password - + OK button OK - + Wrong password Password errata + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Precedente - + Next Prossima @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Aggiungi nota - + Are you sure you want to delete all annotations? Sicuro di voler eliminare tutte le annotazioni? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Numero pagine non valido @@ -423,38 +461,56 @@ Documento non salvato + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Salvare le modifiche a "%1"? - + Cancel button Annulla - + Discard button Scarta - + Save button Salva - + Cancel Annulla - + Delete Elimina @@ -490,12 +546,12 @@ SearchResWidget - + No search results Nessun risultato - + %1 items found %1 elementi trovati @@ -759,23 +815,23 @@ SideBarImageListView - + Copy Copia - + Remove annotation Rimuovi annotazione - - + + Remove all Rimuovi tutti - + Remove bookmark Rimuovi segnalibro @@ -783,7 +839,7 @@ SideBarImageViewModel - + Page %1 Pagina %1 @@ -791,12 +847,12 @@ SlidePlayWidget - + It is the first page È la prima pagina - + It is the last page È l'ultima pagina @@ -804,48 +860,48 @@ TitleMenu - + New window Nuova Finestra - + New tab Nuova Tab - - + + Save Salva - + Save as Salva come - + Display in file manager Visualizza nel file manager - + Magnifer Ingrandimento - + Tools Strumenti - + Search Cerca - + Print Stampa @@ -853,7 +909,7 @@ TitleWidget - + Thumbnails Miniature @@ -866,28 +922,97 @@ Limite inserimento raggiunto + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Genera miniatura. - \ No newline at end of file + diff --git a/translations/deepin-reader_ja.ts b/translations/deepin-reader_ja.ts index 018616dc7..1149e2d0d 100644 --- a/translations/deepin-reader_ja.ts +++ b/translations/deepin-reader_ja.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ ドキュメントビューアー - + Document Viewer is a tool for reading document files, supporting %1. ドキュメントビューアーは、%1ファイルを表示するツールです。 @@ -15,92 +17,97 @@ AttrScrollWidget - + Location 場所 - + Subject 主題 - + Author 作成者 - + Keywords キーワード - + Producer 変換ツール - + Creator オリジナル版作成ツール - + Time created 作成日時 - + Time modified 最終編集日時 - + Format フォーマット - + Pages ページ数 - + Optimized 最適化 - + Security セキュリティ - + Page size ページサイズ - + File size ファイルサイズ - + + Warnings + + + + Basic info 基本情報 - + Unknown 不明 - + Yes はい - + No いいえ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark ブックマークを追加 - + Are you sure you want to delete all bookmarks? すべてのブックマークを削除してもよろしいですか? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy コピー - + Remove annotation 注釈を削除 - - - + + + Add annotation 注釈を追加 - - - - + + + + Remove bookmark ブックマークを削除 - - - - + + + + Add bookmark ブックマークを追加 - + Highlight ハイライト - + Remove highlight ハイライトを削除 - - + + Search 検索 - - + + Exit fullscreen 全画面表示を解除 - - + + Fullscreen 全画面表示 - - + + Slide show スライドショー - - + + First page 最初のページ - - + + Previous page 前のページ - - + + Next page 次のページ - - + + Last page 最後のページ - - + + Rotate left 左に回転 - - + + Rotate right 右に回転 - - + + Print 印刷 - - + + Document info このファイルの情報 @@ -241,7 +248,7 @@ Central - + Documents ドキュメント @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported このフォーマットには対応していません - + Open failed ファイルを開けませんでした - + Please check if the file is damaged ファイルの破損を確認してください - + Conversion failed, please check if the file is damaged 変換できませんでした。ファイルの破損を確認してください - + Save failed ファイルを保存できませんでした - + Saved successfully ファイルが保存されました - + Save as 名前をつけて保存 - - + + Invalid file name ファイル名が無効です - - + + OK button OK @@ -305,12 +312,12 @@ ここにファイルをドラッグして開く - + Format supported: %1 対応フォーマット: %1 - + Select File ファイルを選択 @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed ブックマークが削除されました - - + + Please select the text テキストを選択してください - - + + The annotation has been removed 注釈が削除されました @@ -344,31 +351,62 @@ このファイルは暗号化されています。パスワードを入力してください - + Password パスワード - + OK button OK - + Wrong password パスワードが違います + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous 前 - + Next 次 @@ -389,12 +427,12 @@ NotesWidget - + Add annotation 注釈を追加 - + Are you sure you want to delete all annotations? すべての注釈を削除してもよろしいですか? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number ページ番号が無効です @@ -423,38 +461,56 @@ ドキュメントは保存されていません + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? "%1"への変更を保存しますか? - + Cancel button キャンセル - + Discard button 破棄 - + Save button 保存 - + Cancel キャンセル - + Delete 削除 @@ -490,12 +546,12 @@ SearchResWidget - + No search results 検索結果はありません - + %1 items found %1件見つかりました @@ -551,188 +607,207 @@ ShortCutShow - + Settings 設定 - + Exit 閉じる - + Help ヘルプ - + Page up 上のページに移動 - + Page down 下のページに移動 - + Open 開く - + Zoom in 拡大 - + Zoom out 縮小 - + Save as 名前をつけて保存 - + + File + + + + + Display + + + + + Tools + モード切替 + + + + Edit + + + + Print 印刷 - + Save 上書き保存 - + Thumbnails サムネイル - + 1:1 size 1:1 サイズ - + Fit height 高さに合わせる - + Fit width 幅に合わせる - + Rotate left 左に回転 - + Rotate right 右に回転 - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning 先頭に移動 - + Move to the end 終端に移動 - + Select text テキスト選択 - + Hand tool スクロール - + Add bookmark ブックマークを追加 - + Delete 削除 - + Magnifier 拡大鏡 - + Slide show スライドショー - + Fullscreen 全画面表示 - + Copy コピー - + Cut 切り取り - + Paste 貼り付け - + Undo 元に戻す - + Select all すべて選択 - + Display shortcuts ショートカットの表示 - + Add annotation 注釈を追加 - + Highlight ハイライト - + Search 検索 @@ -740,23 +815,23 @@ SideBarImageListView - + Copy コピー - + Remove annotation 注釈を削除 - - + + Remove all すべて削除 - + Remove bookmark ブックマークを削除 @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 ページ %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page 最初のページです - + It is the last page 最後のページです @@ -785,48 +860,48 @@ TitleMenu - + New window 新しいウィンドウ - + New tab 新しいタブ - - + + Save 上書き保存 - + Save as 名前をつけて保存 - + Display in file manager ファイルマネージャーで表示 - + Magnifer 拡大鏡 - + Tools モード切替 - + Search 検索 - + Print 印刷 @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails サムネイル @@ -847,28 +922,95 @@ 最大数に達しました + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ドキュメントファイルパス。 - - + + FilePath ファイルパス - + ThumbnailPath Path. サムネイルパス パス。 - + Generate thumbnail. サムネイルの生成。 - \ No newline at end of file + diff --git a/translations/deepin-reader_ka.ts b/translations/deepin-reader_ka.ts index 7958f01bb..ce0653a8c 100644 --- a/translations/deepin-reader_ka.ts +++ b/translations/deepin-reader_ka.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer დოკუმენტის მოხსენიება - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - დოკუმენტის მოხსენიება არის ინსტრუმენტი დოკუმენტური ფაილების წაკითხვისთვის, რომელიც მხარდაჭერის ფორმატებს ასახავს, როგორც PDF, DJVU, DOCX და ა.შ. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location ადგილი - + Subject განსაზღვრული საგნი - + Author ავტორი - + Keywords სავარაუდო სიტყვები - + Producer აპროდუსერი - + Creator შემქმნელი - + Time created დრო შექმნისას - + Time modified დრო განახლებისას - + Format ფორმატი - + Pages გვერდები - + Optimized გაუმჯობესებული - + Security უსაფრთხელება - + Page size გვერდის ზომა - + File size ფაილის ზომა - + + Warnings + + + + Basic info საბაზისრი ინფორმაცია - + Unknown უცნობი - + Yes კი - + No არა @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark მარკერის დამატება - + Are you sure you want to delete all bookmarks? თქვენ დარწმუნებული ხართ, რომ გსურთ ყველა მარკერის წაშლა? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy კოპირება - + Remove annotation ანნოტაციის წაშლა - + + + Add annotation ანნოტაციის დამატება - + + + + Remove bookmark მარკერის წაშლა - + + + + Add bookmark გამარკერება - + Highlight გამარკერების წაშლა - + Remove highlight ძებნა - + + Search Search - + + Exit fullscreen სარედაქტირებლად გამოსაშვილი - + + Fullscreen სარედაქტირებლად სრული ეკრანი - + + Slide show სლაიდების გამოსაშვილი - + + First page პირველი გვერდი - + + Previous page წინა გვერდი - + + Next page შემდეგი გვერდი - + + Last page ბოლო გვერდი - + + Rotate left მარცხნივ ბრუნვა - + + Rotate right მარჯვნივ ბრუნვა - + + Print დაბეჭდვა - + + Document info დოკუმენტის ინფორმაცია @@ -219,7 +248,7 @@ Central - + Documents დოკუმენტები @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported ფორმატი არ არის მხარდაჭერილი - + Open failed გახსნა შეუძლებელია - + Please check if the file is damaged გთხოვთ შეამოწმოთ ფაილის დაზიანების გამოყოფის შემთხვევაში - + Conversion failed, please check if the file is damaged კონვერსია შეუძლებელია, გთხოვთ შეამოწმოთ ფაილის დაზიანების გამოყოფის შემთხვევაში - + Save failed შენახვა შეუძლებელია - + Saved successfully წარმატებით შენახულია - + Save as შენახვა როგორც - + + Invalid file name ვალიდური არ არის ფაილის სახელი - + + OK button დიახ @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here დაატვირთეთ დოკუმენტები აქ - + Format supported: %1 ფორმატი მხარდაჭერილია: %1 - + Select File აირჩიეთ ფაილი @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed სათამაშო მარკერი წაშლილია - + + Please select the text გთხოვთ აირჩიოთ ტექსტი - + + The annotation has been removed ანნოტაცია წაშლილია @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password შიფრდა ფაილი, გთხოვთ შეიყვანოთ პაროლი - + Password პაროლი - + OK button დიახ - + Wrong password არასწორი პაროლი + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous წინა - + Next შემდეგი @@ -349,12 +414,12 @@ HandleMenu - + Select Text ტექსტის არჩევა - + Hand Tool ხელის ინსტრუმენტი @@ -362,12 +427,12 @@ NotesWidget - + Add annotation ანნოტაციის დამატება - + Are you sure you want to delete all annotations? დარწმუნებული ხართ, რომ გსურთ წაშალოთ ყველა ანნოტაცია? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number უარყოფითი გვერდის ნომერი @@ -383,7 +448,7 @@ ProgressDialog - + Converting კონვერტირება @@ -391,43 +456,61 @@ QObject - + Document not saved დოკუმენტი არ არის შენახული + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - შენახული განახლებები "%1"-ისთვის? + + Save the changes to "%1"? + შენახული განახლებები "%1"-ისთვის? - + Cancel button გაუქმება - + Discard button გადატარება - + Save button შენახვა - + Cancel გაუქმება - + Delete წაშლა @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View ორგვერდიანი ხედვა - + 1:1 size 1:1 ზომა - + Fit Page გვერდის შესასწორებლად - + Fit Height სიმაღლის შესასწორებლად - + Fit Width სიგანის შესასწორებლად @@ -463,36 +546,36 @@ SearchResWidget - + No search results ძებნის შედეგები არ არის - + %1 items found - '%1 მიმართულება მოიძებნა' + '%1 მიმართულება მოიძებნა' SecurityDialog - + This document is trying to connect to: ამ დოკუმენტს სცადა შეესაერთოს: - + If you trust the website, click Allow, otherwise click Block. თუ მომხმარებელს საკმარისია ვებგვერდი, დააჭირეთ Allow, საწინააღმდეგოდ დააჭირეთ Block. - + Block button დამალება - + Allow button დაშვება @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails მიმართულებების სურათები - + Catalog კატალოგი - + Bookmarks მიმართულებები - + Annotations ანნოტაციები @@ -524,188 +607,207 @@ ShortCutShow - + Settings პარამეტრები - + Exit გასვლა - + Help დახმარება - + Page up გვერდი ზემოთ - + Page down გვერდი ქვემოთ - + Open გახსნა - + Zoom in მაგნიტის გაზარდება - + Zoom out მაგნიტის შემცირება - + Save as შენახვა როგორც - + + File + + + + + Display + + + + + Tools + ინსტრუმენტები + + + + Edit + + + + Print დასაბეჭდი - + Save შენახვა - + Thumbnails მცირე სურათები - + 1:1 size 1:1 ზომა - + Fit height სისქეს შესასწორება - + Fit width სიგანეს შესასწორება - + Rotate left გაბრუნება მარცხნავ - + Rotate right გაბრუნება უკან მიმართული - + Move to the beginning გადატანა დასაწყისში - + Move to the end გადატანა ბოლოში - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text ტექსტის არჩევა - + Hand tool ხელის ინსტრუმენტი - + Add bookmark მარკერის დამატება - + Delete წაშლა - + Magnifier მაგნიტი - + Slide show სლაიდების ჩვენება - + Fullscreen სრული ზომი - + Copy კოპირება - + Cut გადაკეტვა - + Paste ჩასმა - + Undo უკან მიდი - + Select all ყველას აირჩიე - + Display shortcuts საშუალებების ჩვენება - + Add annotation ანნოტაციის დამატება - + Highlight გამარკიდებულება - + Search ძებნა @@ -713,22 +815,23 @@ SideBarImageListView - + Copy კოპირება - + Remove annotation ანნოტაციის წაშლა - + + Remove all ყველას წაშლა - + Remove bookmark მარკერის წაშლა @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 გვერდი %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ეს პირველი გვერდია - + It is the last page ეს ბოლო გვერდია @@ -757,47 +860,48 @@ TitleMenu - + New window ახალი ფანჯარა - + New tab ახალი ჩანაწერი - + + Save შენახვა - + Save as შენახვა როგორც - + Display in file manager ფაილების მართვის სისტემაში ჩვენება - + Magnifer მაგნიფიერი - + Tools ინსტრუმენტები - + Search პრინტი - + Print პროფილები @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails შესატანი ლიმიტი მისაღწევად მოხდა @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached დოკუმენტის ფაილის გზა. + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ფაილის გზა - + + FilePath პროფილის გზა. - + ThumbnailPath Path. პროფილის გენერირება. - + Generate thumbnail. Generate thumbnail. diff --git a/translations/deepin-reader_km_KH.ts b/translations/deepin-reader_km_KH.ts index 565990fcd..0a0a201d4 100644 --- a/translations/deepin-reader_km_KH.ts +++ b/translations/deepin-reader_km_KH.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer កម្មវិធីមើលឯកសារ - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - កម្មវិធីមើលឯកសារ គឺជាកម្មវិធីមួយសម្រាប់អានឯកសារ ដែលគាំទ្រ PDF, DJVU, DOCX និងលើសពីនេះ + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location កន្លែងផ្ទះ - + Subject ប្រធានបទ - + Author អ្នកសរសេរ - + Keywords ពាក្យគន្លឹះ - + Producer ផលិតផ្សិត - + Creator អ្នកបង្កើត - + Time created ពេលបង្កើត - + Time modified ពេលកែសម្រួល - + Format រាងរូប - + Pages ទំព័រ - + Optimized បានប្រើប្រាស់ដោយប្រសិទ្ធភាព - + Security សុវត្តិភាព - + Page size ទំហំទំព័រ - + File size ទំហំឯកសារ - + + Warnings + + + + Basic info ព័ត៌មានមូលដ្ឋាន - + Unknown មិនស្គាល់ - + Yes បាទ - + No ទេ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark បន្ថែមសំណើច - + Are you sure you want to delete all bookmarks? តើអ្នកបានជៀសយ៉ាងពិតប្រាកដថានឹងលុបសំណើចទាំងអស់? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy ថត​ច្បាប់ - + Remove annotation បំបាក់​ការ​សរសេរ​កម្មវិធី - + + + Add annotation បន្ថែម​ការ​សរសេរ​កម្មវិធី - + + + + Remove bookmark បំបាក់​សំណើច - + + + + Add bookmark បន្ថែម​សំណើច - + Highlight បង្ហាញ​ពណ៌ - + Remove highlight បំបាក់​ពណ៌ - + + Search ស្វែងរក - + + Exit fullscreen ចាកចេញពីមូលដ្ឋានអាកាស - + + Fullscreen មូលដ្ឋានអាកាស - + + Slide show បញ្ចេញការបង្ហាញ - + + First page ទំព័រដំបូង - + + Previous page ទំព័រមុន - + + Next page ទំព័របន្ទាប់ - + + Last page ទំព័រចុងក្រោយ - + + Rotate left បង្វិលឆ្វេង - + + Rotate right បង្វិលស្តាំ - + + Print បោះពុល - + + Document info ព័ត៌មានឯកសារ @@ -219,7 +248,7 @@ Central - + Documents ឯកសារ @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported ប្រភេទមិនត្រូវបានគាំទ្រ - + Open failed បើកបានបរាជ័យ - + Please check if the file is damaged សូមពិនិត្យមើលថាតើឯកសារមានការខូចខាតឬអត់ - + Conversion failed, please check if the file is damaged ការបម្លែងបានបរាជ័យ សូមពិនិត្យមើលថាតើឯកសារមានការខូចខាតឬអត់ - + Save failed រក្សាទុកបានបរាជ័យ - + Saved successfully រក្សាទុកដោយជោគជ័យ - + Save as រក្សាទុកជាមួយឈ្មោះ - + + Invalid file name ឈ្មោះឯកសារមិនត្រឹមត្រូវ - + + OK button បាទ/បាន @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here ដោះឈ្មោះឯកសារនៅទីនេះ - + Format supported: %1 ប្រភេទត្រូវបានគាំទ្រ: %1 - + Select File ជ្រើសរើសឯកសារ @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed សំបុត្ដិត្រូវបានបំពាក់ចេញ - + + Please select the text សូមជ្រើសរើសអត្ថបទ - + + The annotation has been removed ការសំបុត្ដិត្រូវបានបំពាក់ចេញ @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password ឯកសារត្រូវបានបំពាក់ សូមបញ្ចូលពាក្យសម្ងាត់ - + Password ពាក្យសម្ងាត់ - + OK button បាទ/បាន - + Wrong password ពាក្យសម្ងាត់ខុស + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous មុន - + Next បន្ទាប់ @@ -349,12 +414,12 @@ HandleMenu - + Select Text ជ្រើសរើសអត្ថបទ - + Hand Tool ឧបករណ៍ដៃ @@ -362,12 +427,12 @@ NotesWidget - + Add annotation បន្ថែមការសម្គាល់ - + Are you sure you want to delete all annotations? តើអ្នកកំពុងប្រាកដថាចង់លុបការសម្គាល់ទាំងអស់? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number លេខទំព័រមិនត្រឹមត្រូវ @@ -383,7 +448,7 @@ ProgressDialog - + Converting កំពុងប្រែក្លាយ @@ -391,43 +456,61 @@ QObject - + Document not saved ឯកសារមិនត្រូវបានរក្សាទុក + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - តើអ្នកចង់រក្សាទុកការកែប្រែទៅ "%1"? + + Save the changes to "%1"? + តើអ្នកចង់រក្សាទុកការកែប្រែទៅ "%1"? - + Cancel button បិទ - + Discard button បំបែក - + Save button រក្សាទុក - + Cancel បិទ - + Delete លុប @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View ការបន្តរបស់ទំព័រពីរ - + 1:1 size ទំហំ 1:1 - + Fit Page ត្រូវបានបម្លាស់ទៅតាមទំព័រ - + Fit Height ត្រូវបានបម្លាស់ទៅតាមកំពស់ - + Fit Width ត្រូវបានបម្លាស់ទៅតាមបណ្ដាត់ @@ -463,36 +546,36 @@ SearchResWidget - + No search results គ្មានលទ្ធផលស្រាវជ្រាវ - + %1 items found - '%1 វត្ថុត្រូវបានស្រួល + '%1 វត្ថុត្រូវបានស្រួល SecurityDialog - + This document is trying to connect to: ឯកសារនេះកំពុងព្យាយាមភ្ជាប់ទៅ: - + If you trust the website, click Allow, otherwise click Block. ប្រសិនបើអ្នកមានការទុកចិត្តលើគេហទំព័រ សូមចុច Allow តាមដែល បើទោះបីជាអ្នកមិនទុកចិត្ត សូមចុច Block។ - + Block button បិទ - + Allow button អនុញ្ញាត @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails សំណាក់តូច - + Catalog សៀវបញ្ញាសៀវ - + Bookmarks សៀវបញ្ញាសៀវ - + Annotations លើការសម្គាល់ @@ -524,188 +607,207 @@ ShortCutShow - + Settings ការកំណfig - + Exit ចាកចេញ - + Help ជំនួយ - + Page up ទំព័រឡើង - + Page down ទំព័រចុះ - + Open បើក - + Zoom in កែងធំ - + Zoom out កែងតូច - + Save as រក្សាទុកជា - + + File + + + + + Display + + + + + Tools + ឧបករណ៍ + + + + Edit + + + + Print បង្ហោះ - + Save រក្សាទុក - + Thumbnails រូបភាពតូច - + 1:1 size ទំហំ ១:១ - + Fit height ប្រើប្រាស់កំពុងខ្សែ - + Fit width ប្រើប្រាស់កំពុងទំហំ - + Rotate left ប្រើប្រាស់ទំនិញខាងឆ្វេង - + Rotate right ប្រើប្រាស់ទំនិញខាងស្តាំ - + Move to the beginning ផ្ទះទៅចុះដើម - + Move to the end ផ្ទះទៅចុះបញ្ចប់ - + Scroll up one line រំកិលឡើងមួយជួរ - + Scroll down one line រំកិលចុះមួយជួរ - - + Select text ជ្រើសរើសអត្ថបទ - + Hand tool ឧបករណ៍ដៃ - + Add bookmark បន្ថែមសំណួរ - + Delete លុប - + Magnifier បង្ហាញពីរបស់អ្នក - + Slide show ការបង្ហាញស្តុក - + Fullscreen ការបង្ហាញស្តុក - + Copy ថតចំលើយ - + Cut កាត់ចំលើយ - + Paste តំឡើងវិញ - + Undo បំបូរិត - + Select all ជ្រើសរើសទាំងអស់ - + Display shortcuts បង្ហាញពីរបៀបប្រើ - + Add annotation បន្ថែមសំណើច - + Highlight ធ្វើឱ្យប្រើប្រាស់ដោយគ្មានសំណើច - + Search ស្វែងរក @@ -713,22 +815,23 @@ SideBarImageListView - + Copy ចំណាំ​បញ្ចូល - + Remove annotation បិទ​សំណើច - + + Remove all បិទ​ទាំងអស់ - + Remove bookmark បិទ​សំណើច​អ្នក​ចូល​ចិត្ត @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 ទំព័រ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page នេះ​គឺ​ជា​ទំព័រ​ដំបូង - + It is the last page នេះ​គឺ​ជា​ទំព័រ​ចុងក្រោយ @@ -757,47 +860,48 @@ TitleMenu - + New window បរិយាកាសថ្មី - + New tab តំបន់ថ្មី - + + Save រក្សាទុក - + Save as រក្សាទុក​ជា - + Display in file manager បង្ហាញ​នៅ​ក្នុង​ស្ថានីយ៍​ឯកសារ - + Magnifer ថ្នាក់​បង្ហាញ​ការ​ភ្ជាប់ - + Tools ឧបករណ៍ - + Search ស្វែងរក - + Print បង្ហាញ​នៅ​ក្នុង​ការ​បោះពុម្ព @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails រូប​តូច​ស្តើង @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached កំណត់​ពីរ​បៀប​ប្រើ​ត្រូវ​បាន​បញ្ចប់​ហើយ + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ផ្លូវ​ឯកសារ​ឯកសារ - + + FilePath ផ្លូវ​ឯកសារ - + ThumbnailPath Path. ផ្លូវ​រូប​តូច​ស្តើង - + Generate thumbnail. បង្កើត​រូប​តូច​ស្តើង diff --git a/translations/deepin-reader_kn_IN.ts b/translations/deepin-reader_kn_IN.ts index 137ddd11d..eabbfb1e0 100644 --- a/translations/deepin-reader_kn_IN.ts +++ b/translations/deepin-reader_kn_IN.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ದಾಖಲೆ ವೀಕ್ಸರ್ - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - ದಾಖಲೆ ವೀಕ್ಸರ್ ದಾಖಲೆ ಫೈಲ್‌ಗಳನ್ನು ಓದಲು ಬಳಸುವ ಒಂದು ಸಾಧನವಾಗಿದೆ, PDF, DJVU, DOCX ಇತ್ಯಾದಿಗಳನ್ನು ಸುಪರ್ಣಿಸುತ್ತದೆ + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location ಸ್ಥಳ - + Subject ವಿಷಯ - + Author ಲೇಖಕ - + Keywords ಕೀವರ್ಡ್ಸ್ - + Producer ತಯರಿಸುವವರು - + Creator ಸೃಷ್ಟಿಕರ್ತ - + Time created ಸೃಷ್ಟಿಸಲಾದ ಸಮಯ - + Time modified ಸುಧಾರಿಸಲಾದ ಸಮಯ - + Format ಆಕಾರ - + Pages ಪುಟಗಳು - + Optimized ಆಪ್ಟಿಮೈಸ್ ಆಗಿದೆ - + Security ಸುರಕ್ಷತೆ - + Page size ಪುಟ ಆಕಾರ - + File size ಫೈಲ್ ಆಕಾರ - + + Warnings + + + + Basic info ಮುಖ್ಯ ಮಾಹಿತಿ - + Unknown ಅಸ್ಪಷ್ಟ - + Yes ಹೌದು - + No ನಾನು @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark ಬುಕ್ಮಾರ್ಕ್ ಸೇರಿಸಿ - + Are you sure you want to delete all bookmarks? ನೀವು ಎಲ್ಲಾ ಬುಕ್ಮಾರ್ಕ್‌ಗಳನ್ನು ಅಪ್ಪಳಿಸಲು ನಿಜವಾಗಿದೆಯಾ? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy ನಕಲಿಸಿ - + Remove annotation ಅನೋಟೇಶನ್ ಕೆಳಗಿಳಿಸಿ - + + + Add annotation ಅನೋಟೇಶನ್ ಸೇರಿಸಿ - + + + + Remove bookmark ಬುಕ್ಮಾರ್ಕ್ ಕೆಳಗಿಳಿಸಿ - + + + + Add bookmark ಬುಕ್ಮಾರ್ಕ್ ಸೇರಿಸಿ - + Highlight ಅಂಶಗಳನ್ನು ಹೈಲೈಟ್ ಮಾಡಿ - + Remove highlight ಅಂಶಗಳನ್ನು ಹೈಲೈಟ್ ತೆಗೆದುಹಾಕಿ - + + Search ಹುಡುಕಿ - + + Exit fullscreen Exit fullscreen - + + Fullscreen Fullscreen - + + Slide show Slide show - + + First page First page - + + Previous page Previous page - + + Next page Next page - + + Last page Last page - + + Rotate left Rotate left - + + Rotate right Rotate right - + + Print Print - + + Document info Document info @@ -219,7 +248,7 @@ Central - + Documents Documents @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported The format is not supported - + Open failed Open failed - + Please check if the file is damaged Please check if the file is damaged - + Conversion failed, please check if the file is damaged Conversion failed, please check if the file is damaged - + Save failed Save failed - + Saved successfully Saved successfully - + Save as Save as - + + Invalid file name Invalid file name - + + OK button OK @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Drag documents here - + Format supported: %1 Format supported: %1 - + Select File Select File @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed The bookmark has been removed - + + Please select the text Please select the text - + + The annotation has been removed The annotation has been removed @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Encrypted file, please enter the password - + Password Password - + OK button OK - + Wrong password ಕೆಲಸದ ಸರಿಯದ ಪಾಸ್ವರ್ಡ್ + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous ಮೊದಲು - + Next ಮುಂದೆ @@ -349,12 +414,12 @@ HandleMenu - + Select Text ಪಠ್ಯವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ - + Hand Tool ಕೈ ಕಾಂತಿ @@ -362,12 +427,12 @@ NotesWidget - + Add annotation ಅನ್ನಾಟ್ನ್ ಸೇರಿಸಿ - + Are you sure you want to delete all annotations? ನೀವು ಎಲ್ಲಾ ಅನ್ನಾಟ್ನ್ ಅನ್ನು ಮಾಡಲು ನಿಶ್ಚಯರಾದಿರಾ? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number ಅವಾಧ್ಯ ಪೇಜ್ ಸಂಖ್ಯೆ @@ -383,7 +448,7 @@ ProgressDialog - + Converting ವರ್ಗಾವಣೆ @@ -391,43 +456,61 @@ QObject - + Document not saved ದಾಸ್ತಾನು ಸಂಗ್ರಹಿಸಲಾಗಿಲ್ಲ + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" ಗೆ ಬದಲಾವಣೆಗಳನ್ನು ಸಂಗ್ರಹಿಸಲು ನಿಶ್ಚಯರಾದಿರಾ? + + Save the changes to "%1"? + "%1" ಗೆ ಬದಲಾವಣೆಗಳನ್ನು ಸಂಗ್ರಹಿಸಲು ನಿಶ್ಚಯರಾದಿರಾ? - + Cancel button ವಾಪಸು - + Discard button ಅನ್ನಿಸಿ - + Save button ಸಂಗ್ರಹಿಸಿ - + Cancel ವಾಪಸು - + Delete ಅಪಹರಿಸಿ @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View ಎರಡು ಪೇಜ್ ರೂಪದಲ್ಲಿ - + 1:1 size 1:1 ಆಕಾರ - + Fit Page ಪೇಜ್ ಅನ್ನು ಅನುಗುಣವಾಗಿ - + Fit Height ಉದ್ದವನ್ನು ಅನುಗುಣವಾಗಿ - + Fit Width ಅಗಲವನ್ನು ಅನುಗುನವಾಗಿ @@ -463,36 +546,36 @@ SearchResWidget - + No search results ಹುಡುಕಾಟದ ಫಲಿತಾಂಶಗಳಿಲ್ಲ - + %1 items found - '%1 ಪ್ರಾಶ್ನೆಗಳು ಕಂಡು ಬಂದಿವೆ' + '%1 ಪ್ರಾಶ್ನೆಗಳು ಕಂಡು ಬಂದಿವೆ' SecurityDialog - + This document is trying to connect to: ಈ ದಾಸ್ತಾನು ಸಂಪರ್ಕಿಸಲು ಪ್ರಯತ್ನಿಸುತ್ತಿದೆ: - + If you trust the website, click Allow, otherwise click Block. ನೀವು ವೆಬ್ಸೈಟ್ಗೆ ನಂಬಿಕೆ ಹೊಂದಿದ್ದರೆ Allow ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ, ಅಥವಾ Block ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ. - + Block button ಅಡ್ಡಿಪಡಿಸಿ - + Allow button ಅನುಮತಿಸಿ @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails ಚಿತ್ರಗಳು - + Catalog ಕ್ಯಾಟಾಲಾಗ್ - + Bookmarks ಮುದ್ರಣಗಳು - + Annotations ಅನ್ನೋಟ್ಸ್ @@ -524,188 +607,207 @@ ShortCutShow - + Settings ಸೆಟ್ಟಿಂಗ್ಸ್ - + Exit ನಿಭೃತಿ - + Help ಸಹಾಯ - + Page up ಪೇಜ್ ಅಪ್ - + Page down ಪೇಜ್ ಡೌನ್ - + Open ಪ್ರಾರಂಭಿಸಿ - + Zoom in ಜಿಯೋಮ್ ಇನ್ - + Zoom out ಜಿಯೋಮ್ ಆಟ್ - + Save as ಸೇವ್ ಆಸ್ - + + File + + + + + Display + + + + + Tools + ಟೂಲ್ಸ್ + + + + Edit + + + + Print ಪ್ರಿಂಟ್ - + Save ಸೇವ್ - + Thumbnails ತಮ್ಮ್ಸ್ - + 1:1 size 1:1 ಆಕಾರ - + Fit height ಹೆಈಟ್ ಅಳುగೆ - + Fit width ಹೈಟ್ ವಿಡ್ತ್ - + Rotate left ರೋಟೇಟ್ ಲೀವ್ಟ್ - + Rotate right ರೋಟೇಟ್ ರೈಟ್ - + Move to the beginning ಪ್ರಾರಂಭದ ಬದಲಿಗೆ ಸ್ಥಳಾಂತರಿಸಿ - + Move to the end ಅಂತ್ಯದ ಬದಲಿಗೆ ಸ್ಥಳಾಂತರಿಸಿ - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text ಪಠ್ಯವನ್ನು ಆಯ್ಕೆಮಾಡಿ - + Hand tool ಕೈ ಸಾಧನ - + Add bookmark ಬುಕ್ಮಾರ್ಕ್ ಸೇರಿಸಿ - + Delete ಅಪ್ಲಿಕೇಶನ್ - + Magnifier ಮಾಗ್ನಿಫೈಯರ್ - + Slide show ಸ್ಲೈಡ್ ಶೋ - + Fullscreen ಫುಲ್ಸ್ಕ್ರೀನ್ - + Copy ನಕಲು - + Cut ಕತ್ತಿ - + Paste ಪೇಸ್ಟ್ - + Undo ಇದನ್ನು ಬದಲಾಯಿಸಿ - + Select all ಮತ್ತು ಎಲ್ಲವನ್ನು ಆಯ್ಕೆಮಾಡಿ - + Display shortcuts ಶರ್ಟ್ಕಟ್‌ಗಳನ್ನು ತೋರಿಸಿ - + Add annotation ಅನ್ನೋಟವನ್ನು ಸೇರಿಸಿ - + Highlight ಅಂಶ ಗುರುತಿಸಿ - + Search ಶೋಧಿಸಿ @@ -713,22 +815,23 @@ SideBarImageListView - + Copy ನಕಲು ಮಾಡಿ - + Remove annotation ಅನ್ನೋಟವನ್ನು ತೆಗೆದುಹಾಕಿ - + + Remove all ಮತ್ತು ಎಲ್ಲವನ್ನು ತೆಗೆದುಹಾಕಿ - + Remove bookmark ಮಾರ್ಕ್ ಮಾಡಿದ ಸೂಚಿಕೆಯನ್ನು ತೆಗೆದುಹಾಕಿ @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 ಪುಟ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ಅದು ಮೊದಲ ಪುಟವಾಗಿದೆ - + It is the last page ಅದು ಕೊನೆಯ ಪುಟವಾಗಿದೆ @@ -757,47 +860,48 @@ TitleMenu - + New window ಹೊಸ ವಿಂಡೋ - + New tab ಹೊಸ ಟಾಬ್ - + + Save ಸೇವ್ ಮಾಡಿ - + Save as ಸೇವ್ ಮಾಡಿ ಅಥವಾ - + Display in file manager ಫೈಲ್ ಮ್ಯಾನಿಯರ್‌ನಲ್ಲಿ ತೋರಿಸಿ - + Magnifer ಮಾಗ್ನಿಫಿಯರ್ - + Tools ಟೂಲ್ಸ್ - + Search ಶೋಧಿಸಿ - + Print ಪ್ರಿಂಟ್ ಮಾಡಿ @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails ತೆರೆಯುವ ಚಿತ್ರಗಳು @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached ಪ್ರವೇಶ ಸೀಮಾ ಸಿಗಿದೆ + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ದಾಖಲೆ ಫೈಲ್ ಪಾಥ್. - + + FilePath ಫೈಲ್ ಪಾಥ್ - + ThumbnailPath Path. ಥ್ಯೂಮ್ನೈಲ್ ಪಾಥ್ ಪಾಥ್. - + Generate thumbnail. ಥ್ಯೂಮ್ನೈಲ್ ಉತ್ಪಾದಿಸಿ. diff --git a/translations/deepin-reader_ko.ts b/translations/deepin-reader_ko.ts index b6d8c7e3b..1f2ff4665 100755 --- a/translations/deepin-reader_ko.ts +++ b/translations/deepin-reader_ko.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ 문서 보기도구 - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location 위치 - + Subject 제목 - + Author 작성자 - + Keywords 키워드 - + Producer 제작자 - + Creator 작성자 - + Time created 생성된 시간 - + Time modified 수정된 시간 - + Format 서식 - + Pages 페이지 - + Optimized 최적화됨 - + Security 보안 - + Page size 페이지 크기 - + File size 파일 크기 - + + Warnings + + + + Basic info 기본 정보 - + Unknown 알 수 없음 - + Yes 예 - + No 아니요 @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark 북마크 추가 - + Are you sure you want to delete all bookmarks? 모든 북마크를 삭제하시겠습니까? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy 복사 - + Remove annotation 주석 제거 - - - + + + Add annotation 주석 추가 - - - - + + + + Remove bookmark 북마크 제거 - - - - + + + + Add bookmark 북마크 추가 - + Highlight 강조표시 - + Remove highlight 강조표시 제거 - - + + Search 검색 - - + + Exit fullscreen 전체화면 종료 - - + + Fullscreen 전체화면 - - + + Slide show 슬라이드 쇼 - - + + First page 첫 페이지 - - + + Previous page 이전 페이지 - - + + Next page 다음 페이지 - - + + Last page 마지막 페이지 - - + + Rotate left 왼쪽으로 회전 - - + + Rotate right 오른쪽으로 회전 - - + + Print 인쇄 - - + + Document info 문서 정보 @@ -241,7 +248,7 @@ Central - + Documents 문서 @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported 형식이 지원되지 않음 - + Open failed 열기 실패 - + Please check if the file is damaged 파일이 손상되었는지 확인하십시오 - + Conversion failed, please check if the file is damaged 변환 실패, 파일이 손상되었는지 확인해 주세요 - + Save failed 저장 실패 - + Saved successfully 성공적으로 저장됨 - + Save as 다른 이름으로 저장 - - + + Invalid file name 잘못된 파일 이름 - - + + OK button 확인 @@ -305,12 +312,12 @@ 문서를 여기로 드래그 - + Format supported: %1 지원되는 형식: %1 - + Select File 파일 선택 @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed 북마크가 제거되었습니다 - - + + Please select the text 텍스트를 선택하십시오. - - + + The annotation has been removed 주석이 제거되었습니다 @@ -344,31 +351,62 @@ 암호화된 파일입니다. 비밀번호를 입력해 주세요 - + Password 비밀번호 - + OK button 확인 - + Wrong password 잘못된 비밀번호 + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous 이전 - + Next 다음 @@ -389,12 +427,12 @@ NotesWidget - + Add annotation 주석 추가 - + Are you sure you want to delete all annotations? 모든 어노테이션을 삭제하시겠습니까? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number 잘못된 페이지 번호 @@ -423,38 +461,56 @@ 저장되지 않은 문서 + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? "%1"에 변경 사항을 저장하시겠습니까? - + Cancel button 취소 - + Discard button 폐기 - + Save button 저장 - + Cancel 취소 - + Delete 삭제 @@ -490,12 +546,12 @@ SearchResWidget - + No search results 검색 결과 없음 - + %1 items found %1개 항목 발견 @@ -551,188 +607,207 @@ ShortCutShow - + Settings 설정 - + Exit 종료 - + Help 도움말 - + Page up 페이지 업 - + Page down 페이지 다운 - + Open 열기 - + Zoom in 확대 - + Zoom out 축소 - + Save as 다른 이름으로 저장 - + + File + + + + + Display + + + + + Tools + 도구 + + + + Edit + + + + Print 인쇄 - + Save 저장 - + Thumbnails 썸네일 - + 1:1 size 1:1 크기 - + Fit height 높이 맞춤 - + Fit width 너비 맞춤 - + Rotate left 왼쪽으로 회전 - + Rotate right 오른쪽으로 회전 - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning 처음으로 이동 - + Move to the end 끝으로 이동 - + Select text 텍스트 선택 - + Hand tool 손 도구 - + Add bookmark 북마크 추가 - + Delete 삭제 - + Magnifier 돋보기 - + Slide show 슬라이드 쇼 - + Fullscreen 전체화면 - + Copy 복사 - + Cut 잘라내기 - + Paste 붙여넣기 - + Undo 되돌리기 - + Select all 모두 선택 - + Display shortcuts 단축키 표시 - + Add annotation 주석 추가 - + Highlight 강조표시 - + Search 검색 @@ -740,23 +815,23 @@ SideBarImageListView - + Copy 복사 - + Remove annotation 주석 제거 - - + + Remove all 모두 제거 - + Remove bookmark 북마크 제거 @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 페이지 %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page 첫 번째 페이지입니다 - + It is the last page 마지막 페이지입니다 @@ -785,48 +860,48 @@ TitleMenu - + New window 새 창 - + New tab 새 탭 - - + + Save 저장 - + Save as 다른 이름으로 저장 - + Display in file manager 파일 관리자에 표시 - + Magnifer 돋보기 - + Tools 도구 - + Search 검색 - + Print 인쇄 @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails 썸네일 @@ -847,28 +922,95 @@ 입력 한계 도달함 + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. 문서 파일 경로. - - + + FilePath 파일 경로 - + ThumbnailPath Path. 썸네일 경로. - + Generate thumbnail. 썸네일 생성. - \ No newline at end of file + diff --git a/translations/deepin-reader_ku.ts b/translations/deepin-reader_ku.ts index 0ab06ba4c..26008e40c 100644 --- a/translations/deepin-reader_ku.ts +++ b/translations/deepin-reader_ku.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ئەتەتەن نەشري - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - ئەتەتەن نەشري دەرەجە دۆخەن فایلو بۆ چونەن بەکاردەن، PDF، DJVU، DOCX ھەڵبەهەو چەکەرەکان بەکاردەن + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location مەکان - + Subject مەسالە - + Author ناوی نووسەر - + Keywords کۆمارەکان - + Producer تەکرەرکەر - + Creator ناوی نووسەر - + Time created زمانی نووسین - + Time modified زمانی دەگرەن - + Format فرۆمەت - + Pages پەجەکان - + Optimized بەکاردەن - + Security سەرچەم - + Page size پەجە کۆتەر - + File size فایل کۆتەر - + + Warnings + + + + Basic info ئەساسی نەشري - + Unknown نەدەیە - + Yes بەر - + No نەر @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark ئەتەتەن نەشري بەکاردەن - + Are you sure you want to delete all bookmarks? ھەڵبەهەو ئەتەتەن نەشري بەکاردەن دەگرەن؟ @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy کۆپی کردن - + Remove annotation ئەتەتەن نەشري نووتە دەگرەن - + + + Add annotation ئەتەتەن نەشري نووتە بەکاردەن - + + + + Remove bookmark ئەتەتەن نەشري بەکاردەن دەگرەن - + + + + Add bookmark ئەتەتەن نەشري بەکاردەن - + Highlight ئەتەتەن نەشري دەرەجە بەکاردەن - + Remove highlight ئەتەتەن نەشري دەرەجە دەگرەن - + + Search تەقىرە - + + Exit fullscreen تۆپ چاپەوە - + + Fullscreen تۆپ چاپەوە - + + Slide show پشتێرەوە - + + First page پەڕەی گەورە - + + Previous page پەڕەی پێش - + + Next page پەڕەی بەرەو - + + Last page پەڕەی کەش - + + Rotate left چەکەوە چەپ - + + Rotate right چەکەوە راست - + + Print چاپ کردن - + + Document info مەلەمەتی دوكۆمان @@ -219,7 +248,7 @@ Central - + Documents دوكۆمانە @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported فرۆمەتی ئەوە نەدەوە - + Open failed بەستەوە نەکردن - + Please check if the file is damaged چек کەوە بۆ کردنەوەی فایلەکە - + Conversion failed, please check if the file is damaged تەواو کردنەوە نەکردن، بەستەوە بۆ کردنەوەی فایلەکە - + Save failed بەستەوە نەکردن - + Saved successfully بەستەوە دەکردن - + Save as بەستەوە بە کۆن - + + Invalid file name ناوی فایلەکە ناکۆن - + + OK button بەرەو @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here دوكۆمانەکە بەرەو کەش بەکەن - + Format supported: %1 فرۆمەتی دەستکارکردن: %1 - + Select File فایلەکە بەکەن @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed تەمەمەکە بەرەو کەش بەکەن - + + Please select the text تەکستەکە بەکەن - + + The annotation has been removed تەمەمەکە بەرەو کەش بەکەن @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password فایلی نەدەوە، پاسۆردەکە بەکەن - + Password پاسۆرد - + OK button بەرەو - + Wrong password کلمه‌ی ژیان چی دەبێ + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous بەرەو دوور - + Next بەرەو کۆش @@ -349,12 +414,12 @@ HandleMenu - + Select Text تەکستی بەرەو چەک کردن - + Hand Tool ئەم ئەمەن @@ -362,12 +427,12 @@ NotesWidget - + Add annotation ئەنوتەشنێک بەرەو دەکەردن - + Are you sure you want to delete all annotations? ئەمەنەکانی هەموو چەک کردنەوە؟ @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number ژمارەی پەڕی ناچاکە @@ -383,7 +448,7 @@ ProgressDialog - + Converting تەواو کردن @@ -391,43 +456,61 @@ QObject - + Document not saved ئاگرەکە ناچاکە + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - تەواو کردنەوە بۆ "%1"؟ + + Save the changes to "%1"? + تەواو کردنەوە بۆ "%1"؟ - + Cancel button بەخێر - + Discard button تەواو کردن - + Save button تەواو کردن - + Cancel بەخێر - + Delete جەزە @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View بینا کردنی دوو پەڕ - + 1:1 size بە ئەنجا 1:1 - + Fit Page بەرەو چەک کردن - + Fit Height بەرەو چەک کردنی بەردەوام - + Fit Width بەرەو چەک کردنی گەڕە @@ -463,36 +546,36 @@ SearchResWidget - + No search results نەتەوە پەڕەکان - + %1 items found - '%1 پەڕە دۆزرایەن' + '%1 پەڕە دۆزرایەن' SecurityDialog - + This document is trying to connect to: ئاگرەکە بەرەو چەک کردنەوە بۆ: - + If you trust the website, click Allow, otherwise click Block. ئەگەر توپەکە بەرەو چەک کردنەوە بێت، کلیک کردنەوە Allow، خەڵکە بەرەو چەک کردنەوە نەبێت، کلیک کردنەوە Block. - + Block button بەرەو چەک کردن - + Allow button پەرەوەز کردن @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails کۆچەکان - + Catalog کاتالۆگ - + Bookmarks کۆچەکان - + Annotations ئەتەسەت @@ -524,188 +607,207 @@ ShortCutShow - + Settings ئەتەسەتە - + Exit تۆر - + Help کۆمەڵات - + Page up پەڕە کەم - + Page down پەڕە زیاد - + Open بەکارھێن - + Zoom in بەزیادکردن - + Zoom out بەکەمکردن - + Save as بەکارھێنەوە - + + File + + + + + Display + + + + + Tools + کۆمەڵ ئەمە + + + + Edit + + + + Print چاپ کردن - + Save بەکارھێنە - + Thumbnails تۆپىکا - + 1:1 size 1:1 چەمە - + Fit height بەکەشانە کۆتات - + Fit width بەکەشانە چەمە - + Rotate left چەمە چەپ - + Rotate right چەمە ھەڵ - + Move to the beginning بەتەنە ھەڵ - + Move to the end بەتەنە چەپ - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text تەکستی چاک کردن - + Hand tool بەکارھێنەرە ھەند - + Add bookmark کۆتاتی چاک کردن - + Delete تۆر - + Magnifier بەکارھێنەرە چەمە - + Slide show سڵايد شوو - + Fullscreen ئەتەسەتە چەمە - + Copy کۆپی کردن - + Cut تۆر کردن - + Paste بەکارھێنە کردن - + Undo بەردەوام کردن - + Select all هەمه لەسەر کردن - + Display shortcuts کوتاکە ئەوە بەکارهێنەرەوە نمایەنەوە - + Add annotation ئەتەتەکە بەکارهێنەرەوە گەڕانەوە - + Highlight ئەوە بەکارهێنەرەوە چاک کردن - + Search تەقەریب کردن @@ -713,22 +815,23 @@ SideBarImageListView - + Copy کۆپی کردن - + Remove annotation ئەتەتەکە بەکارهێنەرەوە پاک کردن - + + Remove all هەمه پاک کردن - + Remove bookmark بەکارهێنەرەوە بەکارهێنەرەوە کۆتاکە پاک کردن @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 پەڕ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ئەوە پەڕی نخستە - + It is the last page ئەوە پەڕی چووە @@ -757,47 +860,48 @@ TitleMenu - + New window پەنجرە نوو - + New tab تەب نوو - + + Save بچوو - + Save as بچوو بە ناوی دیکە - + Display in file manager فایل ھێدەرەوە بەکارهێنەرەوە نمایەنەوە - + Magnifer بەکارهێنەرەوە بەکارهێنەرەوە چاک کردن - + Tools کۆمەڵ ئەمە - + Search تەقەریب کردن - + Print چاپ کردن @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails کۆتاکە @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached مقداری وەرگرتن بەکارهێنەرەوە بەکارهێنەرەوە دەستکاری + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. پەڕەکە فایل پەتوانە - + + FilePath پەتوانە - + ThumbnailPath Path. کۆتاکە پەتوانە - + Generate thumbnail. کۆتاکە بەکارهێنەرەوە بەکارهێنەرەوە دەستکاری diff --git a/translations/deepin-reader_ku_IQ.ts b/translations/deepin-reader_ku_IQ.ts index 18d125af8..3fb4e41d5 100644 --- a/translations/deepin-reader_ku_IQ.ts +++ b/translations/deepin-reader_ku_IQ.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer بەڕەوەکردنەوەی دووگان - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - بەڕەوەکردنەوەی دووگان ھەنگامەکردنەوەی دووگانەکانی ھەڵبەندە، پەیوەندی PDF، DJVU، DOCX ھەروەھا. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location مکان - + Subject مەسالە - + Author ناوی نووسەر - + Keywords کۆمەنەکان - + Producer سەرچاوەکردنەوەکەر - + Creator سازنیکردنەوەکەر - + Time created زمانی سازنیکردنەوە - + Time modified زمانی تەمەمکردنەوە - + Format فرۆمەت - + Pages پەginas - + Optimized بەرھەمەرکردن - + Security سەرچاوە - + Page size چەمەکەری پەginas - + File size چەمەکەری فایل - + + Warnings + + + + Basic info مەلەمەتەکانی بەسە - + Unknown نەشنی - + Yes بەڵە - + No ھەی @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark بەکارھێنانی چەمەکەر - + Are you sure you want to delete all bookmarks? چی دەخوێنیت کە دەتەوێنیت بەکارھێنانی هەموو چەمەکەرەکان؟ @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy کۆپی کردن - + Remove annotation تەمەمکردنی نوتە - + + + Add annotation بەکارھێنانی نوتە - + + + + Remove bookmark تەمەمکردنی چەمەکەر - + + + + Add bookmark بەکارھێنانی چەمەکەر - + Highlight دەرکردن - + Remove highlight تەمەمکردنی دەرکردن - + + Search گەڕاندن - + + Exit fullscreen بەرەوە بەرەوە - + + Fullscreen بەرەوە - + + Slide show شOW لە چەکە - + + First page پەڕەی پەرەوە - + + Previous page پەڕەی پێش - + + Next page پەڕەی هەلە - + + Last page پەڕەی سەرەوە - + + Rotate left چەکە بەرەوە - + + Rotate right چەکە بەرەوە - + + Print چاپ کردن - + + Document info مەلەمەتی دۆکۆمەنت @@ -219,7 +248,7 @@ Central - + Documents دۆکۆمەنتە @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported بەرەوە چەکە نەدەوە - + Open failed بەڕاستی ئەوە بەرەوە - + Please check if the file is damaged بەرەوە دۆکۆمەنتە بەرەوە کەرەوە - + Conversion failed, please check if the file is damaged بەرەوە چەکە بەرەوە کەرەوە - + Save failed بەرەوە کەرەوە - + Saved successfully بەرەوە کەرەوە - + Save as بەرەوە بەرەوە - + + Invalid file name نامی دۆکۆمەنتە بەرەوە کەرەوە - + + OK button بەرەوە @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here دۆکۆمەنتە بەرەوە بەرەوە - + Format supported: %1 بەرەوە چەکە: %1 - + Select File دۆکۆمەنتە بەرەوە @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed بەرەوە چەکە بەرەوە - + + Please select the text بەرەوە چەکە بەرەوە - + + The annotation has been removed بەرەوە چەکە بەرەوە @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password دۆکۆمەنتە بەرەوە، لەوە بەرەوە پاسۆوردە بەرەوە - + Password پاسۆورد - + OK button بەرەوە - + Wrong password کلمه ی پاسورد یواشە + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous پێشوور - + Next بەتەن @@ -349,12 +414,12 @@ HandleMenu - + Select Text تەکستی بەکارهێنرە - + Hand Tool کرەوەکردنەوە @@ -362,12 +427,12 @@ NotesWidget - + Add annotation ئەنوتاسیۆن بەکارهێنرە - + Are you sure you want to delete all annotations? ئەنوتاسیۆنەکانی ھەڵە بەکارهێنرە بەکارهێنرە چی دەوترێت؟ @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number ژمارەی پەڕ یواشە @@ -383,7 +448,7 @@ ProgressDialog - + Converting تەواو کردن @@ -391,43 +456,61 @@ QObject - + Document not saved دۆکومنەکان ھەڵە بەکارهێنرە + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - تەواو کردنەوە بۆ "%1"? + + Save the changes to "%1"? + تەواو کردنەوە بۆ "%1"? - + Cancel button بەکەرکردن - + Discard button پەڕەوەرکردن - + Save button تەواو کردن - + Cancel بەکەرکردن - + Delete پەڕەوەرکردن @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View بینا دووپەڕ - + 1:1 size 1:1 بەش - + Fit Page بەپەڕ بەکارهێنرە - + Fit Height بەکەمەت بەکارهێنرە - + Fit Width بەپەڕەت بەکارهێنرە @@ -463,36 +546,36 @@ SearchResWidget - + No search results نتییەتی جووبەکان - + %1 items found - '%1 بەکارهێنرە جووبەکان' + '%1 بەکارهێنرە جووبەکان' SecurityDialog - + This document is trying to connect to: دۆکومنەکان دەخوێنێت بۆ: - + If you trust the website, click Allow, otherwise click Block. ئەگەر دەتوانرێت کۆمپەنیەکان بەکارهێنرە، بەکەرکردنەوە Allow، بەڵام ئەگەر نەتوانرێت، بەکەرکردنەوە Block. - + Block button بڵوك کردن - + Allow button ئەلۆو کردن @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails تۆمارەکان - + Catalog کاتالۆگ - + Bookmarks بۆکمارکس - + Annotations ئەتەسەت @@ -524,188 +607,207 @@ ShortCutShow - + Settings ئەمەندارى - + Exit تۆpkە - + Help کۆمەڵات - + Page up پەج ئەپ - + Page down پەج داون - + Open بەکارهێنە - + Zoom in بەکارهێنە - + Zoom out بەکارهێنە - + Save as بەکارهێنە - + + File + + + + + Display + + + + + Tools + بەکاره Willie + + + + Edit + + + + Print چاپ کردن - + Save بەکارهێنە - + Thumbnails تۆمەنەکان - + 1:1 size 1:1 چەمە - + Fit height بەکارهێنە - + Fit width بەکارهێنە - + Rotate left تۆرەت چەپ - + Rotate right تۆرەت ھەیو - + Move to the beginning بە ھەڵەکان بەرە - + Move to the end بە ھەڵەکان هەو - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text مەتەن دەخە - + Hand tool پەلەن دەرە - + Add bookmark بەکارهێنە - + Delete چاک کردن - + Magnifier مەگنەفەر - + Slide show سلايد شوو - + Fullscreen فولسکرېن - + Copy کۆپى کردن - + Cut کات کردن - + Paste پەسەت کردن - + Undo بەردەوام کردن - + Select all هەموو نووسەرەکان بەردەوام کردن - + Display shortcuts کوتاکەکان نمایش کردن - + Add annotation Add annotation - + Highlight ئەنجامدان بەکارهێنەری بەکارهێنەری بەکارهێنەری بەکاره Willie - + Search بەکاره Willie @@ -713,22 +815,23 @@ SideBarImageListView - + Copy کۆپی کردن - + Remove annotation ئەنجامدان بەکاره Willie - + + Remove all هەموو بەکاره Willie - + Remove bookmark کۆتەکە بەکاره Willie @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 پەجە %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ئەم پەجە گەلە ڕەوە - + It is the last page ئەم پەجە گەلە چووە @@ -757,47 +860,48 @@ TitleMenu - + New window پەنجرە نوو - + New tab تاپ نوو - + + Save بەسەر کردن - + Save as بەسەر کردن بەناوی - + Display in file manager فایل مەنیجر لە بەکاره Willie - + Magnifer بەکاره Willie - + Tools بەکاره Willie - + Search بەکاره Willie - + Print چاپ کردن @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails کۆتەکەکان @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached کۆتەکەکان بەکاره Willie + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. پەتەنەمە فایل - + + FilePath پەتەنەمە فایل - + ThumbnailPath Path. پەتەنەمە کۆتەکە - + Generate thumbnail. کۆتەکە نمایش کردن diff --git a/translations/deepin-reader_ky.ts b/translations/deepin-reader_ky.ts index f5d1544e4..63a8350ee 100644 --- a/translations/deepin-reader_ky.ts +++ b/translations/deepin-reader_ky.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Документ қарау - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Документ қарау документ файлдарын оқу үшін құрал, PDF, DJVU, DOCX сияқты файлдарды қамтиды. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Жайылғы - + Subject Тақырыбы - + Author Жазуы - + Keywords Англаттар - + Producer Түзетуші - + Creator Сәйкес - + Time created Жасалған уақыты - + Time modified Өзгерту уақыты - + Format Формат - + Pages Беттер - + Optimized Таңбаланған - + Security Қауіпсіздік - + Page size Бет өлшемі - + File size Файл өлшемі - + + Warnings + + + + Basic info Негізгі мағлұмат - + Unknown Белгісіз - + Yes Жоғары - + No Жоқ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Маркер қосу - + Are you sure you want to delete all bookmarks? Барлық маркерлерді өшіруге сіз құттықтайсыз ба? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Көшіру - + Remove annotation Түсіндіруді алып тастау - + + + Add annotation Түсіндіру қосу - + + + + Remove bookmark Маркерді алып тастау - + + + + Add bookmark Маркер қосу - + Highlight Айырылу - + Remove highlight Айырылу алып тастау - + + Search Қарастыру - + + Exit fullscreen Толук экранга чыг - + + Fullscreen Толук экран - + + Slide show Слайд шоу - + + First page Биринчи бет - + + Previous page Алдыңғы бет - + + Next page Келесі бет - + + Last page Соңғы бет - + + Rotate left Солға түсір - + + Rotate right Оңға түсір - + + Print Шынжырлау - + + Document info Документтын маълуматы @@ -219,7 +248,7 @@ Central - + Documents Документтар @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Форматтын түрі дәстүрләнбеген - + Open failed Ачылмады - + Please check if the file is damaged Файлдын бұзылғанын тексеріңіз - + Conversion failed, please check if the file is damaged Айналдыру үзгерісі үшін файлдын бұзылғанын тексеріңіз - + Save failed Сақтау үзгерісі үшін файлдын бұзылғанын тексеріңіз - + Saved successfully Мақсаттау үшін файлдын бұзылғанын тексеріңіз - + Save as Сақтау үшін - + + Invalid file name Дәл әріпсіз файл аты - + + OK button Тағдырын @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Документтарды шығар - + Format supported: %1 Форматтын түрі: %1 - + Select File Файлды таңдаңыз @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Күшті атау үзгерісі - + + Please select the text Мәтінді таңдаңыз - + + The annotation has been removed Түсіндіру үзгерісі @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Шифрланған файл, құпия сөз енгізіңіз - + Password Құпия сөз - + OK button Тағдырын - + Wrong password Жазылган үткөн + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Алдыңгы - + Next Кийинки @@ -349,12 +414,12 @@ HandleMenu - + Select Text Мәтінді тандаңыз - + Hand Tool Көрсеткіш әріп @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Түшініктеме қўшыңыз - + Are you sure you want to delete all annotations? Барлық түшініктемелерди өчүрәрсіз ба? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Берілгін page number қате @@ -383,7 +448,7 @@ ProgressDialog - + Converting Айландыруу @@ -391,43 +456,61 @@ QObject - + Document not saved Документ сақталған жок + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" үзіндісін сақлау қылырсыз ба? + + Save the changes to "%1"? + "%1" үзіндісін сақлау қылырсыз ба? - + Cancel button Батыр - + Discard button Алып таста - + Save button Сақла - + Cancel Батыр - + Delete Жою @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Екі беттік қарау - + 1:1 size 1:1 өлчөм - + Fit Page Бетке үйләт - + Fit Height Биіктікке үйләт - + Fit Width Енге үйләт @@ -463,36 +546,36 @@ SearchResWidget - + No search results Қарастыру нәтижесі жок - + %1 items found - '%1 өнімдер табылды' + '%1 өнімдер табылды' SecurityDialog - + This document is trying to connect to: Бұл документ үзінде қосылуға тырысады: - + If you trust the website, click Allow, otherwise click Block. Сайтты үйрәнсеңіз, Allow деген дәнгейді басыңыз, әйтпесе Block деген дәнгейді басыңыз. - + Block button Блок - + Allow button Разрешить @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Кішірейтілген көріністер - + Catalog Каталог - + Bookmarks Мұрағаттар - + Annotations Таңбалар @@ -524,188 +607,207 @@ ShortCutShow - + Settings Төҙөлөштөр - + Exit Чыгыу - + Help Көмөк - + Page up Бет үткөн - + Page down Бет үткөн - + Open Ачыу - + Zoom in Күбөйтүү - + Zoom out Күчөрүү - + Save as Сақлау - + + File + + + + + Display + + + + + Tools + Ағзалар + + + + Edit + + + + Print Чынтау - + Save Сақлау - + Thumbnails Кичине көрүнүү - + 1:1 size 1:1 өлчөм - + Fit height Жоюу - + Fit width Жоюу - + Rotate left Солго түшүрүү - + Rotate right Оңго түшүрүү - + Move to the beginning Башына күчөрүү - + Move to the end Аягына күчөрүү - + Scroll up one line Бир сап жогору скроллдоо - + Scroll down one line Бир сап төмөн скроллдоо - - + Select text Мәтінді тандау - + Hand tool Көрүү өйөнөнө - + Add bookmark Таңбалау өйөнөнө - + Delete Жогуу - + Magnifier Көзөнөнө - + Slide show Слайд шоу - + Fullscreen Кеңейтилгән - + Copy Көчүрүү - + Cut Көчүрүү - + Paste Көчүрүү - + Undo Башҡаға - + Select all Барлығын сикерәтлә - + Display shortcuts Тышҡы ҡырҡыларҙы күрһәтеү - + Add annotation Түгеләт ҡушыу - + Highlight Түгеләт - + Search Ҡырҡылар @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Күчереү - + Remove annotation Түгеләт алыу - + + Remove all Барлығын алыу - + Remove bookmark Саҡыт алыу @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Бит %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Был беренсе бит - + It is the last page Был өйрәнеш бит @@ -757,47 +860,48 @@ TitleMenu - + New window Яңы ҡырҡылау - + New tab Яңы вкладка - + + Save Сақлау - + Save as Сақлау һыҙыҡ - + Display in file manager Файл менеджерында күрһәтеү - + Magnifer Магнит - + Tools Ағзалар - + Search Ҡырҡылар - + Print Ҡаплау @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Ҡаплауҙар @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Күсереү һыҙығын ҡынау + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Документ файлын ҡынау. - + + FilePath Файлын ҡынау - + ThumbnailPath Path. Ҡаплауҙар ҡынауы. - + Generate thumbnail. Ҡаплау ҡынауы. diff --git a/translations/deepin-reader_lo.ts b/translations/deepin-reader_lo.ts index 8385182c9..b19719264 100644 --- a/translations/deepin-reader_lo.ts +++ b/translations/deepin-reader_lo.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ຕຳຫຼວດເອກະສານ - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - ຕຳຫຼວດເອກະສານແມ່ນເຄື່ອງມືສໍາລັບອ່ານໄຟລ໌ເອກະສານ, ສະໜັບສະໜູນ PDF, DJVU, DOCX ແລະ ອື່ນໆ + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location ບ່ອນຢູ່ - + Subject ວັດຖຸ - + Author ຜູ້ຂຽນ - + Keywords ຄຳສຳຄັນ - + Producer ຜູ້ຜະລິດ - + Creator ຜູ້ສ້າງ - + Time created ເວລາສ້າງ - + Time modified ເວລາແກ້ໄຂ - + Format ຮູບແບບ - + Pages ໜ້າ - + Optimized ທີ່ຖືກປັບປຸງ - + Security ຄວາມປອດໄພ - + Page size ຂະໜາດໜ້າ - + File size ຂະໜາດຟາຍ - + + Warnings + + + + Basic info ຂໍ້ມູນພື້ນຖານ - + Unknown ບໍ່ຮູ້ - + Yes ແມ່ນ - + No ບໍ່ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark ເພີ່ມບັນທຶກ - + Are you sure you want to delete all bookmarks? ທ່ານແມ່ນແທ້ບໍ່ທີ່ຕ້ອງການລົບບັນທຶກທັງໝົດ? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy ຂ້າມ - + Remove annotation ລົບຄໍາອະທິບາຍ - + + + Add annotation ເພີ່ມຄໍາອະທິບາຍ - + + + + Remove bookmark ລົບບັນທຶກ - + + + + Add bookmark ເພີ່ມບັນທຶກ - + Highlight ເນັ້ນສໍາຄັນ - + Remove highlight ລົບການເອີ້ນໃຫ້ເຫັນ - + + Search ຄົ້ນຫາ - + + Exit fullscreen ອອກຈາກສະແດງຮູບ - + + Fullscreen ສະແດງຮູບ - + + Slide show ການສະແດງຮູບ - + + First page ໜ້າທໍາອິດ - + + Previous page ໜ້າກ່ອນ - + + Next page ໜ້າຕໍ່ໄປ - + + Last page ໜ້າສຸດທ້າຍ - + + Rotate left ເລືອກທາງ຋ານຍາວ - + + Rotate right ເລືອກທາງ຋ານຍາວ - + + Print ພິມ - + + Document info ຂໍ້ມູນເອກະສານ @@ -219,7 +248,7 @@ Central - + Documents ເອກະສານ @@ -227,66 +256,68 @@ CentralDocPage - + The format is not supported ຮູບແບບບໍ່ໄດ້ຮັບການສະໜັບສະໜູນ - + Open failed ການເປີດບໍ່ສຳເລັດ - + Please check if the file is damaged ຂໍຂ້ອຍຂໍ້ມູນການກວດສອບວ່າເອກະສານມີຄວາມເສຍຫາຍ - + Conversion failed, please check if the file is damaged ການປ່ຽນແປງບໍ່ສຳເລັດ, ກະລຸນາກວດເບິ່ງວ່າຟາຍລ໌ເສຍຫາຍ - + Save failed ບໍ່ສາມາດບັນທຶກໄດ້ - + Saved successfully ບັນທຶກສຳເລັດ - + Save as ບັນທຶກເປັນ - + + Invalid file name ຊື່ຟາຍລ໌ບໍ່ຖືກຕ້ອງ - + + OK button ຕົກລົງ - + CentralNavPage - + Drag documents here ດຶງຟາຍລ໌ມາທີ່ນີ້ - + Format supported: %1 ຮູບແບບທີ່ສະໜັບສະໜູນ: %1 - + Select File ເລືອກຟາຍລ໌ @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed ບັນທຶກໄດ້ຖືກລົບ - + + Please select the text ກະລຸນາເລືອກຂໍ້ຄວາມ - + + The annotation has been removed ການອະທິບາຍໄດ້ຖືກລົບ @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password ຟາຍລ໌ທີ່ຖືກລັບລາຍ, ກະລຸນາປ້ອນລະຫັດຜ່ານ - + Password ລະຫັດຜ່ານ - + OK button ຕົກລົງ - + Wrong password ລະຫັດຜິດ + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous ກ່ອນ - + Next ຕໍ່ໄປ @@ -349,12 +414,12 @@ HandleMenu - + Select Text ເລືອກຂໍ້ຄວາມ - + Hand Tool ເຄື່ອງມືມື @@ -362,12 +427,12 @@ NotesWidget - + Add annotation ເພີ່ມການອະທິບາຍ - + Are you sure you want to delete all annotations? ທ່ານມັນໃຈບໍວ່າຕ້ອງການລົບການອະທິບາຍທັງໝົດ? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number ເລກທີ່ໜ້າບໍ່ຖືກຕ້ອງ @@ -383,7 +448,7 @@ ProgressDialog - + Converting ກຳລັງປ່ຽນ @@ -391,43 +456,61 @@ QObject - + Document not saved ເອກະສານບໍ່ໄດ້ບັນທຶກ + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? ທ່ານມັນໃຈບໍ່ວ່າຕ້ອງການບັນທຶກການປ່ຽນແປງຂໍ້ມູນເອກະສານນີ້ຫາງຈາກທີ່ປ່ອຍອອກມາທີ່ນີ້? - + Cancel button ຍົກເລີກ - + Discard button ລົບ - + Save button ບັນທຶກ - + Cancel ຍົກເລີກ - + Delete ລົບ @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View ການສະແດງສອງໜ້າ - + 1:1 size ຂະໜາດ 1:1 - + Fit Page ເຂົ້າກັບຫນ້າ - + Fit Height ເຂົ້າກັບສູງ - + Fit Width ເຂົ້າກັບກວ້າງ @@ -463,12 +546,12 @@ SearchResWidget - + No search results ບໍ່ມີຜົນໄດ້ຮັບການຄົ້ນຫາ - + %1 items found '%1 ອິດສະລັດທີ່ພົບໄດ້' @@ -476,23 +559,23 @@ SecurityDialog - + This document is trying to connect to: ເອກະສານນີ້ກຳລັງພະຍາຍາມເຊື່ອມຕໍ່ກັບ: - + If you trust the website, click Allow, otherwise click Block. ຖ້າທ່ານມັນໃຈບໍ່ວ່າຕ້ອງການອນຸຍາດການເຊື່ອມຕໍ່ກັບເວັ້າທີ່ນີ້, ກະລຸນາເລືອກອນຸຍາດ, ມິໄດ້ກະລຸນາເລືອກບັດບັດ - + Block button ກັ້ນ - + Allow button ອນຸຍາດ @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails ຮູບແບບນ້ອຍ - + Catalog ບັນຊີ - + Bookmarks ບັນທຶກ - + Annotations ຄໍາອະທິບາຍ @@ -524,188 +607,207 @@ ShortCutShow - + Settings ການຕັ້ງຄ່າ - + Exit ອອກ - + Help ຊ່ວຍເຫຼືອ - + Page up ຂຶ້ນໜ້າ - + Page down ລົງໜ້າ - + Open ເປີດ - + Zoom in ຂະໜາດລະຄູມາກຂຶ້ນ - + Zoom out ຂະໜາດລະຄູມາກຂຶ້ນ - + Save as ບັນທຶກເປັນ - + + File + + + + + Display + + + + + Tools + ເຄື່ອງມື + + + + Edit + + + + Print ພິມ - + Save ບັນທຶກ - + Thumbnails ຮູບນ້ອຍ - + 1:1 size ຂະໜາດ 1:1 - + Fit height ຕິດຕັ້ງຄວາມສູງ - + Fit width ຕິດຕັ້ງຄວາມກວ້າງ - + Rotate left ປັ້ນ຋ານຍາວ - + Rotate right ປັ້ນຂວາ - + Move to the beginning ຍ້າຍໄປທີ່ເລີ່ມຕົ້ນ - + Move to the end ຍ້າຍໄປທີ່ສິ້ນສຸດ - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text ເລືອກຂໍ້ຄວາມ - + Hand tool ເຄື່ອງມືມື - + Add bookmark ເພີ່ມບັນທຶກ - + Delete ລົບ - + Magnifier ມັງກີເຟີ - + Slide show ສະແດງລາຍຊື່ການເຂົ້າເຖິງ - + Fullscreen ສະແດງຮູບ - + Copy ຝາກ - + Cut ຕັດ - + Paste ວາງ - + Undo ກູ້ຄືນ - + Select all ເລືອກທັງໝົດ - + Display shortcuts ສະແດງລາຍຊື່ການເຂົ້າເຖິງ - + Add annotation ເພີ່ມຄໍາອະທິບາຍ - + Highlight ເນັ້ນສໍາຄັນ - + Search ຄົ້ນຫາ @@ -713,22 +815,23 @@ SideBarImageListView - + Copy ຝາກ - + Remove annotation ລົບຄໍາອະທິບາຍ - + + Remove all ລົບທັງໝົດ - + Remove bookmark ລົບບັນທຶກ @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 ໜ້າ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ມັນແມ່ນໜ້າທໍາອິດ - + It is the last page ມັນແມ່ນໜ້າສຸດທ້າຍ @@ -757,47 +860,48 @@ TitleMenu - + New window ໜ້າຕ່າງໃໝ່ - + New tab ໝວດໃໝ່ - + + Save ບັນທຶກ - + Save as ບັນທຶກເປັນ - + Display in file manager ສະແດງໃນຕິດຕາມຟາຍ - + Magnifer ມັງກີເຟີ - + Tools ເຄື່ອງມື - + Search ຄົ້ນຫາ - + Print ພິມ @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails ຮູບແບບນ້ອຍ @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached ຈຳກັດການປ້ອນຂໍ້ມູນບັນທຶກ + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ທິດສະດີຂອງຟາຍເອກະສານ. - + + FilePath ທິດສະດີຟາຍ - + ThumbnailPath Path. ທິດສະດີຮູບແບບນ້ອຍ - + Generate thumbnail. ສ້າງຮູບເງົາ. diff --git a/translations/deepin-reader_lt.ts b/translations/deepin-reader_lt.ts index c55e0a195..f02aeec56 100644 --- a/translations/deepin-reader_lt.ts +++ b/translations/deepin-reader_lt.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumento peržiūra - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Pozicija - + Subject Tema - + Author Autorius - + Keywords Žymos - + Producer Sukūrėjas - + Creator Sukūrėjas - + Time created Sukurtos laikas - + Time modified Pakeistos laikas - + Format Formatas - + Pages Puslapiai - + Optimized Optimizuotas - + Security SAU - + Page size Puslapis dydis - + File size Failo dydis - + + Warnings + + + + Basic info Pagrindinė informacija - + Unknown Nežinomas - + Yes Taip - + No Ne @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Pridėti nuorodą - + Are you sure you want to delete all bookmarks? Ar tikrai norite ištrinti visus nuorodas? @@ -122,119 +129,119 @@ BrowserMenu - - - + + + Copy Kopijuoti - + Remove annotation Pašalinti atsakymą - - - + + + Add annotation Pridėti atsakymą - - - - + + + + Remove bookmark Šaliu žymes - - - - + + + + Add bookmark Pridėti žymę - + Highlight Iškirti žymeklį - + Remove highlight Šalinti žymeklį - - + + Search Ieškoti - - + + Exit fullscreen Išeiti iš pilno ekrano - - + + Fullscreen Pilnas ekranas - - + + Slide show Sliktinė skelbimas - - + + First page Pirmas puslapis - - + + Previous page Ankstesnis puslapis - - + + Next page Kitas puslapis - - + + Last page Paskutinis puslapis - - + + Rotate left Rotuoti į kairę - - + + Rotate right Rotuoti į dešinę - - + + Print Spausdinti - - + + Document info Dokumento informacija @@ -242,7 +249,7 @@ Central - + Documents Dokumentai @@ -250,49 +257,49 @@ CentralDocPage - + The format is not supported Formatas yra nepalaikomas - + Open failed Atidarymas nepavyko - + Please check if the file is damaged Patikrinkite, ar failas yra pažeistas - + Conversion failed, please check if the file is damaged Konvertavimas nepavyko, patikrinkite, ar failas yra pažeistas - + Save failed Saugojimas nepavyko - + Saved successfully Saugojimas sėkmingas - + Save as Saugoti kaip - - + + Invalid file name Neteisingas failo pavadinimas - - + + OK button Gerai @@ -306,12 +313,12 @@ Pakelkite dokumentus čia - + Format supported: %1 Palaikomas formatas: %1 - + Select File Pasirinkite failą @@ -319,20 +326,20 @@ DocSheet - - + + The bookmark has been removed Žymė buvo pašalinama - - + + Please select the text Prašome pasirinkti tekstą - - + + The annotation has been removed Pastaba buvo pašalinama @@ -345,31 +352,62 @@ Šifravimo failas, prašome įvesti slaptažodį - + Password Slaptažodis - + OK button Gerai - + Wrong password Neteisingas slaptažodis + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Ankstesnis - + Next Kitas @@ -390,12 +428,12 @@ NotesWidget - + Add annotation Pridėti pašalintį žymi - + Are you sure you want to delete all annotations? Ar tikrai norite pašalinti visas pastabas? @@ -403,7 +441,7 @@ PagingWidget - + Invalid page number Nesukurta puslapis @@ -424,38 +462,56 @@ Dokumentas neįrašytas + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Įrašyti pakeitimus į "%1"? - + Cancel button Atsisakyti - + Discard button Atmesti - + Save button Įrašyti - + Cancel Atsisakyti - + Delete Ištrinti @@ -491,12 +547,12 @@ SearchResWidget - + No search results Nėra ieškomo rezultato - + %1 items found %1 prekės rasta @@ -552,188 +608,207 @@ ShortCutShow - + Settings Nustatymai - + Exit Išeiti - + Help Pagalba - + Page up Puslapis į viršų - + Page down Puslapis į apačią - + Open Atverti - + Zoom in Didinti - + Zoom out Mažinti - + Save as Saugoti kaip - + + File + + + + + Display + + + + + Tools + Įrankiai + + + + Edit + + + + Print Spausdinti - + Save Saugoti - + Thumbnails Miniatures - + 1:1 size 1:1 dydis - + Fit height Išlaikyti aukštį - + Fit width Išlaikyti plotį - + Rotate left Rotuoti kairėms kryptimis - + Rotate right Rotuoti dešinėms kryptimis - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Perkelti į pradžią - + Move to the end Perkelti į pabaigą - + Select text Pažymėti tekstą - + Hand tool Rankos įrankis - + Add bookmark Pridėti pašalinimą - + Delete Ištrinti - + Magnifier Didinėjas - + Slide show Slido šaukimas - + Fullscreen Visas ekranas - + Copy Kopijuoti - + Cut Iškirpti - + Paste Įdėti - + Undo Atšaukti - + Select all Pasirinkti viską - + Display shortcuts Rodyti spartu atlikimus - + Add annotation Pridėti pašalintį žymi - + Highlight Iškelti - + Search Paieška @@ -741,23 +816,23 @@ SideBarImageListView - + Copy Kopijuoti - + Remove annotation Pašalinti žymeklį - - + + Remove all Pašalinti viską - + Remove bookmark Pašalinti žargelį @@ -765,7 +840,7 @@ SideBarImageViewModel - + Page %1 puslapis %1 @@ -773,12 +848,12 @@ SlidePlayWidget - + It is the first page tai pirmas puslapis - + It is the last page tai paskutinis puslapis @@ -786,48 +861,48 @@ TitleMenu - + New window nauja langas - + New tab nauja vėliava - - + + Save Saugoti - + Save as Saugoti kaip - + Display in file manager Rodyti failų tvarkyklėje - + Magnifer Didinimo prietaisas - + Tools Įrankiai - + Search Paieška - + Print Spausdinti @@ -835,7 +910,7 @@ TitleWidget - + Thumbnails Mažos nuotraukos @@ -848,28 +923,99 @@ Įvesties riba pasiekta + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumento failo kelias. - - + + FilePath Failo kelias - + ThumbnailPath Path. Mažos nuotraukos kelias. - + Generate thumbnail. Sukurti mažą nuotrauką. - \ No newline at end of file + diff --git a/translations/deepin-reader_ml.ts b/translations/deepin-reader_ml.ts index a40c2d97a..7d6473d87 100644 --- a/translations/deepin-reader_ml.ts +++ b/translations/deepin-reader_ml.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ഡോക്യുമെന്റ് വ്യൂവർ - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - ഡോക്യുമെന്റ് വ്യൂവർ ഡോക്യുമെന്റ് ഫയലുകൾ വായിക്കാൻ ഉപയോഗിക്കുന്ന ഒരു ഉപകരണമാണ്, PDF, DJVU, DOCX പോലുള്ളവ പിന്തുണയുന്നതാണ് + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location സ്ഥലം - + Subject വിഷയം - + Author രചയിതാവ് - + Keywords പ്രധാന വാക്കുകൾ - + Producer ഉൽപാദകൻ - + Creator സൃഷ്ടിക്കുന്നവൻ - + Time created സൃഷ്ടിക്കപ്പെട്ട സമയം - + Time modified തിരുത്തപ്പെട്ട സമയം - + Format ഫോർമാറ്റ് - + Pages പേജുകൾ - + Optimized ഉയർന്ന പ്രകടനം - + Security സുരക്ഷ - + Page size പേജ് വലുപ്പം - + File size ഫയൽ വലുപ്പം - + + Warnings + + + + Basic info പ്രാഥമിക വിവരങ്ങൾ - + Unknown അപരിചിതമായ - + Yes അത് ആണ് - + No അത് അല്ല @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark ബുക്ക്‌മാർക് ചേർക്കുക - + Are you sure you want to delete all bookmarks? നിങ്ങൾ എല്ലാ ബുക്ക്‌മാർക്കുകളും മായ്ക്കാൻ തയാറാണോ? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy കോപ്പി - + Remove annotation അനോടേഷൻ അകറ്റുക - + + + Add annotation അനോടേഷൻ ചേർക്കുക - + + + + Remove bookmark ബുക്ക്‌മാർക് അകറ്റുക - + + + + Add bookmark ബുക്ക്‌മാർക് ചേർക്കുക - + Highlight ഹൈലൈറ്റ് - + Remove highlight ഹൈലൈറ്റ് അകറ്റുക - + + Search സെർച്ച് - + + Exit fullscreen ഫൾസ്ക്രീൻ പുറത്ത് - + + Fullscreen ഫൾസ്ക്രീൻ - + + Slide show സ്ലൈഡ് ഷോ - + + First page ആദ്യ പേജ് - + + Previous page പ്രിവ്യൂ പേജ് - + + Next page അടുത്ത പേജ് - + + Last page അവസാന പേജ് - + + Rotate left ലെfty പരത്തുക - + + Rotate right തെറ്റുക പരത്തുക - + + Print പ്രിന്റ് ചെയ്യുക - + + Document info ഡോക്യൂമെന്റ് വിവരങ്ങൾ @@ -219,7 +248,7 @@ Central - + Documents ഡോക്യൂമെന്റുകൾ @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported ഫോർമാറ്റ് സപ്പോർട്ട് ചെയ്യുന്നില്ല - + Open failed എബോൺ ഫെയിൽ - + Please check if the file is damaged ഫയൽ ക്രാഷ് ചെയ്തിട്ടുള്ളൂ എന്ന് പരിശോധിക്കുക - + Conversion failed, please check if the file is damaged കോൺവർഷൻ ഫെയിൽ, ഫയൽ ക്രാഷ് ചെയ്തിട്ടുള്ളൂ എന്ന് പരിശോധിക്കുക - + Save failed സേവ് ഫെയിൽ - + Saved successfully സേവ് ചെയ്തു പൂർത്തിയാക്കി - + Save as സേവ് ആസ് - + + Invalid file name അലിഡ് ഫയൽ പേര് - + + OK button ഓ.കെ. @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here ഡോക്യൂമെന്റുകൾ ഇവിടെ കൊണ്ടുവരുക - + Format supported: %1 ഫോർമാറ്റ് സപോർട്ട് ചെയ്യുന്നു: %1 - + Select File ഫയൽ തിരഞ്ഞെടുക്കുക @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed ബുക്‌മാർക് നീക്കം ചെയ്തു - + + Please select the text സൂചിപ്പിക്കുക ടെക്സ്റ്റ് - + + The annotation has been removed ആനോടേഷൻ നീക്കം ചെയ്തു @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password എൻക്രിപ്റ്റ് ചെയ്ത ഫയൽ, പാസ്വേഡ് പ്രവിശ്യിക്കുക - + Password പാസ്വേഡ് - + OK button ഓ.കെ. - + Wrong password ശരിയായ പാസ്വേഡ് + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous പ്രിവിയസ് - + Next നെക്സ്റ്റ് @@ -349,12 +414,12 @@ HandleMenu - + Select Text ടെക്സ്റ്റ് തിരഞ്ഞെടുക്കുക - + Hand Tool ഹാൻഡ് ടൂൾ @@ -362,12 +427,12 @@ NotesWidget - + Add annotation അനോടേഷൻ ചേർക്കുക - + Are you sure you want to delete all annotations? നിങ്ങൾ എല്ലാ അനോടേഷനുകളും മായ്ക്കാൻ വേണിയോ? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number അസാധുവായ പേജ് നമ്പർ @@ -383,7 +448,7 @@ ProgressDialog - + Converting കോൺവർട്ടിംഗ് @@ -391,43 +456,61 @@ QObject - + Document not saved ഡോക്യുമെന്റ് സേവ് ചെയ്യാതെ വന്നു + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" എന്ന പ്രവർത്തനം സേവ് ചെയ്യാനോ? + + Save the changes to "%1"? + "%1" എന്ന പ്രവർത്തനം സേവ് ചെയ്യാനോ? - + Cancel button സെൽക്ക് ചെയ്യുക - + Discard button മായ്ക്കുക - + Save button സേവ് ചെയ്യുക - + Cancel സെൽക്ക് ചെയ്യുക - + Delete മായ്ക്കുക @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View ടൂ പേജ് വിയ്യ - + 1:1 size 1:1 പരിമാപം - + Fit Page പേജ് ഫിറ്റ് ചെയ്യുക - + Fit Height ഹൈറ്റ് ഫിറ്റ് ചെയ്യുക - + Fit Width വിഡ്ത് ഫിറ്റ് ചെയ്യുക @@ -463,36 +546,36 @@ SearchResWidget - + No search results സെർച്ച് റിസൾട്ട് ഇല്ല - + %1 items found - '%1 പേപ്പർ കണ്ടു + '%1 പേപ്പർ കണ്ടു SecurityDialog - + This document is trying to connect to: ഇത് ഡോക്യുമെന്റ് കണക്ക് ചെയ്യുന്നത്: - + If you trust the website, click Allow, otherwise click Block. നിങ്ങൾ വെബ്സൈറ്റിനെ വിശ്വസിക്കുന്നുവെങ്കിൽ Allow ക്ലിക്ക് ചെയ്യുക, അല്ലാതെ വെങ്കിൽ Block ക്ലിക്ക് ചെയ്യുക. - + Block button ബ്ലോക്ക് - + Allow button അല്ലോ @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails തിരക്കാറ്റ് - + Catalog ക്യാറ്റലോഗ് - + Bookmarks ബുക്ക്മാർക്ക് - + Annotations ഓർമ്മകൾ @@ -524,188 +607,207 @@ ShortCutShow - + Settings സെറ്റിംഗ്സ് - + Exit പുറത്ത് - + Help സഹായം - + Page up പേജ് മുകളിലേക്ക് - + Page down പേജ് താഴെക്ക് - + Open തുറക്കുക - + Zoom in സ്കോർ ഇൻ - + Zoom out സ്കോർ ഔട്ട് - + Save as സേവ് ആക് - + + File + + + + + Display + + + + + Tools + ഫലകങ്ങൾ + + + + Edit + + + + Print പ്രിന്റ് ചെയ്യുക - + Save സേവ് ചെയ്യുക - + Thumbnails തുറക്കുക - + 1:1 size 1:1 പരിമാപം - + Fit height നീളം അനുയോജിപ്പിക്കുക - + Fit width വീതി അനുയോജിപ്പിക്കുക - + Rotate left പക്വായി മാറ്റുക - + Rotate right ഇടത് മാറ്റുക - + Move to the beginning ആരംഭത്തിലേക്ക് മാറ്റുക - + Move to the end അവസാനത്തിലേക്ക് മാറ്റുക - + Scroll up one line ഒരു വരി മുകളിലേക്ക് സ്ക്രോൾ ചെയ്യുക - + Scroll down one line ഒരു വരി താഴേക്ക് സ്ക്രോൾ ചെയ്യുക - - + Select text ടെക്സ്റ്റ് തിരഞ്ഞെടുക്കുക - + Hand tool ഹാൻഡ് ടൂൾ - + Add bookmark ബുക്ക്‌മാർക്ക് ചേർക്കുക - + Delete ഒഴിവാക്കുക - + Magnifier മഗ്നിഫയർ - + Slide show സ്ലൈഡ് ഷോ - + Fullscreen ഫുൾസ്ക്രീൻ - + Copy കോപ്പി - + Cut കട്ട് - + Paste പേസ്റ്റ് - + Undo ഇത് പ്രതികരിക്കുക - + Select all എല്ലാവയും തിരഞ്ഞെടുക്കുക - + Display shortcuts ശേഖരിക്കുക - + Add annotation അനുബന്ധം ചേർക്കുക - + Highlight പ്രശസ്തി - + Search തിരയൽ @@ -713,22 +815,23 @@ SideBarImageListView - + Copy പകര്‍ക്കുക - + Remove annotation അനുബന്ധം അകറ്റുക - + + Remove all എല്ലാവയും അകറ്റുക - + Remove bookmark മാർക്ക് അകറ്റുക @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 പേജ് %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ഇത് ആദ്യ പേജ് ആണ് - + It is the last page ഇത് അവസാന പേജ് ആണ് @@ -757,47 +860,48 @@ TitleMenu - + New window പുതിയ വിൻഡോ - + New tab പുതിയ ടാബ് - + + Save സേവ് ചെയ്യുക - + Save as സേവ് ചെയ്യുക എന്നത് പേരിൽ - + Display in file manager ഫയൽ മാനേജർ ഉപയോഗിച്ച് പ്രദർശിപ്പിക്കുക - + Magnifer മാഗ്നിഫൈറ് - + Tools ഫലകങ്ങൾ - + Search തിരയൽ - + Print പ്രിന്റ് ചെയ്യുക @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails തിരക്കിൽ @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached ഇൻപുട് ലിമിറ്റ് അതിക്രമിച്ചിട്ടുണ്ട് + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ഡോക്യുമെന്റ് ഫയൽ പാത. - + + FilePath ഫയൽ പാത് - + ThumbnailPath Path. തിരക്കിൽ പാത്. - + Generate thumbnail. തിരക്കിൽ ഉണ്ടാക്കുക. diff --git a/translations/deepin-reader_mn.ts b/translations/deepin-reader_mn.ts index 6b3919474..2e455e92c 100644 --- a/translations/deepin-reader_mn.ts +++ b/translations/deepin-reader_mn.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Документын үзүүр - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Документын үзүүр нь документын файлуудыг унших болгох програм бөгөөд PDF, DJVU, DOCX гэх мэт үр дүнгээ үнэ цэнэгээ дэмждэг + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Хаяг - + Subject Хөндрөл - + Author Зохиогч - + Keywords Хүснэгт - + Producer Үүсгэгч - + Creator Үүсгэгч - + Time created Үүсгэсэн огноо - + Time modified Өөрчлөгдсөн огноо - + Format Формат - + Pages Хуудас - + Optimized Эрэмбэлсэн - + Security Албан ёсоор - + Page size Хуудасны хэмжээ - + File size Файлын хэмжээ - + + Warnings + + + + Basic info Нэмэлт мэдээ - + Unknown Хүмүүсийн хүсэл - + Yes Тийм - + No Үгүй @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Хүснэгт нэмэх - + Are you sure you want to delete all bookmarks? Хүснэгтүүдийг нь үүсгэхээс үгүй болохыг итгэж байна уу? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Хуваалцах - + Remove annotation Суралцах - + + + Add annotation Суралцах - + + + + Remove bookmark Хүснэгт устгах - + + + + Add bookmark Хүснэгт нэмэх - + Highlight Тэмдэглэх - + Remove highlight Тэмдэглэх - + + Search Хайх - + + Exit fullscreen Өргөдөлдөө оох - + + Fullscreen Өргөдөлдөө - + + Slide show Слайд шоу - + + First page Эхний хуудас - + + Previous page Өмнөх хуудас - + + Next page Дараах хуудас - + + Last page Хүчтэй хуудас - + + Rotate left Зүүн тийш үүргэх - + + Rotate right Баруун тийш үүргэх - + + Print Хэвлэх - + + Document info Документын мэдээ @@ -219,7 +248,7 @@ Central - + Documents Документууд @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Формат нь дэмждэггүй - + Open failed Хаахад алдаа гарлаа - + Please check if the file is damaged Файлыг үзэхэд алдаа гарлаа - + Conversion failed, please check if the file is damaged Алдаа гарлаа, файлыг үзэхэд алдаа гарлаа - + Save failed Хадгалахад алдаа гарлаа - + Saved successfully Амжилттай хадгалагдсан - + Save as Хадгалах - + + Invalid file name Буруу файлын нэр - + + OK button Итгэл @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Документуудыг энд дарж хая - + Format supported: %1 Дэмждэгдсэн формат: %1 - + Select File Файл сонгох @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Хүрээлэн нь хасагдсан - + + Please select the text Текстийг сонгох - + + The annotation has been removed Тэмдэглэл нь хасагдсан @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Хэлбэрчлэгдсэн файл, нууц үгээ оруулна уу - + Password Нууц үг - + OK button Итгэл - + Wrong password Хүүхэд нууц үг + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Өмнөх - + Next Дараах @@ -349,12 +414,12 @@ HandleMenu - + Select Text Текст сонгох - + Hand Tool Хөөрөн хөгс @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Хэмжээний тэмдэг - + Are you sure you want to delete all annotations? Хүүхэд нь бүх хэмжээний тэмдэгүүдийг устгахдаа итгэж байна уу? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Хүүхэд нь хуудасны дугаар буруу @@ -383,7 +448,7 @@ ProgressDialog - + Converting Хөрөнгө оруулах @@ -391,43 +456,61 @@ QObject - + Document not saved Документ хадгалаагүй + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1"-д өөрчлөлтүүдийг хадгалахдаа итгэж байна уу? + + Save the changes to "%1"? + "%1"-д өөрчлөлтүүдийг хадгалахдаа итгэж байна уу? - + Cancel button Цуцлах - + Discard button Хөрөнгө оруулах - + Save button Хадгалах - + Cancel Цуцлах - + Delete Устгах @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Хоёр хуудасны үзүүлбэр - + 1:1 size 1:1 хэмжээ - + Fit Page Хуудсыг үнэ цэнэгүй - + Fit Height Өндөрт үнэ цэнэгүй - + Fit Width Хэмжээнд үнэ цэнэгүй @@ -463,36 +546,36 @@ SearchResWidget - + No search results Хайлсны үр дүнгүй - + %1 items found - '%1 нь олдсон' + '%1 нь олдсон' SecurityDialog - + This document is trying to connect to: Энэ документ %1-д холбогдохыг хүсч байна: - + If you trust the website, click Allow, otherwise click Block. Хэрэв таны нь вэбсайтыг итгэж байвал Allow-ийг, үгүй бол Block-ийг дарна уу. - + Block button Блоклох - + Allow button Хүсэлтэй @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Хүснэгт - + Catalog Хүснэгт - + Bookmarks Хүснэгт - + Annotations Тэмдэглэлүүд @@ -524,188 +607,207 @@ ShortCutShow - + Settings Сонголтууд - + Exit Гарах - + Help Тусламж - + Page up Хуудас дээш - + Page down Хуудас доош - + Open Нээх - + Zoom in Хөрвөх - + Zoom out Хөрвөөх - + Save as Хадгалах - + + File + + + + + Display + + + + + Tools + Үзүүлэгч + + + + Edit + + + + Print Хэвлэх - + Save Хадгалах - + Thumbnails Хуудасны зураг - + 1:1 size 1:1 хэмжээ - + Fit height Өндөрт нэмэгдэх - + Fit width Тойргын хэмжээ - + Rotate left Зүүн тийш хөрвөх - + Rotate right Баруун тийш хөрвөх - + Move to the beginning Эхний хэсэгт хөдөлгөх - + Move to the end Хувааны дээд хэсэгт хөдөлгөх - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Текст сонгох - + Hand tool Хөгжүүлэгч - + Add bookmark Хуудасны тэмдэг нэмэх - + Delete Устгах - + Magnifier Хүчтэй үзүүр - + Slide show Хуудасны үзүүлэлт - + Fullscreen Хүчтэй үзүүр - + Copy Хуваах - + Cut Хуваах - + Paste Нэмэх - + Undo Хүчлэх - + Select all Бүхийг сонгох - + Display shortcuts Хялбартийг харуулах - + Add annotation Шинэ нэмэлт нэмэх - + Highlight Тэмдэглэх - + Search Хайх @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Хуваах - + Remove annotation Нэмэлт устгах - + + Remove all Бүгдийг устгах - + Remove bookmark Хүснэгтэйг устгах @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Хуудас %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Эхний хуудас болно - + It is the last page Хүрээний хуудас болно @@ -757,47 +860,48 @@ TitleMenu - + New window Шинэ болон - + New tab Шинэ таб - + + Save Хадгалах - + Save as Хадгалах болгох - + Display in file manager Файлын менежерд харуулах - + Magnifer Хүчлэгч - + Tools Үзүүлэгч - + Search Хайх - + Print Хэвлэх @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Хуудасны бичгийн хөрвөө @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Нэмэгдэх хязгаар нь үнэ цэй + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Документын файлын шуудан. - + + FilePath Файлын шуудан - + ThumbnailPath Path. Хуудасны бичгийн шуудан. - + Generate thumbnail. Хуудасны бичгийг үүсгэх. diff --git a/translations/deepin-reader_mr.ts b/translations/deepin-reader_mr.ts index 018e866ba..8d947157f 100644 --- a/translations/deepin-reader_mr.ts +++ b/translations/deepin-reader_mr.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer દસ્તાવેજ વીઝર - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - દસ્તાવેજ વીઝર એ એક સાધન છે જે દસ્તાવેજ ફાઇલોનું વાંચન કરવા માટે વાપરવામાં આવે છે, જેમાં PDF, DJVU, DOCX આદિ સમર્થન છે + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location સ્થાન - + Subject વિષય - + Author લેખક - + Keywords કીવર્ડ્સ - + Producer ઉત્પાદક - + Creator નિર્માતા - + Time created સર્જન સમય - + Time modified સુધારણ સમય - + Format ફોર્મેટ - + Pages પેજો - + Optimized સંગતિકરણ - + Security સુરક્ષા - + Page size પેજ આકાર - + File size ફાઇલ આકાર - + + Warnings + + + + Basic info મૂળભૂત માહિતી - + Unknown અપરિચિત - + Yes હા - + No ના @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark બુકમાર્ક ઉમેરો - + Are you sure you want to delete all bookmarks? તમે બધા બુકમાર્ક નાખવા માંગો છો? ખાતરી કરો @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy કૉપી - + Remove annotation ટેક્સ્ટ ટેક્સ્ટ નાખો - + + + Add annotation ટેક્સ્ટ ટેક્સ્ટ ઉમેરો - + + + + Remove bookmark બુકમાર્ક નાખો - + + + + Add bookmark બુકમાર્ક ઉમેરો - + Highlight શીટ કરો - + Remove highlight શીટ દૂર કરો - + + Search શોધ - + + Exit fullscreen अंतर्गत फुलस्क्रीन बाहेर - + + Fullscreen फुलस्क्रीन - + + Slide show स्लाइड शो - + + First page पहिली पृष्ठ - + + Previous page पूर्व पृष्ठ - + + Next page पुढील पृष्ठ - + + Last page अंतिम पृष्ठ - + + Rotate left वर्तુળ ડાબી બાજુ - + + Rotate right વર્તુળ જમણી બાજુ - + + Print પ્રિંટ - + + Document info દોસ્તા માહિતી @@ -219,7 +248,7 @@ Central - + Documents દોસ્તા @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported ફોર્મેટ સપોર્ટ કરે છે નહીં - + Open failed ખોલવામાં ફેલ - + Please check if the file is damaged કૃપા કરી છે કે ફાઇલ નુકસાન થઈ છે તે તપાસો - + Conversion failed, please check if the file is damaged કન્વર્શન ફેલ, કૃપા કરી છે કે ફાઇલ નુકસાન થઈ છે તે તપાસો - + Save failed બચાવવામાં ફેલ - + Saved successfully સફળપણે બચાવવામાં આવ્યું છે - + Save as બચાવો તરીકે - + + Invalid file name અમાન્ય ફાઇલ નામ - + + OK button ઓક @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here અહીં દોસ્તા ખસેડો - + Format supported: %1 ફોર્મેટ સપોર્ટ: %1 - + Select File ફાઇલ પસંદ કરો @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed બુકમાર્ક દૂર કરવામાં આવ્યો છે - + + Please select the text કૃપા કરી છે કે ટેક્સ્ટ પસંદ કરો - + + The annotation has been removed એનોટેશન દૂર કરવામાં આવ્યો છે @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password એન્ક્રિપ્ટ કરેલ ફાઇલ, કૃપા કરી છે કે પાસવર્ડ પ્રવેશ કરો - + Password પાસવર્ડ - + OK button ઓક - + Wrong password अ‍याप बार्ट + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous पूर्व - + Next अगला @@ -349,12 +414,12 @@ HandleMenu - + Select Text मजकर टेक्स्ट निवडा - + Hand Tool हाण्ड टूल @@ -362,12 +427,12 @@ NotesWidget - + Add annotation अनोटेशन उपलब्ध करा - + Are you sure you want to delete all annotations? तुम्ही सर्व अनोटेशन विल्यो आहात? खात्री करा @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number अवैध पेज नंबर @@ -383,7 +448,7 @@ ProgressDialog - + Converting कन्वर्ट करा @@ -391,43 +456,61 @@ QObject - + Document not saved दॉक्युमेंट सेव केलेला नाही + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" मध्ये बदल करा? + + Save the changes to "%1"? + "%1" मध्ये बदल करा? - + Cancel button वाटा - + Discard button काढा - + Save button सेव - + Cancel वाटा - + Delete हटवा @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View दोन पेज व्ह्यू - + 1:1 size 1:1 आकार - + Fit Page पेज फिट करा - + Fit Height उंची फिट करा - + Fit Width पूर्ण चौरस फिट करा @@ -463,36 +546,36 @@ SearchResWidget - + No search results कोणतेही शोध रिझल्ट नाहीत - + %1 items found - '%1 आइटम आढळले' + '%1 आइटम आढळले' SecurityDialog - + This document is trying to connect to: हे दॉक्युमेंट खालील वेबसाइटशी संपर्क साधत आहे: - + If you trust the website, click Allow, otherwise click Block. यदी तुम्ही वेबसाइट विश्वास ठेवत आहात, Allow बटण दाबा, इतरथी Block बटण दाबा. - + Block button ब्लॉक - + Allow button अलॉव @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails थंबनेल्स - + Catalog कॅटलॉग - + Bookmarks बुकमार्क्स - + Annotations अंकन @@ -524,188 +607,207 @@ ShortCutShow - + Settings सेटिंग्ज - + Exit બહાર - + Help મદદ - + Page up પેજ ઉપર - + Page down પેજ નીચે - + Open ખોલો - + Zoom in સ્કેલ વધારો - + Zoom out સ્કેલ ઘટાડો - + Save as સેવ તરીકે - + + File + + + + + Display + + + + + Tools + उपकरणे + + + + Edit + + + + Print પ્રિંટ કરો - + Save સેવ - + Thumbnails છોટા છબીઓ - + 1:1 size 1:1 આયસ - + Fit height ઊભા કરો - + Fit width ઊભા કરો - + Rotate left બાજુ પર ફેરફાર કરો - + Rotate right બાજુ પર ફેરફાર કરો - + Move to the beginning શરૂઆતમાં મૂકો - + Move to the end અંતે મૂકો - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text ટેક્સ્ટ પસંદ કરો - + Hand tool હેન્ડ ટૂલ - + Add bookmark બુકમેર્ક ઉમેરો - + Delete ટેકો કરો - + Magnifier મેગ્નિફાયર - + Slide show સલાઇડ શો - + Fullscreen ફૂલસ્ક્રીન - + Copy કોપી કરો - + Cut કાપો - + Paste પેસ્ટ કરો - + Undo उडो - + Select all सर्व निवडा - + Display shortcuts क्षमता दर्शवा - + Add annotation अंकन उમटवा - + Highlight उत्कृष्ट करा - + Search शोध @@ -713,22 +815,23 @@ SideBarImageListView - + Copy कॉपी - + Remove annotation अंकन हटवा - + + Remove all सर्व हटवा - + Remove bookmark मार्क हटवा @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 पृष्ठ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page हे पहिले पृष्ठ आहे - + It is the last page हे अंतिम पृष्ठ आहे @@ -757,47 +860,48 @@ TitleMenu - + New window नवीन विंडो - + New tab नवीन टॅब - + + Save सेव - + Save as सेव करा - + Display in file manager फाइल मॅनेजरमध्ये दर्शवा - + Magnifer मॅग्निफिअअर - + Tools उपकरणे - + Search शोध - + Print प्रिंट @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails थंबनेल @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached इंप्यूट लिमिट पोहोचला + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. दॉक्युमेंट फाइल पाथ. - + + FilePath फाइल पाथ - + ThumbnailPath Path. थंबनेल पाथ पाथ. - + Generate thumbnail. थंबनेल उत्पन्न करा. diff --git a/translations/deepin-reader_ms.ts b/translations/deepin-reader_ms.ts index f61fcb6d7..c4bd7ae0b 100755 --- a/translations/deepin-reader_ms.ts +++ b/translations/deepin-reader_ms.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Pelihat Dokumen - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Lokasi - + Subject Subjek - + Author Pengarang - + Keywords Kata Kunci - + Producer Pengeluar - + Creator Pencipta - + Time created Waktu dicipta - + Time modified Waktu diubah suai - + Format Format - + Pages Halaman - + Optimized Dioptimum - + Security Keselamatan - + Page size Saiz halaman - + File size Saiz fail - + + Warnings + + + + Basic info Maklumat asas - + Unknown Tidak diketahui - + Yes Ya - + No Tidak @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Tambah tanda buku - + Are you sure you want to delete all bookmarks? Anda pasti mahu memadam semua tanda buku? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Salin - + Remove annotation Buang catatan - - - + + + Add annotation Tambah catatan - - - - + + + + Remove bookmark Buang tanda buku - - - - + + + + Add bookmark Tambah tanda buku - + Highlight Sorot - + Remove highlight Buang sorot - - + + Search Gelintar - - + + Exit fullscreen Keluar dari skrin penuh - - + + Fullscreen Skrin penuh - - + + Slide show Paparan slaid - - + + First page Halaman pertama - - + + Previous page Halaman terdahulu - - + + Next page Halaman berikutnya - - + + Last page Halaman terakhir - - + + Rotate left Putar kiri - - + + Rotate right Putar kanan - - + + Print Cetak - - + + Document info Maklumat dokumen @@ -241,7 +248,7 @@ Central - + Documents Dokumen @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Format tidak disokong - + Open failed Gagal dibuka - + Please check if the file is damaged Sila periksa sekiranya fail telah rosak - + Conversion failed, please check if the file is damaged Penukaran format gagal, sila periksa sama ada fail tersebut sudah rosak - + Save failed Gagal disimpan - + Saved successfully Berjaya disimpan - + Save as Simpan sebagai - - + + Invalid file name Nama fail tidak sah - - + + OK button OK @@ -305,12 +312,12 @@ Seret dokumen di sini - + Format supported: %1 Format disokong: %1 - + Select File Pilih Fail @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Tanda buku telah dibuang - - + + Please select the text Sila pilih teks - - + + The annotation has been removed Catatan telah dibuang @@ -344,31 +351,62 @@ Fail disulitkan, sila masukkan kata laluan - + Password Kata laluan - + OK button OK - + Wrong password Kata laluan salah + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Terdahulu - + Next Berikutnya @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Tambah catatan - + Are you sure you want to delete all annotations? Anda pasti mahu memadam semua catatan? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Nombor halaman tidak sah @@ -423,38 +461,56 @@ Dokumen tidak disimpan + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Simpan perubahan ke dalam "%1"? - + Cancel button Batal - + Discard button Singkir - + Save button Simpan - + Cancel Batal - + Delete Padam @@ -490,12 +546,12 @@ SearchResWidget - + No search results Tiada keputusan gelintar - + %1 items found %1 item ditemui @@ -551,188 +607,207 @@ ShortCutShow - + Settings Tetapan - + Exit Keluar - + Help Bantuan - + Page up Halaman ke atas - + Page down Halaman ke bawah - + Open Buka - + Zoom in Zum masuk - + Zoom out Zum keluar - + Save as Simpan sebagai - + + File + + + + + Display + + + + + Tools + Alat + + + + Edit + + + + Print Cetak - + Save Simpan - + Thumbnails Imej Kenit - + 1:1 size Saiz 1:1 - + Fit height Suai muat tinggi - + Fit width Suai muat lebar - + Rotate left Putar kiri - + Rotate right Putar kanan - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Alih ke permulaan - + Move to the end Alih ke penghujung - + Select text Pilih teks - + Hand tool Alat tangan - + Add bookmark Tambah tanda buku - + Delete Padam - + Magnifier Pembesar - + Slide show Paparan slaid - + Fullscreen Skrin penuh - + Copy Salin - + Cut Potong - + Paste Tampal - + Undo Buat asal - + Select all Pilih semua - + Display shortcuts Papar pintasan - + Add annotation Tambah catatan - + Highlight Sorot - + Search Gelintar @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Salin - + Remove annotation Buang catatan - - + + Remove all Buang semua - + Remove bookmark Buang tanda buku @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Halaman %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Merupakan halaman pertama - + It is the last page Merupakan halaman terakhir @@ -785,48 +860,48 @@ TitleMenu - + New window Tetingkap baharu - + New tab Tab baharu - - + + Save Simpan - + Save as Simpan sebagai - + Display in file manager Papar dalam pengurus fail - + Magnifer Pembesar - + Tools Alat - + Search Gelintar - + Print Cetak @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Lakaran kenit @@ -847,28 +922,95 @@ Had input dicapai + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Menjana imej kecil. - \ No newline at end of file + diff --git a/translations/deepin-reader_my.ts b/translations/deepin-reader_my.ts index 2cfb6d5d0..b3f965a9d 100644 --- a/translations/deepin-reader_my.ts +++ b/translations/deepin-reader_my.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ผู้ดูเอกสาร - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Document Viewer เป็นเครื่องมือสำหรับอ่านไฟล์เอกสาร รองรับ PDF, DJVU, DOCX เป็นต้น + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location ตำแหน่ง - + Subject หัวเรื่อง - + Author ผู้แต่ง - + Keywords คำสำคัญ - + Producer ผู้ผลิต - + Creator ผู้สร้าง - + Time created เวลาที่สร้าง - + Time modified เวลาที่แก้ไข - + Format รูปแบบ - + Pages หน้า - + Optimized ปรับแต่ง - + Security ความปลอดภัย - + Page size ขนาดหน้า - + File size ขนาดไฟล์ - + + Warnings + + + + Basic info ข้อมูลพื้นฐาน - + Unknown ไม่ทราบ - + Yes ใช่ - + No ไม่ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark เพิ่มข้อความอ้างอิง - + Are you sure you want to delete all bookmarks? คุณแน่ใจว่าต้องการลบข้อความอ้างอิงทั้งหมดหรือไม่? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy คัดลอก - + Remove annotation ลบคำอธิบาย - + + + Add annotation เพิ่มคำอธิบัติ - + + + + Remove bookmark ลบข้อความอ้างอิง - + + + + Add bookmark เพิ่มข้อความอ้างอิง - + Highlight เน้น - + Remove highlight ลบการเน้น - + + Search ค้นหา - + + Exit fullscreen ထွက်လိုက်ပါ - + + Fullscreen ပြည့်စုံသောအမှား - + + Slide show စာမျက်နှာပြပွဲ - + + First page ပထမစာမျက်နှာ - + + Previous page မျှော်လိုက်သောစာမျက်နှာ - + + Next page နောက်ထပ်စာမျက်နှာ - + + Last page နောက်ဆုံးစာမျက်နှာ - + + Rotate left အောက်ကျော်ပြောင်းရန် - + + Rotate right အလယ်ကျော်ပြောင်းရန် - + + Print မှန်ပြောင်းရန် - + + Document info စာအုပ်အချက်အလက် @@ -219,7 +248,7 @@ Central - + Documents စာအုပ်များ @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported ဖိုင်ပုံစံကို လက်ခံမရသေးပါ - + Open failed ဖွင့်ရန် ကြိုးစားခဲ့ပါသော်လည်း ကြိုးနှုန်းမှားပါ - + Please check if the file is damaged ဖိုင်ကို ထိခိုက်မှုရှိသော်လည်း စစ်ဆေးပါ - + Conversion failed, please check if the file is damaged ပြောင်းလဲရန် ကြိုးနှုန်းမှားပါသော်လည်း ဖိုင်ကို ထိခိုက်မှုရှိသော်လည်း စစ်ဆေးပါ - + Save failed သိမ်းဆည်းရန် ကြိုးနှုန်းမှားပါ - + Saved successfully အောင်မြင်စွာ သိမ်းဆည်းပြီးပါပြီ - + Save as သိမ်းဆည်းရန်အောင်မြင်စွာ - + + Invalid file name မှန်ကန်မှုမရှိသောဖိုင်အမည် - + + OK button အောင်မြင်စွာ @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here စာအုပ်များကို အောက်တွင် ဆွဲချပါ - + Format supported: %1 ပုံစံကို လက်ခံရရှိပါသည်: %1 - + Select File ဖိုင်ကို ရွေးချယ်ပါ @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed စာမျက်နှာမှားကို ဖျက်ပါသည် - + + Please select the text စာကို ရွေးချယ်ပါ - + + The annotation has been removed မှတ်ချက်ကို ဖျက်ပါသည် @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password ကာကွယ်ထားသောဖိုင်၊ အကြောင်းကို ထည့်သွင်းပါ - + Password အကြောင်း - + OK button အောင်မြင်စွာ - + Wrong password รหัสผ่านผิด + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous ก่อนหน้า - + Next ต่อไป @@ -349,12 +414,12 @@ HandleMenu - + Select Text เลือกข้อความ - + Hand Tool เครื่องมือมือ @@ -362,12 +427,12 @@ NotesWidget - + Add annotation เพิ่มข้อความอธิบาย - + Are you sure you want to delete all annotations? คุณแน่ใจว่าต้องการลบข้อความอธิบายทั้งหมดหรือไม่? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number เลขหน้าไม่ถูกต้อง @@ -383,7 +448,7 @@ ProgressDialog - + Converting กำลังแปลง @@ -391,43 +456,61 @@ QObject - + Document not saved เอกสารไม่ได้รับการบันทึก + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - คุณต้องการบันทึกการเปลี่ยนแปลงไปยัง "%1"? + + Save the changes to "%1"? + คุณต้องการบันทึกการเปลี่ยนแปลงไปยัง "%1"? - + Cancel button ยกเลิก - + Discard button ทิ้ง - + Save button บันทึก - + Cancel ยกเลิก - + Delete ลบ @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View การแสดงผลแบบสองหน้า - + 1:1 size ขนาด 1:1 - + Fit Page ปรับให้เหมาะสมกับหน้า - + Fit Height ปรับให้เหมาะสมกับความสูง - + Fit Width ปรับให้เหมาะสมกับความกว้าง @@ -463,36 +546,36 @@ SearchResWidget - + No search results ไม่มีผลการค้นหา - + %1 items found - '%1 รายการพบ' + '%1 รายการพบ' SecurityDialog - + This document is trying to connect to: เอกสารนี้กำลังพยายามเชื่อมต่อไปยัง: - + If you trust the website, click Allow, otherwise click Block. หากคุณไว้วางใจเว็บไซต์ ให้คลิก Allow แต่ถ้าไม่ไว้วางใจ ให้คลิก Block. - + Block button บล็อก - + Allow button อนุญาต @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails ตัวอย่างภาพ - + Catalog แคตตาล็อก - + Bookmarks เครื่องมือจดจำ - + Annotations หมายเหตุ @@ -524,188 +607,207 @@ ShortCutShow - + Settings ตั้งค่า - + Exit ออกจาก - + Help ความช่วยเหลือ - + Page up หน้าขึ้น - + Page down หน้าลง - + Open เปิด - + Zoom in ขยาย - + Zoom out หด - + Save as บันทึกเป็น - + + File + + + + + Display + + + + + Tools + ကိရိယာများ + + + + Edit + + + + Print พิมพ์ - + Save บันทึก - + Thumbnails ภาพตัวอย่าง - + 1:1 size ขนาด 1:1 - + Fit height ปรับให้เหมาะกับความสูง - + Fit width ปรับให้เหมาะกับความกว้าง - + Rotate left หมุนซ้าย - + Rotate right หมุนขวา - + Move to the beginning ย้ายไปยังจุดเริ่มต้น - + Move to the end ย้ายไปยังจุดสิ้นสุด - + Scroll up one line တစ်ကြောင်းအပေါ်သို့ ဆွဲချလိုက်ပါ - + Scroll down one line တစ်ကြောင်းအောက်သို့ ဆွဲချလိုက်ပါ - - + Select text เลือกข้อความ - + Hand tool เครื่องมือมือ - + Add bookmark เพิ่มชื่อหนังสือ - + Delete ลบ - + Magnifier ขยายภาพ - + Slide show การนำเสนอภาพ - + Fullscreen แสดงแบบเต็มหน้าจอ - + Copy คัดลอก - + Cut ตัด - + Paste วาง - + Undo ပြန်လည်ပြင်ဆင်ခြင်း - + Select all အားလုံးကိုရွေးပါ - + Display shortcuts တိုက်ရိုက်ကြိုတင်ပြသခြင်း - + Add annotation မှတ်ချက်ထားခြင်း - + Highlight မှတ်ပုံတင်ခြင်း - + Search ရှာရန် @@ -713,22 +815,23 @@ SideBarImageListView - + Copy ကူးရန် - + Remove annotation မှတ်ချက်ဖျက်ပါ - + + Remove all အားလုံးဖျက်ပါ - + Remove bookmark မှတ်ပုံတင်ချက်ဖျက်ပါ @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 စာမျက်နှာ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page ဒါက ပထမ စာမျက်နှာပါ - + It is the last page ဒါက နောက်ဆုံး စာမျက်နှာပါ @@ -757,47 +860,48 @@ TitleMenu - + New window အသစ် ဂိုး - + New tab အသစ် တိုက် - + + Save သိမ်းဆည်းခြင်း - + Save as အမည်ပေးပြီးသိမ်းဆည်းခြင်း - + Display in file manager ဖိုင်မန်းဂိုးတွင် ပြသခြင်း - + Magnifer မိုးခေါင်းပေါက် - + Tools ကိရိယာများ - + Search ရှာရန် - + Print အမှတ်ပြုခြင်း @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails စာမျက်နှာများ @@ -813,30 +917,98 @@ TransparentTextEdit - + Input limit reached အကူးအ,output နိမ့်နှုန်း ရောက်ပြီ + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ပြုလုပ်ထားသော ဖိုင်နှုန်း - + + FilePath ဖိုင်နှုန်း - + ThumbnailPath Path. သီးခြားဖိုင်နှုန်း - + Generate thumbnail. သီးခြားဖိုင်ကို ဖန်တီးခြင်း diff --git a/translations/deepin-reader_nb.ts b/translations/deepin-reader_nb.ts index cdf7ec50e..faf906e6e 100644 --- a/translations/deepin-reader_nb.ts +++ b/translations/deepin-reader_nb.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumentviser - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Sted - + Subject Emne - + Author Forfatter - + Keywords Nøkkelord - + Producer Producert av - + Creator Opprettet av - + Time created Tid opprettet - + Time modified Tid endret - + Format Format - + Pages Sider - + Optimized Optimert - + Security Sikkerhet - + Page size Sidestørrelse - + File size Filstørrelse - + + Warnings + + + + Basic info Grunnleggende informasjon - + Unknown Ukjent - + Yes Ja - + No Nei @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Legg til merknad - + Are you sure you want to delete all bookmarks? Er du sikker på at du vil slette alle merknadene? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopier - + Remove annotation Fjern merknad - - - + + + Add annotation Legg til merknad - - - - + + + + Remove bookmark Fjern merknad - - - - + + + + Add bookmark Legg til merknad - + Highlight Markering - + Remove highlight Fjern markering - - + + Search Søk - - + + Exit fullscreen Avslutt fullskjerm - - + + Fullscreen Fullskjerm - - + + Slide show Slide-show - - + + First page Første side - - + + Previous page Forrige side - - + + Next page Neste side - - + + Last page Siste side - - + + Rotate left Drein til venstre - - + + Rotate right Drein til høyre - - + + Print Skriv ut - - + + Document info Dokumentinformasjon @@ -241,7 +248,7 @@ Central - + Documents Dokumenter @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Formatet støttes ikke - + Open failed Åpning feilet - + Please check if the file is damaged Vennligst sjekk om filen er skadet - + Conversion failed, please check if the file is damaged Konvertering feilet, vennligst sjekk om filen er skadet - + Save failed Lagring feilet - + Saved successfully Lagret vellykket - + Save as Lagre som - - + + Invalid file name Ugyldig filnavn - - + + OK button OK @@ -305,12 +312,12 @@ Træk dokumenter her - + Format supported: %1 Format støttes: %1 - + Select File Velg fil @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Markeringen har blitt fjernet - - + + Please select the text Vennligst velg teksten - - + + The annotation has been removed Annotasjonen har blitt fjernet @@ -344,31 +351,62 @@ Kryptert fil, vennligst skriv inn passordet - + Password Passord - + OK button OK - + Wrong password Feil passord + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Forrige - + Next Neste @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Legg til en notis - + Are you sure you want to delete all annotations? Er du sikker på at du vil slette alle noter? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Ugyldig side-nummer @@ -423,38 +461,56 @@ Dokumentet er ikke lagret + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Lagre endringene til "%1"? - + Cancel button Avbryt - + Discard button Kast bort - + Save button Lagre - + Cancel Avbryt - + Delete Slett @@ -490,12 +546,12 @@ SearchResWidget - + No search results Ingen søkeresultater - + %1 items found '%1 elementer funnet' @@ -551,188 +607,207 @@ ShortCutShow - + Settings Innstillinger - + Exit Avslutt - + Help Hjelp - + Page up Side opp - + Page down Side ned - + Open Åpne - + Zoom in Forstør - + Zoom out Forsmå - + Save as Lagre som - + + File + + + + + Display + + + + + Tools + Verktøy + + + + Edit + + + + Print Skriv ut - + Save Lagre - + Thumbnails Miniatyrer - + 1:1 size 1:1 størrelse - + Fit height Passer høyde - + Fit width Passer bredde - + Rotate left Snurr til venstre - + Rotate right Snurr til høyre - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Flytt til starten - + Move to the end Flytt til slutten - + Select text Velg tekst - + Hand tool Håndverktøy - + Add bookmark Legg til merknad - + Delete Slett - + Magnifier Forstøringsglass - + Slide show Slide-show - + Fullscreen Fullskjerm - + Copy Kopier - + Cut Klipp ut - + Paste Lim inn - + Undo Angre - + Select all Vel alle - + Display shortcuts Vis hurtigtaster - + Add annotation Legg til merknad - + Highlight Hevde - + Search Søk @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopier - + Remove annotation Fjern merknad - - + + Remove all Fjern alle - + Remove bookmark Fjern markering @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Side %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Det er den første siden - + It is the last page Det er den siste siden @@ -785,48 +860,48 @@ TitleMenu - + New window Nytt vindu - + New tab Nytt fane - - + + Save Lagre - + Save as Lagre som - + Display in file manager Vis i filbehandler - + Magnifer Forstørrelsesglass - + Tools Verktøy - + Search Søk - + Print Skriv ut @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniatyrer @@ -847,28 +922,97 @@ Innstillingsgrense oppnådd + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumentfilsti. - - + + FilePath Filsti - + ThumbnailPath Path. Miniatyrsti. - + Generate thumbnail. Generer miniatyr. - \ No newline at end of file + diff --git a/translations/deepin-reader_ne.ts b/translations/deepin-reader_ne.ts index 874deedab..cb56ad087 100644 --- a/translations/deepin-reader_ne.ts +++ b/translations/deepin-reader_ne.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer दस्तावेज़ देखने वाला - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - दस्तावेज़ देखने वाला दस्तावेज़ फ़ाइलों को पढ़ने के लिए एक उपकरण है, जो PDF, DJVU, DOCX आदि समर्थन प्रदान करता है। + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location स्थान - + Subject विषय - + Author लेखक - + Keywords कीवर्ड्स - + Producer उत्पादक - + Creator सृजक - + Time created सृजन का समय - + Time modified संशोधन का समय - + Format फॉर्मेट - + Pages पृष्ठ - + Optimized अनुकूलित - + Security सुरक्षा - + Page size पृष्ठ का आकार - + File size फ़ाइल का आकार - + + Warnings + + + + Basic info मूल सूचना - + Unknown अज्ञात - + Yes हाँ - + No नहीं @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark बुकमार्क जोड़ें - + Are you sure you want to delete all bookmarks? क्या आप सभी बुकमार्क हटाना चाहते हैं? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy कॉपी - + Remove annotation अंकन हटाएं - + + + Add annotation अंकन जोड़ें - + + + + Remove bookmark बुकमार्क हटाएं - + + + + Add bookmark हाइलाइट करें - + Highlight हाइलाइट हटाएं - + Remove highlight खोजें - + + Search Search - + + Exit fullscreen अन्तर्गत फुलस्क्रीन - + + Fullscreen फुलस्क्रीन - + + Slide show स्लाइड शो - + + First page पहिलो पन - + + Previous page पिछलो पन - + + Next page अगलो पन - + + Last page अन्तिम पन - + + Rotate left बायाँ घुमाउनु - + + Rotate right दायाँ घुमाउनु - + + Print प्रिंट गर्नु - + + Document info दस्तावेज जानकारी @@ -219,7 +248,7 @@ Central - + Documents दस्तावेज @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported फारमेट समर्थन गर्दछ नभने - + Open failed खुलाउन असफल - + Please check if the file is damaged कृपया छाँट असंगत छ वा क्षत भएको छ भन्नको लागि जाँच गर्नुहोस् - + Conversion failed, please check if the file is damaged कन्वर्जन असफल, कृपया छाँट असंगत छ वा क्षत भएको छ भन्नको लागि जाँच गर्नुहोस् - + Save failed सेभ असफल - + Saved successfully सफलतापूर्वक सेभ गरियो - + Save as सेभ गर्नु - + + Invalid file name अमान्य छाँट नाम - + + OK button ठीक @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here हाल दस्तावेज खिच्नु - + Format supported: %1 समर्थित फारमेट: %1 - + Select File छाँट चयन गर्नु @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed यहाँ एक बुकमार्क हटाइयो - + + Please select the text कृपया छाँट चयन गर्नुहोस् - + + The annotation has been removed यहाँ एक अनोटेशन हटाइयो @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password एन्क्रिप्ट छाँट, कृपया पासवर्ड दिनुहोस् - + Password पासवर्ड - + OK button ठीक - + Wrong password भूल्यो भएको पासवर्ड + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous अघिल्लो - + Next अगाडि @@ -349,12 +414,12 @@ HandleMenu - + Select Text पाठ चयन गर्नुहोस - + Hand Tool हात कुरा @@ -362,12 +427,12 @@ NotesWidget - + Add annotation अनुमान थप्नुहोस - + Are you sure you want to delete all annotations? के तपाईं सबै अनुमान हटाउन चाहनु छु? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number अमान्य पन्ना संख्या @@ -383,7 +448,7 @@ ProgressDialog - + Converting कन्वर्ट गर्दै @@ -391,43 +456,61 @@ QObject - + Document not saved दस्तावेज सेभ गरिएको छैन + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" मा समायोजन सेभ गर्नु चाहनु छु? + + Save the changes to "%1"? + "%1" मा समायोजन सेभ गर्नु चाहनु छु? - + Cancel button रद्द गर्नुहोस - + Discard button छोड्नुहोस - + Save button सेभ गर्नुहोस - + Cancel रद्द गर्नुहोस - + Delete हटाउनुहोस @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View दुई पन्ना दृश्य - + 1:1 size 1:1 आकार - + Fit Page पन्ना मा फिट गर्नुहोस - + Fit Height उचाई मा फिट गर्नुहोस - + Fit Width चौडाई मा फिट गर्नुहोस @@ -463,36 +546,36 @@ SearchResWidget - + No search results ढोक अनुसार फलाउ छैन - + %1 items found - '%1 वस्तु पाइएको' + '%1 वस्तु पाइएको' SecurityDialog - + This document is trying to connect to: यस दस्तावेजले सम्पर्क स्थापित गर्न आएको छ: - + If you trust the website, click Allow, otherwise click Block. यदि तपाईं वेबसाइटलाई विश्वास गर्दिनु छु, Allow बटन दबाउनुहोस अन्यथा Block बटन दबाउनुहोस। - + Block button ब्लॉक गर्नुहोस - + Allow button अनुमति दिनुहोस @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails छोटा छवि - + Catalog काटलग - + Bookmarks बुकमार्क - + Annotations अटैचमेंट @@ -524,188 +607,207 @@ ShortCutShow - + Settings सेटिंग्स - + Exit अवैध - + Help सहायता - + Page up पेज अप - + Page down पेज डाउन - + Open खुलाउ - + Zoom in ज़ूम इन - + Zoom out ज़ूम आउट - + Save as सेव कर्ने को लेने - + + File + + + + + Display + + + + + Tools + टुल्स + + + + Edit + + + + Print प्रिंट - + Save सेव - + Thumbnails थंबनेल - + 1:1 size 1:1 आकार - + Fit height ऊंचाई में फिट - + Fit width चौड़ाई में फिट - + Rotate left बाएँ घुमाउ - + Rotate right दाएँ घुमाउ - + Move to the beginning आरंभ में लेने - + Move to the end अंत में लेने - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text पाठ चयन - + Hand tool हैंड टूल - + Add bookmark बुकमार्क जोड़े - + Delete हटाउ - + Magnifier मैग्निफायर - + Slide show स्लाइड शो - + Fullscreen फुलस्क्रीन - + Copy कॉपी - + Cut कट - + Paste पेस्ट - + Undo अन्डू - + Select all सब चयन गर्नुहोस् - + Display shortcuts छोटा रूप देखाउनुहोस् - + Add annotation अनुमान थप्नुहोस् - + Highlight हाइलाइट गर्नुहोस् - + Search खोज्नुहोस् @@ -713,22 +815,23 @@ SideBarImageListView - + Copy काट्नुहोस् - + Remove annotation अनुमान हटाउनुहोस् - + + Remove all सब हटाउनुहोस् - + Remove bookmark बुकमार्क हटाउनुहोस् @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 पृष्ठ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page यो पहिलो पृष्ठ हो - + It is the last page यो अन्तिम पृष्ठ हो @@ -757,47 +860,48 @@ TitleMenu - + New window नयाँ विंडो - + New tab नयाँ टैब - + + Save सेभ - + Save as सेभ जस्तो - + Display in file manager फाइल मैनेजरमा देखाउनुहोस् - + Magnifer मग्निफर - + Tools टुल्स - + Search खोज्नुहोस् - + Print प्रिन्ट @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails थम्बनेल @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached इनपुट सीमा पुगेको + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. डक्युमेन्ट फाइल पथ - + + FilePath फाइल पथ - + ThumbnailPath Path. थम्बनेल पथ पथ - + Generate thumbnail. थम्बनेल उत्पन्न गर्नुहोस् diff --git a/translations/deepin-reader_nl.ts b/translations/deepin-reader_nl.ts index 8249aa062..611898023 100755 --- a/translations/deepin-reader_nl.ts +++ b/translations/deepin-reader_nl.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Documentweergave - + Document Viewer is a tool for reading document files, supporting %1. Documentweergave is een programma voor het lezen van %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Locatie - + Subject Onderwerp - + Author Auteur - + Keywords Trefwoorden - + Producer Uitgever - + Creator Maker - + Time created Gemaakt op - + Time modified Aangepast op - + Format Formaat - + Pages Aantal pagina's - + Optimized Geoptimaliseerd - + Security Beveiliging - + Page size Paginagrootte - + File size Bestandsgrootte - + + Warnings + + + + Basic info Eigenschappen - + Unknown Onbekend - + Yes Ja - + No Nee @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Bladwijzer toevoegen - + Are you sure you want to delete all bookmarks? Weet je zeker dat je alle bladwijzers wilt verwijderen? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopiëren - + Remove annotation Aantekening verwijderen - - - + + + Add annotation Aantekening maken - - - - + + + + Remove bookmark Bladwijzer verwijderen - - - - + + + + Add bookmark Bladwijzer toevoegen - + Highlight Markeren - + Remove highlight Markering verwijderen - - + + Search Zoeken - - + + Exit fullscreen Schermvullende weergave verlaten - - + + Fullscreen Schermvullende weergave - - + + Slide show Diavoorstelling - - + + First page Eerste pagina - - + + Previous page Vorige pagina - - + + Next page Volgende pagina - - + + Last page Laatste pagina - - + + Rotate left Naar links draaien - - + + Rotate right Naar rechts draaien - - + + Print Afdrukken - - + + Document info Documentinformatie @@ -241,7 +248,7 @@ Central - + Documents Documenten @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Dit formaat wordt niet ondersteund. - + Open failed Het document kan niet worden geopend. - + Please check if the file is damaged Het bestand is mogelijk beschadigd. - + Conversion failed, please check if the file is damaged De conversie is mislukt; het bestand is mogelijk beschadigd. - + Save failed Het document kan niet worden opgeslagen. - + Saved successfully Het bestand is opgeslagen. - + Save as Opslaan als - - + + Invalid file name Ongeldige bestandsnaam - - + + OK button Oké @@ -305,12 +312,12 @@ Sleep documenten hierheen - + Format supported: %1 Ondersteunde formaten: %1 - + Select File Kies een bestand @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed De bladwijzer is verwijderd - - + + Please select the text Selecteer de tekst - - + + The annotation has been removed De aantekening is verwijderd @@ -344,31 +351,62 @@ Het bestand is versleuteld - voer het wachtwoord in - + Password Wachtwoord - + OK button Oké - + Wrong password Het wachtwoord is onjuist + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Vorige - + Next Volgende @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Aantekening maken - + Are you sure you want to delete all annotations? Weet je zeker dat je alle aantekeningen wilt verwijderen? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Ongeldig paginanummer @@ -423,38 +461,56 @@ Het document is niet opgeslagen + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Wil je de wijzigingen aan ‘%1’ opslaan? - + Cancel button Annuleren - + Discard button Verwerpen - + Save button Opslaan - + Cancel Annuleren - + Delete Verwijderen @@ -490,12 +546,12 @@ SearchResWidget - + No search results Geen zoekresultaten - + %1 items found %1 items aangetroffen @@ -551,188 +607,207 @@ ShortCutShow - + Settings Instellingen - + Exit Afsluiten - + Help Hulp - + Page up Pagina omhoog - + Page down Pagina omlaag - + Open Openen - + Zoom in Inzoomen - + Zoom out Uitzoomen - + Save as Opslaan als - + + File + + + + + Display + + + + + Tools + Gereedschap + + + + Edit + + + + Print Afdrukken - + Save Opslaan - + Thumbnails Voorbeeldminiaturen - + 1:1 size Ware grootte - + Fit height Aanpassen aan hoogte - + Fit width Aanpassen aan breedte - + Rotate left Naar links draaien - + Rotate right Naar rechts draaien - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Verplaatsen naar begin - + Move to the end Verplaatsen naar einde - + Select text Tekst selecteren - + Hand tool Handgereedschap - + Add bookmark Bladwijzer toevoegen - + Delete Verwijderen - + Magnifier Vergrootglas - + Slide show Diavoorstelling - + Fullscreen Schermvullende weergave - + Copy Kopiëren - + Cut Knippen - + Paste Plakken - + Undo Ongedaan maken - + Select all Alles selecteren - + Display shortcuts Sneltoetsen tonen - + Add annotation Aantekening maken - + Highlight Markeren - + Search Zoeken @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopiëren - + Remove annotation Aantekening verwijderen - - + + Remove all Alles verwijderen - + Remove bookmark Bladwijzer verwijderen @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Pagina %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Dit is de eerste pagina - + It is the last page Dit is de laatste pagina @@ -785,48 +860,48 @@ TitleMenu - + New window Nieuw venster - + New tab Nieuw tabblad - - + + Save Opslaan - + Save as Opslaan als - + Display in file manager Tonen in bestandsbeheer - + Magnifer Vergrootglas - + Tools Gereedschap - + Search Zoeken - + Print Afdrukken @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Voorbeeldminiaturen @@ -847,28 +922,97 @@ Tekenlimiet bereikt + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - \ No newline at end of file + diff --git a/translations/deepin-reader_pa.ts b/translations/deepin-reader_pa.ts index 53e3abe32..0d294516f 100644 --- a/translations/deepin-reader_pa.ts +++ b/translations/deepin-reader_pa.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ ਦਸਤਾਵੇਜ਼ ਦਰਸ਼ਕ - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location ਟਿਕਾਣਾ - + Subject Subject - + Author Author - + Keywords Keywords - + Producer Producer - + Creator Creator - + Time created Time created - + Time modified Time modified - + Format Format - + Pages ਸਫ਼ੇ - + Optimized Optimized - + Security Security - + Page size Page size - + File size File size - + + Warnings + + + + Basic info Basic info - + Unknown Unknown - + Yes Yes - + No ਨਹੀਂ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Add bookmark - + Are you sure you want to delete all bookmarks? Are you sure you want to delete all bookmarks? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy ਕਾਪੀ ਕਰੋ - + Remove annotation Remove annotation - - - + + + Add annotation Add annotation - - - - + + + + Remove bookmark Remove bookmark - - - - + + + + Add bookmark Add bookmark - + Highlight Highlight - + Remove highlight Remove highlight - - + + Search Search - - + + Exit fullscreen Exit fullscreen - - + + Fullscreen Fullscreen - - + + Slide show Slide show - - + + First page First page - - + + Previous page Previous page - - + + Next page Next page - - + + Last page Last page - - + + Rotate left Rotate left - - + + Rotate right Rotate right - - + + Print Print - - + + Document info Document info @@ -241,7 +248,7 @@ Central - + Documents Documents @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported The format is not supported - + Open failed Open failed - + Please check if the file is damaged Please check if the file is damaged - + Conversion failed, please check if the file is damaged Conversion failed, please check if the file is damaged - + Save failed Save failed - + Saved successfully Saved successfully - + Save as Save as - - + + Invalid file name Invalid file name - - + + OK button ਠੀਕ ਹੈ @@ -305,12 +312,12 @@ Drag documents here - + Format supported: %1 Format supported: %1 - + Select File ਫ਼ਾਇਲ ਚੁਣੋ @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed The bookmark has been removed - - + + Please select the text Please select the text - - + + The annotation has been removed The annotation has been removed @@ -344,31 +351,62 @@ Encrypted file, please enter the password - + Password ਪਾਸਵਰਡ - + OK button ਠੀਕ ਹੈ - + Wrong password ਪਾਸਵਰਡ ਗਲਤ ਹੈ + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous ਪਿੱਛੇ - + Next ਅੱਗੇ @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Add annotation - + Are you sure you want to delete all annotations? Are you sure you want to delete all annotations? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Invalid page number @@ -423,38 +461,56 @@ Document not saved + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Save the changes to "%1"? - + Cancel button ਰੱਦ ਕਰੋ - + Discard button Discard - + Save button ਸੰਭਾਲੋ - + Cancel ਰੱਦ ਕਰੋ - + Delete ਹਟਾਓ @@ -490,12 +546,12 @@ SearchResWidget - + No search results No search results - + %1 items found %1 items found @@ -551,188 +607,207 @@ ShortCutShow - + Settings ਸੈਟਿੰਗਾਂ - + Exit ਸੋਧੋ - + Help ਮਦਦ - + Page up Page up - + Page down Page down - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Open Open - + Zoom in Zoom in - + Zoom out Zoom out - + Save as Save as - + + File + + + + + Display + + + + + Tools + Tools + + + + Edit + + + + Print Print - + Save ਸੰਭਾਲੋ - + Thumbnails Thumbnails - + 1:1 size 1:1 size - + Fit height Fit height - + Fit width Fit width - + Rotate left Rotate left - + Rotate right Rotate right - + Move to the beginning Move to the beginning - + Move to the end Move to the end - + Select text Select text - + Hand tool Hand tool - + Add bookmark Add bookmark - + Delete ਹਟਾਓ - + Magnifier Magnifier - + Slide show Slide show - + Fullscreen Fullscreen - + Copy ਕਾਪੀ ਕਰੋ - + Cut Cut - + Paste Paste - + Undo Undo - + Select all Select all - + Display shortcuts Display shortcuts - + Add annotation Add annotation - + Highlight Highlight - + Search Search @@ -740,23 +815,23 @@ SideBarImageListView - + Copy ਕਾਪੀ ਕਰੋ - + Remove annotation Remove annotation - - + + Remove all Remove all - + Remove bookmark Remove bookmark @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Page %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page It is the first page - + It is the last page It is the last page @@ -785,48 +860,48 @@ TitleMenu - + New window New window - + New tab New tab - - + + Save ਸੰਭਾਲੋ - + Save as Save as - + Display in file manager Display in file manager - + Magnifer Magnifer - + Tools Tools - + Search Search - + Print Print @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Thumbnails @@ -847,28 +922,97 @@ Input limit reached + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - \ No newline at end of file + diff --git a/translations/deepin-reader_pl.ts b/translations/deepin-reader_pl.ts index 3c06da252..361b6dbdc 100755 --- a/translations/deepin-reader_pl.ts +++ b/translations/deepin-reader_pl.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Przeglądarka dokumentów - + Document Viewer is a tool for reading document files, supporting %1. Przeglądarka dokumentów to narzędzie umożliwiające odczytywanie dokumentów, obsługująca %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Położenie - + Subject Temat - + Author Autor - + Keywords Słowa kluczowe - + Producer Producent - + Creator Twórca - + Time created Data utworzenia - + Time modified Data modyfikacji - + Format Format - + Pages Ilość stron - + Optimized Zoptymalizowany - + Security Bezpieczeństwo - + Page size Rozmiar strony - + File size Rozmiar pliku - + + Warnings + + + + Basic info Informacje podstawowe - + Unknown Nieznane - + Yes Tak - + No Nie @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Dodać zakładkę - + Are you sure you want to delete all bookmarks? Czy na pewno chcesz usunąć wszystkie zakładki? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopiuj - + Remove annotation Usuń adnotację - - - + + + Add annotation Dodaj adnotację - - - - + + + + Remove bookmark Usuń zakładkę - - - - + + + + Add bookmark Dodaj zakładkę - + Highlight Wyróżnij - + Remove highlight Usuń wyróżnienie - - + + Search Szukaj - - + + Exit fullscreen Opuść pełny ekran - - + + Fullscreen Pełny ekran - - + + Slide show Pokaz slajdów - - + + First page Pierwsza strona - - + + Previous page Poprzednia strona - - + + Next page Następna strona - - + + Last page Ostatnia strona - - + + Rotate left Obróć w lewo - - + + Rotate right Obróć w prawo - - + + Print Drukuj - - + + Document info Informacje o dokumencie @@ -241,7 +248,7 @@ Central - + Documents Dokumenty @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Format pliku nie jest obsługiwany - + Open failed Nie udało się otworzyć - + Please check if the file is damaged Sprawdź, czy plik jest uszkodzony - + Conversion failed, please check if the file is damaged Konwersja nie powiodła się, upewnij się, że plik nie jest uszkodzony - + Save failed Nie udało się zapisać - + Saved successfully Zapisano pomyślnie - + Save as Zapisz jako - - + + Invalid file name Nieprawidłowa nazwa pliku - - + + OK button OK @@ -305,12 +312,12 @@ Przeciągnij tutaj dokumenty - + Format supported: %1 Obsługiwane formaty: %1 - + Select File Wybierz plik @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Zakładka została usunięta - - + + Please select the text Zaznacz tekst - - + + The annotation has been removed Adnotacja została usunięta @@ -344,31 +351,62 @@ Plik zaszyfrowany, wprowadź hasło - + Password Hasło - + OK button OK - + Wrong password Błędne hasło + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Poprzednia - + Next Następna @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Dodaj adnotację - + Are you sure you want to delete all annotations? Czy na pewno chcesz usunąć wszystkie adnotacje? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Nieprawidłowy numer strony @@ -423,38 +461,56 @@ Dokument nie został zapisany + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Czy chcesz zapisać zmiany jako %1? - + Cancel button Anuluj - + Discard button Odrzuć - + Save button Zapisz - + Cancel Anuluj - + Delete Usuń @@ -490,12 +546,12 @@ SearchResWidget - + No search results Brak wyników wyszukiwania - + %1 items found Znaleziono %1 przedmiotów @@ -551,188 +607,207 @@ ShortCutShow - + Settings Ustawienia - + Exit Wyjdź - + Help Pomoc - + Page up Strona w górę - + Page down Strona w dół - + Open Otwórz - + Zoom in Powiększ - + Zoom out Pomniejsz - + Save as Zapisz jako - + + File + + + + + Display + + + + + Tools + Narzędzia + + + + Edit + + + + Print Drukuj - + Save Zapisz - + Thumbnails Miniatury - + 1:1 size Rozmiar 1:1 - + Fit height Dopasuj do wysokości - + Fit width Dopasuj do szerokości - + Rotate left Obróć w lewo - + Rotate right Obróć w prawo - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Przenieś się na początek - + Move to the end Przenieś się na koniec - + Select text Zaznacz tekst - + Hand tool Przesuwanie ręką - + Add bookmark Dodaj zakładkę - + Delete Usuń - + Magnifier Lupa - + Slide show Pokaz slajdów - + Fullscreen Pełny ekran - + Copy Kopiuj - + Cut Wytnij - + Paste Wklej - + Undo Cofnij - + Select all Zaznacz wszystko - + Display shortcuts Wyświetl skróty - + Add annotation Dodaj adnotację - + Highlight Wyróżnij - + Search Szukaj @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopiuj - + Remove annotation Usuń adnotację - - + + Remove all Usuń wszystkie - + Remove bookmark Usuń zakładkę @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Strona %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Jesteś na pierwszej stronie - + It is the last page Jesteś na ostatniej stronie @@ -785,48 +860,48 @@ TitleMenu - + New window Nowe okno - + New tab Nowa karta - - + + Save Zapisz - + Save as Zapisz jako - + Display in file manager Wyświetl w Menedżerze plików - + Magnifer Lupa - + Tools Narzędzia - + Search Szukaj - + Print Drukuj @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniatury @@ -847,28 +922,99 @@ Osiągnięto limit wejściowy + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - \ No newline at end of file + diff --git a/translations/deepin-reader_pt.ts b/translations/deepin-reader_pt.ts index 9aa13d02d..6b1393e5b 100755 --- a/translations/deepin-reader_pt.ts +++ b/translations/deepin-reader_pt.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Visualizador de Documentos - + Document Viewer is a tool for reading document files, supporting %1. O Visualizador de Documentos é uma ferramenta para ler ficheiros de documentos, que suporta %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Localização - + Subject Assunto - + Author Autor - + Keywords Palavras-chave - + Producer Produtor - + Creator Criador - + Time created Data de criação - + Time modified Data de modificação - + Format Formato - + Pages Páginas - + Optimized Optimizado - + Security Segurança - + Page size Tamanho da página - + File size Tamanho do ficheiro - + + Warnings + + + + Basic info Informação básica - + Unknown Desconhecido - + Yes Sim - + No Não @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Adicionar marcador - + Are you sure you want to delete all bookmarks? Tem a certeza que deseja eliminar todos os marcadores? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copiar - + Remove annotation Remover anotação - - - + + + Add annotation Adicionar anotação - - - - + + + + Remove bookmark Remover marcador - - - - + + + + Add bookmark Adicionar marcador - + Highlight Destacar - + Remove highlight Remover destaque - - + + Search Pesquisar - - + + Exit fullscreen Sair de ecrã inteiro - - + + Fullscreen Ecrã inteiro - - + + Slide show Apresentação - - + + First page Primeira página - - + + Previous page Página anterior - - + + Next page Página seguinte - - + + Last page Última página - - + + Rotate left Rodar para a esquerda - - + + Rotate right Rodar para a direita - - + + Print Imprimir - - + + Document info Informações do documento @@ -241,7 +248,7 @@ Central - + Documents Documentos @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported O formato não é suportado - + Open failed Falha ao abrir - + Please check if the file is damaged Verificar se o ficheiro está danificado - + Conversion failed, please check if the file is damaged Falha ao converter, verifique se o ficheiro está danificado - + Save failed Falha ao guardar - + Saved successfully Guardado com sucesso - + Save as Guardar como - - + + Invalid file name Nome de ficheiro inválido - - + + OK button Aceitar @@ -305,12 +312,12 @@ Arraste documentos para aqui - + Format supported: %1 Formato suportado: %1 - + Select File Selecionar ficheiro @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed O marcador foi removido - - + + Please select the text Selecione o texto - - + + The annotation has been removed A anotação foi removida @@ -344,31 +351,62 @@ Ficheiro encriptado, introduza a palavra-passe - + Password Palavra-passe - + OK button Aceitar - + Wrong password Palavra-passe incorreta + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Anterior - + Next Seguinte @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Adicionar anotação - + Are you sure you want to delete all annotations? Tem a certeza que deseja eliminar todos as anotações? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Número de página inválido @@ -423,38 +461,56 @@ Documento não guardado + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Guardar as alterações para "%1"? - + Cancel button Cancelar - + Discard button Descartar - + Save button Guardar - + Cancel Cancelar - + Delete Eliminar @@ -490,12 +546,12 @@ SearchResWidget - + No search results Sem resultados - + %1 items found %1 itens encontrados @@ -759,23 +815,23 @@ SideBarImageListView - + Copy Copiar - + Remove annotation Remover anotação - - + + Remove all Remover tudo - + Remove bookmark Remover marcador @@ -783,7 +839,7 @@ SideBarImageViewModel - + Page %1 Página %1 @@ -791,12 +847,12 @@ SlidePlayWidget - + It is the first page É a primeira página - + It is the last page É a última página @@ -804,48 +860,48 @@ TitleMenu - + New window Nova janela - + New tab Novo separador - - + + Save Guardar - + Save as Guardar como - + Display in file manager Mostrar no gestor de ficheiros - + Magnifer Lupa - + Tools Ferramentas - + Search Pesquisar - + Print Imprimir @@ -853,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturas @@ -866,28 +922,97 @@ Atingiu o limite de caracteres + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - \ No newline at end of file + diff --git a/translations/deepin-reader_pt_BR.ts b/translations/deepin-reader_pt_BR.ts index f603723ca..0b263a253 100755 --- a/translations/deepin-reader_pt_BR.ts +++ b/translations/deepin-reader_pt_BR.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Visualizador de Documentos - + Document Viewer is a tool for reading document files, supporting %1. O Visualizador de Documentos permite ler documentos, com suporte a %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Localização - + Subject Assunto - + Author Autor - + Keywords Palavras-chave - + Producer Produtor - + Creator Criador - + Time created Data de Criação - + Time modified Última modificação - + Format Formato - + Pages Páginas - + Optimized Otimizado - + Security Segurança - + Page size Tamanho da página - + File size Tamanho do arquivo - + + Warnings + + + + Basic info Informações básicas - + Unknown Desconhecido - + Yes Sim - + No Não @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Adicionar marcador - + Are you sure you want to delete all bookmarks? Excluir todos os marcadores? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copiar - + Remove annotation Remover anotação - - - + + + Add annotation Adicionar anotação - - - - + + + + Remove bookmark Remover marcador - - - - + + + + Add bookmark Adicionar marcador - + Highlight Destaque - + Remove highlight Remover destaque - - + + Search Pesquisar - - + + Exit fullscreen Sair da tela cheia - - + + Fullscreen Tela cheia - - + + Slide show Apresentação de slides - - + + First page Primeira página - - + + Previous page Página anterior - - + + Next page Próxima página - - + + Last page Última página - - + + Rotate left Girar à esquerda - - + + Rotate right Girar à direita - - + + Print Imprimir - - + + Document info Informações do documento @@ -241,7 +248,7 @@ Central - + Documents Documentos @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported O formato não é suportado - + Open failed A abertura falhou - + Please check if the file is damaged Verifique se o arquivo está danificado - + Conversion failed, please check if the file is damaged A conversão falhou; verifique se o arquivo está danificado - + Save failed Falha ao salvar - + Saved successfully Salvo - + Save as Salvar como - - + + Invalid file name Nome do arquivo inválido - - + + OK button OK @@ -305,12 +312,12 @@ Arraste documentos até aqui - + Format supported: %1 Formato suportado: %1 - + Select File Selecionar arquivo @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed O marcador foi removido - - + + Please select the text Selecione o texto - - + + The annotation has been removed A anotação foi removida @@ -344,31 +351,62 @@ Arquivo criptografado; insira a senha - + Password Senha - + OK button OK - + Wrong password Senha incorreta + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Anterior - + Next Próximo @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Adicionar anotação - + Are you sure you want to delete all annotations? Excluir todas as anotações? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Número de página inválido @@ -423,38 +461,56 @@ Documento não salvo + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Salvar as alterações em "%1"? - + Cancel button Cancelar - + Discard button Descartar - + Save button Salvar - + Cancel Cancelar - + Delete Excluir @@ -490,12 +546,12 @@ SearchResWidget - + No search results Nenhum resultado encontrado - + %1 items found %1 itens encontrados @@ -759,23 +815,23 @@ SideBarImageListView - + Copy Copiar - + Remove annotation Remover anotação - - + + Remove all Remover tudo - + Remove bookmark Remover marcador @@ -783,7 +839,7 @@ SideBarImageViewModel - + Page %1 Página %1 @@ -791,12 +847,12 @@ SlidePlayWidget - + It is the first page Essa é a primeira página - + It is the last page Essa é a última página @@ -804,48 +860,48 @@ TitleMenu - + New window Nova janela - + New tab Nova aba - - + + Save Salvar - + Save as Salvar como - + Display in file manager Exibir no Gerenciador de Arquivos - + Magnifer Lupa - + Tools Ferramentas - + Search Pesquisar - + Print Imprimir @@ -853,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturas @@ -866,28 +922,97 @@ Limite de entrada atingido + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath Caminho do Arquivo - + ThumbnailPath Path. Caminho da Miniatura. - + Generate thumbnail. Gerar miniatura. - \ No newline at end of file + diff --git a/translations/deepin-reader_ro.ts b/translations/deepin-reader_ro.ts index 843275356..911e06ee1 100644 --- a/translations/deepin-reader_ro.ts +++ b/translations/deepin-reader_ro.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Vizualizator de Documente - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Amplasare - + Subject Subiect - + Author Autor - + Keywords Cuvintele cheie - + Producer Producător - + Creator Compilator - + Time created Perioada creării - + Time modified Perioada modificării - + Format Format - + Pages Paginile - + Optimized Optimizat - + Security Securitate - + Page size Mărimea paginii - + File size Mărimea fișierului - + + Warnings + + + + Basic info Informații de bază - + Unknown Necunoscut - + Yes Da - + No Nu @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Adăugarea marcajului - + Are you sure you want to delete all bookmarks? Doriți să ștergeți toate marcajele? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Copiere - + Remove annotation Eliminarea adnotare - - - + + + Add annotation Adăugarea adnotare - - - - + + + + Remove bookmark Eliminarea marcajului - - - - + + + + Add bookmark Adăugarea marcajului - + Highlight Evidențiere - + Remove highlight Scoatere evidențiere - - + + Search Căutare - - + + Exit fullscreen Ieșire ecran complet - - + + Fullscreen Ecran complet - - + + Slide show Prezentare - - + + First page Prima pagină - - + + Previous page Pagina precedentă - - + + Next page Pagina următoare - - + + Last page Ultima pagină - - + + Rotate left Rotire stânga - - + + Rotate right Rotire dreapta - - + + Print Printare - - + + Document info Informație document @@ -241,7 +248,7 @@ Central - + Documents Documente @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Formatul dat nu este acceptat - + Open failed Deschidere eșuata - + Please check if the file is damaged Vă rugăm să vă asigurați dacă fișierul nu este deteriorat - + Conversion failed, please check if the file is damaged Conversion failed, please check if the file is damaged - + Save failed Salvare eșuată - + Saved successfully Salvare cu succes - + Save as Salvează ca - - + + Invalid file name Nume de fișier inacceptabil - - + + OK button OK @@ -305,12 +312,12 @@ Trageți documentele aici - + Format supported: %1 Formatul acceptat: %1 - + Select File Selectați Fișierul @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Marcajul a fost eliminat - - + + Please select the text Selectați vă rog textul - - + + The annotation has been removed Adnotare a fost eliminată @@ -344,31 +351,62 @@ Fișierul criptat, introduceți vă rog parola - + Password Parola - + OK button OK - + Wrong password Parola incorectă + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Precedent - + Next Următor @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Adăugarea adnotare - + Are you sure you want to delete all annotations? Doriți să ștergeți toate adnotările? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Numărul de pagină inacceptabil @@ -423,38 +461,56 @@ Documentul nu a fost salvat + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Save the changes to "%1"? - + Cancel button Anulare - + Discard button Renunțare - + Save button Salvare - + Cancel Anulare - + Delete Șterge @@ -490,12 +546,12 @@ SearchResWidget - + No search results Nici-un rezultat - + %1 items found %1 obiecte găsite @@ -551,188 +607,207 @@ ShortCutShow - + Settings Setări - + Exit Ieșire - + Help Ajutor - + Page up Pagină sus - + Page down Pagină jos - + Open Accesa - + Zoom in A mări - + Zoom out A micșora - + Save as Salvează ca - + + File + + + + + Display + + + + + Tools + Instrumente + + + + Edit + + + + Print Printare - + Save Salvare - + Thumbnails Miniaturi - + 1:1 size 1:1 mărime - + Fit height Potrivire înălțime - + Fit width Potrivire lățime - + Rotate left Rotire stânga - + Rotate right Rotire dreapta - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Move to the beginning - + Move to the end Move to the end - + Select text Selectați textul - + Hand tool Instrumentul ”Mâna” - + Add bookmark Adăugarea marcajului - + Delete Șterge - + Magnifier Lupă - + Slide show Prezentare - + Fullscreen Ecran complet - + Copy Copiere - + Cut Decupare - + Paste Lipire - + Undo Anulare - + Select all Selectați tot - + Display shortcuts Afișare comenzi rapide - + Add annotation Adăugarea adnotare - + Highlight Evidențiere - + Search Căutare @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Copiere - + Remove annotation Eliminarea adnotare - - + + Remove all Eliminare tot - + Remove bookmark Eliminarea marcajului @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Pagina %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page It is the first page - + It is the last page It is the last page @@ -785,48 +860,48 @@ TitleMenu - + New window Fereastră nouă - + New tab Filă nouă - - + + Save Salvare - + Save as Salvează ca - + Display in file manager Afișare manager de fișiere - + Magnifer Lupă - + Tools Instrumente - + Search Căutare - + Print Printare @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniaturi @@ -847,28 +922,99 @@ Limită de intrare atinsă + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Cale Fișierului de Document - - + + FilePath Cale Fișierului - + ThumbnailPath Path. Cale ThumbnailPath - + Generate thumbnail. Generează miniatură - \ No newline at end of file + diff --git a/translations/deepin-reader_ru.ts b/translations/deepin-reader_ru.ts index c2af04f7f..5f2e6616a 100755 --- a/translations/deepin-reader_ru.ts +++ b/translations/deepin-reader_ru.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Просмотрщик документов - + Document Viewer is a tool for reading document files, supporting %1. Просмотрщик документов — это средство для чтения файлов документов в формате %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Положение - + Subject Предмет - + Author Автор - + Keywords Ключевые слова - + Producer Поставщик - + Creator Составитель - + Time created Время создания - + Time modified Время изменения - + Format Формат - + Pages Страницы - + Optimized Оптимизирован - + Security Безопасность - + Page size Размер страницы - + File size Размер файла - + + Warnings + + + + Basic info Основная информация - + Unknown Неизвестный - + Yes Да - + No Нет @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Добавить закладку - + Are you sure you want to delete all bookmarks? Уверены, что хотите удалить все закладки? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Копировать - + Remove annotation Удалить аннотацию - - - + + + Add annotation Добавить аннотацию - - - - + + + + Remove bookmark Удалить закладку - - - - + + + + Add bookmark Добавить закладку - + Highlight Выделение - + Remove highlight Удалить выделение - - + + Search Поиск - - + + Exit fullscreen Выход из полноэкранного режима - - + + Fullscreen Полноэкранный режим - - + + Slide show Слайд-шоу - - + + First page Первая страница - - + + Previous page Предыдущая страница - - + + Next page Следущая страница - - + + Last page Последняя страница - - + + Rotate left Повернуть влево - - + + Rotate right Повернуть вправо - - + + Print Печать - - + + Document info Информация о документе @@ -241,7 +248,7 @@ Central - + Documents Документы @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Формат не поддерживается - + Open failed Не удалось открыть - + Please check if the file is damaged Пожалуйста, проверьте, не повреждён ли файл - + Conversion failed, please check if the file is damaged Не удалось выполнить преобразование, пожалуйста, проверьте, не поврежден ли файл - + Save failed Сохранение не удалось - + Saved successfully Успешно сохранено - + Save as Сохранить как - - + + Invalid file name Неверное имя файла - - + + OK button ОК @@ -305,12 +312,12 @@ Перетащить документы сюда - + Format supported: %1 Поддерживаемый формат: %1 - + Select File Выберите файл @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Закладка удалена - - + + Please select the text Пожалуйста, выберите текст - - + + The annotation has been removed Примечание удалено @@ -344,31 +351,62 @@ Зашифрованный файл, пожалуйста, введите пароль - + Password Пароль - + OK button ОК - + Wrong password Неверный пароль + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Предыдущая - + Next Следущая @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Добавить аннотацию - + Are you sure you want to delete all annotations? Уверенны, что хотите удалить все аннотации? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Неверный номер страницы @@ -423,38 +461,56 @@ Документ не сохранён + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Сохранить изменения в «%1»? - + Cancel button Отмена - + Discard button Отклонить - + Save button Сохранить - + Cancel Отмена - + Delete Удалить @@ -490,12 +546,12 @@ SearchResWidget - + No search results Поиск не дал результатов - + %1 items found %1 элементов найдено @@ -759,23 +815,23 @@ SideBarImageListView - + Copy Копировать - + Remove annotation Удалить аннотацию - - + + Remove all Удалить все - + Remove bookmark Удалить закладку @@ -783,7 +839,7 @@ SideBarImageViewModel - + Page %1 Страница %1 @@ -791,12 +847,12 @@ SlidePlayWidget - + It is the first page Это первая страница - + It is the last page Это последняя страница @@ -804,48 +860,48 @@ TitleMenu - + New window Новое окно - + New tab Новая вкладка - - + + Save Сохранить - + Save as Сохранить как - + Display in file manager Показать в файловом менеджере - + Magnifer Увеличительное стекло - + Tools Инструменты - + Search Поиск - + Print Печать @@ -853,7 +909,7 @@ TitleWidget - + Thumbnails Эскизы @@ -866,28 +922,99 @@ Достигнут предел ввода + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Путь файла документа - - + + FilePath Путь файла - + ThumbnailPath Path. Путь ThumbnailPath. - + Generate thumbnail. Сгенерировать эскиз. - \ No newline at end of file + diff --git a/translations/deepin-reader_si.ts b/translations/deepin-reader_si.ts index 1e7dffe36..356d1f635 100644 --- a/translations/deepin-reader_si.ts +++ b/translations/deepin-reader_si.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ මාතෘකා පරීක්ෂක - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location ස්ථානය - + Subject අධ්‍යාපනය - + Author ක්‍රේතා - + Keywords කේවෝර්ඩ් - + Producer ප්‍රොඩුස් - + Creator සිදුකරුව - + Time created සිදුකරුව දිනය - + Time modified සංස්කරණ දිනය - + Format ස්වරුපය - + Pages පිටින් - + Optimized අවශ්‍ය අභියෝග - + Security සිරස් ස්වරුපය - + Page size පිටින් ස්වරුපය - + File size ගොනු ස්වරුපය - + + Warnings + + + + Basic info මූල අභියෝග - + Unknown විශේෂ අභියෝග - + Yes ඔව් - + No නැති @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark බෝක්මාර්ක් තැනීම - + Are you sure you want to delete all bookmarks? ඔබ මාතෘකා පරීක්ෂකයෙන් අග්‍රා බෝක්මාර්ක් පුළුවන් අත්හැරීමට මෙය අවශ්‍ය දැයි අසන්නේ ද? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy සිරස් කරන්න - + Remove annotation අභියෝග අත්හැරීම - - - + + + Add annotation අභියෝග තැනීම - - - - + + + + Remove bookmark බෝක්මාර්ක් අත්හැරීම - - - - + + + + Add bookmark බෝක්මාර්ක් තැනීම - + Highlight අභියෝග අභියෝගය - + Remove highlight අභියෝග අභියෝගය අත්හැරීම - - + + Search සොයන්න - - + + Exit fullscreen අවලංගු ප්‍රමාණය අවලංගු කරන්න - - + + Fullscreen අවලංගු ප්‍රමාණය - - + + Slide show ස්ලයිඩ් ස්ළෝ ප්‍රදර්ශනය - - + + First page පළමු පිටුව - - + + Previous page පෙර පිටුව - - + + Next page පොදු පිටුව - - + + Last page අවසන් පිටුව - - + + Rotate left කුළු දකුණු ප්‍රතිවේදනය - - + + Rotate right කුළු අභ්‍යන්තරය ප්‍රතිවේදනය - - + + Print ප්‍රින්ට් කරන්න - - + + Document info සම්මත පත්‍ර සැකසූ තොරතුරු @@ -241,7 +248,7 @@ Central - + Documents සම්මත පත්‍ර @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported ස්වර්ගය අවලංගු නොවේ - + Open failed ව්‍යාප්ත විය - + Please check if the file is damaged කරුණාකර ප්‍රමාණය අන්තර්ගතය විය හැකි නොවේ යන්න පරීක්ෂා කරන්න - + Conversion failed, please check if the file is damaged අනුවාදය විය, කරුණාකර ප්‍රමාණය අන්තර්ගතය විය හැකි නොවේ යන්න පරීක්ෂා කරන්න - + Save failed ස්ථාපනය විය - + Saved successfully ස්ථාපනය කළ තරම් ප්‍රමාණය සාර්ථකව ස්ථාපනය කරනි - + Save as ස්ථාපනය කරන්න සැකසුන් - - + + Invalid file name අන්වායිත ප්‍රමාණය නම - - + + OK button ඇක්‍ක් @@ -305,12 +312,12 @@ සම්මත පත්‍ර මෙහි පත් කරන්න - + Format supported: %1 ස්වර්ගය අවලංගු වේ: %1 - + Select File ප්‍රමාණය තෝරන්න @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed ස්තූතිය අවලංගු කරන්න - - + + Please select the text කරුණාකර තෝරන්න ප්‍රමාණය - - + + The annotation has been removed ස්තූතිය අවලංගු කරන්න @@ -344,31 +351,62 @@ අවලංගු ප්‍රමාණය, කරුණාකර පාස්වර්ඩ් ඇති අභ්‍යන්තරය ඇති අභ්‍යන්තරය ඇති අභ්‍යන්තරය ඇති අභ්‍යන්තරය ඇති අභ්‍යන්තරය ඇති අභ්‍යන්තරය ඇති - + Password පාස්වර්ඩ් - + OK button ඇක්‍ක් - + Wrong password අසිද්ධ පාස්වර්ඩ් + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous පෙර - + Next නැවී @@ -389,12 +427,12 @@ NotesWidget - + Add annotation අනාවරණය තේරුම් කරන්න - + Are you sure you want to delete all annotations? ඔබ අනාවරණය සියලුම දැක්වීම් අල්ලා ගැනීමට අවශ්‍ය නොවේද? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number අන්වාදිත පිටු අංකය @@ -423,38 +461,56 @@ මිනිත්තු නොසිදු කරන නොයේ + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? "%1" වෙත වෙනස් කිරීම් සිදු කරන්නද? - + Cancel button අවලංගු කරන්න - + Discard button අත්හැරීම - + Save button සිදු කරන්න - + Cancel අවලංගු කරන්න - + Delete උවමින් @@ -490,12 +546,12 @@ SearchResWidget - + No search results සේර්ච් අවමින් නොමැත - + %1 items found '%1 ප්‍රමාණය සොයා ගෙන තිබේ' @@ -551,188 +607,207 @@ ShortCutShow - + Settings සැකසුම් - + Exit අවසන් කරන්න - + Help ඇහළුව - + Page up පිටින් අඩු කරන්න - + Page down පිටින් අඟුරු කරන්න - + Open විවර්ගනය කරන්න - + Zoom in සමීප කරන්න - + Zoom out දුර කරන්න - + Save as සොයා ගන්න - + + File + + + + + Display + + + + + Tools + අවයව + + + + Edit + + + + Print ප්‍රින්ට් කරන්න - + Save සොයා ගන්න - + Thumbnails තිරස් අංශය - + 1:1 size 1:1 ප්‍රමාණය - + Fit height අඩු ප්‍රමාණය - + Fit width ප්‍රමාණය අඩු කරන්න - + Rotate left වම් ප්‍රතිලෝකනය කරන්න - + Rotate right මැදින් ප්‍රතිලෝකනය කරන්න - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning ආරම්භයට නඟින්න - + Move to the end අවසන්යට නඟින්න - + Select text මිනිසුම් තිරස් අංශය නිර්දේශ කරන්න - + Hand tool හැඳින් ආයුරු දෙන තාක්සියා - + Add bookmark බෝක්මාර්ක් තිරස් අංශය දෙන්න - + Delete ඕනෑම අංශය අතිරික්ත කරන්න - + Magnifier මිරිදු ආයුරු දෙන තාක්සියා - + Slide show සලයිඩ් අංශය දෙන්න - + Fullscreen සම්පූර්ණ ප්‍රමාණය - + Copy සිංචිත කරන්න - + Cut විශ්‍රාම කරන්න - + Paste උත්සර්ග කරන්න - + Undo අතුරු කරන්න - + Select all සියලුම තීරුවන්න - + Display shortcuts ස්කෝර්ට් දර්ශනය කරන්න - + Add annotation අනුමානයක් තීරුවන්න - + Highlight හිල්ලිග්‍රීට් කරන්න - + Search සොයන්න @@ -740,23 +815,23 @@ SideBarImageListView - + Copy ප්‍රතිඵලය - + Remove annotation අනුමානය අතුරු කරන්න - - + + Remove all සියලුම අතුරු කරන්න - + Remove bookmark බෝක්මාර්ක් අතුරු කරන්න @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 පිටුව %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page එය පළමු පිටුව ය - + It is the last page එය අවසන් පිටුව ය @@ -785,48 +860,48 @@ TitleMenu - + New window නව ප්‍රවේශය - + New tab නව තාබ් - - + + Save සොයන්න - + Save as සොයන්න ලෙස - + Display in file manager ගේ අතුරු දර්ශනය කරන්න - + Magnifer මාග්නිෆර් - + Tools අවයව - + Search සොයන්න - + Print ලිපියන්න @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails තීරුවන් දර්ශනය @@ -847,28 +922,97 @@ ඇතුල් අවම ප්‍රමාණය අසා + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ඇතුල් අවම ප්‍රමාණය අසා - - + + FilePath ගේ අතුරු - + ThumbnailPath Path. තීරුවන් අතුරු ප්‍රමාණය - + Generate thumbnail. තීරුවන් සිදු කරන්න - \ No newline at end of file + diff --git a/translations/deepin-reader_sk.ts b/translations/deepin-reader_sk.ts index ca745a075..3678859c1 100644 --- a/translations/deepin-reader_sk.ts +++ b/translations/deepin-reader_sk.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Prehliadač dokumentov - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Prehliadač dokumentov je nástroj na čítanie súborov dokumentov, podporuje PDF, DJVU, DOCX atď. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Miesto - + Subject Predmet - + Author Autor - + Keywords Kľúčové slová - + Producer Výrobca - + Creator Vytvoriť - + Time created Čas vytvorenia - + Time modified Čas upravenia - + Format Formát - + Pages Strany - + Optimized Optimalizovaný - + Security Bezpečnosť - + Page size Veľkosť strany - + File size Veľkosť súboru - + + Warnings + + + + Basic info Základné informácie - + Unknown Neznáme - + Yes Áno - + No Nie @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Pridať zápisník - + Are you sure you want to delete all bookmarks? Naozaj chcete vymazať všetky zápisníky? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Kopírovať - + Remove annotation Odstrániť poznámku - + + + Add annotation Pridať poznámku - + + + + Remove bookmark Odstrániť zápisník - + + + + Add bookmark Pridať zápisník - + Highlight Zvýčiarkovať - + Remove highlight Odstrániť zvýčiarkovanie - + + Search Vyhľadať - + + Exit fullscreen Opusti plný obraz - + + Fullscreen Plný obraz - + + Slide show Prezentácia - + + First page Prvá strana - + + Previous page Predchádzajúca strana - + + Next page Nasledujúca strana - + + Last page Posledná strana - + + Rotate left Otoči doľava - + + Rotate right Otoči doprava - + + Print Tlač - + + Document info Informácie o dokumente @@ -219,7 +248,7 @@ Central - + Documents Dokumenty @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Formát nie je podporovaný - + Open failed Otvorenie zlyhalo - + Please check if the file is damaged Skontrolujte, či je súbor poškodený - + Conversion failed, please check if the file is damaged Prekonverzia zlyhala, skontrolujte, či je súbor poškodený - + Save failed Uloženie zlyhalo - + Saved successfully Uložené úspešne - + Save as Uložiť ako - + + Invalid file name Neplatný názov súboru - + + OK button OK @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Pridajte dokumenty sem - + Format supported: %1 Podporovaný formát: %1 - + Select File Vybrať súbor @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Zaznamenanie bolo odstránené - + + Please select the text Vyberte text - + + The annotation has been removed Poznámka bolo odstránené @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Šifrovaný súbor, prosím, zadajte heslo - + Password Heslo - + OK button OK - + Wrong password Nesprávne heslo + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Predchádzajúce - + Next Nasledujúce @@ -349,12 +414,12 @@ HandleMenu - + Select Text Vybrať text - + Hand Tool Ručný nástroj @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Pridať poznámku - + Are you sure you want to delete all annotations? Naozaj chcete vymazať všetky poznámky? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Neplatné číslo strany @@ -383,7 +448,7 @@ ProgressDialog - + Converting Prebieha konverzia @@ -391,43 +456,61 @@ QObject - + Document not saved Dokument nie je uložený + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - Uložiť zmeny do "%1"? + + Save the changes to "%1"? + Uložiť zmeny do "%1"? - + Cancel button Zrušiť - + Discard button Zahodiť - + Save button Uložiť - + Cancel Zrušiť - + Delete Vymazať @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Zobrazenie na dve strany - + 1:1 size 1:1 veľkosť - + Fit Page Prispôsobiť stranu - + Fit Height Prispôsobiť výšku - + Fit Width Prispôsobiť šírku @@ -463,36 +546,36 @@ SearchResWidget - + No search results Žiadne výsledky hľadania - + %1 items found - '%1 položiek nájdených' + '%1 položiek nájdených' SecurityDialog - + This document is trying to connect to: Tento dokument sa snaží pripojiť k: - + If you trust the website, click Allow, otherwise click Block. Ak dôverujete stránke, kliknite na Povoliť, inak kliknite na Zablokovať. - + Block button Zablokovať - + Allow button Povoliť @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Náhľady - + Catalog Katalóg - + Bookmarks Záložky - + Annotations Poznámky @@ -524,188 +607,207 @@ ShortCutShow - + Settings Nastavenia - + Exit Vystúpiť - + Help Pomoc - + Page up Strana nahor - + Page down Strana nadol - + Open Otvoriť - + Zoom in Priblížiť - + Zoom out Oddialiť - + Save as Uložiť ako - + + File + + + + + Display + + + + + Tools + Nástroje + + + + Edit + + + + Print Tlač - + Save Uložiť - + Thumbnails Náhľady - + 1:1 size 1:1 veľkosť - + Fit height Pridobiť výšku - + Fit width Pridobiť šírku - + Rotate left Otočiť vľavo - + Rotate right Otočiť vpravo - + Move to the beginning Presunúť na začiatok - + Move to the end Presunúť na koniec - + Scroll up one line Posunúť o jeden riadok hore - + Scroll down one line Posunúť o jeden riadok dole - - + Select text Vybrať text - + Hand tool Ručný nástroj - + Add bookmark Pridať záložku - + Delete Vymazať - + Magnifier Pomedzovka - + Slide show Prezentácia - + Fullscreen Celá obrazovka - + Copy Kopírovať - + Cut Vystrihnúť - + Paste Vložiť - + Undo Späť - + Select all Vybrať všetko - + Display shortcuts Zobraziť skratky - + Add annotation Pridať poznámku - + Highlight Zvýrazniť - + Search Hľadať @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Kopírovať - + Remove annotation Odstrániť poznámku - + + Remove all Odstrániť všetko - + Remove bookmark Odstrániť záložku @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Strana %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Je to prvá strana - + It is the last page Je to posledná strana @@ -757,47 +860,48 @@ TitleMenu - + New window Nové okno - + New tab Nový panel - + + Save Uložiť - + Save as Uložiť ako - + Display in file manager Zobraziť v správci súborov - + Magnifer Pomocný zväčšovač - + Tools Nástroje - + Search Hľadať - + Print Tlač @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Náhľady @@ -813,30 +917,102 @@ TransparentTextEdit - + Input limit reached Bol dosiahnutý limit vstupu + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Cesta k súboru dokumentu. - + + FilePath Cesta k súboru - + ThumbnailPath Path. Cesta k náhľadu. - + Generate thumbnail. Generovať náhľad. diff --git a/translations/deepin-reader_sl.ts b/translations/deepin-reader_sl.ts index 3ace350d4..023707e82 100644 --- a/translations/deepin-reader_sl.ts +++ b/translations/deepin-reader_sl.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Pregledovalnik dokumentov - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Lokacija - + Subject Subjekt - + Author Avtor - + Keywords Ključne besede - + Producer Producent - + Creator Ustvarjalec - + Time created Ustvarjeno - + Time modified Spremenjeno - + Format Format - + Pages Strani - + Optimized Optimatizirano - + Security Varnost - + Page size Velikost strani - + File size Velikost datoteke - + + Warnings + + + + Basic info Osnovni podatki - + Unknown Neznano - + Yes Da - + No Ne @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Dodaj zaznamek - + Are you sure you want to delete all bookmarks? Ali ste prepričani, da želite odstraniti vse zaznamke? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopiraj - + Remove annotation Odstrani opombe - - - + + + Add annotation Dodaj opombo - - - - + + + + Remove bookmark Odstrani zaznamek - - - - + + + + Add bookmark Dodaj zaznamek - + Highlight Osvetli - + Remove highlight Odstrani osvetlitev - - + + Search Iskanje - - + + Exit fullscreen Zapri celozaslonski način - - + + Fullscreen Celozaslonsko - - + + Slide show Diaprojekcija - - + + First page Prva stran - - + + Previous page Prejšnja stran - - + + Next page Naslednja stran - - + + Last page Zadnja stran - - + + Rotate left Obrni levo - - + + Rotate right Obrni desno - - + + Print Tiskanje - - + + Document info Podatki o dokumentu @@ -241,7 +248,7 @@ Central - + Documents Dokumenti @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Format ni podprt - + Open failed Odpiranje ni uspelo - + Please check if the file is damaged Preverite ali datoteka ni poškodovana - + Conversion failed, please check if the file is damaged Pretvorba ni uspela. Preverite ali datoteka ni poškodovana - + Save failed Neuspešno shranjevanje - + Saved successfully Uspešno shranjeno - + Save as Shrani kot - - + + Invalid file name Neveljavno ime datoteke - - + + OK button V redu @@ -305,12 +312,12 @@ Povlecite dokumente sem - + Format supported: %1 Podprti format: %1 - + Select File Izberite datoteko @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Zaznamek je bil odstranjen - - + + Please select the text Izberite besedilo - - + + The annotation has been removed Opomba je bila odstranjena @@ -344,31 +351,62 @@ Šifirirana datoreka, vnesite geslo - + Password Geslo - + OK button V redu - + Wrong password Napačno geslo + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Nazaj - + Next Naprej @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Dodaj opombo - + Are you sure you want to delete all annotations? Želite res izbrisati vse opombe? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Napačna številka strani @@ -423,38 +461,56 @@ Dokument ni shranjen + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Sharnim spremembe v "%1"? - + Cancel button Prekini - + Discard button Opusti - + Save button Shrani - + Cancel Prekini - + Delete Izbriši @@ -490,12 +546,12 @@ SearchResWidget - + No search results Ni rezultatov iskanja - + %1 items found Najdenih predmetov: %1 @@ -551,188 +607,207 @@ ShortCutShow - + Settings Nastavitve - + Exit Izhod - + Help Pomoč - + Page up Stran gor - + Page down Stran dol - + Open Odpri - + Zoom in Približaj - + Zoom out Oddalji - + Save as Shrani kot - + + File + + + + + Display + + + + + Tools + Orodja + + + + Edit + + + + Print Tiskanje - + Save Shrani - + Thumbnails Predogledne sličice - + 1:1 size razmerje 1:1 - + Fit height Prilagodi višino - + Fit width Prilagodi širino - + Rotate left Obrni levo - + Rotate right Obrni desno - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Premik na začetek - + Move to the end Premik na konec - + Select text Izberi besedilo - + Hand tool Ročno orodje - + Add bookmark Dodaj zaznamek - + Delete Izbriši - + Magnifier Povečalo - + Slide show Diaprojekcija - + Fullscreen Celozaslonsko - + Copy Kopiraj - + Cut Izreži - + Paste Prilepi - + Undo Razveljavi - + Select all Izberi vse - + Display shortcuts Prikaži bljižnice - + Add annotation Dodaj opombo - + Highlight Osvetli - + Search Iskanje @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopiraj - + Remove annotation Odstrani opombe - - + + Remove all Odstrani vse - + Remove bookmark Odstrani zaznamek @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Stran %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page To je prva stran - + It is the last page To je zadnja stran @@ -785,48 +860,48 @@ TitleMenu - + New window Novo okno - + New tab Nov zavihek - - + + Save Shrani - + Save as Shrani kot - + Display in file manager Prikaži v upravljaniku datotek - + Magnifer Povečalo - + Tools Orodja - + Search Iskanje - + Print Tiskanje @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Predogledne sličice @@ -847,28 +922,101 @@ Vhodna omejitev je bila dosežena + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Pot do dokumenta. - - + + FilePath PotDokumenta - + ThumbnailPath Path. PotPredogledne pot. - + Generate thumbnail. Ustvari predogledno sličico. - \ No newline at end of file + diff --git a/translations/deepin-reader_sq.ts b/translations/deepin-reader_sq.ts index 90df9be9a..b5c25c9a9 100755 --- a/translations/deepin-reader_sq.ts +++ b/translations/deepin-reader_sq.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Parës Dokumentesh - + Document Viewer is a tool for reading document files, supporting %1. Parësi i Dokumenteve është një mjet për lexim kartelash dokument, që mbulon %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Vendndodhje - + Subject Subjekt - + Author Autor - + Keywords Fjalëkyçe - + Producer Prodhues - + Creator Krijues - + Time created Kohë kur u krijua - + Time modified Kohë kur u ndryshua - + Format Format - + Pages Faqe - + Optimized E optimizuar - + Security Siguri - + Page size Madhësi faqeje - + File size Madhësi kartele - + + Warnings + + + + Basic info Hollësi elementare - + Unknown E panjohur - + Yes Po - + No Jo @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Shtoni faqerojtës - + Are you sure you want to delete all bookmarks? Jeni i sigurt se doni të hiqen krejt faqerojtësit? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopjoje - + Remove annotation Hiqe shënimin - - - + + + Add annotation Shtoni shënim - - - - + + + + Remove bookmark Hiq faqerojtës - - - - + + + + Add bookmark Shtoni faqerojtës - + Highlight Theksoje - + Remove highlight Hiqja theksimin - - + + Search Kërko - - + + Exit fullscreen Dil nga mënyra “Sa krejt ekrani” - - + + Fullscreen Sa krejt ekrani - - + + Slide show Shfaqje diapozitivash - - + + First page Faqja e parë - - + + Previous page Faqja e mëparshme - - + + Next page Faqja pasuese - - + + Last page Faqja e fundit - - + + Rotate left Rrotulloje majtas - - + + Rotate right Rrotulloje djathtas - - + + Print Shtyp - - + + Document info Hollësi dokumenti @@ -241,7 +248,7 @@ Central - + Documents Dokumente @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Formati s’mbulohet - + Open failed Hapja dështoi - + Please check if the file is damaged Ju lutemi, kontrolloni se mos kartela është e dëmtuar - + Conversion failed, please check if the file is damaged Shndërrimi dështoi, ju lutemi, kontrolloni se mos kartela është e dëmtuar - + Save failed Ruajtja dështoi - + Saved successfully U ruajt me sukses - + Save as Ruaje si - - + + Invalid file name Emër i pavlefshëm kartele - - + + OK button OK @@ -305,12 +312,12 @@ Tërhiqni dokumente këtu - + Format supported: %1 Format i mbuluar: %1 - + Select File Përzgjidhni Kartelë @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Faqerojtësi u hoq - - + + Please select the text Ju lutemi, përzgjidhni tekstin - - + + The annotation has been removed Shënimi u hoq @@ -344,31 +351,62 @@ Kartelë e fshehtëzuar, ju lutemi, jepni fjalëkalimin - + Password Fjalëkalim - + OK button OK - + Wrong password Fjalëkalim i gabuar + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous E mëparshmja - + Next Pasuesja @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Shtoni shënim - + Are you sure you want to delete all annotations? Jeni i sigurt se doni të hiqen krejt shënimet? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Numër i pavlefshëm faqeje @@ -423,38 +461,56 @@ Dokumenti s’u ruajt + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Të ruhen ndryshimet te “%1”? - + Cancel button Anuloje - + Discard button Hidhe tej - + Save button Ruaje - + Cancel Anuloje - + Delete Fshije @@ -490,12 +546,12 @@ SearchResWidget - + No search results S’ka përfundime kërkimi - + %1 items found U gjetën %1 objekte @@ -551,188 +607,207 @@ ShortCutShow - + Settings Rregullime - + Exit Dalje - + Help Ndihmë - + Page up Tasti “Page Up” - + Page down Tasti “Page Down” - + Open Hap - + Zoom in Zmadhoje - + Zoom out Zvogëloje - + Save as Ruaje si - + + File + + + + + Display + + + + + Tools + Mjete + + + + Edit + + + + Print Shtyp - + Save Ruaje - + Thumbnails Miniatura - + 1:1 size Madhësi 1:1 - + Fit height Sa ta nxërë lartësia - + Fit width Sa ta nxërë gjerësia - + Rotate left Rrotulloje majtas - + Rotate right Rrotulloje djathtas - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Kalo te fillimi - + Move to the end Kalo te fundi - + Select text Përzgjidhni tekst - + Hand tool Mjeti Dorë - + Add bookmark Shtoni faqerojtës - + Delete Fshije - + Magnifier Thjerrë zmadhimi - + Slide show Shfaqje diapozitivash - + Fullscreen Sa krejt ekrani - + Copy Kopjoje - + Cut Prije - + Paste Ngjite - + Undo Zhbëje - + Select all Përzgjidhe krejt - + Display shortcuts Shfaq shkurtore - + Add annotation Shtoni shënim - + Highlight Theksoje - + Search Kërko @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopjoje - + Remove annotation Hiq shënim - - + + Remove all Hiqi krejt - + Remove bookmark Hiqe faqerojtësin @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Faqja %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Gjendet në faqen e parë - + It is the last page Gjendet në faqen e fundit @@ -785,48 +860,48 @@ TitleMenu - + New window Dritare e re - + New tab Skedë e re - - + + Save Ruaje - + Save as Ruaje si - + Display in file manager Shfaqe te përgjegjës kartelash - + Magnifer Thjerrë zmadhimi - + Tools Mjete - + Search Kërko - + Print Shtype @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Miniatura @@ -847,28 +922,97 @@ U mbërrit në kufij dhënieje + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Shteg Kartele Dokumenti. - - + + FilePath ShtegKartele - + ThumbnailPath Path. Shteg ShtegMiniature. - + Generate thumbnail. Prodho miniaturë. - \ No newline at end of file + diff --git a/translations/deepin-reader_sr.ts b/translations/deepin-reader_sr.ts index a94d4b2ca..8647ec95b 100755 --- a/translations/deepin-reader_sr.ts +++ b/translations/deepin-reader_sr.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Прегледач Докумената - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Локација - + Subject Тема - + Author Аутор - + Keywords Кључне речи - + Producer Издавач - + Creator Стваралац - + Time created Време настаника - + Time modified Време измене - + Format Формат - + Pages Страницa - + Optimized Оптимизовано - + Security Безбедност - + Page size Димензије - + File size Величина - + + Warnings + + + + Basic info Основни подаци - + Unknown Непознато - + Yes Да - + No Не @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Додај забелешку - + Are you sure you want to delete all bookmarks? Заиста желите да обришете све забелешке? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Копирај - + Remove annotation Уклони напомену - - - + + + Add annotation Додај напомену - - - - + + + + Remove bookmark Уклони забелешку - - - - + + + + Add bookmark Додај забелешку - + Highlight Истакни - + Remove highlight Уклони истицање - - + + Search Претражи - - + + Exit fullscreen Напусти цео екран - - + + Fullscreen Цео екран - - + + Slide show Покретни приказ - - + + First page Прва страница - - + + Previous page Претходна страница - - + + Next page Следећа страница - - + + Last page Последња страница - - + + Rotate left Ротирај улево - - + + Rotate right Ротирај удесно - - + + Print Штампај - - + + Document info Подаци документа @@ -241,7 +248,7 @@ Central - + Documents Документи @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Формат није подржан - + Open failed Неуспешно отварање - + Please check if the file is damaged Проверите да ли је датотека оштећена - + Conversion failed, please check if the file is damaged Неуспешно претварање, проверите да ли је датотека оштећена - + Save failed Није сачувано - + Saved successfully Успешно сачувано - + Save as Сачувај као - - + + Invalid file name Неважећи назив датотеке - - + + OK button У реду @@ -305,12 +312,12 @@ Превуци документе овде - + Format supported: %1 Подржани формат: %1 - + Select File Изабери датотеку @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Забелешка је уклоњена - - + + Please select the text Молимо изаберите текст - - + + The annotation has been removed Напомена је уклоњена @@ -344,31 +351,62 @@ Датотека је шифрована, унесите лозинку - + Password Лозинка - + OK button У реду - + Wrong password Погрешна лозинка + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Претходно - + Next Следеће @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Додај напомену - + Are you sure you want to delete all annotations? Заиста желите да обришете све напомене? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Неисправан број странице @@ -423,38 +461,56 @@ Документ није сачуван + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Сачувати измене у "%1"? - + Cancel button Откажи - + Discard button Одбаци - + Save button Сачувај - + Cancel Откажи - + Delete Обриши @@ -490,12 +546,12 @@ SearchResWidget - + No search results Нема резултата претраге - + %1 items found Ставки пронађено %1 @@ -551,188 +607,207 @@ ShortCutShow - + Settings Подешавања - + Exit Изађи - + Help Помоћ - + Page up Страница нагоре - + Page down Страница надоле - + Open Отвори - + Zoom in Увећај - + Zoom out Умањи - + Save as Сачувај као - + + File + + + + + Display + + + + + Tools + Алати + + + + Edit + + + + Print Штампај - + Save Сачувај - + Thumbnails Умањени прикази - + 1:1 size 1:1 размера - + Fit height Уклопи по висини - + Fit width Уклопи по ширини - + Rotate left Ротирај улево - + Rotate right Ротирај удесно - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Move to the beginning - + Move to the end Move to the end - + Select text Изабери текст - + Hand tool Ручни алат - + Add bookmark Додај забелешку - + Delete Обриши - + Magnifier Лупа - + Slide show Покретни приказ - + Fullscreen Цео екран - + Copy Копирај - + Cut Исеци - + Paste Убаци - + Undo Опозови - + Select all Изабери све - + Display shortcuts Прикажи пречице - + Add annotation Додај напомену - + Highlight Истакни - + Search Претражи @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Копирај - + Remove annotation Уклони напомену - - + + Remove all Уклони све - + Remove bookmark Уклони забелешку @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Страница %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page It is the first page - + It is the last page It is the last page @@ -785,48 +860,48 @@ TitleMenu - + New window Нови прозор - + New tab Нова картица - - + + Save Сачувај - + Save as Сачувај као - + Display in file manager Прикажи у управнику података - + Magnifer Лупа - + Tools Алати - + Search Претражи - + Print Штампај @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Умањени прикази @@ -847,28 +922,99 @@ Достигнуто ограничење уноса + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath Путања датотеке - + ThumbnailPath Path. Путања умањеног приказа. - + Generate thumbnail. Створи умањени приказ. - \ No newline at end of file + diff --git a/translations/deepin-reader_sv.ts b/translations/deepin-reader_sv.ts index 3a5d54dc0..0a70d4e67 100644 --- a/translations/deepin-reader_sv.ts +++ b/translations/deepin-reader_sv.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Dokumentvisare - + Document Viewer is a tool for reading document files, supporting %1. Dokumentvisare är ett verktyg för att läsa dokumentfiler och stöder %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Plats - + Subject Ämne - + Author Författare - + Keywords Nyckelord - + Producer Producent - + Creator Skapare - + Time created Skapad - + Time modified Ändrad - + Format Format - + Pages Sidor - + Optimized Optimerad - + Security Säkerhet - + Page size Sidstorlek - + File size Filstorlek - + + Warnings + + + + Basic info Grundläggande information - + Unknown Okänt - + Yes Ja - + No Nej @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Lägg till bokmärke - + Are you sure you want to delete all bookmarks? Vill du verkligen ta bort alla bokmärken? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopiera - + Remove annotation Ta bort anteckning - - - + + + Add annotation Lägg till anteckning - - - - + + + + Remove bookmark Ta bort bokmärke - - - - + + + + Add bookmark Lägg till bokmärke - + Highlight Markera - + Remove highlight Ta bort markering - - + + Search Sök - - + + Exit fullscreen Avsluta helskärmsläge - - + + Fullscreen Helskärm - - + + Slide show Bildspel - - + + First page Första sidan - - + + Previous page Föregående sida - - + + Next page Nästa sida - - + + Last page Sista sidan - - + + Rotate left Rotera åt vänster - - + + Rotate right Rotera åt höger - - + + Print Skriv ut - - + + Document info Dokumentinformation @@ -241,7 +248,7 @@ Central - + Documents Dokument @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Formatet stöds inte - + Open failed Det gick inte att öppna - + Please check if the file is damaged Kontrollera om filen är skadad - + Conversion failed, please check if the file is damaged Konverteringen misslyckades. Kontrollera om filen är skadad - + Save failed Det gick inte att spara - + Saved successfully Sparades - + Save as Spara som - - + + Invalid file name Ogiltigt filnamn - - + + OK button OK @@ -305,12 +312,12 @@ Dra dokument hit - + Format supported: %1 Format som stöds: %1 - + Select File Välj fil @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Bokmärket har tagits bort - - + + Please select the text Markera texten - - + + The annotation has been removed Anteckningen har tagits bort @@ -344,18 +351,18 @@ Krypterad fil. Ange lösenordet - + Password Lösenord - + OK button OK - + Wrong password Fel lösenord @@ -363,22 +370,22 @@ EyeProtection - + No eye protection Inget ögonskydd - + Classic eye protection Klassiskt ögonskydd - + Green eye protection Grönt ögonskydd - + Night eye protection Nattläge för ögonskydd @@ -386,7 +393,7 @@ EyeProtectionAction - + Eye protection mode Ögonskyddsläge @@ -394,12 +401,12 @@ FindWidget - + Previous Föregående - + Next Nästa @@ -420,12 +427,12 @@ NotesWidget - + Add annotation Lägg till anteckning - + Are you sure you want to delete all annotations? Vill du verkligen ta bort alla anteckningar? @@ -462,12 +469,12 @@ Återställd till senaste läsposition - + Jump to first page Gå till första sidan - + Close Stäng @@ -539,12 +546,12 @@ SearchResWidget - + No search results Inga sökresultat - + %1 items found %1 träffar @@ -808,23 +815,23 @@ SideBarImageListView - + Copy Kopiera - + Remove annotation Ta bort anteckning - - + + Remove all Ta bort alla - + Remove bookmark Ta bort bokmärke @@ -832,7 +839,7 @@ SideBarImageViewModel - + Page %1 Sida %1 @@ -840,12 +847,12 @@ SlidePlayWidget - + It is the first page Det här är första sidan - + It is the last page Det här är sista sidan @@ -864,7 +871,7 @@ - + Save Spara @@ -884,17 +891,17 @@ Förstoringsglas - + Tools Verktyg - + Search Sök - + Print Skriv ut @@ -902,7 +909,7 @@ TitleWidget - + Thumbnails Miniatyrer @@ -915,33 +922,97 @@ Inmatningsgränsen har nåtts + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Dokumentets filsökväg. - - + + FilePath Filsökväg - + ThumbnailPath Path. Sökväg till miniatyrbild. - + Generate thumbnail. Skapa miniatyrbild. - - - Batch print documents without UI. - Skriv ut dokument i grupp utan användargränssnitt. - - \ No newline at end of file + diff --git a/translations/deepin-reader_sw.ts b/translations/deepin-reader_sw.ts index 7855a0fba..956960703 100644 --- a/translations/deepin-reader_sw.ts +++ b/translations/deepin-reader_sw.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer Mikorati ya Dokumenti - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Mikorati ya Dokumenti ni programu ya kushirikiana na faili ya dokumenti, inapungua PDF, DJVU, DOCX na kati. + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location Mkono - + Subject Makala - + Author Mwanaume - + Keywords Miongoni - + Producer Mwambo - + Creator Mwambo - + Time created Wakati ya kuanza - + Time modified Wakati ya kushirikiana - + Format Matokeo - + Pages Makao - + Optimized Iliyotolewa - + Security Uzalishaji - + Page size Ukunda wa mako - + File size Ukunda wa faili - + + Warnings + + + + Basic info Matokeo ya kichwa - + Unknown Hali ya kama - + Yes Yes - + No No @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Ongeza Mokorati - + Are you sure you want to delete all bookmarks? Una umekuwa na kushirikiana kusafisha mokorati zote? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy Kopia - + Remove annotation Ondoa Matokeo - + + + Add annotation Ongeza Matokeo - + + + + Remove bookmark Ondoa Mokorati - + + + + Add bookmark Ongeza Mokorati - + Highlight Kuzalisha - + Remove highlight Ondoa Kuzalisha - + + Search Tafuta - + + Exit fullscreen Kupwa na kifua - + + Fullscreen Kifua - + + Slide show Mwaka wa mato - + + First page Sahifa ya kwanza - + + Previous page Sahifa ya binafsi - + + Next page Sahifa ya kibaki - + + Last page Sahifa ya mbili - + + Rotate left Tumia kulia kati - + + Rotate right Tumia kura kati - + + Print Kurusha - + + Document info Maelezo ya dokumeni @@ -219,7 +248,7 @@ Central - + Documents Dokumenti @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported Moyo wa kifua haikuwa inayozalishwa - + Open failed Kuonyesha haikuwa kifanyiwa - + Please check if the file is damaged Tafakari kama faili ina kuchapishwa - + Conversion failed, please check if the file is damaged Kuungwa kifanyiwa, tafakari kama faili ina kuchapishwa - + Save failed Kuondoka haikuwa kifanyiwa - + Saved successfully Kuondoka kifanyiwa - + Save as Kuondoka kama - + + Invalid file name Jina la faili inayolipwa - + + OK button OK @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here Panga dokumenti hapa - + Format supported: %1 Kifua inayozalishwa: %1 - + Select File Chagua faili @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed Moto wa kifua wa kifua ililipunguka - + + Please select the text Tafakari chagua neno - + + The annotation has been removed Moto wa kifua wa kifua ililipunguka @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password Faili inayotumika, tafakari chagua kipaswo - + Password Kipaswo - + OK button OK - + Wrong password Nenye kata kiki + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Siku ya mbili - + Next Siku ya kati @@ -349,12 +414,12 @@ HandleMenu - + Select Text Chagua mato - + Hand Tool Vipenge @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Ongeza mato ya kificha - + Are you sure you want to delete all annotations? Ukiwamaliza kufuta mato yote ya kificha? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number Numbi ya siku ya kati inayotangika @@ -383,7 +448,7 @@ ProgressDialog - + Converting Kuungia @@ -391,43 +456,61 @@ QObject - + Document not saved Dokumenti inayotangika + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - Tuma mato ya kificha kwa "%1"? + + Save the changes to "%1"? + Tuma mato ya kificha kwa "%1"? - + Cancel button Kufuta - + Discard button Kufuta - + Save button Tuma - + Cancel Kufuta - + Delete Futa @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View Mwaka wa siku ya mbili - + 1:1 size Ule wa 1:1 - + Fit Page Fungua siku ya kati - + Fit Height Fungua ukubwa - + Fit Width Fungua ukubwa wa kati @@ -463,36 +546,36 @@ SearchResWidget - + No search results Hakuna mato ya kificha - + %1 items found - '%1 mato yote + '%1 mato yote SecurityDialog - + This document is trying to connect to: Dokumenti hii inayotangika kufungua kwa: - + If you trust the website, click Allow, otherwise click Block. Kama unatambua website, chagua Allow, kama hakuna chagua Block. - + Block button Block - + Allow button Allow @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Mato ya kificha - + Catalog Mato ya kificha - + Bookmarks Mato ya kificha - + Annotations Tambua @@ -524,188 +607,207 @@ ShortCutShow - + Settings Mipango - + Exit Futa - + Help Msaada - + Page up Pili up - + Page down Pili down - + Open Kamenge - + Zoom in Zoom in - + Zoom out Zoom out - + Save as Tafuta kama - + + File + + + + + Display + + + + + Tools + Kifaa + + + + Edit + + + + Print Tafuta - + Save Tafuta - + Thumbnails Mipango ya picha - + 1:1 size Uwezo wa 1:1 - + Fit height Tafuta kwa kipindi cha punda - + Fit width Tafuta kwa kipindi cha punda - + Rotate left Tafuta kati ya kushuka kaskaskasi - + Rotate right Tafuta kati ya kushuka kaskaskasi - + Move to the beginning Tafuta kwenye kipindi cha awali - + Move to the end Tafuta kwenye kipindi cha mwisho - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text Tafuta kipindi cha mstari - + Hand tool Kifaa cha mafuta - + Add bookmark Ongeza kipambo - + Delete Futa - + Magnifier Kifaa cha magnifier - + Slide show Mipango ya slide show - + Fullscreen Fullscreen - + Copy Kopia - + Cut Kopia na futa - + Paste Pasta - + Undo Kuwa - + Select all Chagua wote - + Display shortcuts Tazama kifaa - + Add annotation Onesha maelekezo - + Highlight Kuondolea - + Search Tazama @@ -713,22 +815,23 @@ SideBarImageListView - + Copy Kopia - + Remove annotation Ondoa maelekezo - + + Remove all Ondoa wote - + Remove bookmark Ondoa maelekezo ya bookmark @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 Sipani %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page Huna sipani ya kwanza - + It is the last page Huna sipani ya mbili @@ -757,47 +860,48 @@ TitleMenu - + New window Picha kipande mpya - + New tab Picha tab mpya - + + Save Hifadhi - + Save as Hifadhi kama - + Display in file manager Tazama katika manager ya faili - + Magnifer Magnifier - + Tools Kifaa - + Search Tazama - + Print Print @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails Thumbnails @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached Kuongeza kwa kipande mpya + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Jina la faili ya dokumini. - + + FilePath Jina la faili - + ThumbnailPath Path. Jina la faili ya thumbnail. - + Generate thumbnail. Tengeneza thumbnail. diff --git a/translations/deepin-reader_ta.ts b/translations/deepin-reader_ta.ts index 2d90c6bc4..0e2b1c4a7 100644 --- a/translations/deepin-reader_ta.ts +++ b/translations/deepin-reader_ta.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer தகவல் பார்வையாளர் - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - தகவல் பார்வையாளர் ஒரு தகவல் கோப்புகளை படிக்க உதவும் கருவி ஆகும், PDF, DJVU, DOCX போன்றவற்றை ஆதரிக்கிறது + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location இடம் - + Subject பொருள் - + Author ரசிகர் - + Keywords கீல்வார்ட்ஸ் - + Producer தயாரிப்பாளர் - + Creator உருவாக்கியவர் - + Time created உருவாக்கப்பட்ட நேரம் - + Time modified திருத்தப்பட்ட நேரம் - + Format வடிவம் - + Pages பக்கங்கள் - + Optimized உயர்தரம் - + Security மீன்மை - + Page size பக்க அளவு - + File size கோப்பு அளவு - + + Warnings + + + + Basic info அடிப்படை தகவல் - + Unknown தெரியாத - + Yes ஆம் - + No இல்லை @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark புள்ளி கூட்டு - + Are you sure you want to delete all bookmarks? நீங்கள் அனைத்து புள்ளிகளையும் நீக்க விரும்புகிறீர்களா? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy காப்பி - + Remove annotation அனாலிட்டியை நீக்கு - + + + Add annotation அனாலிட்டி கூட்டு - + + + + Remove bookmark புள்ளி நீக்கு - + + + + Add bookmark போடு புள்ளி - + Highlight குறிப்பிடு - + Remove highlight குறிப்பிட்டதை நீக்கு - + + Search தேடு - + + Exit fullscreen - + + Fullscreen - + முழு திரை - + + Slide show - + சில்லு காட்சி - + + First page - + + Previous page - + + Next page - + + Last page - + + Rotate left - + இடது சுழற்சி - + + Rotate right - + வலது சுழற்சி - + + Print - + அச்சு - + + Document info @@ -219,7 +248,7 @@ Central - + Documents @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported - + Open failed - + Please check if the file is damaged - + Conversion failed, please check if the file is damaged - + Save failed - + Saved successfully - + Save as - + சேமிக்கவும் - + + Invalid file name - + + OK button @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here - + Format supported: %1 - + Select File @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed - + + Please select the text - + + The annotation has been removed @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password - + Password - + OK button - + Wrong password தவறான கடவுச்சொல் + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous முன்னதாக - + Next அடுத்ததாக @@ -349,12 +414,12 @@ HandleMenu - + Select Text தேர்வு செய்யப்பட்ட தொடர் - + Hand Tool கை கருவி @@ -362,12 +427,12 @@ NotesWidget - + Add annotation அங்கீகரிக்க - + Are you sure you want to delete all annotations? நீங்கள் அனைத்து அங்கீகரிப்புகளையும் நீக்க விரும்புகிறீர்களா? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number தவறான பக்க எண் @@ -383,7 +448,7 @@ ProgressDialog - + Converting மாற்றுகிறது @@ -391,43 +456,61 @@ QObject - + Document not saved குறிப்பு சேமிக்கப்படவில்லை + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" க்கு மாற்றங்களை சேமிக்க விரும்புகிறீர்களா? + + Save the changes to "%1"? + "%1" க்கு மாற்றங்களை சேமிக்க விரும்புகிறீர்களா? - + Cancel button தவறாக - + Discard button விடு - + Save button சேமிக்க - + Cancel தவறாக - + Delete அகற்று @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View இரு பக்க பார்வை - + 1:1 size 1:1 அளவு - + Fit Page பக்கத்தை ஏற்று - + Fit Height மெய்ப்பார்வை உயரம் - + Fit Width மெய்ப்பார்வை அகலம் @@ -463,36 +546,36 @@ SearchResWidget - + No search results தேடல் விளைவுகள் இல்லை - + %1 items found - '%1 பொருட்கள் கண்டுபிடிக்கப்பட்டன' + '%1 பொருட்கள் கண்டுபிடிக்கப்பட்டன' SecurityDialog - + This document is trying to connect to: இந்த குறிப்பு இணைக்க முயலுகிறது: - + If you trust the website, click Allow, otherwise click Block. நீங்கள் இணையதளத்தை நம்பினால் Allow ஐ கிளிக் செய்யவும், இல்லையென்றால் Block ஐ கிளிக் செய்யவும். - + Block button தடு - + Allow button அனுமதி @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails சின்னங்கள் - + Catalog கட்டமைப்பு - + Bookmarks நினைவுகள் - + Annotations மையோட்டிகள் @@ -524,188 +607,207 @@ ShortCutShow - + Settings அமைப்புகள் - + Exit மூடு - + Help துணை - + Page up பேஜ் மேல் - + Page down பேஜ் கீழ் - + Open திறந்து - + Zoom in செல்லாக்கல் - + Zoom out பூமியில் - + Save as சேமிக்கவும் - + + File + + + + + Display + + + + + Tools + அரங்கேற்று + + + + Edit + + + + Print அச்சு - + Save சேமிக்கவும் - + Thumbnails தொகுதிகள் - + 1:1 size 1:1 அளவு - + Fit height மெய்ப்பொருத்து - + Fit width மெய்ப்பொருத்து - + Rotate left இடது சுழற்சி - + Rotate right வலது சுழற்சி - + Move to the beginning தொடக்கத்திற்கு மேலே - + Move to the end முடிவத்திற்கு கீழே - + Scroll up one line ஒரு வரி மேலே நிலைப்படுத்து - + Scroll down one line ஒரு வரி கீழே நிலைப்படுத்து - - + Select text தொடர்புடைய பொருளை தேர்ந்தெடுக்கவும் - + Hand tool கை கருவி - + Add bookmark நினைவுச்சின்னத்தை சேர்க்கவும் - + Delete அகற்று - + Magnifier மெக்கானிக் - + Slide show சில்லு காட்சி - + Fullscreen முழு திரை - + Copy காப்பி - + Cut வெட்டி - + Paste அட்டை - + Undo திரும்ப அனுமதி - + Select all அனைத்தையும் தேர்ந்தெடு - + Display shortcuts சுருட்சுகளை காட்டு - + Add annotation உரையிடு - + Highlight தெரிவு செய்யு - + Search தேடு @@ -713,22 +815,23 @@ SideBarImageListView - + Copy காப்பி - + Remove annotation உரையை அகற்று - + + Remove all அனைத்தையும் அகற்று - + Remove bookmark நீக்கு @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 பக்கம் %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page இது முதல் பக்கம் - + It is the last page இது கடைசி பக்கம் @@ -757,47 +860,48 @@ TitleMenu - + New window புதிய படிவம் - + New tab புதிய டப்பிள் - + + Save சேமிக்கு - + Save as சேமிக்கவும் - + Display in file manager பைல் மேனேஜரில் காட்டு - + Magnifer மாக்னிப்பர் - + Tools அரங்கேற்று - + Search தேடு - + Print அச்சு @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails தொடர்பு படிவங்கள் @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached உள்ளீடு எல்லை எட்டியுள்ளது + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. தகவல் கோப்பு பாதை. - + + FilePath பாதை - + ThumbnailPath Path. தொடர்பு படிவம் பாதை. - + Generate thumbnail. தொடர்பு படிவத்தை உருவாக்கு. diff --git a/translations/deepin-reader_th.ts b/translations/deepin-reader_th.ts index 8e97025be..a613c060e 100644 --- a/translations/deepin-reader_th.ts +++ b/translations/deepin-reader_th.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ผู้ชมเอกสาร - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - Document Viewer เป็นเครื่องมือสำหรับอ่านไฟล์เอกสาร รองรับ PDF, DJVU, DOCX เป็นต้น + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location ตำแหน่ง - + Subject หัวข้อ - + Author ผู้แต่ง - + Keywords คำสำคัญ - + Producer ผู้ผลิต - + Creator ผู้สร้าง - + Time created เวลาที่สร้าง - + Time modified เวลาที่แก้ไข - + Format รูปแบบ - + Pages หน้า - + Optimized ได้รับการปรับแต่ง - + Security ความปลอดภัย - + Page size ขนาดหน้า - + File size ขนาดไฟล์ - + + Warnings + + + + Basic info ข้อมูลพื้นฐาน - + Unknown ไม่ทราบ - + Yes ใช่ - + No ไม่ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark เพิ่มเครื่องหมาย - + Are you sure you want to delete all bookmarks? คุณแน่ใจหรือไม่ว่าต้องการลบเครื่องหมายทั้งหมด? @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy คัดลอก - + Remove annotation ลบคำอธิบาย - + + + Add annotation เพิ่มคำอธิบาย - + + + + Remove bookmark ลบเครื่องหมาย - + + + + Add bookmark เพิ่มเครื่องหมาย - + Highlight เน้น - + Remove highlight ลบการเน้น - + + Search ค้นหา - + + Exit fullscreen ออกโหมดเต็มหน้าจอ - + + Fullscreen เต็มหน้าจอ - + + Slide show การแสดงภาพ - + + First page หน้าแรก - + + Previous page หน้าก่อนหน้า - + + Next page หน้าถัดไป - + + Last page หน้าสุดท้าย - + + Rotate left หมุนซ้าย - + + Rotate right หมุนขวา - + + Print พิมพ์ - + + Document info ข้อมูลเอกสาร @@ -219,7 +248,7 @@ Central - + Documents เอกสาร @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported รูปแบบไม่รองรับ - + Open failed การเปิดล้มเหลว - + Please check if the file is damaged กรุณาตรวจสอบว่าไฟล์เสียหายหรือไม่ - + Conversion failed, please check if the file is damaged การแปลงล้มเหลว กรุณาตรวจสอบว่าไฟล์เสียหายหรือไม่ - + Save failed การบันทึกล้มเหลว - + Saved successfully บันทึกสำเร็จ - + Save as บันทึกเป็น - + + Invalid file name ชื่อไฟล์ไม่ถูกต้อง - + + OK button ตกลง @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here ลากเอกสารนี้มาที่นี่ - + Format supported: %1 รูปแบบที่รองรับ: %1 - + Select File เลือกไฟล์ @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed เครื่องหมายตำแหน่งถูกลบ - + + Please select the text กรุณาเลือกข้อความ - + + The annotation has been removed การติดแท็กถูกลบ @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password ไฟล์ถูกเข้ารหัส กรุณาป้อนรหัสผ่าน - + Password รหัสผ่าน - + OK button ตกลง - + Wrong password รหัสผ่านผิด + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous ก่อนหน้านี้ - + Next ต่อไป @@ -349,12 +414,12 @@ HandleMenu - + Select Text เลือกข้อความ - + Hand Tool เครื่องมือมือ @@ -362,12 +427,12 @@ NotesWidget - + Add annotation เพิ่มคำอธิบาย - + Are you sure you want to delete all annotations? คุณแน่ใจว่าต้องการลบคำอธิบายทั้งหมดหรือไม่? @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number เลขหน้าไม่ถูกต้อง @@ -383,7 +448,7 @@ ProgressDialog - + Converting กำลังแปลง @@ -391,43 +456,61 @@ QObject - + Document not saved เอกสารไม่ได้ถูกบันทึก + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - คุณต้องการบันทึกการเปลี่ยนแปลงของ "%1" หรือไม่? + + Save the changes to "%1"? + คุณต้องการบันทึกการเปลี่ยนแปลงของ "%1" หรือไม่? - + Cancel button ยกเลิก - + Discard button ทิ้ง - + Save button บันทึก - + Cancel ยกเลิก - + Delete ลบ @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View การแสดงผลหน้าสองหน้า - + 1:1 size ขนาด 1:1 - + Fit Page ปรับให้เหมาะกับหน้า - + Fit Height ปรับให้เหมาะกับความสูง - + Fit Width ปรับให้เหมาะกับความกว้าง @@ -463,36 +546,36 @@ SearchResWidget - + No search results ไม่มีผลการค้นหา - + %1 items found - '%1 รายการถูกค้นพบ' + '%1 รายการถูกค้นพบ' SecurityDialog - + This document is trying to connect to: เอกสารนี้กำลังพยายามเชื่อมต่อไปยัง: - + If you trust the website, click Allow, otherwise click Block. หากคุณไว้วางใจเว็บไซต์ ให้คลิก Allow อื่น ๆ คลิก Block - + Block button บล็อก - + Allow button อนุญาต @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails ตัวอย่างภาพ - + Catalog แคตตาล็อก - + Bookmarks เครื่องหมายการอ่าน - + Annotations หมายเหตุ @@ -524,188 +607,207 @@ ShortCutShow - + Settings การตั้งค่า - + Exit ออก - + Help ความช่วยเหลือ - + Page up หน้าขึ้น - + Page down หน้าลง - + Open เปิด - + Zoom in ซูมเข้า - + Zoom out ซูมออก - + Save as บันทึกเป็น - + + File + + + + + Display + + + + + Tools + เครื่องมือ + + + + Edit + + + + Print พิมพ์ - + Save บันทึก - + Thumbnails ตัวอย่างภาพ - + 1:1 size ขนาด 1:1 - + Fit height ปรับความสูง - + Fit width ปรับความกว้าง - + Rotate left หมุนซ้าย - + Rotate right หมุนขวา - + Move to the beginning ย้ายไปที่ต้น - + Move to the end ย้ายไปที่สิ้น - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Select text เลือกข้อความ - + Hand tool เครื่องมือมือ - + Add bookmark เพิ่มหนังสือทำเครื่องหมาย - + Delete ลบ - + Magnifier ขยายภาพ - + Slide show การแสดงภาพ - + Fullscreen หน้าจอเต็มหน้า - + Copy คัดลอก - + Cut ตัด - + Paste วาง - + Undo ยกเลิก - + Select all เลือกทั้งหมด - + Display shortcuts แสดงคำสั่งลัด - + Add annotation เพิ่มคำอธิบาย - + Highlight เน้น - + Search ค้นหา @@ -713,22 +815,23 @@ SideBarImageListView - + Copy คัดลอก - + Remove annotation ลบคำอธิบาย - + + Remove all ลบออกทั้งหมด - + Remove bookmark ลบเครื่องหมายถูก @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 หน้า %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page นี่คือหน้าแรก - + It is the last page นี่คือหน้าสุดท้าย @@ -757,47 +860,48 @@ TitleMenu - + New window หน้าต่างใหม่ - + New tab แท็บใหม่ - + + Save บันทึก - + Save as บันทึกเป็น - + Display in file manager แสดงในโปรแกรมจัดการไฟล์ - + Magnifer ขยายภาพ - + Tools เครื่องมือ - + Search พิมพ์ - + Print ตัวอย่างภาพ @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails ขีดจำกัดการป้อนข้อมูลถึงขีดสุด @@ -813,30 +917,98 @@ TransparentTextEdit - + Input limit reached เส้นทางไฟล์เอกสาร + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. เส้นทางไฟล์ - + + FilePath เส้นทางตัวอย่างภาพ - + ThumbnailPath Path. สร้างตัวอย่างภาพ - + Generate thumbnail. Generate thumbnail. diff --git a/translations/deepin-reader_tr.ts b/translations/deepin-reader_tr.ts index 6a9160719..40dadec84 100755 --- a/translations/deepin-reader_tr.ts +++ b/translations/deepin-reader_tr.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Belge Görüntüleyici - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Konum - + Subject Konu - + Author Yazar - + Keywords Anahtar kelimeler - + Producer Yapımcı - + Creator Oluşturan - + Time created Oluşturulma zamanı - + Time modified Değiştirilme zamanı - + Format Biçim - + Pages Sayfalar - + Optimized İyileştirildi - + Security Güvenlik - + Page size Sayfa boyutu - + File size Dosya boyutu - + + Warnings + + + + Basic info Temel bilgi - + Unknown Bilinmeyen - + Yes Evet - + No Hayır @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Yer imi ekle - + Are you sure you want to delete all bookmarks? Tüm yer imlerini silmek istediğinizden emin misiniz? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Kopyala - + Remove annotation Ek açıklamayı kaldır - - - + + + Add annotation Açıklama ekle - - - - + + + + Remove bookmark Yer imini kaldır - - - - + + + + Add bookmark Yer imi ekle - + Highlight Vurgula - + Remove highlight Vurguyu kaldır - - + + Search Ara - - + + Exit fullscreen Tam ekrandan çık - - + + Fullscreen Tam ekan - - + + Slide show Slayt gösterisi - - + + First page İlk sayfa - - + + Previous page Önceki sayfa - - + + Next page Sonraki sayfa - - + + Last page Son sayfa - - + + Rotate left Sola döndür - - + + Rotate right Sağa döndür - - + + Print Yazdır - - + + Document info Belge bilgisi @@ -241,7 +248,7 @@ Central - + Documents Belgeler @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Biçim desteklenmiyor - + Open failed Açılamadı - + Please check if the file is damaged Dosyanın hasarlı olup olmadığını kontrol edin - + Conversion failed, please check if the file is damaged Dönüştürme başarısız, lütfen dosyanın zarar görüp görmediğini kontrol edin - + Save failed Kayıt başarısız - + Saved successfully Başarıyla kaydedildi - + Save as Farklı kaydet - - + + Invalid file name Geçersiz dosya adı - - + + OK button Tamam @@ -305,12 +312,12 @@ Belgeleri buraya sürükle - + Format supported: %1 Desteklenen biçim: %1 - + Select File Dosya Seç @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Yer imi kaldırıldı - - + + Please select the text Lütfen metni seç - - + + The annotation has been removed Ek açıklama kaldırıldı @@ -344,31 +351,62 @@ Şifrelenmiş dosya, lütfen parolayı gir - + Password Parola - + OK button Tamam - + Wrong password Yanlış parola + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Önceki - + Next Sonraki @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Açıklama ekle - + Are you sure you want to delete all annotations? Tüm ek açıklamaları silmek istediğinizden emin misiniz? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Geçersiz dosya adı @@ -423,38 +461,56 @@ Belge kaydedilmedi + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Değişiklikler "%1" olarak kaydedilsin mi? - + Cancel button İptal - + Discard button Yoksay - + Save button Kaydet - + Cancel İptal - + Delete Sil @@ -490,12 +546,12 @@ SearchResWidget - + No search results Arama sonucu bulunamadı - + %1 items found %1 öge bulundu @@ -551,188 +607,207 @@ ShortCutShow - + Settings Ayarlar - + Exit Çıkış - + Help Yardım - + Page up Sayfa yukarı - + Page down Sayfa aşağı - + Open Aç - + Zoom in Yakınlaştır - + Zoom out Uzaklaştır - + Save as Farklı kaydet - + + File + + + + + Display + + + + + Tools + Araçlar + + + + Edit + + + + Print Yazdır - + Save Kaydet - + Thumbnails Küçük resimler - + 1:1 size 1:1 boyut - + Fit height Uygun yükseklik - + Fit width Uygun genişlik - + Rotate left Sola döndür - + Rotate right Sağa döndür - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Başa git - + Move to the end Sona git - + Select text Metni seç - + Hand tool El aracı - + Add bookmark Yer imi ekle - + Delete Sil - + Magnifier Büyüteç - + Slide show Slayt gösterisi - + Fullscreen Tam ekan - + Copy Kopyala - + Cut Kes - + Paste Yapıştır - + Undo Geri al - + Select all Tümünü seç - + Display shortcuts Kısayolları görüntüle - + Add annotation Açıklama ekle - + Highlight Vurgula - + Search Ara @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Kopyala - + Remove annotation Ek açıklamayı kaldır - - + + Remove all Tümünü kaldır - + Remove bookmark Yer imini kaldır @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Sayfa %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page İlk sayfa - + It is the last page Son sayfa @@ -785,48 +860,48 @@ TitleMenu - + New window Yeni pencere - + New tab Yeni sekme - - + + Save Kaydet - + Save as Farklı kaydet - + Display in file manager Dosya yöneticisinde görüntüle - + Magnifer Büyüteç - + Tools Araçlar - + Search Ara - + Print Yazdır @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Küçük resimler @@ -847,28 +922,95 @@ Giriş sınırına ulaşıldı + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Belge Dosya Yolu. - - + + FilePath DosyaYolu - + ThumbnailPath Path. KüçükResimYolu Yolu. - + Generate thumbnail. Küçük resim oluştur. - \ No newline at end of file + diff --git a/translations/deepin-reader_ug.ts b/translations/deepin-reader_ug.ts index cf0520eff..3ed9540b2 100755 --- a/translations/deepin-reader_ug.ts +++ b/translations/deepin-reader_ug.ts @@ -9,7 +9,7 @@ ھۆججەت كۆرگۈچ - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -17,92 +17,97 @@ AttrScrollWidget - + Location ئورنى - + Subject تېما - + Author ئاپتور - + Keywords ئاچقۇچلۇق سۆزلەر - + Producer ئىشلەپچىقارغۇچى - + Creator ئاپتورى - + Time created يىڭىدىن قۇرغان ۋاقىت - + Time modified تەھرىرلەنگەن ۋاقتى - + Format فورماتى - + Pages بەت - + Optimized ئەلالاشتۇرۇلغان - + Security بىخەتەرلىك - + Page size بەت ھەجىمى - + File size ھۆججەت سىغىمى - + + Warnings + + + + Basic info ئاساسىي ئۇچۇر - + Unknown نامەلۇم - + Yes ھەئە - + No ياق @@ -110,12 +115,12 @@ BookMarkWidget - + Add bookmark خەتكۈچكە قوش - + Are you sure you want to delete all bookmarks? بارلىق خەتكۈچلەرنى يۇيۋەتمەكچىمۇ؟ @@ -123,119 +128,119 @@ BrowserMenu - - - + + + Copy كۆچۈرۈش - + Remove annotation ئىزاھاتنى ئۆچۈرۈش - - - + + + Add annotation ئىزاھات قوشۇش - - - - + + + + Remove bookmark خەتكۈچنى ئۆچۈرۈش - - - - + + + + Add bookmark خەتكۈچكە قوش - + Highlight يارقىن قىلىش - + Remove highlight يارقىن قىلىشنى ئەمەلدىن قالدۇرۇڭ - - + + Search ئىزدەش - - + + Exit fullscreen پۈتۈن ئېكراندىن چېكىنىش - - + + Fullscreen پۈتۈن ئېكران - - + + Slide show پىرويېكسيەنى قويۇش - - + + First page بىرىنچى بەت - - + + Previous page ئالدىنقى بەت - - + + Next page كېيىنكى بەت - - + + Last page ئەڭ ئاخىرقى بەت - - + + Rotate left سولغا ئايلاندۇرۇش - - + + Rotate right ئوڭغا ئايلاندۇرۇش - - + + Print بېسىش - - + + Document info ھۆججەت ئۇچۇرى @@ -243,7 +248,7 @@ Central - + Documents ھۆججەتلەر @@ -251,49 +256,49 @@ CentralDocPage - + The format is not supported بۇ ھۆججەتنىڭ فورماتىنى قوللىمايدۇ - + Open failed ئېچىش مەغلۇب بولدى - + Please check if the file is damaged ھۆججەتنىڭ بۇزۇلغان-بۇزۇلمىغانلىقىنى تەكشۈرۈڭ - + Conversion failed, please check if the file is damaged ئايلاندۇرۇش مەغلۇب بولدى، ھۆججەتنىڭ بۇزۇلغان-بۇزۇلمىغانلىقىنى تەكشۈرۈڭ - + Save failed ساقلانمىدى - + Saved successfully ساقلاندى - + Save as باشقا يەرگە ساقلاش - - + + Invalid file name ئۈنۈملۈك ھۆججەت نامى كىرگۈرۈڭ - - + + OK button ھەئە @@ -307,12 +312,12 @@ ھۆججەتنى بۇ يەرگە سۆرەپ تاشلاڭ - + Format supported: %1 قوللايدىغان فورماتلار: %1 - + Select File ھۆججەت تاللاش @@ -320,20 +325,20 @@ DocSheet - - + + The bookmark has been removed خەتكۈچ ئۆچۈرۈلدى - - + + Please select the text تېكىستنى تاللاڭ - - + + The annotation has been removed ئىزاھات ئۆچۈرۈلدى @@ -346,18 +351,18 @@ بۇ ھۆججەت پاروللانغان، پارولنى كىرگۈزۈڭ - + Password پارول - + OK button ھەئە - + Wrong password پارول خاتا @@ -365,22 +370,22 @@ EyeProtection - + No eye protection كۆز ئاسراش يوق - + Classic eye protection كلاسسىك كۆز ئاسراش - + Green eye protection يېشىل كۆز ئاسراش - + Night eye protection كېچىلىك كۆز ئاسراش @@ -388,7 +393,7 @@ EyeProtectionAction - + Eye protection mode كۆز قوغداش ھالىتى @@ -396,12 +401,12 @@ FindWidget - + Previous ئالدىنقىسى - + Next كېيىنكىسى @@ -422,12 +427,12 @@ NotesWidget - + Add annotation ئىزاھات قوشۇش - + Are you sure you want to delete all annotations? ئىزاھاتنى راستلا ئۆچۈرەمسىز؟ @@ -464,12 +469,12 @@ ئالدىنقى ئوقۇش ئورنىغا ئەسلىگە كەلتۈرۈلدى - + Jump to first page بىرىنچى بەتكە سەكرەش - + Close تاقاش @@ -541,12 +546,12 @@ SearchResWidget - + No search results ئىزدەش نەتىجىسى يوق - + %1 items found %1 ئىزدەش نەتىجىسى @@ -810,23 +815,23 @@ SideBarImageListView - + Copy كۆچۈرۈش - + Remove annotation ئىزاھاتنى ئۆچۈرۈش - - + + Remove all ھەممىنى ئۆچۈرۈش - + Remove bookmark خەتكۈچنى ئۆچۈرۈش @@ -834,7 +839,7 @@ SideBarImageViewModel - + Page %1 %1-بەت @@ -842,12 +847,12 @@ SlidePlayWidget - + It is the first page بۇ باش بەت - + It is the last page بۇ ئاخىرقى بەت @@ -866,7 +871,7 @@ - + Save ساقلايمەن @@ -886,17 +891,17 @@ لوپا ئەينەك - + Tools قورال - + Search ئىزدەش - + Print بېسىش @@ -904,7 +909,7 @@ TitleWidget - + Thumbnails قىسقارتىلغان سۈرەت @@ -917,33 +922,97 @@ كىرگۈزۈش يۇقىرى چېكىگە يەتتى + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - - - Batch print documents without UI. - Batch print documents without UI. - diff --git a/translations/deepin-reader_uk.ts b/translations/deepin-reader_uk.ts index b1b1e0642..bee95afff 100755 --- a/translations/deepin-reader_uk.ts +++ b/translations/deepin-reader_uk.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Переглядач документів - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Розташування - + Subject Тема - + Author Автор - + Keywords Ключові слова - + Producer Виготовлено - + Creator Створено у - + Time created Час створення - + Time modified Час внесення змін - + Format Формат - + Pages Сторінки - + Optimized З оптимізацією - + Security Безпека - + Page size Розмір сторінки - + File size Розмір файла - + + Warnings + + + + Basic info Базові відомості - + Unknown Невідомий - + Yes Так - + No Ні @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Додати закладку - + Are you sure you want to delete all bookmarks? Ви справді хочете вилучити усі закладки? @@ -121,119 +128,119 @@ BrowserMenu - - - + + + Copy Копіювати - + Remove annotation Вилучити анотацію - - - + + + Add annotation Додати анотацію - - - - + + + + Remove bookmark Вилучити закладку - - - - + + + + Add bookmark Додати закладку - + Highlight Підсвічування - + Remove highlight Вилучити підсвічування - - + + Search Пошук - - + + Exit fullscreen Звичайний режим - - + + Fullscreen На весь екран - - + + Slide show Показ слайдів - - + + First page Перша сторінка - - + + Previous page Попередня сторінка - - + + Next page Наступна сторінка - - + + Last page Остання сторінка - - + + Rotate left Обернути ліворуч - - + + Rotate right Обернути праворуч - - + + Print Надрукувати - - + + Document info Дані щодо документа @@ -241,7 +248,7 @@ Central - + Documents Документи @@ -249,49 +256,49 @@ CentralDocPage - + The format is not supported Підтримки формату не передбачено - + Open failed Не вдалося відкрити - + Please check if the file is damaged Будь ласка, перевірте, чи не пошкоджено файл - + Conversion failed, please check if the file is damaged Невдала спроба перетворення. Будь ласка, перевірте, чи не пошкоджено файл. - + Save failed Не вдалося зберегти - + Saved successfully Успішно збережено - + Save as Зберегти як - - + + Invalid file name Некоректна назва файла - - + + OK button Гаразд @@ -305,12 +312,12 @@ Сюди можна перетягти документи - + Format supported: %1 Підтримувані формати: %1 - + Select File Виберіть файл @@ -318,20 +325,20 @@ DocSheet - - + + The bookmark has been removed Закладку вилучено - - + + Please select the text Будь ласка, позначте текст - - + + The annotation has been removed Анотацію вилучено @@ -344,31 +351,62 @@ Зашифрований файл. Будь ласка, введіть пароль - + Password Пароль - + OK button Гаразд - + Wrong password Помилковий пароль + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Назад - + Next Далі @@ -389,12 +427,12 @@ NotesWidget - + Add annotation Додати анотацію - + Are you sure you want to delete all annotations? Ви справді хочете вилучити усі анотації? @@ -402,7 +440,7 @@ PagingWidget - + Invalid page number Некоректний номер сторінки @@ -423,38 +461,56 @@ Документ не збережено + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Зберегти зміни до «%1»? - + Cancel button Скасувати - + Discard button Відкинути - + Save button Зберегти - + Cancel Скасувати - + Delete Вилучити @@ -490,12 +546,12 @@ SearchResWidget - + No search results Нічого не знайдено - + %1 items found %1 записів знайдено @@ -551,188 +607,207 @@ ShortCutShow - + Settings Параметри - + Exit Вийти - + Help Довідка - + Page up Сторінка вгору - + Page down Сторінка вниз - + Open Відкрити - + Zoom in Збільшити - + Zoom out Зменшити - + Save as Зберегти як - + + File + + + + + Display + + + + + Tools + Інструменти + + + + Edit + + + + Print Надрукувати - + Save Зберегти - + Thumbnails Мініатюри - + 1:1 size Розмір 1:1 - + Fit height Підібрати за висотою - + Fit width Вмістити за шириною - + Rotate left Обернути ліворуч - + Rotate right Обернути праворуч - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Перейти на початок - + Move to the end Перейти на кінець - + Select text Вибрати текст - + Hand tool Інструмент «Рука» - + Add bookmark Додати закладку - + Delete Вилучити - + Magnifier Збільшувальне скло - + Slide show Показ слайдів - + Fullscreen На весь екран - + Copy Копіювати - + Cut Вирізати - + Paste Вставити - + Undo Скасувати - + Select all Позначити все - + Display shortcuts Показати клавіатурні скорочення - + Add annotation Додати анотацію - + Highlight Підсвічування - + Search Пошук @@ -740,23 +815,23 @@ SideBarImageListView - + Copy Копіювати - + Remove annotation Вилучити анотацію - - + + Remove all Вилучити усе - + Remove bookmark Вилучити закладку @@ -764,7 +839,7 @@ SideBarImageViewModel - + Page %1 Сторінка %1 @@ -772,12 +847,12 @@ SlidePlayWidget - + It is the first page Це перша сторінка - + It is the last page Це остання сторінка @@ -785,48 +860,48 @@ TitleMenu - + New window Нове вікно - + New tab Нова вкладка - - + + Save Зберегти - + Save as Зберегти як - + Display in file manager Показати у менеджері файлів - + Magnifer Збільшувальне скло - + Tools Інструменти - + Search Пошук - + Print Надрукувати @@ -834,7 +909,7 @@ TitleWidget - + Thumbnails Мініатюри @@ -847,28 +922,99 @@ Досягнуто межі вхідних даних + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Шлях до файла документа. - - + + FilePath Шлях до файла - + ThumbnailPath Path. Шлях до мініатюр. - + Generate thumbnail. Створити мініатюру. - \ No newline at end of file + diff --git a/translations/deepin-reader_ur.ts b/translations/deepin-reader_ur.ts index ca607138c..ba8482c9d 100644 --- a/translations/deepin-reader_ur.ts +++ b/translations/deepin-reader_ur.ts @@ -1,106 +1,113 @@ - + + + Application - + Document Viewer ڈاکیومٹ ویوئر - - Document Viewer is a tool for reading document files, supporting PDF, DJVU, DOCX etc. - ڈاکیومٹ ویوئر ایک ڈاکیومٹ فائل کے پڑھنے کے لئے ایک اداľ کے طور پر استعمال ہوتا ہے، جو PDF، DJVU، DOCX وغیرہ کو سپورٹ کرتا ہے۔ + + Document Viewer is a tool for reading document files, supporting %1. + AttrScrollWidget - + Location مقام - + Subject موضوع - + Author автор - + Keywords کیویورڈز - + Producer پروڈیوسر - + Creator کریٹر - + Time created ایجاد کی گئی تاریخ - + Time modified تبدیل کی گئی تاریخ - + Format فارمیٹ - + Pages صفحات - + Optimized اپٹمائزڈ - + Security سیکورٹی - + Page size صفحہ کا سائز - + File size فائل کا سائز - + + Warnings + + + + Basic info اولیا تفصیلات - + Unknown نامعلوم - + Yes ہاں - + No نہ @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark bookmark اضافہ کریں - + Are you sure you want to delete all bookmarks? کیا آپ تمام bookmarks حذف کرنے کے لئے یقین رکھتے ہیں؟ @@ -121,97 +128,119 @@ BrowserMenu - + + + Copy کاپی - + Remove annotation اےنوتیشن ہٹا دیں - + + + Add annotation اےنوتیشن اضافہ کریں - + + + + Remove bookmark bookmark ہٹا دیں - + + + + Add bookmark bookmark اضافہ کریں - + Highlight ہائیلائٹ کریں - + Remove highlight ہائیلائٹ ہٹا دیں - + + Search تلاش کریں - + + Exit fullscreen fullscreen سے باہر جانا - + + Fullscreen fullscreen - + + Slide show سلايد شو - + + First page پہلی صفحہ - + + Previous page پہلی صفحہ - + + Next page اگلی صفحہ - + + Last page آخری صفحہ - + + Rotate left بائیں کریں - + + Rotate right دیسی کریں - + + Print چھپائی - + + Document info ڈاکومنٹ ایڈیٹ @@ -219,7 +248,7 @@ Central - + Documents ڈاکومنٹس @@ -227,47 +256,49 @@ CentralDocPage - + The format is not supported فرمیٹ سپورٹ نہیں کیا جاسکتا - + Open failed open failed - + Please check if the file is damaged کیا فائل متاع کی ہے - + Conversion failed, please check if the file is damaged کنورٹیشن فیلڈ، کیا فائل متاع کی ہے - + Save failed بچانے میں کامیاب نہ ہو سکا - + Saved successfully کامیابی سے بچا دیا گیا - + Save as بچا کرے - + + Invalid file name غلط فائل نام - + + OK button ٹیک @@ -276,17 +307,17 @@ CentralNavPage - + Drag documents here ڈاکومنٹس یہاں ڈراگ کریں - + Format supported: %1 فرمیٹ سپورٹ ہے: %1 - + Select File فائل کا انتخاب کریں @@ -294,17 +325,20 @@ DocSheet - + + The bookmark has been removed bookmark ہٹا دیا گیا ہے - + + Please select the text کیا ٹیکسٹ کا انتخاب کریں - + + The annotation has been removed annotation ہٹا دیا گیا ہے @@ -312,36 +346,67 @@ EncryptionPage - + Encrypted file, please enter the password انکریپٹڈ فائل، پاس ورڈ داخل کریں - + Password پاس ورڈ - + OK button ٹیک - + Wrong password غلط پاسورڈ + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous پہلے - + Next اگلی @@ -349,12 +414,12 @@ HandleMenu - + Select Text ٹیکسٹ کا انتخاب کریں - + Hand Tool ہینڈ ٹول @@ -362,12 +427,12 @@ NotesWidget - + Add annotation Annotation اضافہ کریں - + Are you sure you want to delete all annotations? کیا آپ تمام اینوتیشن حذف کرنے کے لئے یقین رکھتے ہیں؟ @@ -375,7 +440,7 @@ PagingWidget - + Invalid page number غلط صفحہ نمبر @@ -383,7 +448,7 @@ ProgressDialog - + Converting کنورٹ کر رہے ہیں @@ -391,43 +456,61 @@ QObject - + Document not saved ڈاکیومنٹ نہیں بچا گیا + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - - Save the changes to "%1"? - "%1" میں تبدیلیوں کو بچا لیں؟ + + Save the changes to "%1"? + "%1" میں تبدیلیوں کو بچا لیں؟ - + Cancel button انسٹال کریں - + Discard button تھونڈ کریں - + Save button بچا لیں - + Cancel انسٹال کریں - + Delete حذف کریں @@ -435,27 +518,27 @@ ScaleMenu - + Two-Page View دو صفحہ نظر - + 1:1 size 1:1 سائز - + Fit Page صفحہ کے مطابق - + Fit Height آ高度 کے مطابق - + Fit Width چوڑائی کے مطابق @@ -463,36 +546,36 @@ SearchResWidget - + No search results تلاش کے نتائج نہیں ہیں - + %1 items found - '%1 آئٹم ملے ہیں' + '%1 آئٹم ملے ہیں' SecurityDialog - + This document is trying to connect to: یہ ڈاکیومنٹ کسی سے کنکشن کر رہا ہے: - + If you trust the website, click Allow, otherwise click Block. اگر آپ ویب سائٹ کو اعتماد کرتے ہیں، Allow کلک کریں، اوریں Block کلک کریں۔ - + Block button بک - + Allow button ایلائو @@ -501,22 +584,22 @@ SheetSidebar - + Thumbnails Thumbnail - + Catalog کیتالوج - + Bookmarks bookmark - + Annotations ملاحظات @@ -524,188 +607,207 @@ ShortCutShow - + Settings Settings - + Exit خراج - + Help مددہ - + Page up صفحہ اوپر - + Page down صفحہ نیچے - + Open open - + Zoom in Zoom داخل - + Zoom out Zoom باہر - + Save as ذخیرہ کریں جیسے - + + File + + + + + Display + + + + + Tools + ٹولز + + + + Edit + + + + Print چھپائی - + Save ذخیرہ کریں - + Thumbnails Thumbnail - + 1:1 size 1:1 سائز - + Fit height آسمان کی بلندی - + Fit width چوڑائی - + Rotate left چھوٹے چھوٹے چھوٹے - + Rotate right بڑے چھوٹے چھوٹے - + Move to the beginning شروع کریں - + Move to the end ختم کریں - + Scroll up one line ایک لائن اوپر اسکرول کریں - + Scroll down one line ایک لائن نیچے اسکرول کریں - - + Select text متن کا انتخاب کریں - + Hand tool ہینڈ ٹول - + Add bookmark bookmark اضافہ کریں - + Delete حذف - + Magnifier میگنیفائر - + Slide show سلاڈ شو - + Fullscreen فول سکرین - + Copy کاپی - + Cut کٹ - + Paste پیسٹ - + Undo انسخ - + Select all تم اختيار الكل - + Display shortcuts کٹ کریں نمایاں کریں - + Add annotation توضیح شامل کریں - + Highlight ہائی لائٹ کریں - + Search تلاش کریں @@ -713,22 +815,23 @@ SideBarImageListView - + Copy کاپی کریں - + Remove annotation توضیح ہٹا دیں - + + Remove all ہر چیز ہٹا دیں - + Remove bookmark bookmark ہٹا دیں @@ -736,7 +839,7 @@ SideBarImageViewModel - + Page %1 صفحہ %1 @@ -744,12 +847,12 @@ SlidePlayWidget - + It is the first page یہ پہلی صفحہ ہے - + It is the last page یہ آخری صفحہ ہے @@ -757,47 +860,48 @@ TitleMenu - + New window نیا ونڈو - + New tab نیا ٹیب - + + Save ذخیرہ کریں - + Save as ذخیرہ کریں جیسے - + Display in file manager فائل ڈیٹا کے ساتھ نمایاں کریں - + Magnifer میگنیفر - + Tools ٹولز - + Search تلاش کریں - + Print پرنٹ کریں @@ -805,7 +909,7 @@ TitleWidget - + Thumbnails thumbnail @@ -813,30 +917,100 @@ TransparentTextEdit - + Input limit reached آپ کی ورچو کی مقدار کا محدودیت حاصل ہو گئی ہے + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. ڈاکیومنٹ فائل پتہ. - + + FilePath فائل پتہ - + ThumbnailPath Path. thumbnailpath پتہ. - + Generate thumbnail. thumbnail تیار کریں۔ diff --git a/translations/deepin-reader_vi.ts b/translations/deepin-reader_vi.ts index b63156c02..43c6a7578 100644 --- a/translations/deepin-reader_vi.ts +++ b/translations/deepin-reader_vi.ts @@ -1,4 +1,6 @@ - + + + Application @@ -7,7 +9,7 @@ Xem tài liệu - + Document Viewer is a tool for reading document files, supporting %1. Document Viewer is a tool for reading document files, supporting %1. @@ -15,92 +17,97 @@ AttrScrollWidget - + Location Vị trí - + Subject Tiêu đề - + Author Tác giả - + Keywords Từ khóa - + Producer Nhà sản xuất - + Creator Tạo bởi - + Time created Thời gian tạo - + Time modified Thời gian sửa đổi - + Format Định dạng - + Pages Trang - + Optimized Được tối ưu hóa - + Security An toàn - + Page size Kích thước trang - + File size Kích thước tệp - + + Warnings + + + + Basic info Thông tin cơ bản - + Unknown Không rõ - + Yes Có - + No Không @@ -108,12 +115,12 @@ BookMarkWidget - + Add bookmark Thêm mốc - + Are you sure you want to delete all bookmarks? Bạn có chắc chắn muốn xóa tất cả các mốc không? @@ -122,119 +129,119 @@ BrowserMenu - - - + + + Copy Sao chép - + Remove annotation Xóa chú thích - - - + + + Add annotation Thêm chú thích - - - - + + + + Remove bookmark Xóa dấu trang收藏夹 - - - - + + + + Add bookmark Thêm dấu trang收藏夹 - + Highlight Đánh dấu - + Remove highlight Xóa đánh dấu - - + + Search Tìm kiếm - - + + Exit fullscreen Thoát khỏi màn hình toàn màn hình - - + + Fullscreen Màn hình toàn màn hình - - + + Slide show Hình ảnh di chuyển - - + + First page Trang đầu - - + + Previous page Trang trước - - + + Next page Trang tiếp theo - - + + Last page Trang cuối - - + + Rotate left Quay trái - - + + Rotate right Quay phải - - + + Print In - - + + Document info Thông tin tài liệu @@ -242,7 +249,7 @@ Central - + Documents Tài liệu @@ -250,49 +257,49 @@ CentralDocPage - + The format is not supported Định dạng không được hỗ trợ - + Open failed Không thể mở - + Please check if the file is damaged Vui lòng kiểm tra xem file có bị hỏng không - + Conversion failed, please check if the file is damaged Chuyển đổi thất bại, vui lòng kiểm tra xem file có bị hỏng không - + Save failed Không thể lưu - + Saved successfully Lưu thành công - + Save as Lưu dưới dạng - - + + Invalid file name Tên file không hợp lệ - - + + OK button OK @@ -306,12 +313,12 @@ Drag documents here - + Format supported: %1 Format supported: %1 - + Select File Select File @@ -319,20 +326,20 @@ DocSheet - - + + The bookmark has been removed The bookmark has been removed - - + + Please select the text Please select the text - - + + The annotation has been removed The annotation has been removed @@ -345,31 +352,62 @@ Encrypted file, please enter the password - + Password Password - + OK button OK - + Wrong password Wrong password + + EyeProtection + + + No eye protection + + + + + Classic eye protection + + + + + Green eye protection + + + + + Night eye protection + + + + + EyeProtectionAction + + + Eye protection mode + + + FindWidget - + Previous Previous - + Next Next @@ -390,12 +428,12 @@ NotesWidget - + Add annotation Thêm chú thích - + Are you sure you want to delete all annotations? Are you sure you want to delete all annotations? @@ -403,7 +441,7 @@ PagingWidget - + Invalid page number Invalid page number @@ -424,38 +462,56 @@ Document not saved + + RestoreTipWidget + + + Restored to last reading position + + + + + Jump to first page + + + + + Close + + + SaveDialog - + Save the changes to "%1"? Save the changes to "%1"? - + Cancel button Cancel - + Discard button Discard - + Save button Lưu - + Cancel Cancel - + Delete Xóa @@ -491,12 +547,12 @@ SearchResWidget - + No search results Không tìm thấy kết quả - + %1 items found %1 mục được tìm thấy @@ -552,188 +608,207 @@ ShortCutShow - + Settings Cài đặt - + Exit Thoát - + Help Trợ giúp - + Page up Trang trước - + Page down Trang sau - + Open Mở - + Zoom in Làm lớn - + Zoom out Làm nhỏ - + Save as Lưu lại dưới dạng - + + File + + + + + Display + + + + + Tools + Công cụ + + + + Edit + + + + Print Inpress - + Save Lưu - + Thumbnails Ảnh minh họa - + 1:1 size Kích thước 1:1 - + Fit height Đồ họa vừa cao độ màn hình - + Fit width Đồ họa vừa chiều rộng màn hình - + Rotate left xoay trái - + Rotate right xoay phải - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - - + Move to the beginning Di chuyển đến đầu - + Move to the end Di chuyển đến cuối - + Select text Chọn văn bản - + Hand tool Công cụ tay - + Add bookmark Thêm dấu truy cập - + Delete Xóa - + Magnifier Tăng kính - + Slide show Hình chiếu trượt - + Fullscreen Toàn màn hình - + Copy Sao chép - + Cut Cắt - + Paste Dán - + Undo Hủy bỏ - + Select all Chọn tất cả - + Display shortcuts Hiển thị phím tắt - + Add annotation Thêm chú thích - + Highlight Nhấn mạnh - + Search Tìm kiếm @@ -741,23 +816,23 @@ SideBarImageListView - + Copy Sao chép - + Remove annotation Xóa chú thích - - + + Remove all Xóa tất cả - + Remove bookmark Xóa dấu truy cập @@ -765,7 +840,7 @@ SideBarImageViewModel - + Page %1 Trang %1 @@ -773,12 +848,12 @@ SlidePlayWidget - + It is the first page Đây là trang đầu tiên - + It is the last page Đây là trang cuối cùng @@ -786,48 +861,48 @@ TitleMenu - + New window Mở cửa sổ mới - + New tab Mở tab mới - - + + Save Lưu - + Save as Lưu dưới dạng - + Display in file manager Hiển thị trong quản lý tệp - + Magnifer Kính lúp - + Tools Công cụ - + Search Tìm kiếm - + Print In @@ -835,7 +910,7 @@ TitleWidget - + Thumbnails Nhỏ hình ảnh @@ -848,28 +923,95 @@ Đạt giới hạn nhập liệu + + batchprint + + + CUPS is not available. Please check if the printing service is running. + + + + + No default printer found. Please set a default printer first. + + + + + Failed to convert file: %1 + + + + + Failed to print file: %1 + + + + + Batch Print + + + + + All %n file(s) printed successfully. + + + + + + + %1 file(s) printed successfully, %2 file(s) failed. + + + + + All %n file(s) failed to print. + + + + + + + Batch print documents silently + + + + + Document files to print + + + + + No files specified. + + + + + and %1 more file(s) failed. + + + main - + Document File Path. Đường dẫn tệp tài liệu. - - + + FilePath Đường dẫn tệp. - + ThumbnailPath Path. Đường dẫnThumbnailPath. - + Generate thumbnail. Tạo hình ảnh nhỏ. - \ No newline at end of file + diff --git a/translations/deepin-reader_zh_CN.ts b/translations/deepin-reader_zh_CN.ts index 85b2adc90..6f8d7cbb3 100755 --- a/translations/deepin-reader_zh_CN.ts +++ b/translations/deepin-reader_zh_CN.ts @@ -1,14 +1,15 @@ - + + Application - + Document Viewer 文档查看器 - + Document Viewer is a tool for reading document files, supporting %1. 文档查看器是一种用于阅读文档文件的工具,支持%1. @@ -16,96 +17,97 @@ AttrScrollWidget - + Location 位置 - + Subject 主题 - + Author 作者 - + Keywords 关键词 - + Producer 制作者 - + Creator 创建者 - + Time created 创建于 - + Time modified 修改于 - + Format 格式 - + Pages 页数 - + Optimized 优化 - + Security 安全性 - + Page size 页面大小 - + File size 文件大小 + Warnings 文档警告 - + Basic info 基本信息 - + Unknown 未知 - + Yes 是 - + No 否 @@ -113,12 +115,12 @@ BookMarkWidget - + Add bookmark 添加书签 - + Are you sure you want to delete all bookmarks? 您确定要删除所有书签吗? @@ -126,119 +128,119 @@ BrowserMenu - - - + + + Copy 复制 - + Remove annotation 删除注释 - - - + + + Add annotation 添加注释 - - - - + + + + Remove bookmark 删除书签 - - - - + + + + Add bookmark 添加书签 - + Highlight 高亮 - + Remove highlight 取消高亮 - - + + Search 搜索 - - + + Exit fullscreen 退出全屏 - - + + Fullscreen 全屏 - - + + Slide show 幻灯片放映 - - + + First page 第一页 - - + + Previous page 前一页 - - + + Next page 后一页 - - + + Last page 最后一页 - - + + Rotate left 左旋转 - - + + Rotate right 右旋转 - - + + Print 打印 - - + + Document info 文档信息 @@ -246,7 +248,7 @@ Central - + Documents 文档文件 @@ -254,49 +256,49 @@ CentralDocPage - + The format is not supported 不支持该文件格式 - + Open failed 打开失败 - + Please check if the file is damaged 请检查文件是否损坏 - + Conversion failed, please check if the file is damaged 转换失败,请检查文件是否损坏 - + Save failed 保存失败 - + Saved successfully 保存成功 - + Save as 另存为 - - + + Invalid file name 请输入有效的文件名 - - + + OK button 确 定 @@ -305,17 +307,17 @@ CentralNavPage - + Drag documents here 拖拽文件到此 - + Format supported: %1 支持格式:%1 - + Select File 选择文件 @@ -323,20 +325,20 @@ DocSheet - - + + The bookmark has been removed 已删除书签 - - + + Please select the text 请选择文本 - - + + The annotation has been removed 已删除注释 @@ -344,23 +346,23 @@ EncryptionPage - + Encrypted file, please enter the password 此文档已加密,请输入密码 - + Password 密码 - + OK button 确 定 - + Wrong password 密码错误 @@ -368,22 +370,22 @@ EyeProtection - + No eye protection 无护眼 - + Classic eye protection 经典护眼 - + Green eye protection 绿色护眼 - + Night eye protection 夜间护眼 @@ -391,7 +393,7 @@ EyeProtectionAction - + Eye protection mode 护眼模式 @@ -399,12 +401,12 @@ FindWidget - + Previous 上一个 - + Next 下一个 @@ -412,12 +414,12 @@ HandleMenu - + Select Text 选择工具 - + Hand Tool 手形工具 @@ -425,12 +427,12 @@ NotesWidget - + Add annotation 添加注释 - + Are you sure you want to delete all annotations? 您确定要删除所有注释吗? @@ -438,7 +440,7 @@ PagingWidget - + Invalid page number 请输入有效的页码 @@ -446,7 +448,7 @@ ProgressDialog - + Converting 正在转换 @@ -454,7 +456,7 @@ QObject - + Document not saved 文档未保存 @@ -462,17 +464,17 @@ RestoreTipWidget - + Restored to last reading position 已恢复上次阅读位置 - + Jump to first page 跳转到首页 - + Close 关闭 @@ -480,35 +482,35 @@ SaveDialog - - Save the changes to "%1"? + + Save the changes to "%1"? 是否保存对“%1”的编辑? - + Cancel button 取 消 - + Discard button 不保存 - + Save button 保 存 - + Cancel 取消 - + Delete 删除 @@ -516,27 +518,27 @@ ScaleMenu - + Two-Page View 双页显示 - + 1:1 size 默认大小 - + Fit Page 适合页面 - + Fit Height 适应高度 - + Fit Width 适应宽度 @@ -544,12 +546,12 @@ SearchResWidget - + No search results 无搜索结果 - + %1 items found %1个搜索结果 @@ -557,23 +559,23 @@ SecurityDialog - + This document is trying to connect to: 文档正在尝试链接至: - + If you trust the website, click Allow, otherwise click Block. 如果信任该网站,请点击“允许”,否则请选择“阻止”。 - + Block button 阻止 - + Allow button 允许 @@ -582,22 +584,22 @@ SheetSidebar - + Thumbnails 缩略图 - + Catalog 目录 - + Bookmarks 书签 - + Annotations 注释 @@ -605,207 +607,207 @@ ShortCutShow - + Settings 设置 - + Exit 退出 - + Help 帮助 - + Page up 上一页 - + Page down 下一页 - + Scroll up one line 上一行 - + Scroll down one line 下一行 - + Open 打开 - + Zoom in 放大 - + Zoom out 缩小 - + Save as 另存为 - + File 文件 - + Display 视图 - + Tools 工具 - + Edit 编辑 - + Print 打印 - + Save 保存 - + Thumbnails 缩略图 - + 1:1 size 默认大小 - + Fit height 适应高度 - + Fit width 适应宽度 - + Rotate left 左旋转 - + Rotate right 右旋转 - + Move to the beginning 定位至首页 - + Move to the end 定位至末尾 - + Select text 选择工具 - + Hand tool 手形工具 - + Add bookmark 添加书签 - + Delete 删除 - + Magnifier 放大镜 - + Slide show 幻灯片放映 - + Fullscreen 全屏 - + Copy 复制 - + Cut 剪切 - + Paste 粘贴 - + Undo 撤销 - + Select all 全选 - + Display shortcuts 显示快捷键 - + Add annotation 添加注释 - + Highlight 高亮 - + Search 搜索 @@ -813,23 +815,23 @@ SideBarImageListView - + Copy 复制 - + Remove annotation 删除注释 - - + + Remove all 全部删除 - + Remove bookmark 删除书签 @@ -837,7 +839,7 @@ SideBarImageViewModel - + Page %1 第%1页 @@ -845,12 +847,12 @@ SlidePlayWidget - + It is the first page 已是第一页 - + It is the last page 已是最后一页 @@ -858,48 +860,48 @@ TitleMenu - + New window 新窗口 - + New tab 新标签页 - - + + Save 保存 - + Save as 另存为 - + Display in file manager 在文件管理器中显示 - + Magnifer 放大镜 - + Tools 工具 - + Search 搜索 - + Print 打印 @@ -907,7 +909,7 @@ TitleWidget - + Thumbnails 缩略图 @@ -915,38 +917,100 @@ TransparentTextEdit - + Input limit reached 输入已达上限 + + batchprint + + + CUPS is not available. Please check if the printing service is running. + CUPS 不可用,请检查打印服务是否正在运行。 + + + + No default printer found. Please set a default printer first. + 未找到默认打印机,请先设置默认打印机。 + + + + Failed to convert file: %1 + 转换文件失败:%1 + + + + Failed to print file: %1 + 打印文件失败:%1 + + + + Batch Print + 批量打印 + + + + All %n file(s) printed successfully. + + 已成功打印全部 %n 个文件。 + + + + + %1 file(s) printed successfully, %2 file(s) failed. + %1 个文件打印成功,%2 个文件打印失败。 + + + + All %n file(s) failed to print. + + 全部 %n 个文件打印失败。 + + + + + Batch print documents silently + 静默批量打印文档 + + + + Document files to print + 要打印的文档文件 + + + + No files specified. + 未指定文件。 + + + + and %1 more file(s) failed. + 还有 %1 个文件打印失败。 + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - - - Batch print documents without UI. - 无界面批量打印文档。 - diff --git a/translations/deepin-reader_zh_HK.ts b/translations/deepin-reader_zh_HK.ts index 913799c59..c48ec2acf 100755 --- a/translations/deepin-reader_zh_HK.ts +++ b/translations/deepin-reader_zh_HK.ts @@ -9,7 +9,7 @@ 文檔查看器 - + Document Viewer is a tool for reading document files, supporting %1. 文件檢視器係一個用嚟閱讀文件嘅工具,支援%1. @@ -17,96 +17,97 @@ AttrScrollWidget - + Location 位置 - + Subject 主題 - + Author 作者 - + Keywords 關鍵詞 - + Producer 製作者 - + Creator 創建者 - + Time created 創建於 - + Time modified 修改於 - + Format 格式 - + Pages 頁數 - + Optimized 優化 - + Security 安全性 - + Page size 頁面大小 - + File size 文件大小 + Warnings 文件警告 - + Basic info 基本訊息 - + Unknown 未知 - + Yes 是 - + No 否 @@ -114,12 +115,12 @@ BookMarkWidget - + Add bookmark 添加書籤 - + Are you sure you want to delete all bookmarks? 您確定要刪除所有書籤嗎? @@ -127,119 +128,119 @@ BrowserMenu - - - + + + Copy 複製 - + Remove annotation 刪除注釋 - - - + + + Add annotation 添加注釋 - - - - + + + + Remove bookmark 刪除書籤 - - - - + + + + Add bookmark 添加書籤 - + Highlight 高亮 - + Remove highlight 取消高亮 - - + + Search 搜索 - - + + Exit fullscreen 退出全屏 - - + + Fullscreen 全屏 - - + + Slide show 幻燈片放映 - - + + First page 第一頁 - - + + Previous page 前一頁 - - + + Next page 後一頁 - - + + Last page 最後一頁 - - + + Rotate left 左旋轉 - - + + Rotate right 右旋轉 - - + + Print 打印 - - + + Document info 文檔訊息 @@ -247,7 +248,7 @@ Central - + Documents 文檔文件 @@ -255,49 +256,49 @@ CentralDocPage - + The format is not supported 不支持該文件格式 - + Open failed 打開失敗 - + Please check if the file is damaged 請檢查文件是否損壞 - + Conversion failed, please check if the file is damaged 轉換失敗,請檢查文件是否損壞 - + Save failed 保存失敗 - + Saved successfully 保存成功 - + Save as 另存為 - - + + Invalid file name 請輸入有效的文件名 - - + + OK button 確 定 @@ -311,12 +312,12 @@ 拖拽文件到此 - + Format supported: %1 支持格式:%1 - + Select File 選擇文件 @@ -324,20 +325,20 @@ DocSheet - - + + The bookmark has been removed 已刪除書籤 - - + + Please select the text 請選擇文本 - - + + The annotation has been removed 已刪除注釋 @@ -350,18 +351,18 @@ 此文檔已加密,請輸入密碼 - + Password 密碼 - + OK button 確 定 - + Wrong password 密碼錯誤 @@ -369,22 +370,22 @@ EyeProtection - + No eye protection 無護眼 - + Classic eye protection 經典護眼 - + Green eye protection 綠色護眼 - + Night eye protection 夜間護眼 @@ -392,7 +393,7 @@ EyeProtectionAction - + Eye protection mode 護眼模式 @@ -400,12 +401,12 @@ FindWidget - + Previous 上一個 - + Next 下一個 @@ -426,12 +427,12 @@ NotesWidget - + Add annotation 添加注釋 - + Are you sure you want to delete all annotations? 您確定要刪除所有注釋嗎? @@ -468,12 +469,12 @@ 已恢復上次閱讀位置 - + Jump to first page 跳轉到首頁 - + Close 關閉 @@ -545,12 +546,12 @@ SearchResWidget - + No search results 無搜索結果 - + %1 items found %1個搜索結果 @@ -814,23 +815,23 @@ SideBarImageListView - + Copy 複製 - + Remove annotation 刪除注釋 - - + + Remove all 全部刪除 - + Remove bookmark 刪除書籤 @@ -838,7 +839,7 @@ SideBarImageViewModel - + Page %1 第%1頁 @@ -846,12 +847,12 @@ SlidePlayWidget - + It is the first page 已是第一頁 - + It is the last page 已是最後一頁 @@ -870,7 +871,7 @@ - + Save 保存 @@ -890,17 +891,17 @@ 放大鏡 - + Tools 工具 - + Search 搜索 - + Print 打印 @@ -908,7 +909,7 @@ TitleWidget - + Thumbnails 打開目錄縮略圖 @@ -921,33 +922,95 @@ 輸入已達上限 + + batchprint + + + CUPS is not available. Please check if the printing service is running. + CUPS 不可用,請檢查打印服務是否正在運行。 + + + + No default printer found. Please set a default printer first. + 未找到默認打印機,請先設置默認打印機。 + + + + Failed to convert file: %1 + 轉換文件失敗:%1 + + + + Failed to print file: %1 + 打印文件失敗:%1 + + + + Batch Print + 批量打印 + + + + All %n file(s) printed successfully. + + 已成功打印全部 %n 個文件。 + + + + + %1 file(s) printed successfully, %2 file(s) failed. + %1 個文件打印成功,%2 個文件打印失敗。 + + + + All %n file(s) failed to print. + + 全部 %n 個文件打印失敗。 + + + + + Batch print documents silently + 靜默批量打印文檔 + + + + Document files to print + 要打印的文檔 + + + + No files specified. + 未指定文件。 + + + + and %1 more file(s) failed. + 還有 %1 個文件打印失敗。 + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - - - Batch print documents without UI. - 無介面批次列印文件。 - diff --git a/translations/deepin-reader_zh_TW.ts b/translations/deepin-reader_zh_TW.ts index 24a783ab8..eb5651f53 100755 --- a/translations/deepin-reader_zh_TW.ts +++ b/translations/deepin-reader_zh_TW.ts @@ -9,7 +9,7 @@ 文件查看器 - + Document Viewer is a tool for reading document files, supporting %1. 文件檢視器是一個用於閱讀檔案的工具,支援%1. @@ -17,96 +17,97 @@ AttrScrollWidget - + Location 位置 - + Subject 主題 - + Author 作者 - + Keywords 關鍵字 - + Producer 製作者 - + Creator 建立者 - + Time created 建立於 - + Time modified 修改於 - + Format 格式 - + Pages 頁數 - + Optimized 最佳化 - + Security 安全性 - + Page size 頁面大小 - + File size 檔案大小 + Warnings 文件警告 - + Basic info 基本訊息 - + Unknown 未知 - + Yes 是 - + No 否 @@ -114,12 +115,12 @@ BookMarkWidget - + Add bookmark 添加書籤 - + Are you sure you want to delete all bookmarks? 您確定要刪除所有書籤嗎? @@ -127,119 +128,119 @@ BrowserMenu - - - + + + Copy 複製 - + Remove annotation 刪除注釋 - - - + + + Add annotation 添加注釋 - - - - + + + + Remove bookmark 刪除書籤 - - - - + + + + Add bookmark 添加書籤 - + Highlight 突顯 - + Remove highlight 取消突顯 - - + + Search 搜尋 - - + + Exit fullscreen 退出全螢幕 - - + + Fullscreen 全螢幕 - - + + Slide show 幻燈片秀 - - + + First page 第一頁 - - + + Previous page 前一頁 - - + + Next page 後一頁 - - + + Last page 最後一頁 - - + + Rotate left 左旋轉 - - + + Rotate right 右旋轉 - - + + Print 列印 - - + + Document info 文件訊息 @@ -247,7 +248,7 @@ Central - + Documents 文件 @@ -255,49 +256,49 @@ CentralDocPage - + The format is not supported 不支援該檔案格式 - + Open failed 打開失敗 - + Please check if the file is damaged 請檢查文件是否損壞 - + Conversion failed, please check if the file is damaged 轉換失敗,請檢查文件是否損壞 - + Save failed 儲存失敗 - + Saved successfully 儲存成功 - + Save as 另存為 - - + + Invalid file name 請輸入有效的檔案名 - - + + OK button 確 定 @@ -311,12 +312,12 @@ 拖曳文件到此 - + Format supported: %1 支援格式:%1 - + Select File 選擇文件 @@ -324,20 +325,20 @@ DocSheet - - + + The bookmark has been removed 已刪除書籤 - - + + Please select the text 請選擇文字 - - + + The annotation has been removed 已刪除注釋 @@ -350,18 +351,18 @@ 此文件已加密,請輸入密碼 - + Password 密碼 - + OK button 確 定 - + Wrong password 密碼錯誤 @@ -369,22 +370,22 @@ EyeProtection - + No eye protection 無護眼 - + Classic eye protection 經典護眼 - + Green eye protection 綠色護眼 - + Night eye protection 夜間護眼 @@ -392,7 +393,7 @@ EyeProtectionAction - + Eye protection mode 護眼模式 @@ -400,12 +401,12 @@ FindWidget - + Previous 上一個 - + Next 下一個 @@ -426,12 +427,12 @@ NotesWidget - + Add annotation 添加注釋 - + Are you sure you want to delete all annotations? 您確定要刪除所有注釋嗎? @@ -468,12 +469,12 @@ 已恢復上次閱讀位置 - + Jump to first page 跳轉到首頁 - + Close 關閉 @@ -545,12 +546,12 @@ SearchResWidget - + No search results 无搜尋結果 - + %1 items found %1個搜尋結果 @@ -814,23 +815,23 @@ SideBarImageListView - + Copy 複製 - + Remove annotation 刪除注釋 - - + + Remove all 全部刪除 - + Remove bookmark 刪除書籤 @@ -838,7 +839,7 @@ SideBarImageViewModel - + Page %1 第%1頁 @@ -846,12 +847,12 @@ SlidePlayWidget - + It is the first page 已是第一頁 - + It is the last page 已是最後一頁 @@ -870,7 +871,7 @@ - + Save 儲存 @@ -890,17 +891,17 @@ 放大鏡 - + Tools 工具 - + Search 搜尋 - + Print 列印 @@ -908,7 +909,7 @@ TitleWidget - + Thumbnails 開啟目錄縮圖 @@ -921,33 +922,95 @@ 輸入已達上限 + + batchprint + + + CUPS is not available. Please check if the printing service is running. + CUPS 無法使用,請檢查列印服務是否正在執行。 + + + + No default printer found. Please set a default printer first. + 找不到預設印表機,請先設定預設印表機。 + + + + Failed to convert file: %1 + 轉換檔案失敗:%1 + + + + Failed to print file: %1 + 列印檔案失敗:%1 + + + + Batch Print + 批次列印 + + + + All %n file(s) printed successfully. + + 已成功列印全部 %n 個檔案。 + + + + + %1 file(s) printed successfully, %2 file(s) failed. + %1 個檔案列印成功,%2 個檔案列印失敗。 + + + + All %n file(s) failed to print. + + 全部 %n 個檔案列印失敗。 + + + + + Batch print documents silently + 靜默批次列印文件 + + + + Document files to print + 要列印的文件 + + + + No files specified. + 未指定檔案。 + + + + and %1 more file(s) failed. + 還有 %1 個檔案列印失敗。 + + main - + Document File Path. Document File Path. - - + + FilePath FilePath - + ThumbnailPath Path. ThumbnailPath Path. - + Generate thumbnail. Generate thumbnail. - - - Batch print documents without UI. - 無介面批次列印文件。 - From c2d5d9578a6a33f78349af2af7ebf293acdaa3f5 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Sun, 20 Sep 2026 14:00:22 +0800 Subject: [PATCH 42/63] chore: update version to 6.6.1 - bump version to 6.6.1 Log : bump version to 6.6.1 --- debian/changelog | 12 ++++++++++++ linglong.yaml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b5a48cac0..780ecd1bf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +deepin-reader (6.6.1) unstable; urgency=medium + + * fix(batchprint): send DBus notification with correct argument signature + * feat(build): add sources to rofd to support OFD + * fix(reader): guard null annotation and event pointers + * fix: guard null sidebar pointer in setAlive close path + * fix: replace unsafe strcpy with memcpy in setLibNames + * fix(reader): correct null-page guard operator in render callback slots + * chore: Update version to 6.6.0 + + -- xiepengfei Sun, 20 Sep 2026 13:59:56 +0800 + deepin-reader (6.6.0) unstable; urgency=medium * chore: Update version to 6.6.0 diff --git a/linglong.yaml b/linglong.yaml index 34b9cfd5f..c50bff9c2 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.6.0.1 + version: 6.6.1.1 kind: app description: | reader for deepin os. From 1ad0608ce26b3610c6191b5477c7e21941208a50 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Mon, 28 Sep 2026 13:26:41 +0800 Subject: [PATCH 43/63] chore: migrate linglong packaging to declarative buildext apt deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace manual apt download, install_dep, deploy_dep and .install generation with buildext.apt build_depends/depends declarations. 以声明式 buildext.apt 替代手动 apt 下载、install_dep/deploy_dep 与 .install 生成逻辑,构建期与运行期统一使用 runtime 层的 Qt。 Log: 迁移 linglong 打包依赖为声明式 buildext.apt Influence: 构建依赖与随包依赖改为 buildext 声明;Qt/DTK 改用 runtime 层 提供,不再捆绑 libqt6waylandclient6;pandoc 数据目录改为构建期显式复制; 已通过 ll-builder build 与运行容器 ldd/pandoc 自测验证。 --- linglong.yaml | 128 ++++++++++++++++++++++---------------------------- 1 file changed, 57 insertions(+), 71 deletions(-) diff --git a/linglong.yaml b/linglong.yaml index c50bff9c2..60bc32ef4 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -24,24 +24,9 @@ command: - deepin-reader build: | - # 下载和安装依赖 - # libqt6waylandclient6: libdtk6gui 的隐式依赖(未在 deb 声明),必须随 apt 的 Qt 6.8.0 一起打包, - # 否则链接时会拉取 /runtime 中 webengine 运行时的 libQt6WaylandClient,其私有 ABI 与打包的 Qt 不一致导致链接失败 - apt -y install --download-only qt6-base-dev qt6-base-dev-tools qt6-tools-dev libdtk6widget-dev libspectre-dev libdjvulibre-dev libtiff-dev libjpeg-dev libicu-dev libpng-dev zlib1g-dev liblcms2-dev libopenjp2-7-dev libfreetype6-dev libgtest-dev libchardet-dev qt6-webengine-dev qt6-5compat-dev libdtk6gui-dev libdtk6core-dev qt6-svg-dev pandoc libgxps-dev libcairo2-dev libglib2.0-dev libqt6waylandclient6 cargo rustc pkg-config libjbig2dec0-dev - # 供 rofd 源码构建使用:cargo/rustc 构建工具链;pkg-config 供 sys crate 探测系统库; - # libjbig2dec0-dev 对应 rofd-render 默认开启的 jbig2 特性(cairo/freetype/glib 的 -dev 已在上方列表中) - # libjbig2dec0 已被 base 安装,上面的 --download-only 不会下载其 deb,用 --reinstall - # 强制下载;注意必须先于下方 install_dep 执行,install_dep 才能在 archives 里找到它 - apt -y install --download-only --reinstall libjbig2dec0 - # 第三个参数强制安装 runtime 已提供的 libqt6waylandclient6;libjbig2dec0 是 rofd 的运行时 - # 依赖(jbig2 特性),base 虽自带,但为不随 base 组成变化而破,强制解压随包分发 - bash ./install_dep /var/cache/apt/archives "$PREFIX" "libqt6waylandclient6,libjbig2dec0" - - # cargo/rustc 等构建工具由 install_dep 解压到 $PREFIX,加入 PATH 供 rofd 构建调用 - export PATH="$PREFIX/bin:$PATH" - # ================= 从源码构建 rofd(OFD 支持库) ================= - # 源码来自上方 sources 段;crates.io 依赖由 Cargo.lock 固定,构建机需可访问 github 与 crates.io + # 源码来自上方 sources 段;crates.io 依赖由 Cargo.lock 固定,构建机需可访问 github 与 crates.io。 + # cargo/rustc 由 buildext.apt.build_depends 声明式安装(base 镜像自带 gcc/g++/cmake/make,无需声明)。 ROFD_SRC="" for d in /project/linglong/sources/rofd /project/sources/rofd /project/rofd /source/rofd; do if [ -f "$d/Cargo.toml" ] && [ -f "$d/crates/rofd-ffi/include/rofd.h" ]; then ROFD_SRC="$d"; break; fi @@ -61,76 +46,77 @@ build: | # 依赖它生效;--manifest-path 不参与配置查找,在 /project 下跑会走 crates.io 导致 CI 无外网时失败。 # 必须用子 shell:否则 cwd 停留在 rofd 目录,后续 build/ 与 cmake .. 等相对路径全部错位 (cd "$ROFD_SRC" && CARGO_TARGET_DIR=/tmp/rofd-build cargo build --release -p rofd-ffi) - # 安装到与 librofd-ffi0/librofd-ffi-dev deb 解包完全相同的布局(soname 由 rofd build.rs 固定为 librofd_ffi.so.0, - # deploy_dep 与主工程 CMake 的 find_path/find_library 依赖这些路径) + # 安装到与 librofd-ffi deb 相同的布局(soname 由 rofd build.rs 固定为 librofd_ffi.so.0, + # 主工程 CMake 的 find_path/find_library 依赖这些路径) ROFD_FFI_VER=$(sed -n 's/^version = "\(.*\)"/\1/p' "$ROFD_SRC/crates/rofd-ffi/Cargo.toml" | head -1) install -d -m 0755 $PREFIX/lib/${TRIPLET} $PREFIX/include install -m 0755 /tmp/rofd-build/release/librofd_ffi.so $PREFIX/lib/${TRIPLET}/librofd_ffi.so.$ROFD_FFI_VER ln -sf librofd_ffi.so.$ROFD_FFI_VER $PREFIX/lib/${TRIPLET}/librofd_ffi.so.0 ln -sf librofd_ffi.so.0 $PREFIX/lib/${TRIPLET}/librofd_ffi.so install -m 0644 "$ROFD_SRC/crates/rofd-ffi/include/rofd.h" $PREFIX/include/rofd.h - # 刷新 ld 缓存,保证后续 ldd/deploy_dep 能解析 $PREFIX 下 rofd 的运行时依赖(如 libjbig2dec) - if [ -n "$LINGLONG_LD_SO_CACHE" ]; then ldconfig -C "$LINGLONG_LD_SO_CACHE"; fi - # 构建(CMake) + # ================= pandoc 数据目录 ================= + # reader 以 --data-dir=${prefix}/share/pandoc/data 调用 pandoc;buildext.apt.depends 合并产物 + # 时仅收集 bin/sbin/lib,share/ 会被丢弃,故在构建期从 /usr/share 复制随包分发 + # (pandoc 本体经 buildext.apt.depends 声明式分发,其 libyaml/liblua 闭包由 apt 自动解析) + if [ ! -d /usr/share/pandoc/data ]; then + echo "ERROR: /usr/share/pandoc/data 不存在,pandoc 包布局与预期不符" >&2 + exit 1 + fi + mkdir -p ${PREFIX}/share + cp -a /usr/share/pandoc ${PREFIX}/share/pandoc + + # ================= 主工程(CMake) ================= + # Qt/DTK 开发文件由 runtime 层提供(挂载于 /runtime),经 CMAKE_PREFIX_PATH 探测: + # 构建期与运行期使用同一套 runtime Qt(含 waylandclient),不再需要打包 apt 的 + # libqt6waylandclient6 来规避 apt Qt 与 runtime Qt 混用导致的私有 ABI 链接失败。 + # pkg-config 探测的第三方 -dev 库由 buildext.apt.build_depends 安装到 /usr; + # 显式补充 PKG_CONFIG_PATH,确保 /usr 与 $PREFIX 下的 .pc 无论环境默认值如何均可见。 + export PKG_CONFIG_PATH="${PREFIX}/lib/${TRIPLET}/pkgconfig:/usr/lib/${TRIPLET}/pkgconfig:/usr/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" rm -rf build && mkdir -p build && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DCMAKE_INSTALL_LIBDIR=lib/${TRIPLET} \ - -DCMAKE_PREFIX_PATH=${PREFIX} \ + -DCMAKE_PREFIX_PATH="${PREFIX};/runtime" \ -DROFD_ROOT=${PREFIX} \ - -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}" \ - -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}" + -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" make -j$(nproc) make install > ../install.log 2>&1 - cd .. - - # 项目生成应用名和动态隐式加载的依赖库,ldd无法找到的其他库 - LDD_FILES=( - deepin-reader - deepin-reader-batchprint - ../lib/${TRIPLET}/deepin-reader/htmltopdf - pandoc - libdeepin-pdfium-reader.so - # dtk6gui 的隐式依赖,需打包与本体 Qt 版本一致的 waylandclient,避免运行时混用 /runtime 的 Qt - libQt6WaylandClient.so - # 定制插件不存在 - libzpdcallback.so - # OFD 支持库,sources 方式源码构建(soname 为 librofd_ffi.so.0,deploy_dep 的 .so 通配 - # 会同时收编 .so/.so.0/.so.);libjbig2dec 为 rofd 默认 jbig2 特性的运行时依赖, - # runtime(webengine) 不提供,必须随包分发 - librofd_ffi.so - libjbig2dec.so - ) - - # 生成.install 文件 - ID_VALUE=$(awk -F ': ' '/^ id: / {print $2}' linglong.yaml) - bash ./deploy_dep "${LDD_FILES[@]}" - - # lib/deepin-reader 文件添加到 install 文件 - for OTHER in "${PREFIX}"/lib/${TRIPLET}/deepin-reader/*; do - if [[ -f "$OTHER" ]]; then - echo "$OTHER" >> "${ID_VALUE}.install" - fi - done - - EXEC_FILES=( - pandoc - ) - # 添加额外依赖进程到 install 文件 - for EXEFILE in "${PREFIX}/bin"/${EXEC_FILES[@]}*; do - echo "$EXEFILE" >> "${ID_VALUE}.install" - done - - # pandoc data 文件添加到 install 文件 - find "${PREFIX}/share/pandoc/" -type f -o -type d >> "${ID_VALUE}.install" - - # 添加帮助手册到 install - find $PREFIX/share/deepin-manual/manual-assets/application/deepin-reader >> "${ID_VALUE}.install" -# allow apt download in build and do apt update +# 依赖声明:构建期依赖安装进构建容器(/usr);depends 在构建完成后安装并仅合并 +# bin/sbin/lib 进产物(share/ 不合并,需要的文件须在 build 中显式复制)。 +# 分类依据(base/runtime 包清单核对): +# - base 已提供运行库:libjbig2dec0、liblcms2-2、libopenjp2-7、libfreetype6、libcairo2、 +# libglib2.0-0、libjpeg62-turbo —— 不进 depends(depends 对 base 已有包是无效 no-op); +# - runtime 层提供 Qt/DTK 全套开发包(qt6-*-dev、libdtk6*-dev),经 /runtime 前缀探测, +# 不重复列入 build_depends;gcc/cmake/make 由 base 镜像自带,pkg-config 由 runtime 提供; +# - 旧列表中的 libspectre-dev/libicu-dev/libgtest-dev 工程内无对应探测,属冗余,剔除。 buildext: apt: build_depends: - - libc6 + # rofd(Rust)构建工具链,构建容器内不预置 + - cargo + - rustc + # 构建期取 /usr/share/pandoc 数据目录随包复制(见 build 段说明) + - pandoc + # pkg-config 探测的第三方开发库(.pc + 头文件) + - libjbig2dec0-dev # rofd 默认开启的 jbig2 特性 + - libdjvulibre-dev # reader: pkg_check_modules(ddjvuapi) + - libgxps-dev # reader: XPS(libgxps cairo glib gobject freetype2) + - libcairo2-dev # reader: XPS/OFD 的 cairo 探测 + - libglib2.0-dev # reader: glib-2.0/gobject-2.0 探测 + - libfreetype6-dev # reader: XPS 的 freetype2 探测 + - libjpeg-dev # reader: pkg_check_modules(libjpeg) + - libchardet-dev # 3rdparty/deepin-pdfium(vendored) + - liblcms2-dev # 3rdparty/deepin-pdfium(vendored) + - libopenjp2-7-dev # 3rdparty/deepin-pdfium(vendored) + - libicu-dev # 3rdparty/deepin-pdfium:pdfium 源码直接包含 , + # 无 pkg-config 探测故须显式声明 + depends: + # base 与 runtime 均不提供、必须随包分发的运行时依赖 + - pandoc # 文档转换子进程(libyaml-0-2/liblua5.3-0 等闭包由 apt 自动解析) + - libdjvulibre21 # reader DT_NEEDED libdjvulibre.so.21 + - libgxps2 # reader DT_NEEDED libgxps.so.2 + - libchardet1 # 3rdparty/deepin-pdfium DT_NEEDED libchardet.so.1 From 4cf24f8b3b92d96537e97295e06e883811da66fe Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 29 Sep 2026 13:31:12 +0800 Subject: [PATCH 44/63] test: add tests for deepin-reader batch 1 (7/7 classes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated by qt-autotest-generator skill. Batch 1: DocSheet, SideBarImageViewModel, Central, DBusObject, Utils, Model, ... Cumulative: 7/7 classes, 18/18 methods tested Baseline: master @ ad672ceb "chore: Update version to 6.6.2" (2026-09-29) Log: 新增 deepin-reader 单元测试 Influence: 新增 7 个类的单元测试,本批次覆盖率 18/18,累计覆盖率 18/18 PMS 补强(Mode 7→Mode 2):为 10 个 sev1/2 bug 的 18 个目标函数 生成 26 个 BUG_<场景> 回归用例,26/26 通过,全量 1226/1226 通过。 分布: - tests/uiframe/ut_docsheet.cpp +5(bugs 348017/106171/164325) - tests/sidebar/ut_sidebarimageviewmodel.cpp +9(bugs 343541/335473) - tests/uiframe/ut_central.cpp +2(bug 97761) - tests/app/ut_dbusobject.cpp +3(bug 312013) - tests/app/ut_utils.cpp +2(bug 218701) - tests/document/ut_model.cpp +3(bugs 332133/304083) - tests/document/ut_xpsmodel.cpp +2(bug 343541) 覆盖率(build-ut-coverage):lines 84.6%(13088/15465), functions 98.1%(1363/1389),18/18 目标函数 FNDA 全命中。 测试过程中新发现源码缺陷 3 个(记录留本地,不入库): 1. runtime: CentralDocPage::isFullScreen(:897)parentWidget 三级链无空守卫 2. logic: DocumentFactory::getDocument(Model.cpp:160)copy 失败分支 *pprocess 未置空 3. manual: calculateTimeout/getHtmlToPdfPath(Model.cpp:40/60)static 自由函数不可直测 注:PMS 工作单与缺陷记录留本地,不入库。 --- tests/app/ut_dbusobject.cpp | 64 +++++++++ tests/app/ut_utils.cpp | 24 ++++ tests/document/ut_model.cpp | 115 +++++++++++++++++ tests/document/ut_xpsmodel.cpp | 28 ++++ tests/sidebar/ut_sidebarimageviewmodel.cpp | 143 +++++++++++++++++++++ tests/uiframe/ut_central.cpp | 24 ++++ tests/uiframe/ut_docsheet.cpp | 71 ++++++++++ 7 files changed, 469 insertions(+) diff --git a/tests/app/ut_dbusobject.cpp b/tests/app/ut_dbusobject.cpp index 18a2e15aa..cc7efa328 100644 --- a/tests/app/ut_dbusobject.cpp +++ b/tests/app/ut_dbusobject.cpp @@ -8,6 +8,7 @@ #include "stub.h" #include +#include #include @@ -164,3 +165,66 @@ TEST_F(TestDBusObject, UT_DBusObject_handleFiles_002) delete g_mainWindow; } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +// PMS: https://pms.uniontech.com/bug-view-312013.html commit: c44cc7a0 +static QString g_lastAddFilePath; +// 成员函数桩经 ut-stub jmp 补丁以成员 ABI (this, path) 被调用,需双参接收 +void addFileCapture_stub(MainWindow *self, const QString &path) +{ + Q_UNUSED(self) + g_funcName = __FUNCTION__; + g_lastAddFilePath = path; +} + +// PMS: https://pms.uniontech.com/bug-view-312013.html commit: c44cc7a0 +TEST_F(TestDBusObject, BUG312013_handleFiles_urlConvertedToLocal) +{ + // 双击 pdf 无法查看修复(DBus 支持 URL 入参):file:// URL 必须转换为本地路径后打开 + Stub s; + s.set(ADDR(MainWindow, addFile), addFileCapture_stub); + s.set(ADDR(QWidget, show), show_stub); + s.set(static_cast(ADDR(MainWindow, createWindow)), createWindow_stub); + + m_tester->m_isBlockShutdown = true; + QString localPath = UTSOURCEDIR; + localPath += "/files/normal.pdf"; + QStringList filePathList = {QUrl::fromLocalFile(localPath).toString()}; + m_tester->handleFiles(filePathList); + EXPECT_EQ(g_lastAddFilePath, localPath); + delete g_mainWindow; +} + +// PMS: https://pms.uniontech.com/bug-view-312013.html commit: c44cc7a0 +TEST_F(TestDBusObject, BUG312013_handleFiles_alreadyOpenNoReadd) +{ + // 已打开文件(activateSheetIfExist 命中)不得重复入窗 + Stub s; + s.set(ADDR(MainWindow, addFile), addFileCapture_stub); + s.set(ADDR(QWidget, show), show_stub); + s.set(static_cast(ADDR(MainWindow, createWindow)), createWindow_stub); + s.set(ADDR(MainWindow, activateSheetIfExist), registerService_stub); // 任意返回 true 的 bool(const QString&) + + m_tester->m_isBlockShutdown = true; + QString localPath = UTSOURCEDIR; + localPath += "/files/normal.pdf"; + QStringList filePathList = {QUrl::fromLocalFile(localPath).toString()}; + g_lastAddFilePath.clear(); + m_tester->handleFiles(filePathList); + EXPECT_FALSE(g_funcName == QString("addFileCapture_stub")); + delete g_mainWindow; +} + +// PMS: https://pms.uniontech.com/bug-view-312013.html commit: c44cc7a0 +TEST_F(TestDBusObject, BUG312013_unBlockShutdown_repeatNoCrash) +{ + // DBus 入口修复涉及 unBlockShutdown:重复解除关机阻断不得崩溃 + Stub s; + s.set(ADDR(QDBusAbstractInterface, callWithArgumentList), callWithArgumentList_stub); + m_tester->blockShutdown(); + m_tester->unBlockShutdown(); + EXPECT_FALSE(m_tester->m_isBlockShutdown); + m_tester->unBlockShutdown(); + EXPECT_FALSE(m_tester->m_isBlockShutdown); +} diff --git a/tests/app/ut_utils.cpp b/tests/app/ut_utils.cpp index 5a64fa674..261589c8a 100644 --- a/tests/app/ut_utils.cpp +++ b/tests/app/ut_utils.cpp @@ -176,3 +176,27 @@ TEST_F(TestUtils, UT_Utils_setCurrentFilePath_001) EXPECT_TRUE(Utils::m_currenFilePath == "/test/path/file.pdf"); Utils::setCurrentFilePath(""); } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +// PMS: https://pms.uniontech.com/bug-view-218701.html commit: bb8f3e92 +TEST_F(TestUtils, BUG218701_roundQPixmap_nullInputGuard) +{ + // 复制文本修复涉及 roundQPixmap:空图输入必须返回空图不崩溃 + QPixmap in; + EXPECT_TRUE(Utils::roundQPixmap(in, 10).isNull()); +} + +// PMS: https://pms.uniontech.com/bug-view-218701.html commit: bb8f3e92 +TEST_F(TestUtils, BUG218701_roundQPixmap_validInputKeepsSize) +{ + // 有效图输入圆角处理:输出非空且保持原始尺寸,零半径退化场景不崩溃 + QPixmap in(100, 80); + QPixmap out = Utils::roundQPixmap(in, 12); + EXPECT_FALSE(out.isNull()); + EXPECT_EQ(out.size(), in.size()); + + QPixmap out0 = Utils::roundQPixmap(in, 0); + EXPECT_FALSE(out0.isNull()); + EXPECT_EQ(out0.size(), in.size()); +} diff --git a/tests/document/ut_model.cpp b/tests/document/ut_model.cpp index 73478dd9b..52ad73a8d 100644 --- a/tests/document/ut_model.cpp +++ b/tests/document/ut_model.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include using namespace deepin_reader; @@ -305,3 +307,116 @@ TEST(UT_DocumentBase, UT_Annotation_destructor_001) delete annot; delete dAnnot; } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +/* 说明:calculateTimeout / getHtmlToPdfPath 为 Model.cpp 文件内 static 自由函数, + * 无法从测试侧直接调用,经公开入口 DocumentFactory::getDocument 的 DOCX 转换管线 + * 间接驱动(管线内 calculateTimeout×3、getHtmlToPdfPath×1)。 + */ + +// PMS: https://pms.uniontech.com/bug-view-332133.html commit: b1746b32 +TEST(UT_DocumentFactory_getDocument, BUG332133_docxTimeout_dynamicTimeoutNoHang) +{ + // 大文件 docx 转换超时修复:动态超时(按 MB 计算)替代固定超时, + // 常规文件取基准超时且各阶段失败时优雅返回 ConvertFailed,不得挂起 + Stub s; + s.set(static_cast(ADDR(QFile, copy)), copy_stub); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + s.set(static_cast(ADDR(QProcess, start)), start_stub_qt6); +#else + s.set(static_cast(ADDR(QProcess, start)), start_stub); +#endif + Stub s1; + s1.set(ADDR(QProcess, waitForStarted), waitForStarted_true_stub); + s1.set(ADDR(QProcess, waitForFinished), waitForFinished_true_stub); + + int fileType = Dr::DOCX; + QString filePath = UTSOURCEDIR; + filePath += "/files/normal.docx"; + QString convertedFileDir = QCoreApplication::applicationDirPath(); + QString password; + QProcess p; + QProcess *process = &p; + Document::Error error = Document::NoError; + + Document *pdocument = DocumentFactory::getDocument(fileType, filePath, convertedFileDir, password, &process, error); + EXPECT_EQ(pdocument, nullptr); + EXPECT_EQ(error, Document::ConvertFailed); // word/ 目录未生成(unzip 桩不落盘) + EXPECT_EQ(process, nullptr); +} + +// PMS: https://pms.uniontech.com/bug-view-332133.html commit: b1746b32 +TEST(UT_DocumentFactory_getDocument, BUG332133_docxTimeout_overflowGuard) +{ + // 溢出保护:超大文件 sizeInMB 超过安全上限时超时取 MAX_TIMEOUT_MS, + // 不得整型溢出/崩溃(300MB 稀疏文件 > 各阶段 maxSafeSize:unzip 285/pandoc 108/htmltopdf 48) + QString bigPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/ut_big_sparse.docx"; + QFile bigFile(bigPath); + if (bigFile.exists()) + bigFile.remove(); + ASSERT_TRUE(bigFile.open(QIODevice::WriteOnly)); + ASSERT_TRUE(bigFile.resize(300LL * 1024 * 1024)); // 300MB 稀疏文件,瞬间创建 + bigFile.close(); + + Stub s; + s.set(static_cast(ADDR(QFile, copy)), copy_stub); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + s.set(static_cast(ADDR(QProcess, start)), start_stub_qt6); +#else + s.set(static_cast(ADDR(QProcess, start)), start_stub); +#endif + Stub s1; + s1.set(ADDR(QProcess, waitForStarted), waitForStarted_true_stub); + s1.set(ADDR(QProcess, waitForFinished), waitForFinished_true_stub); + + int fileType = Dr::DOCX; + QString convertedFileDir = QCoreApplication::applicationDirPath(); + QString password; + QProcess p; + QProcess *process = &p; + Document::Error error = Document::NoError; + + Document *pdocument = DocumentFactory::getDocument(fileType, bigPath, convertedFileDir, password, &process, error); + EXPECT_EQ(pdocument, nullptr); + EXPECT_EQ(error, Document::ConvertFailed); + EXPECT_EQ(process, nullptr); + + bigFile.remove(); +} + +// PMS: https://pms.uniontech.com/bug-view-304083.html commit: f260a63f +TEST(UT_DocumentFactory_getDocument, BUG304083_docxPipeline_gracefulFailNoCrash) +{ + // docx 打不开修复(getHtmlToPdfPath 多级路径查找):完整转换管线(unzip->pandoc->htmltopdf) + // 各阶段失败必须优雅返回不崩溃,getHtmlToPdfPath 真实路径查找正常执行 + Stub s; + s.set(static_cast(ADDR(QFile, copy)), copy_stub); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + s.set(static_cast(ADDR(QProcess, start)), start_stub_qt6); +#else + s.set(static_cast(ADDR(QProcess, start)), start_stub); +#endif + Stub s1; + s1.set(ADDR(QProcess, waitForStarted), waitForStarted_true_stub); + s1.set(ADDR(QProcess, waitForFinished), waitForFinished_true_stub); + Stub s2; + s2.set(static_cast(ADDR(QDir, exists)), exists_stub); + s2.set(static_cast(ADDR(QFile, exists)), exists_stub); + Stub s3; + s3.set(ADDR(PDFDocument, loadDocument), loadpdfDocument_stub); + + int fileType = Dr::DOCX; + QString filePath = UTSOURCEDIR; + filePath += "/files/normal.docx"; + QString convertedFileDir = QCoreApplication::applicationDirPath(); + QString password; + QProcess p; + QProcess *process = &p; + Document::Error error = Document::NoError; + + Document *pdocument = DocumentFactory::getDocument(fileType, filePath, convertedFileDir, password, &process, error); + EXPECT_EQ(pdocument, nullptr); + EXPECT_EQ(error, Document::FileError); // 转换产物加载失败(stub FileError) + EXPECT_EQ(process, nullptr); +} diff --git a/tests/document/ut_xpsmodel.cpp b/tests/document/ut_xpsmodel.cpp index 579948a4d..f98887635 100644 --- a/tests/document/ut_xpsmodel.cpp +++ b/tests/document/ut_xpsmodel.cpp @@ -492,3 +492,31 @@ TEST_F(TestXpsTextExtractor, parseGlyphsMissingOrigin) // Position is default-constructed QPointF. EXPECT_TRUE(info.position.isNull()); } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestXpsDocumentAdapter, BUG343541_renderPage_highDpiScaling) +{ + // XPS 渲染慢修复(cairo_matrix 高DPI 缩放):目标尺寸大于逻辑页尺寸时 + // 按 A4@300dpi 渲染不崩溃且尺寸精确 + ASSERT_GT(m_doc->pageCount(), 0); + QImage img = m_doc->renderPage(0, 2480, 3508, QRect()); + EXPECT_FALSE(img.isNull()); + EXPECT_EQ(img.size(), QSize(2480, 3508)); +} + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestXpsDocumentAdapter, BUG343541_renderPage_fixedSizeAndGuard) +{ + // 固定尺寸渲染与守卫补充:单维负值/负页码返回空图且不崩溃 + QImage img = m_doc->renderPage(0, 100, 100, QRect()); + EXPECT_FALSE(img.isNull()); + EXPECT_EQ(img.size(), QSize(100, 100)); + + // 单维负值(既有用例仅覆盖双负值与零值) + EXPECT_TRUE(m_doc->renderPage(0, -1, 100, QRect()).isNull()); + EXPECT_TRUE(m_doc->renderPage(0, 100, -1, QRect()).isNull()); + // 负页码(既有用例仅覆盖越界正页码) + EXPECT_TRUE(m_doc->renderPage(-1, 100, 100, QRect()).isNull()); +} diff --git a/tests/sidebar/ut_sidebarimageviewmodel.cpp b/tests/sidebar/ut_sidebarimageviewmodel.cpp index 1ce5ac713..7a3d28e94 100644 --- a/tests/sidebar/ut_sidebarimageviewmodel.cpp +++ b/tests/sidebar/ut_sidebarimageviewmodel.cpp @@ -7,11 +7,14 @@ #include "DocSheet.h" #include "SideBarImageViewModel.h" #include "PageRenderThread.h" +#include "PDFModel.h" +#include "dpdfannot.h" #include "stub.h" #include #include +#include #include class TestImagePageInfo_t : public ::testing::Test @@ -233,3 +236,143 @@ TEST_F(TestSideBarImageViewModel, testonBatchUpdateTimer) m_tester->onBatchUpdateTimer(); SUCCEED(); } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestSideBarImageViewModel, BUG343541_ctor_batchUpdateTimerConfigured) +{ + // XPS 渲染慢修复引入批量更新去抖:构造后批量刷新 timer 必须为 100ms 单次触发且未激活 + EXPECT_FALSE(m_tester->m_batchUpdateTimer->isActive()); + EXPECT_TRUE(m_tester->m_batchUpdateTimer->isSingleShot()); + EXPECT_EQ(m_tester->m_batchUpdateTimer->interval(), 100); +} + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestSideBarImageViewModel, BUG343541_ctor_nullSheetNoCrash) +{ + // 构造入参 sheet 允许为空(内部日志有指针守卫),不得崩溃 + SideBarImageViewModel model(nullptr); + EXPECT_TRUE(model.m_pagelst.isEmpty()); + EXPECT_EQ(model.rowCount(), 0); +} + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestSideBarImageViewModel, BUG343541_handleRenderThumbnail_batchDebounce) +{ + // 缩略图渲染去抖:连续渲染仅启动一次批量刷新 timer, + // timer 触发后发出 dataChanged 且待更新集合清空 + m_tester->initModelLst(QList() << ImagePageInfo_t(0) << ImagePageInfo_t(1), true); + m_tester->handleRenderThumbnail(0, QPixmap(10, 10), QVector() << QRectF(0, 0, 10, 10)); + m_tester->handleRenderThumbnail(1, QPixmap(10, 10), QVector() << QRectF(0, 0, 10, 10)); + EXPECT_TRUE(m_tester->m_pendingUpdatePages.contains(0)); + EXPECT_TRUE(m_tester->m_pendingUpdatePages.contains(1)); + EXPECT_TRUE(m_tester->m_batchUpdateTimer->isActive()); + + QSignalSpy spy(m_tester, &SideBarImageViewModel::dataChanged); + QTest::qWait(200); // timer 100ms 单次触发 onBatchUpdateTimer + EXPECT_GE(spy.count(), 1); + EXPECT_TRUE(m_tester->m_pendingUpdatePages.isEmpty()); + EXPECT_FALSE(m_tester->m_batchUpdateTimer->isActive()); +} + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestSideBarImageViewModel, BUG343541_onBatchUpdateTimer_emptyPendingNoCrash) +{ + // 空待更新集合直接批量刷新:提前返回,不崩溃且不发出 dataChanged + QSignalSpy spy(m_tester, &SideBarImageViewModel::dataChanged); + m_tester->onBatchUpdateTimer(); + EXPECT_EQ(spy.count(), 0); + EXPECT_TRUE(m_tester->m_pendingUpdatePages.isEmpty()); +} + +// PMS: https://pms.uniontech.com/bug-view-343541.html commit: a3cb6cff +TEST_F(TestSideBarImageViewModel, BUG343541_onBatchUpdateTimer_emitsDataChangedAndClears) +{ + // 批量刷新:待更新页映射为模型索引后按行序发出 dataChanged,集合清空 + m_tester->initModelLst(QList() << ImagePageInfo_t(2) << ImagePageInfo_t(0), true); + m_tester->m_pendingUpdatePages.insert(0); + m_tester->m_pendingUpdatePages.insert(2); + QSignalSpy spy(m_tester, &SideBarImageViewModel::dataChanged); + m_tester->onBatchUpdateTimer(); + EXPECT_GE(spy.count(), 2); + EXPECT_TRUE(m_tester->m_pendingUpdatePages.isEmpty()); +} + +// PMS: https://pms.uniontech.com/bug-view-335473.html commit: b8625f70 +TEST_F(TestSideBarImageViewModel, BUG335473_findItemForAnno_boundaryLookup) +{ + // 注释拖动崩溃修复(移除不安全的 QObject* 日志):注释查找必须返回边界值不崩溃 + // 列表内空注释命中索引 0;不存在的注释返回 -1;空列表返回 -1 + ImagePageInfo_t info; + info.pageIndex = 0; + info.annotation = nullptr; + m_tester->initModelLst(QList() << info, true); + EXPECT_EQ(m_tester->findItemForAnno(nullptr), 0); + + DPdfTextAnnot dAnnot; + deepin_reader::PDFAnnotation annot(&dAnnot); + EXPECT_EQ(m_tester->findItemForAnno(&annot), -1); + + m_tester->resetData(); + EXPECT_EQ(m_tester->findItemForAnno(nullptr), -1); +} + +// PMS: https://pms.uniontech.com/bug-view-335473.html commit: b8625f70 +TEST_F(TestSideBarImageViewModel, BUG335473_removeItemForAnno_idempotentNoCrash) +{ + // 注释拖动崩溃修复:移除存在的注释生效,重复移除(索引 -1 守卫)不崩溃 + DPdfTextAnnot dAnnot; + deepin_reader::PDFAnnotation annot(&dAnnot); + ImagePageInfo_t info; + info.pageIndex = 0; + info.annotation = &annot; + m_tester->initModelLst(QList() << info, true); + EXPECT_EQ(m_tester->m_pagelst.count(), 1); + + m_tester->removeItemForAnno(&annot); + EXPECT_TRUE(m_tester->m_pagelst.isEmpty()); + + m_tester->removeItemForAnno(&annot); + EXPECT_TRUE(m_tester->m_pagelst.isEmpty()); + + m_tester->removeItemForAnno(nullptr); + EXPECT_TRUE(m_tester->m_pagelst.isEmpty()); +} + +// PMS: https://pms.uniontech.com/bug-view-335473.html commit: b8625f70 +TEST_F(TestSideBarImageViewModel, BUG335473_removePageIndex_idempotentNoCrash) +{ + // 页码移除:存在的页移除生效,不存在的页仅告警,重复移除不崩溃 + m_tester->initModelLst(QList() << ImagePageInfo_t(0) << ImagePageInfo_t(1), true); + EXPECT_EQ(m_tester->m_pagelst.count(), 2); + + m_tester->removePageIndex(0); + EXPECT_EQ(m_tester->m_pagelst.count(), 1); + + m_tester->removePageIndex(99); + EXPECT_EQ(m_tester->m_pagelst.count(), 1); + + m_tester->removePageIndex(1); + EXPECT_TRUE(m_tester->m_pagelst.isEmpty()); +} + +// PMS: https://pms.uniontech.com/bug-view-335473.html commit: b8625f70 +TEST_F(TestSideBarImageViewModel, BUG335473_getModelIndexImageInfo_boundaryGuard) +{ + // 模型索引信息获取:有效索引填充数据,越界索引守卫不修改不崩溃 + m_tester->initModelLst(QList() << ImagePageInfo_t(3), true); + + ImagePageInfo_t info; + info.pageIndex = -1; + m_tester->getModelIndexImageInfo(0, info); + EXPECT_EQ(info.pageIndex, 3); + + ImagePageInfo_t untouched; + untouched.pageIndex = 42; + m_tester->getModelIndexImageInfo(-1, untouched); + EXPECT_EQ(untouched.pageIndex, 42); + + m_tester->getModelIndexImageInfo(m_tester->m_pagelst.size(), untouched); + EXPECT_EQ(untouched.pageIndex, 42); +} diff --git a/tests/uiframe/ut_central.cpp b/tests/uiframe/ut_central.cpp index de047c1be..4f638eb01 100644 --- a/tests/uiframe/ut_central.cpp +++ b/tests/uiframe/ut_central.cpp @@ -649,3 +649,27 @@ TEST_F(TestCentral, UT_Central_closeRestoreTip_lambda_001) emit tip->sigCloseRestoreTip(); SUCCEED(); } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +// PMS: https://pms.uniontech.com/bug-view-97761.html commit: f1be9fc9 +TEST_F(TestCentral, BUG97761_docPage_lazyCreationStable) +{ + // wayland 选择界面外菜单点击无效修复涉及 docPage:懒创建必须幂等, + // 二次调用返回同实例(不得重复创建导致菜单信号失联) + CentralDocPage *first = m_tester->docPage(); + ASSERT_NE(first, nullptr); + EXPECT_EQ(m_tester->docPage(), first); + EXPECT_EQ(m_tester->docPage(), first); +} + +// PMS: https://pms.uniontech.com/bug-view-97761.html commit: f1be9fc9 +TEST_F(TestCentral, BUG97761_docPage_signalsWiredNoCrash) +{ + // docPage 创建后信号槽接线完成:发出页数变化信号不得崩溃 + CentralDocPage *page = m_tester->docPage(); + ASSERT_NE(page, nullptr); + emit page->sigSheetCountChanged(0); + emit page->sigSheetCountChanged(1); + SUCCEED(); +} diff --git a/tests/uiframe/ut_docsheet.cpp b/tests/uiframe/ut_docsheet.cpp index 5a9370a78..dbe721c0d 100644 --- a/tests/uiframe/ut_docsheet.cpp +++ b/tests/uiframe/ut_docsheet.cpp @@ -1780,3 +1780,74 @@ TEST_F(TestDocSheet, UT_DocSheet_onPrintRequested_singleArg_lambda) m_tester->m_fileType = Dr::PDF; SUCCEED(); } + +/* ========== PMS 回归用例(sev1/2 bug 补强,批次1) ========== */ + +// PMS: https://pms.uniontech.com/bug-view-348017.html commit: da254c72 +TEST_F(TestDocSheet, BUG348017_setAlive_registerUnregisterUuid) +{ + // 打印乱码/空白修复涉及 setAlive 状态机:反复激活/注销时 uuid 注册必须一致, + // 激活后可查询到 uuid,注销后 uuid 清空,重复切换不崩溃 + m_tester->setAlive(true); + EXPECT_FALSE(DocSheet::getUuid(m_tester).isNull()); + + m_tester->setAlive(false); + EXPECT_TRUE(DocSheet::getUuid(m_tester).isNull()); + + // 重复激活(setAlive(true) 内部先注销旧 uuid 再注册新 uuid) + m_tester->setAlive(true); + EXPECT_FALSE(DocSheet::getUuid(m_tester).isNull()); + + m_tester->setAlive(false); + EXPECT_TRUE(DocSheet::getUuid(m_tester).isNull()); +} + +// PMS: https://pms.uniontech.com/bug-view-106171.html commit: 17dbeb2d +TEST_F(TestDocSheet, BUG106171_scaleFactorList_containsDefaultAscending) +{ + // 打印预览空白修复涉及 scaleFactorList:列表非空、升序、含默认 1.0, + // 且所有因子不超过文档最大缩放比例 + QList list = m_tester->scaleFactorList(); + EXPECT_FALSE(list.isEmpty()); + EXPECT_TRUE(list.contains(1.0)); + for (int i = 1; i < list.size(); ++i) { + EXPECT_TRUE(list.at(i) > list.at(i - 1)) << "factor list must be ascending"; + } + EXPECT_TRUE(list.last() <= m_tester->maxScaleFactor() + 0.0001); + EXPECT_TRUE(list.first() > 0); +} + +// PMS: https://pms.uniontech.com/bug-view-164325.html commit: 894b5c56 +TEST_F(TestDocSheet, BUG164325_setSidebarVisible_notifyToggleNoCrash) +{ + // 大量注释 ctrl+s 保存崩溃修复涉及 setSidebarVisible:notify=true 双向显隐切换不得崩溃 + // (isFullScreen 需 3 级父链,测试环境无完整层级,同 UT_002 桩掉) + Stub s; + s.set(ADDR(DocSheet, isFullScreen), isFullScreen_stub); + m_tester->setSidebarVisible(true, true); + m_tester->setSidebarVisible(false, true); + m_tester->setSidebarVisible(true, true); + m_tester->setSidebarVisible(false, true); + SUCCEED(); +} + +// PMS: https://pms.uniontech.com/bug-view-164325.html commit: 894b5c56 +TEST_F(TestDocSheet, BUG164325_setSidebarVisible_animationToggleNoCrash) +{ + // notify=false 走 QPropertyAnimation 动画路径:重复触发动画不得崩溃 + // (Running 且目标一致时直接返回,目标变化时重启动画) + Stub s; + s.set(ADDR(DocSheet, isFullScreen), isFullScreen_stub); + m_tester->setSidebarVisible(true, false); + m_tester->setSidebarVisible(false, false); + m_tester->setSidebarVisible(false, false); + m_tester->setSidebarVisible(true, false); + SUCCEED(); +} + +// PMS: https://pms.uniontech.com/bug-view-106171.html commit: 17dbeb2d +TEST_F(TestDocSheet, BUG106171_removeAllAnnotation_emptySheetSucceeds) +{ + // 打印预览空白修复涉及 removeAllAnnotation:无注释文档移除仍返回成功且不崩溃 + EXPECT_TRUE(m_tester->removeAllAnnotation()); +} From b6349b0a5eb4f90b13014110a01886b497b675e4 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 29 Sep 2026 11:07:50 +0800 Subject: [PATCH 45/63] chore: Update version to 6.6.2 - update version to 6.6.2 log: update version to 6.6.2 --- debian/changelog | 7 +++++++ linglong.yaml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 780ecd1bf..90ebd86ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +deepin-reader (6.6.2) unstable; urgency=medium + + * chore: Update version to 6.6.2 + * chore: migrate linglong packaging to declarative buildext apt deps + + -- zhanghongyuan Tue, 29 Sep 2026 11:07:42 +0800 + deepin-reader (6.6.1) unstable; urgency=medium * fix(batchprint): send DBus notification with correct argument signature diff --git a/linglong.yaml b/linglong.yaml index 60bc32ef4..6eb1e935d 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.6.1.1 + version: 6.6.2.1 kind: app description: | reader for deepin os. From 9e1f6ad5a4501c1b442fc30a2db73faa8e708395 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 30 Sep 2026 16:14:53 +0800 Subject: [PATCH 46/63] fix: clear *pprocess when file copy fails in DocumentFactory::getDocument Every other error branch of getDocument() sets *pprocess = nullptr before returning, but the QFile::copy() failure path left the output parameter untouched, so callers relying on *process == nullptr could read a stale pointer. Align the branch with the rest. Log: Influence: document opening --- reader/document/Model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/reader/document/Model.cpp b/reader/document/Model.cpp index 03b981f72..09dbd8718 100644 --- a/reader/document/Model.cpp +++ b/reader/document/Model.cpp @@ -160,6 +160,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & if (!file.copy(targetDoc)) { qCritical() << "Failed to copy file from" << filePath << "to" << targetDoc; error = deepin_reader::Document::ConvertFailed; + *pprocess = nullptr; return nullptr; } From 9061ecbe9b1908314a57bf354ca2ed775a5bdfcc Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 30 Sep 2026 16:14:34 +0800 Subject: [PATCH 47/63] fix: walk the parent chain safely in CentralDocPage isFullScreen()/openFullScreen()/quitFullScreen()/onSheetCountChanged() called parentWidget()->parentWidget()->parentWidget() unchecked; if the widget has fewer than three levels of parents (embedded use, tests) the chain dereferences a null QWidget and crashes. The existing null check only covered the final dynamic_cast result. Replace the chained calls with a parentMainWindow() helper that stops at the first null level. Log: Influence: doc page fullscreen handling --- reader/uiframe/CentralDocPage.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/reader/uiframe/CentralDocPage.cpp b/reader/uiframe/CentralDocPage.cpp index 4cd838bbb..94dc67f64 100644 --- a/reader/uiframe/CentralDocPage.cpp +++ b/reader/uiframe/CentralDocPage.cpp @@ -891,10 +891,22 @@ void CentralDocPage::prepareSearch() docSheet->prepareSearch(); } +// Walk up the fixed three-level parent chain safely: parentWidget() may +// return nullptr at any level (embedded or test environments), and calling +// parentWidget() on a null pointer crashes. +static MainWindow *parentMainWindow(CentralDocPage *page) +{ + QWidget *widget = page; + for (int i = 0; i < 3 && widget != nullptr; ++i) { + widget = widget->parentWidget(); + } + return widget != nullptr ? dynamic_cast(widget) : nullptr; +} + bool CentralDocPage::isFullScreen() { // qCInfo(appLog) << "isFullScreen"; - MainWindow *mainWindow = dynamic_cast(parentWidget()->parentWidget()->parentWidget()); + MainWindow *mainWindow = parentMainWindow(this); if (nullptr == mainWindow) return false; @@ -905,7 +917,7 @@ bool CentralDocPage::isFullScreen() void CentralDocPage::openFullScreen() { qCInfo(appLog) << "openFullScreen"; - MainWindow *mainWindow = dynamic_cast(parentWidget()->parentWidget()->parentWidget()); + MainWindow *mainWindow = parentMainWindow(this); if (nullptr == mainWindow) return; @@ -925,7 +937,7 @@ void CentralDocPage::openFullScreen() bool CentralDocPage::quitFullScreen(bool force) { qCInfo(appLog) << "quitFullScreen"; - MainWindow *mainWindow = dynamic_cast(parentWidget()->parentWidget()->parentWidget()); + MainWindow *mainWindow = parentMainWindow(this); if (nullptr == mainWindow) return false; @@ -973,7 +985,7 @@ void CentralDocPage::onSheetCountChanged(int count) m_tabBar->setVisible(true); } - MainWindow *mainWindow = dynamic_cast(parentWidget()->parentWidget()->parentWidget()); + MainWindow *mainWindow = parentMainWindow(this); if (mainWindow && mainWindow->isFullScreen()) { qCInfo(appLog) << "mainWindow && mainWindow->isFullScreen()"; From 97457f86c1f1e075da6393eb346c84edb41e22c3 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Fri, 9 Oct 2026 09:29:49 +0800 Subject: [PATCH 48/63] fix: correct batch print context menu text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: context-menu config used "Batch Print" without "Document Viewer" prefix; zh_CN/zh_HK/zh_TW all showed "批量打印" missing the required prefix per spec 2. Fix: update Name and Name[locale] fields in deepin-reader-batchprint.conf to match required text 3. Impact: only menu display text changes, no logic affected Log: Updated batch print menu text to include Document Viewer Influence: 1. Verify right-click menu on PDF shows correct text in zh_CN 2. Verify English locale shows "Batch Print with Document Viewer" 3. Verify zh_HK and zh_TW show correct traditional Chinese text fix: 修正批量打印右键菜单文案 1. 根因:右键菜单配置文件中 Name 字段为"批量打印"/"Batch Print", 缺少"使用文档查看器"前缀,与需求文案不一致 2. 方案:修改 deepin-reader-batchprint.conf 中 Name 及各 locale 字段, 使文案与需求一致 3. 影响:仅菜单显示文案变化,不涉及任何逻辑改动 Log: 修正右键菜单批量打印文案为"使用文档查看器批量打印" Influence: 1. 验证右键PDF文件菜单显示"使用文档查看器批量打印" 2. 验证英文环境下显示"Batch Print with Document Viewer" 3. 验证繁体中文环境显示正确的繁体文案 PMS: BUG-378359 --- src/context-menus/deepin-reader-batchprint.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/context-menus/deepin-reader-batchprint.conf b/src/context-menus/deepin-reader-batchprint.conf index b8f498f5d..b4e33bce8 100644 --- a/src/context-menus/deepin-reader-batchprint.conf +++ b/src/context-menus/deepin-reader-batchprint.conf @@ -5,12 +5,12 @@ Version=1.0 [Menu Action Zero] Exec=deepin-reader-batchprint %F MimeType=application/pdf:application/vnd.openxmlformats-officedocument.wordprocessingml.document:application/wps-office.docx:image/vnd.djvu:application/vnd.ms-xpsdocument:application/oxps -Name=Batch Print +Name=Batch Print with Document Viewer PosNum=6 Separator=Top X-DFM-ExcludeMimeTypes=inode/directory:application/x-desktop X-DFM-MenuTypes=SingleFile:MultiFiles X-DFM-SupportSchemes=file -Name[zh_CN]=批量打印 -Name[zh_HK]=批量打印 -Name[zh_TW]=批量打印 +Name[zh_CN]=使用文档查看器批量打印 +Name[zh_HK]=使用文檔查看器批量打印 +Name[zh_TW]=使用文件查看器批量打印 From 78314f44b466532dc0b1286ae0e4a8a0f9ca67a8 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Fri, 9 Oct 2026 09:46:06 +0800 Subject: [PATCH 49/63] test: add tests for deepin-reader batch 2 (20 bugs, 38 cases) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated by qt-autotest-generator skill (PMS mining, Mode 7 -> Mode 2). Batch 2: SheetBrowser, BrowserPage, BrowserWord, BookMarkWidget, CentralDocPage, DocTabBar, TitleWidget, Application, PDFModel/DPdfDoc. Baseline: master @ 9061ecbe "fix: walk the parent chain safely in CentralDocPage" (2026-10-08) Log: 补充 deepin-reader PMS 批次 2 单元测试(38 个回归用例) Influence: 新增 20 个 sev1/2 bug 的回归用例 38 个,38/38 通过; 全量 1264 用例 1263 通过(1 个存量 flaky 与本批次无关) 依据 PMS bug 修复历史补强,按文件分布: - tests/document/ut_pdfmodel.cpp +10 (46911/54210/68550/304111/ 304471/351271/353429) - tests/browser/ut_sheetbrowser.cpp +10 (22093/43216/44136/44264/ 44491/41018) - tests/sidebar/ut_bookmarkwidget.cpp +5 (10332/12219) - tests/uiframe/ut_centraldocpage.cpp +3 (20978) - tests/ut_application.cpp +3 (44137/44264) - tests/browser/ut_browserword.cpp +2 (40946) - tests/browser/ut_browserpage.cpp +2 (25004) - tests/uiframe/ut_doctabbar.cpp +2 (46381) - tests/uiframe/ut_titlewidget.cpp +1 (44136) 覆盖率(lcov, reader/ 范围):lines 84.7% (13106/15471), functions 98.1% (1364/1390);21/21 目标函数 FNDA 全命中。 另 2 个 bug(102352/347387)位于 htmltopdf main() 内 __sw_64__ 条件编译,x86 构建不可达,需申威环境手工验证。 测试中新发现的源码缺陷留本地记录,不入库。 --- tests/browser/ut_browserpage.cpp | 57 +++++++ tests/browser/ut_browserword.cpp | 36 ++++ tests/browser/ut_sheetbrowser.cpp | 252 ++++++++++++++++++++++++++++ tests/document/ut_pdfmodel.cpp | 195 +++++++++++++++++++++ tests/sidebar/ut_bookmarkwidget.cpp | 88 ++++++++++ tests/uiframe/ut_centraldocpage.cpp | 65 +++++++ tests/uiframe/ut_doctabbar.cpp | 43 +++++ tests/uiframe/ut_titlewidget.cpp | 40 +++++ tests/ut_application.cpp | 42 +++++ 9 files changed, 818 insertions(+) diff --git a/tests/browser/ut_browserpage.cpp b/tests/browser/ut_browserpage.cpp index f5171d532..0808763d5 100644 --- a/tests/browser/ut_browserpage.cpp +++ b/tests/browser/ut_browserpage.cpp @@ -866,3 +866,60 @@ TEST_F(TestBrowserPage, UT_BrowserPage_applyNightMode_001) EXPECT_EQ(qGreen(darkPixel), 255); EXPECT_EQ(qBlue(darkPixel), 255); } + +// ==================== PMS 批次 2 补强 ==================== +// BUG25004 (sev2): 页面旋转后点击/注释坐标映射错乱。 +// 回归意图: BrowserPage 的旋转态坐标换算必须自洽: +// getTopLeftPos 在 90°/270° 下 x/y 轴互换(旋转感知); +// translateRect 对 0°/180° 仅缩放、对 90°/270° 缩放+轴互换, 且与 +// getNorotateRect 构成可用互逆链(注释框回归文档坐标系)。 + +TEST_F(TestBrowserPage, BUG25004_rotationSwapsAxesInTopLeftPos) +{ + Stub s; + s.set(ADDR(BrowserPage, rect), rect_stub); + s.set(ADDR(QGraphicsItem, pos), pos_stub); + + // 旋转 90°: x 轴偏移翻负; 旋转 270°: y 轴偏移翻负 (轴互换语义) + m_tester->m_rotation = Dr::RotateBy90; + QPointF pos90 = m_tester->getTopLeftPos(); + m_tester->m_rotation = Dr::RotateBy0; + QPointF pos0 = m_tester->getTopLeftPos(); + m_tester->m_rotation = Dr::RotateBy270; + QPointF pos270 = m_tester->getTopLeftPos(); + + EXPECT_LT(pos90.x(), pos0.x()); + EXPECT_LT(pos270.y(), pos0.y()); +} + +TEST_F(TestBrowserPage, BUG25004_translateRectRoundTripWithNorotateRect) +{ + m_tester->m_scaleFactor = 1.5; + m_tester->m_originSizeF = QSizeF(200, 200); + + Stub s; + typedef QRectF (*fptr)(BrowserPage *); + s.set((fptr)&BrowserPage::boundingRect, boundingRect_stub); + + QRectF docRect(10, 10, 20, 10); + + // 0°: 尺寸仅随缩放(非零偏移不改变尺寸映射) + m_tester->m_rotation = Dr::RotateBy0; + QRectF screenRect = m_tester->translateRect(docRect); + EXPECT_TRUE(qFuzzyCompare(screenRect.width(), docRect.width() * 1.5)); + // getNorotateRect 同链缩放(注释框回归文档坐标系时缩放链一致) + QRectF backRect = m_tester->getNorotateRect(screenRect); + EXPECT_TRUE(qFuzzyCompare(backRect.width(), screenRect.width() * m_tester->m_scaleFactor)); + + // 180°: 尺寸不变(仅平移), 缩放链保持 + m_tester->m_rotation = Dr::RotateBy180; + screenRect = m_tester->translateRect(docRect); + EXPECT_TRUE(qFuzzyCompare(screenRect.width(), docRect.width() * 1.5)); + backRect = m_tester->getNorotateRect(screenRect); + EXPECT_TRUE(qFuzzyCompare(backRect.width(), screenRect.width() * m_tester->m_scaleFactor)); + + // 90°: 宽高轴互换生效(旋转感知映射不丢精度) + m_tester->m_rotation = Dr::RotateBy90; + screenRect = m_tester->translateRect(docRect); + EXPECT_TRUE(qFuzzyCompare(screenRect.width(), docRect.height() * m_tester->m_scaleFactor)); +} diff --git a/tests/browser/ut_browserword.cpp b/tests/browser/ut_browserword.cpp index 4c8ef520b..e145e202a 100644 --- a/tests/browser/ut_browserword.cpp +++ b/tests/browser/ut_browserword.cpp @@ -142,3 +142,39 @@ TEST_F(TestBrowserWord, UT_BrowserWord_mouseReleaseEvent_001) delete e; } + +// ==================== PMS 批次 2 补强 ==================== +// BUG40946 (sev2): 文字处于可选择状态时, 单击仍触发词项拖拽/移动。 +// 回归意图: setSelectable 打开后: +// 1) ItemIsSelectable 标志位同步(场景选择机制生效的依据); +// 2) 单击 press/release 被抑制(不透传给 QGraphicsItem 拖拽链路)。 + +TEST_F(TestBrowserWord, BUG40946_selectableFlagSyncsWithSetSelectable) +{ + m_tester->setSelectable(true); + EXPECT_TRUE(m_tester->flags() & QGraphicsItem::ItemIsSelectable); + + m_tester->setSelectable(false); + EXPECT_FALSE(m_tester->flags() & QGraphicsItem::ItemIsSelectable); +} + +TEST_F(TestBrowserWord, BUG40946_selectableSuppressesSingleClickDrag) +{ + typedef void (*fptr)(QGraphicsItem *, QGraphicsSceneMouseEvent *); + fptr A_foo = (fptr)(&QGraphicsItem::mousePressEvent); + Stub s; + s.set(A_foo, mousePressEvent_stub); + + QGraphicsSceneMouseEvent e; + + // 文本选择模式: 单击不透传(不触发词项拖拽) + m_tester->setSelectable(true); + g_funcName.clear(); + m_tester->mousePressEvent(&e); + EXPECT_FALSE(g_funcName == "mousePressEvent_stub"); + + // 非选择模式: 恢复正常点击链路 + m_tester->setSelectable(false); + m_tester->mousePressEvent(&e); + EXPECT_TRUE(g_funcName == "mousePressEvent_stub"); +} diff --git a/tests/browser/ut_sheetbrowser.cpp b/tests/browser/ut_sheetbrowser.cpp index f6a957fa4..14538ea25 100644 --- a/tests/browser/ut_sheetbrowser.cpp +++ b/tests/browser/ut_sheetbrowser.cpp @@ -2670,3 +2670,255 @@ TEST_F(TestSheetBrowser, UT_SheetBrowser_eyeProtectionMode_lambda_001) EyeProtectionManager::instance()->setMode(prev); SUCCEED(); } + +// ==================== PMS 批次 2 补强 ==================== +// 桩函数(批次 2 专用, 避免与既有全局桩重名) +static QString g_b2_funcName; +static void b2_setSelectIconRect_stub(const bool, Annotation *) { g_b2_funcName = "setSelectIconRect"; } +static void b2_showMenu_stub() { g_b2_funcName = "showMenu"; } +static void b2_clearSelectIconAnnot_stub() { g_b2_funcName = "clearSelectIconAnnot"; } +static void b2_setScaleFactor_stub(qreal f) { g_b2_funcName = "setScaleFactor:" + QString::number(f); } +static void b2_rotateLeft_stub() { g_b2_funcName = "rotateLeft"; } +static void b2_rotateRight_stub() { g_b2_funcName = "rotateRight"; } +static Qt::GestureState b2_gestureState = Qt::NoGesture; +static Qt::GestureState b2_state_stub() { return b2_gestureState; } + +// BUG22093 (sev2): 无任何选中内容时点击右键菜单崩溃。 +// 回归意图: showMenu 在无选中(m_selectEndWord/m_iconAnnot 均空)时走基础菜单路径, 不崩溃; +// 图标注释选中态时菜单操作后必须清理选中(m_clearSelectIconAnnotAfterMenu)。 + +TEST_F(TestSheetBrowser, BUG22093_showMenuWithoutAnySelection) +{ + Stub stub; + stub.set(ADDR(SheetBrowser, selectedWordsText), selectedWordsText_stub_empty); + stub.set(ADDR(BrowserMenu, initActions), initActions_stub); + stub.set((QAction * (QMenu::*)(const QPoint &, QAction *))ADDR(QMenu, exec), exec_stub); + stub.set(ADDR(SheetBrowser, clearSelectIconAnnotAfterMenu), clearSelectIconAnnotAfterMenu_stub); + + // 无选中: m_selectEndWord / m_iconAnnot 均为空 + DocSheet *sheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + m_tester->m_sheet = sheet; + m_tester->showMenu(); + + delete sheet; + EXPECT_TRUE(m_tester->m_selectIconAnnotation == false); +} + +TEST_F(TestSheetBrowser, BUG22093_showMenuWithIconAnnotClearsSelection) +{ + Stub stub; + stub.set(ADDR(SheetBrowser, selectedWordsText), selectedWordsText_stub_empty); + stub.set(ADDR(BrowserMenu, initActions), initActions_stub); + stub.set((QAction * (QMenu::*)(const QPoint &, QAction *))ADDR(QMenu, exec), exec_stub); + g_b2_funcName.clear(); + stub.set(ADDR(SheetBrowser, clearSelectIconAnnotAfterMenu), b2_clearSelectIconAnnot_stub); + + BrowserWord *word = new BrowserWord(nullptr, Word()); + m_tester->m_selectEndWord = word; + PDFAnnotation *annot = new PDFAnnotation(nullptr); + m_tester->m_iconAnnot = annot; + DocSheet *sheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + m_tester->m_sheet = sheet; + m_tester->showMenu(); + + delete word; + delete annot; + delete sheet; + // 图标注释菜单操作后选中态被清理 + EXPECT_TRUE(g_b2_funcName == "clearSelectIconAnnot"); + EXPECT_TRUE(m_tester->m_selectIconAnnotation == false); +} + +// BUG43216 (sev2): 添加注释时点击位置越界/页面为空导致崩溃。 +// 回归意图: getClickAnnot 对空页面必须返回空注释且不崩溃; +// 空白页面无命中时返回 nullptr。 + +TEST_F(TestSheetBrowser, BUG43216_getClickAnnotNullPageGuard) +{ + QPointF pos(10, 10); + // 空页面守卫: 返回 nullptr 不崩溃 + EXPECT_TRUE(m_tester->getClickAnnot(nullptr, pos) == nullptr); + SUCCEED(); +} + +TEST_F(TestSheetBrowser, BUG43216_getClickAnnotEmptyPageReturnsNull) +{ + // fixture 页面无注释/无文字: 任意命中点均应安全返回 nullptr + BrowserPage *page = m_tester->m_items.at(0); + QPointF pos(10, 10); + EXPECT_TRUE(m_tester->getClickAnnot(page, pos) == nullptr); +} + +// BUG44136 (sev2): Tab 键焦点遍历时图标注释选中框未释放。 +// 回归意图: SheetBrowser::event 收到 Key_Tab 必须释放最后选中的图标注释选中框。 + +TEST_F(TestSheetBrowser, BUG44136_keyTabReleasesIconAnnotSelection) +{ + DocSheet *sheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + m_tester->m_sheet = sheet; + BrowserPage *page = m_tester->m_items.at(0); + m_tester->m_lastSelectIconAnnotPage = page; + + g_b2_funcName.clear(); + Stub stub; + stub.set(ADDR(BrowserPage, setSelectIconRect), b2_setSelectIconRect_stub); + + QKeyEvent tabEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier); + m_tester->event(&tabEvent); + + // Tab 释放图注选中框 + EXPECT_TRUE(g_b2_funcName == "setSelectIconRect"); + delete sheet; +} + +// BUG44264 (sev2): Alt+M 快捷键无法唤出右键菜单。 +// 回归意图: SheetBrowser::event 捕获 Alt+M 并调用 showMenu。 + +TEST_F(TestSheetBrowser, BUG44264_keyAltMShowsContextMenu) +{ + DocSheet *sheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + m_tester->m_sheet = sheet; + + g_b2_funcName.clear(); + Stub stub; + stub.set(ADDR(SheetBrowser, showMenu), b2_showMenu_stub); + + QKeyEvent altMEvent(QEvent::KeyPress, Qt::Key_M, Qt::AltModifier); + m_tester->event(&altMEvent); + + EXPECT_TRUE(g_b2_funcName == "showMenu"); + delete sheet; +} + +// BUG44491 (sev2): 双指捏合缩放过于灵敏/难以生效(scale=1.0 步进污染)。 +// 回归意图: 真实 pinchTriggered 路径(完整手势序列 Started→Updated→Finished): +// 捏合缩放必须到达 setScaleFactor(不丢失), 结束态按总缩放落盘最终值。 +// 注: pinchTriggered 使用函数级 static(tempScalefactor/currentStepScaleFactor) +// 跨调用累计, 必须从 GestureStarted 起步才能得到确定性的结果。 + +TEST_F(TestSheetBrowser, BUG44491_pinchScaleFactorReachesDocSheet) +{ + DocSheet *sheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + m_tester->m_sheet = sheet; + m_tester->m_lastScaleFactor = 1.0; + + g_b2_funcName.clear(); + Stub stub; + stub.set(ADDR(DocSheet, setScaleFactor), b2_setScaleFactor_stub); + + // 手势开始: 重置 static 累计基线 + b2_gestureState = Qt::GestureStarted; + Stub stateStub; + stateStub.set(ADDR(QGesture, state), b2_state_stub); + QPinchGesture started; + started.setChangeFlags(QPinchGesture::ScaleFactorChanged); + started.setTotalScaleFactor(1.0); + m_tester->pinchTriggered(&started); + + // 捏合中: totalScaleFactor 变为 2.0, 缩放必须同步生效 + b2_gestureState = Qt::GestureUpdated; + QPinchGesture updated; + updated.setChangeFlags(QPinchGesture::ScaleFactorChanged); + updated.setTotalScaleFactor(2.0); + m_tester->pinchTriggered(&updated); + + // 缩放手势生效: 到达文档缩放设置, 且缩放值非初始 1.0 污染 + EXPECT_TRUE(g_b2_funcName.startsWith("setScaleFactor:")); + if (g_b2_funcName.startsWith("setScaleFactor:")) { + qreal applied = g_b2_funcName.mid(QString("setScaleFactor:").size()).toDouble(); + EXPECT_GT(applied, 1.0); + } + delete sheet; +} + +TEST_F(TestSheetBrowser, BUG44491_pinchFinishedKeepsValidScale) +{ + DocSheet *sheet = new DocSheet(Dr::FileType::PDF, "1.pdf", nullptr); + m_tester->m_sheet = sheet; + m_tester->m_lastScaleFactor = 1.0; + + g_b2_funcName.clear(); + Stub stub; + stub.set(ADDR(DocSheet, setScaleFactor), b2_setScaleFactor_stub); + + // 完整手势序列: 开始→结束(缩小到 0.5) + b2_gestureState = Qt::GestureStarted; + Stub stateStub; + stateStub.set(ADDR(QGesture, state), b2_state_stub); + QPinchGesture started; + started.setChangeFlags(QPinchGesture::ScaleFactorChanged); + started.setTotalScaleFactor(1.0); + m_tester->pinchTriggered(&started); + + b2_gestureState = Qt::GestureFinished; + QPinchGesture finished; + finished.setChangeFlags(QPinchGesture::ScaleFactorChanged); + finished.setTotalScaleFactor(0.5); + m_tester->pinchTriggered(&finished); + + // 结束态: 缩放值有效(>0), 不会退化为 0/失效 + EXPECT_TRUE(g_b2_funcName.startsWith("setScaleFactor:")); + if (g_b2_funcName.startsWith("setScaleFactor:")) { + qreal applied = g_b2_funcName.mid(QString("setScaleFactor:").size()).toDouble(); + EXPECT_GT(applied, 0.0); + } + delete sheet; +} + +// BUG41018 (sev2): 大页面文档双页模式 maxWidth 计算错误(未乘页数)导致布局溢出。 +// 回归意图: 同一文档下, 双页模式的适配缩放不得大于单页模式(宽度预算必须按 2 页计算)。 + +TEST_F(TestSheetBrowser, BUG41018_doublePageScaleNotGreaterThanSingleBigWidth) +{ + Stub stub; + stub.set(ADDR(BrowserPage, render), render_stub); + stub.set(ADDR(SheetBrowser, beginViewportChange), beginViewportChange_stub); + + // 大宽度页面: 双页宽度预算未乘 2 时 scale 会反超单页 + m_tester->m_items.at(0)->m_originSizeF = QSizeF(2000, 1000); + m_tester->m_items.at(1)->m_originSizeF = QSizeF(2000, 1000); + + SheetOperation opSingle; + opSingle.scaleMode = Dr::FitToPageWidthMode; + opSingle.layoutMode = Dr::SinglePageMode; + m_tester->deform(opSingle); + double scaleSingle = m_tester->m_lastScaleFactor; + + SheetOperation opDouble; + opDouble.scaleMode = Dr::FitToPageWidthMode; + opDouble.layoutMode = Dr::TwoPagesMode; + m_tester->deform(opDouble); + double scaleDouble = m_tester->m_lastScaleFactor; + + EXPECT_GT(scaleSingle, 0.0); + EXPECT_GT(scaleDouble, 0.0); + // 双页(两页并排)的缩放不得大于单页缩放 + EXPECT_LE(scaleDouble, scaleSingle + 1e-6); +} + +TEST_F(TestSheetBrowser, BUG41018_doublePageScaleNotGreaterThanSingleBigHeight) +{ + Stub stub; + stub.set(ADDR(BrowserPage, render), render_stub); + stub.set(ADDR(SheetBrowser, beginViewportChange), beginViewportChange_stub); + + // 大高度页面: 约束翻转到高度轴, 双页缩放同样不得反超单页 + m_tester->m_items.at(0)->m_originSizeF = QSizeF(1000, 4000); + m_tester->m_items.at(1)->m_originSizeF = QSizeF(1000, 4000); + + SheetOperation opSingle; + opSingle.scaleMode = Dr::FitToPageWidthMode; + opSingle.layoutMode = Dr::SinglePageMode; + m_tester->deform(opSingle); + double scaleSingle = m_tester->m_lastScaleFactor; + + SheetOperation opDouble; + opDouble.scaleMode = Dr::FitToPageWidthMode; + opDouble.layoutMode = Dr::TwoPagesMode; + m_tester->deform(opDouble); + double scaleDouble = m_tester->m_lastScaleFactor; + + EXPECT_GT(scaleSingle, 0.0); + EXPECT_GT(scaleDouble, 0.0); + EXPECT_LE(scaleDouble, scaleSingle + 1e-6); +} diff --git a/tests/document/ut_pdfmodel.cpp b/tests/document/ut_pdfmodel.cpp index 50d7670ae..fecff5838 100644 --- a/tests/document/ut_pdfmodel.cpp +++ b/tests/document/ut_pdfmodel.cpp @@ -10,6 +10,12 @@ #include "stub.h" #include + +#include +#include +#include +#include + using namespace deepin_reader; /********测试PDFAnnotation***********/ @@ -576,6 +582,11 @@ bool DPdfPage_isValid_stub() return true; } +bool DPdfPage_isValid_stub_false() +{ + return false; +} + QString label_stub(int) { return "test"; @@ -766,3 +777,187 @@ TEST_F(TestPDFDocument, UT_PDFDocument_fileIdentifier_001) QString id1 = m_tester->fileIdentifier(); EXPECT_TRUE(id1 == m_tester->fileIdentifier()); } + +// ==================== PMS 批次 2 补强 ==================== +// 真实文件 fixture: normal.pdf / broken.pdf (UTSOURCEDIR/files/) +// 注意: PDFDocument 析构会 delete m_document, fixture 只 delete m_tester。 +class TestPDFDocumentReal : public ::testing::Test +{ +public: + virtual void SetUp(); + virtual void TearDown(); + +protected: + PDFDocument *m_tester = nullptr; +}; + +void TestPDFDocumentReal::SetUp() +{ + m_tester = new PDFDocument(new DPdfDoc(QString(UTSOURCEDIR) + "/files/normal.pdf", "")); +} + +void TestPDFDocumentReal::TearDown() +{ + delete m_tester; +} + +// BUG46911 (sev2): 打开损坏的 PDF 文件崩溃。 +// 回归意图: broken.pdf 打开后 pageCount/page/properties 全链路安全降级。 + +TEST_F(TestPDFDocumentReal, BUG46911_brokenPdfOpensGracefully) +{ + PDFDocument brokenTester(new DPdfDoc(QString(UTSOURCEDIR) + "/files/broken.pdf", "")); + + // 损坏文档可打开(部分对象可解析), 取损坏页时安全降级为空, 不崩溃 + EXPECT_GE(brokenTester.pageCount(), 0); + EXPECT_TRUE(brokenTester.page(0) == nullptr); +} + +TEST_F(TestPDFDocumentReal, BUG46911_brokenPdfPropertiesSafe) +{ + PDFDocument brokenTester(new DPdfDoc(QString(UTSOURCEDIR) + "/files/broken.pdf", "")); + + // 损坏文档属性/大纲可重复获取且稳定(不崩溃不漂移) + Properties first = brokenTester.properties(); + Properties second = brokenTester.properties(); + EXPECT_EQ(first.size(), second.size()); + + QList
outline = brokenTester.outline(); + Q_UNUSED(outline); + SUCCEED(); +} + +// BUG54210 (sev2): 无效页面(isValid=false)未拦截导致下游崩溃。 +// 回归意图: PDFDocument::page 对 isValid=false 的页面返回空并安全释放。 + +TEST_F(TestPDFDocumentReal, BUG54210_pageInvalidPageReturnsNull) +{ + // 真实页面: 有效 + Page *validPage = m_tester->page(0); + EXPECT_TRUE(validPage != nullptr); + delete validPage; + + // isValid=false: 守卫生效返回空 + Stub s; + s.set(ADDR(DPdfPage, isValid), DPdfPage_isValid_stub_false); + + Page *invalidPage = m_tester->page(0); + EXPECT_TRUE(invalidPage == nullptr); +} + +// BUG68550 (sev2): 选中文字时矩形/文本错乱。 +// 回归意图: 真实页面上 allTextRects/allTextLooseRects 的 rects 与 texts 一一对应, +// charCount 为上限(每字符一个合法矩形才追加)。 + +TEST_F(TestPDFDocumentReal, BUG68550_allTextRectsRectTextAligned) +{ + DPdfPage *dp = m_tester->m_document->page(0, 96, 96); + ASSERT_TRUE(dp != nullptr); + ASSERT_TRUE(dp->isValid()); + + int charCount = 0; + QStringList texts; + QVector rects; + dp->allTextRects(charCount, texts, rects); + + // 有文字的真实文档: 每个矩形对应一段文本, 数量严格一致 + EXPECT_GT(charCount, 0); + EXPECT_EQ(rects.count(), texts.count()); + EXPECT_LE(rects.count(), charCount); + // 注: DPdfPage 由 DPdfDoc(m_pages) 持有管理, 不可 delete (qDeleteAll 双重释放) +} + +TEST_F(TestPDFDocumentReal, BUG68550_allTextLooseRectsRectTextAligned) +{ + DPdfPage *dp = m_tester->m_document->page(0, 96, 96); + ASSERT_TRUE(dp != nullptr); + + int charCount = 0; + QStringList texts; + QVector rects; + dp->allTextLooseRects(charCount, texts, rects); + + EXPECT_GT(charCount, 0); + EXPECT_EQ(rects.count(), texts.count()); + EXPECT_FALSE(texts.join(QString()).isEmpty()); + // 同上: DPdfPage 生命周期归 DPdfDoc 管理 +} + +// BUG304111 (sev2): 获取文件属性时多线程重入死锁。 +// 回归意图: 并发调用 properties() (内部 DPdfMutexLocker) 可在时限内完成。 + +TEST_F(TestPDFDocumentReal, BUG304111_concurrentPropertiesNoDeadlock) +{ + std::atomic done1(false), done2(false); + std::thread t1([this, &done1]() { + Properties p = m_tester->properties(); + Q_UNUSED(p); + done1 = true; + }); + std::thread t2([this, &done2]() { + Properties p = m_tester->properties(); + Q_UNUSED(p); + done2 = true; + }); + + // 3 秒时限内必须完成(死锁则超时失败) + for (int i = 0; i < 300 && !(done1 && done2); ++i) + QThread::msleep(10); + EXPECT_TRUE(done1.load()); + EXPECT_TRUE(done2.load()); + t1.join(); + t2.join(); +} + +// BUG304471 (sev2): properties 重复调用结果漂移。 +// 回归意图: 缓存机制保证多次获取属性内容一致。 + +TEST_F(TestPDFDocumentReal, BUG304471_propertiesCachedStable) +{ + Properties first = m_tester->properties(); + Properties second = m_tester->properties(); + + EXPECT_EQ(first.size(), second.size()); + for (auto it = first.begin(); it != first.end(); ++it) + EXPECT_TRUE(second.value(it.key()) == it.value()); +} + +// BUG351271 (sev2): SMB 等场景保存失败后文件损坏(未回滚)。 +// 回归意图: 底层 save/saveAs 失败时, PDFDocument 包装层必须如实传递失败, +// 调用方据此不误报保存成功。 + +TEST_F(TestPDFDocumentReal, BUG351271_saveFailurePropagates) +{ + Stub s; + s.set(ADDR(DPdfDoc, save), save_stub); + + EXPECT_FALSE(m_tester->save()); +} + +TEST_F(TestPDFDocumentReal, BUG351271_saveAsFailurePropagates) +{ + Stub s; + s.set(ADDR(DPdfDoc, saveAs), saveAs_stub); + + EXPECT_FALSE(m_tester->saveAs("/tmp/ut_351271_out.pdf")); +} + +// BUG353429 (sev2): 另存为输出的 PDF 文件无效/损坏。 +// 回归意图: 真实文档 saveAs 输出存在、非空、以 %PDF 头开始(有效 PDF)。 + +TEST_F(TestPDFDocumentReal, BUG353429_saveAsOutputIsValidPdf) +{ + QTemporaryDir tmpDir; + ASSERT_TRUE(tmpDir.isValid()); + QString outPath = tmpDir.path() + "/saved.pdf"; + + EXPECT_TRUE(m_tester->saveAs(outPath)); + + QFile outFile(outPath); + ASSERT_TRUE(outFile.exists()); + ASSERT_TRUE(outFile.open(QIODevice::ReadOnly)); + QByteArray head = outFile.read(5); + outFile.close(); + EXPECT_GT(outFile.size(), QFileInfo(QString(UTSOURCEDIR) + "/files/normal.pdf").size() / 100); + EXPECT_TRUE(head.startsWith("%PDF")); +} diff --git a/tests/sidebar/ut_bookmarkwidget.cpp b/tests/sidebar/ut_bookmarkwidget.cpp index 219c72a5b..6154d4a4b 100644 --- a/tests/sidebar/ut_bookmarkwidget.cpp +++ b/tests/sidebar/ut_bookmarkwidget.cpp @@ -145,3 +145,91 @@ TEST_F(TestBookMarkWidget, testonListMenuClick) m_tester->onListMenuClick(E_MENU_ACTION::E_BOOKMARK_DELETE); EXPECT_TRUE(g_deleteItemByKey_result == "deleteItemByKey_stub"); } + +// ==================== PMS 批次 2 补强 ==================== +// BUG10332 (sev2): 添加书签后未保存/书签状态不同步。 +// 回归意图: handleBookMark 添加/移除必须同步书签列表模型与按钮可用状态; +// onAddBookMarkClicked 必须把当前页写入 DocSheet::m_bookmarks 持久化集合。 + +static int pageCount_bug10332_stub() +{ + return 64; +} + +TEST_F(TestBookMarkWidget, BUG10332_handleBookMarkAddSyncsModelAndButton) +{ + int cur = m_tester->m_sheet->currentIndex(); + m_tester->handleBookMark(cur, 1); + + // 添加: 书签列表模型插入该页, 当前页添加按钮置灰 + EXPECT_TRUE(m_tester->m_pImageListView->count() == 1); + EXPECT_FALSE(m_tester->m_pAddBookMarkBtn->isEnabled()); + + m_tester->handleBookMark(cur, 0); + + // 移除: 模型同步移除, 按钮恢复可用 + EXPECT_TRUE(m_tester->m_pImageListView->count() == 0); + EXPECT_TRUE(m_tester->m_pAddBookMarkBtn->isEnabled()); +} + +TEST_F(TestBookMarkWidget, BUG10332_onAddBookMarkClickedPersistsBookmark) +{ + // fixture 中 DocSheet 未打开文档, pageCount() 为 0 会触发 setBookMark 索引守卫; + // 桩定页数使书签写入链路可验证。 + Stub s; + s.set(ADDR(DocSheet, pageCount), pageCount_bug10332_stub); + + int page = m_tester->m_sheet->currentIndex(); + + m_tester->onAddBookMarkClicked(); + + // 书签进入 DocSheet 持久化集合(保存链路的数据源) + EXPECT_TRUE(m_tester->m_sheet->m_bookmarks.contains(page)); +} + +TEST_F(TestBookMarkWidget, BUG10332_onAddBookMarkClickedNullSheetGuard) +{ + // m_sheet 置空后点击添加不应崩溃(QPointer 空守卫) + m_tester->m_sheet = nullptr; + m_tester->onAddBookMarkClicked(); + EXPECT_TRUE(m_tester->m_sheet.isNull()); + SUCCEED(); +} + +// BUG12219 (sev2): 书签列表聚焦时按 Del 删除书签崩溃(无效索引未守卫)。 +// 回归意图: deleteItemByKey 对无效索引必须走守卫路径, 不触发 setBookMark。 + +static QString g_bug12219_setBookMark_called; +void setBookMark_bug12219_stub(int, int) +{ + g_bug12219_setBookMark_called = "called"; +} + +TEST_F(TestBookMarkWidget, BUG12219_deleteItemByKeyInvalidIndexGuard) +{ + // 空书签列表: 当前模型索引无效, 不应触发 setBookMark + g_bug12219_setBookMark_called.clear(); + Stub s; + s.set(ADDR(DocSheet, setBookMark), setBookMark_bug12219_stub); + m_tester->deleteItemByKey(); + EXPECT_TRUE(g_bug12219_setBookMark_called.isEmpty()); +} + +TEST_F(TestBookMarkWidget, BUG12219_deleteItemByKeyValidIndexRemovesBookmark) +{ + int cur = m_tester->m_sheet->currentIndex(); + m_tester->m_sheet->setBookMark(cur, 1); + EXPECT_TRUE(m_tester->m_sheet->m_bookmarks.contains(cur)); + + g_bug12219_setBookMark_called.clear(); + Stub s; + s.set(ADDR(DocSheet, setBookMark), setBookMark_bug12219_stub); + + // 通过 handleBookMark 先向列表模型插入书签项, 再选中后 Del 删除 + m_tester->handleBookMark(cur, 1); + EXPECT_TRUE(m_tester->m_pImageListView->count() == 1); + m_tester->m_pImageListView->selectionModel()->setCurrentIndex( + m_tester->m_pImageListView->model()->index(0, 0), QItemSelectionModel::Select); + m_tester->deleteItemByKey(); + EXPECT_TRUE(g_bug12219_setBookMark_called == "called"); +} diff --git a/tests/uiframe/ut_centraldocpage.cpp b/tests/uiframe/ut_centraldocpage.cpp index 37a270df3..4ffdb90cc 100644 --- a/tests/uiframe/ut_centraldocpage.cpp +++ b/tests/uiframe/ut_centraldocpage.cpp @@ -1447,3 +1447,68 @@ TEST_F(TestCentralDocPage, UT_CentralDocPage_setActiveTabByFilePath_001) m_tester->setActiveTabByFilePath("/tmp/ut_not_exist_active_file.pdf"); SUCCEED(); } + +// ==================== PMS 批次 2 补强 ==================== +// BUG20978 (sev2): 快捷键链缺失导致部分快捷键功能无效。 +// 历史根因: 快捷键分发链未覆盖部分按键(旧 Ctrl+B 链路已在重构中废除)。 +// 回归意图: CentralDocPage::handleShortcut 必须把文档级快捷键分发到"当前文档" +// 并实际生效(alt_2 手型 / ctrl_1 适合页面 / ctrl_m 打开侧栏)。 + +TEST_F(TestCentralDocPage, BUG20978_handleShortcutAlt2DispatchToCurrentSheet) +{ + Stub s; + s.set(ADDR(CentralDocPage, getCurSheet), getCurSheet_stub2); + s.set(ADDR(ReaderImageThreadPoolManager, addgetDocImageTask), addgetDocImageTask_stub); + + QString strPath = UTSOURCEDIR; + strPath += "/files/normal.pdf"; + g_docsheet = new DocSheet(Dr::FileType::PDF, strPath, nullptr); + g_docsheet->m_operation.mouseShape = Dr::MouseShapeNormal; + + m_tester->handleShortcut(Dr::key_alt_2); + + // 分发链生效: 当前文档鼠标形状被切换为手型 + EXPECT_TRUE(g_docsheet->m_operation.mouseShape == Dr::MouseShapeHand); + + delete g_docsheet; + g_docsheet = nullptr; +} + +TEST_F(TestCentralDocPage, BUG20978_handleShortcutCtrl1DispatchToCurrentSheet) +{ + Stub s; + s.set(ADDR(CentralDocPage, getCurSheet), getCurSheet_stub2); + s.set(ADDR(ReaderImageThreadPoolManager, addgetDocImageTask), addgetDocImageTask_stub); + + QString strPath = UTSOURCEDIR; + strPath += "/files/normal.pdf"; + g_docsheet = new DocSheet(Dr::FileType::PDF, strPath, nullptr); + + m_tester->handleShortcut(Dr::key_ctrl_1); + + // 分发链生效: 缩放模式切换为"适合页面" + EXPECT_TRUE(g_docsheet->m_operation.scaleMode == Dr::FitToPageDefaultMode); + + delete g_docsheet; + g_docsheet = nullptr; +} + +TEST_F(TestCentralDocPage, BUG20978_handleShortcutCtrlMOpensSidebar) +{ + Stub s; + s.set(ADDR(CentralDocPage, getCurSheet), getCurSheet_stub2); + s.set(ADDR(ReaderImageThreadPoolManager, addgetDocImageTask), addgetDocImageTask_stub); + + QString strPath = UTSOURCEDIR; + strPath += "/files/normal.pdf"; + g_docsheet = new DocSheet(Dr::FileType::PDF, strPath, nullptr); + g_docsheet->m_operation.sidebarVisible = false; + + m_tester->handleShortcut(Dr::key_ctrl_m); + + // 分发链生效: 侧栏可见状态被置位 + EXPECT_TRUE(g_docsheet->m_operation.sidebarVisible == true); + + delete g_docsheet; + g_docsheet = nullptr; +} diff --git a/tests/uiframe/ut_doctabbar.cpp b/tests/uiframe/ut_doctabbar.cpp index 622af26bb..6695b47f6 100644 --- a/tests/uiframe/ut_doctabbar.cpp +++ b/tests/uiframe/ut_doctabbar.cpp @@ -344,3 +344,46 @@ TEST_F(UT_DocTabBar, UT_DocTabBar_setPendingActiveFile_001) m_tester->setPendingActiveFile(strPath); EXPECT_TRUE(m_tester->m_delayIndex == 0); } + +// ==================== PMS 批次 2 补强 ==================== +// BUG46381 (sev2): 快速连续点击关闭多个标签页导致崩溃。 +// 回归意图: onTabCloseRequested 的 m_intervalTimer 防抖窗口内的重复关闭必须被忽略, +// 窗口结束后恢复处理。 + +TEST_F(UT_DocTabBar, BUG46381_rapidCloseRequestsThrottled) +{ + QString strPath = UTSOURCEDIR; + strPath += "/files/1.pdf"; + DocSheet *sheet = new DocSheet(Dr::PDF, strPath, m_tester); + m_tester->insertSheet(sheet, 0); + + int sigCount = 0; + QObject::connect(m_tester, &DocTabBar::sigTabClosed, [&sigCount](DocSheet *) { + sigCount++; + }); + // 100ms 防抖窗口内连发 3 次关闭: 仅首次生效 + m_tester->onTabCloseRequested(0); + m_tester->onTabCloseRequested(0); + m_tester->onTabCloseRequested(0); + EXPECT_EQ(sigCount, 1); + delete sheet; +} + +TEST_F(UT_DocTabBar, BUG46381_closeAfterThrottleWindowWorksAgain) +{ + QString strPath = UTSOURCEDIR; + strPath += "/files/1.pdf"; + DocSheet *sheet = new DocSheet(Dr::PDF, strPath, m_tester); + m_tester->insertSheet(sheet, 0); + + int sigCount = 0; + QObject::connect(m_tester, &DocTabBar::sigTabClosed, [&sigCount](DocSheet *) { + sigCount++; + }); + m_tester->onTabCloseRequested(0); + // 等待防抖窗口(100ms)结束后, 再次请求关闭应正常处理 + QTest::qWait(150); + m_tester->onTabCloseRequested(0); + EXPECT_EQ(sigCount, 2); + delete sheet; +} diff --git a/tests/uiframe/ut_titlewidget.cpp b/tests/uiframe/ut_titlewidget.cpp index b7cb015f0..fd12f68f1 100644 --- a/tests/uiframe/ut_titlewidget.cpp +++ b/tests/uiframe/ut_titlewidget.cpp @@ -117,3 +117,43 @@ TEST_F(TestTitleWidget, testSizeModeChangedLambda) emit DGuiApplicationHelper::instance()->sizeModeChanged(DGuiApplicationHelper::NormalMode); SUCCEED(); } + +// ==================== PMS 批次 2 补强 ==================== +// BUG44136 (sev2): 标题栏控件 Tab 焦点顺序错乱/回车无效。 +// 回归意图: TitleWidget 在构造后焦点策略与 Tab 遍历链可用, +// 且按键事件处理不崩溃。 + +TEST_F(TestTitleWidget, BUG44136_titleWidgetFocusChainUsable) +{ + // 当前 Tab 顺序机制: 构造时把有序控件链写入父级 orderlist 属性, 并逐个设为 TabFocus + QVariant varOrder = m_parent->property("orderlist"); + EXPECT_TRUE(varOrder.isValid()); + QList orderList = varOrder.value>(); + // 有序链槽位数: 缩略图/减/缩放框/增/opt/最小/最大/关闭 = 8 + // (全屏按钮仅在全屏模式下由 DTitlebar 提供, 裸父级 fixture 中为空不追加) + ASSERT_EQ(orderList.count(), 8); + // 相对顺序约束: 缩略图 → 减 → 增 (缩放框在裸 fixture 下可能尚未实例化) + int idxThumbnail = -1, idxDec = -1, idxInc = -1; + int nonNullCount = 0; + for (int i = 0; i < orderList.count(); ++i) { + QWidget *w = orderList.at(i); + if (w == nullptr) + continue; + ++nonNullCount; + EXPECT_TRUE(w->focusPolicy() == Qt::TabFocus) << "noTabFocus at idx=" << i; + if (w->objectName() == "SP_DecreaseElement") + idxDec = i; + else if (w->objectName() == "SP_IncreaseElement") + idxInc = i; + else if (qobject_cast(w) && w == orderList.first()) + idxThumbnail = i; + } + EXPECT_GE(nonNullCount, 3); + EXPECT_GE(idxThumbnail, 0); + EXPECT_GT(idxDec, idxThumbnail); + EXPECT_GT(idxInc, idxDec); + + QKeyEvent tabEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier); + m_tester->keyPressEvent(&tabEvent); + SUCCEED(); +} diff --git a/tests/ut_application.cpp b/tests/ut_application.cpp index 760a46e3c..4a2df1d4f 100644 --- a/tests/ut_application.cpp +++ b/tests/ut_application.cpp @@ -12,6 +12,7 @@ #include #include #include +#include TEST(UT_Application, UT_Application_emitSheetChanged) { @@ -84,3 +85,44 @@ TEST(UT_Application, UT_Application_notifyOtherEvent) dApp->notify(&widget, &event); SUCCEED(); } + +// ==================== PMS 批次 2 补强 ==================== +// BUG44137 (sev2): 回车键无法触发自定义按钮(DTK DIconButton/DhuaButton 类不默认响应回车)。 +// 回归意图: Application::notify 必须把 Key_Return/Key_Enter 转换为按钮 clicked 信号。 + +TEST(UT_Application, BUG44137_notifyReturnEmitsClickedSignal) +{ + QPushButton btn; + QSignalSpy spy(&btn, &QAbstractButton::clicked); + + QKeyEvent event(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); + dApp->notify(&btn, &event); + + // 回车 → clicked 信号发射且事件被消费 + EXPECT_EQ(spy.count(), 1); + EXPECT_TRUE(event.isAccepted()); +} + +TEST(UT_Application, BUG44137_notifyKeypadEnterEmitsClickedSignal) +{ + QPushButton btn; + QSignalSpy spy(&btn, &QAbstractButton::clicked); + + QKeyEvent event(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier); + dApp->notify(&btn, &event); + + EXPECT_EQ(spy.count(), 1); + EXPECT_TRUE(event.isAccepted()); +} + +// BUG44264 (sev2): Alt+M 无法唤出右键菜单。 +// 回归意图: Application::notify 捕获 Alt+M 合成右键点击; +// 无输入法光标时走 QPoint(0,0) 守卫, 不崩溃。 + +TEST(UT_Application, BUG44264_notifyAltMSynthesizesContextMenu) +{ + QWidget widget; + QKeyEvent event(QEvent::KeyPress, Qt::Key_M, Qt::AltModifier); + dApp->notify(&widget, &event); + SUCCEED(); +} From b84d3e76d18076fb649e6389d9650206a7cef679 Mon Sep 17 00:00:00 2001 From: dengzhongyuan Date: Mon, 12 Oct 2026 11:04:41 +0800 Subject: [PATCH 50/63] test(sidebar): isolate bookmark UT cases from shared test data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bookmark cases wrote bookmarks into the shared tests/files/1.pdf and later cases depended on that leftover state, so the full UT run failed. 书签用例把书签写入共享的 1.pdf,后续用例又依赖这份残留状态, 导致全量执行时相互污染失败。 Log: 修复书签 UT 用例间的状态污染 Influence: 书签用例各自清理写盘数据,全量 1264 条 UT 可稳定通过。 --- tests/sidebar/ut_bookmarkwidget.cpp | 38 ++++++++++++++++------- tests/sidebar/ut_sidebarimagelistview.cpp | 4 ++- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/tests/sidebar/ut_bookmarkwidget.cpp b/tests/sidebar/ut_bookmarkwidget.cpp index 6154d4a4b..7c4d67e50 100644 --- a/tests/sidebar/ut_bookmarkwidget.cpp +++ b/tests/sidebar/ut_bookmarkwidget.cpp @@ -184,7 +184,12 @@ TEST_F(TestBookMarkWidget, BUG10332_onAddBookMarkClickedPersistsBookmark) m_tester->onAddBookMarkClicked(); // 书签进入 DocSheet 持久化集合(保存链路的数据源) - EXPECT_TRUE(m_tester->m_sheet->m_bookmarks.contains(page)); + const bool persisted = m_tester->m_sheet->m_bookmarks.contains(page); + // 立即移除, 避免真实写入磁盘的书签污染同进程内的后续用例 + m_tester->m_sheet->setBookMark(page, 0); + + EXPECT_TRUE(persisted); + EXPECT_FALSE(m_tester->m_sheet->m_bookmarks.contains(page)); } TEST_F(TestBookMarkWidget, BUG10332_onAddBookMarkClickedNullSheetGuard) @@ -217,19 +222,30 @@ TEST_F(TestBookMarkWidget, BUG12219_deleteItemByKeyInvalidIndexGuard) TEST_F(TestBookMarkWidget, BUG12219_deleteItemByKeyValidIndexRemovesBookmark) { + // fixture 中 DocSheet 未打开文档, pageCount() 为 0 会触发 setBookMark 索引守卫; + // 桩定页数, 使书签写入链路可验证, 且不依赖外部残留状态。 + Stub pc; + pc.set(ADDR(DocSheet, pageCount), pageCount_bug10332_stub); + int cur = m_tester->m_sheet->currentIndex(); m_tester->m_sheet->setBookMark(cur, 1); EXPECT_TRUE(m_tester->m_sheet->m_bookmarks.contains(cur)); - g_bug12219_setBookMark_called.clear(); - Stub s; - s.set(ADDR(DocSheet, setBookMark), setBookMark_bug12219_stub); + { + g_bug12219_setBookMark_called.clear(); + Stub s; + s.set(ADDR(DocSheet, setBookMark), setBookMark_bug12219_stub); + + // 通过 handleBookMark 先向列表模型插入书签项, 再选中后 Del 删除 + m_tester->handleBookMark(cur, 1); + EXPECT_TRUE(m_tester->m_pImageListView->count() == 1); + m_tester->m_pImageListView->selectionModel()->setCurrentIndex( + m_tester->m_pImageListView->model()->index(0, 0), QItemSelectionModel::Select); + m_tester->deleteItemByKey(); + EXPECT_TRUE(g_bug12219_setBookMark_called == "called"); + } - // 通过 handleBookMark 先向列表模型插入书签项, 再选中后 Del 删除 - m_tester->handleBookMark(cur, 1); - EXPECT_TRUE(m_tester->m_pImageListView->count() == 1); - m_tester->m_pImageListView->selectionModel()->setCurrentIndex( - m_tester->m_pImageListView->model()->index(0, 0), QItemSelectionModel::Select); - m_tester->deleteItemByKey(); - EXPECT_TRUE(g_bug12219_setBookMark_called == "called"); + // 清理真实写入磁盘的书签, 避免污染同进程内后续用例 + m_tester->m_sheet->setBookMark(cur, 0); + EXPECT_FALSE(m_tester->m_sheet->m_bookmarks.contains(cur)); } diff --git a/tests/sidebar/ut_sidebarimagelistview.cpp b/tests/sidebar/ut_sidebarimagelistview.cpp index 45459e814..654bb3be8 100644 --- a/tests/sidebar/ut_sidebarimagelistview.cpp +++ b/tests/sidebar/ut_sidebarimagelistview.cpp @@ -75,8 +75,10 @@ TEST_F(TestSideBarImageListView, testhandleOpenSuccess) EXPECT_TRUE(m_tester->m_imageModel->m_pagelst.count() == 0); m_tester->m_listType = E_SideBar::SIDE_BOOKMARK; + const int bookmarkCount = m_tester->m_docSheet->getBookMarkList().count(); m_tester->handleOpenSuccess(); - EXPECT_TRUE(m_tester->m_imageModel->m_pagelst.count() == 0); + // 不假设书签必须为 0, 只校验加载数量与 DocSheet 记录一致 + EXPECT_TRUE(m_tester->m_imageModel->m_pagelst.count() == bookmarkCount); m_tester->m_listType = E_SideBar::SIDE_NOTE; m_tester->handleOpenSuccess(); From 439f73ca5db8eb52b68707abbbd7a1a78c9d2a07 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 13 Oct 2026 19:32:52 +0800 Subject: [PATCH 51/63] docs(manual): update user manual for OFD support and new features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update deepin-manual help documents with OFD format support, reading position restore, and batch print sections. Drop legacy index files superseded by the new d_/p_ document format. 更新帮助文档:新增OFD格式支持、恢复阅读位置、批量打印等章节, 删除被新版d_/p_文档格式取代的旧索引文件。 Log: 更新帮助文档 Influence: 帮助手册展示新版功能说明(OFD/恢复阅读位置/批量打印),旧索引文件不再打包。 --- .../en_US/d_document-viewer.md | 63 +++- .../document-viewer/en_US/document-viewer.md | 287 ----------------- .../en_US/p_document-viewer.md | 63 +++- .../zh_CN/d_document-viewer.md | 54 +++- .../document-viewer/zh_CN/document-viewer.md | 292 ------------------ .../zh_CN/p_document-viewer.md | 54 +++- .../zh_HK/d_document-viewer.md | 60 +++- .../document-viewer/zh_HK/document-viewer.md | 277 ----------------- .../zh_HK/p_document-viewer.md | 60 +++- .../zh_TW/d_document-viewer.md | 55 +++- .../document-viewer/zh_TW/document-viewer.md | 287 ----------------- .../zh_TW/p_document-viewer.md | 55 +++- 12 files changed, 376 insertions(+), 1231 deletions(-) delete mode 100755 assets/deepin-reader/document-viewer/en_US/document-viewer.md delete mode 100755 assets/deepin-reader/document-viewer/zh_CN/document-viewer.md delete mode 100755 assets/deepin-reader/document-viewer/zh_HK/document-viewer.md delete mode 100755 assets/deepin-reader/document-viewer/zh_TW/document-viewer.md diff --git a/assets/deepin-reader/document-viewer/en_US/d_document-viewer.md b/assets/deepin-reader/document-viewer/en_US/d_document-viewer.md index 31abcd67e..a989c419c 100755 --- a/assets/deepin-reader/document-viewer/en_US/d_document-viewer.md +++ b/assets/deepin-reader/document-viewer/en_US/d_document-viewer.md @@ -32,9 +32,7 @@ You can run, close or create a shortcut of Document Viewer as follows. ### View Shortcut Keys -On Document Viewer interface, press **Ctrl + Shift+ ?** to view all shortcut keys quickly, which helps you to use them skillfully and improves your working efficiency. - -![1|hotkey](fig/hotkey.png) +On Document Viewer interface, press **Ctrl + Shift+ ?** to view all shortcut keys quickly, which helps you to use them skillfully and improves your working efficiency. ## Basic functions @@ -44,13 +42,24 @@ Document Viewer realizes basic document management such as opening files, saving ### Open files -Document Viewer supports DOCX, PDF, DJVU, and XPS formats. You can open a file by: +Document Viewer supports PDF, DJVU, DOCX, XPS and OFD formats. You can open a file by: - Dragging it directly into the interface or onto the icon. - Right-clicking it and selecting **Open with** > **Document Viewer**. After setting Document Viewer as the default program, you can open it by double-clicking it directly. - - Clicking **Select File** and selecting a file on Document Viewer interface. -- On Document Viewer interface, pressing **Ctrl+O** and selecting the file you want to open. +- On Document Viewer interface, pressing **Ctrl + O** and selecting the file you want to open. + +> ![notes](../common/notes.svg)Notes: +> - OFD (Open Fixed-layout Document) format supports basic viewing, zooming, page turning, and document info. Annotations, highlights, search, and printing are not supported currently. +> - XPS format supports viewing, text selection, search, page turning, and printing. + +### Restore reading position + +Document Viewer automatically remembers your reading state, including the last viewed page, scroll position, zoom ratio, display mode (single/dual page), rotation angle, sidebar status, and tab order. + +- When you reopen a previously viewed document, it automatically restores to your last reading position and interface state. +- Once the document is loaded, a prompt bar appears at the top of the window: "Restored to last reading position, click to jump to first page". Click it to return to the first page quickly. +- When a document is renamed or moved, Document Viewer will attempt to match and restore the reading progress based on file characteristics. ### Save documents @@ -63,13 +72,28 @@ To save the document that has been edited and modified, you can To print you have to connect and configure a printer. -1. Open a document in Document Viewer, right-click and select **Print**, or press **Ctrl + P** to open the preview page. +#### Regular printing + +1. Open a document in Document Viewer, right-click and select **Print**, or press **Ctrl + P** to open the preview page. 2. In this previewing interface, you can preview and set the printing page. 3. In this previewing interface, click **Advanced** to set the page size, print method and other parameters. -4. Click **Print** then the document will be sent to the printer for printing. +4. Click **Print** then the document will be sent to the printer for printing. ![preview](fig/printer.png) +#### Batch print + +You can print multiple documents from File Manager in one click without opening them one by one: + +1. In File Manager, select one or more documents to print (supports PDF, DJVU, DOCX, XPS formats). +2. Right-click and select **Batch print**. +3. Document Viewer will process and submit them directly to the system print queue (CUPS) using default parameters, without opening the application window or print preview. + +> ![notes](../common/notes.svg)Notes: +> - **Default print parameters**: System default printer, all pages, A4 paper, 1 copy, single-sided, actual size, original document orientation, color mode (automatically black-and-white if the printer only supports monochrome). +> - **Independent task processing**: Each document corresponds to an independent print task. Multiple batches are queued in order without interrupting each other. +> - **System notification feedback**: A system notification banner pops up on the right side of the screen to indicate progress. If conversion takes longer (over 1 minute), additional progress notifications will be sent. Once submitted, you can check task status in system **Print Manager**. + ### Manage tabs New tab @@ -133,8 +157,7 @@ On Document Viewer interface, open a file. > ![notes](../common/notes.svg)Notes: > + You can move the note icon in the current page. - > + You can not add annotations to DJVU files. - > + You can not add annotations to XPS files. + > + You can not add annotations to DJVU and OFD files. ## Common operations @@ -158,7 +181,7 @@ This function is only applicable for the current tab. 7. Clear up words in the searching box to clear up all results. -> ![notes](../common/notes.svg)Notes: You can not search in DJVU files. +> ![notes](../common/notes.svg)Notes: You can not search in DJVU and OFD files. @@ -221,8 +244,7 @@ In the scaling drop-down box of tool bar, you can: > ![notes](../common/notes.svg)Notes: > > - Document Viewer memorizes the color choice of the user, which will be the default color used when the user highlights any text the next time. -> - You can not highlight in DJVU files. -> - You can not highlight in XPS files. +> - You can not highlight in DJVU and OFD files. @@ -239,7 +261,7 @@ In the scaling drop-down box of tool bar, you can: ## Main Menu -In the main menu, you can create new window and new tabs, [save documents](#Save documents), [search](#Search), [print documents](#Print documents) switch themes, view help to know more about Document Viewer. +In the main menu, you can create new window and new tabs, [save documents](#Save documents), [search](#Search), [print documents](#Print documents), enable [eye protection mode](#Eye protection mode), switch themes, view help to know more about Document Viewer. ### Display in file manager @@ -253,6 +275,19 @@ In the main menu, you can create new window and new tabs, [save documents](#Save 3. Move the cursor to the area you want to view to magnify. 4. Press **Esc** or right-click to cancel magnifying. +### Eye protection mode + +When reading for a long time, you can enable eye protection mode to reduce visual glare and eye strain. + +1. On Document Viewer interface, click ![icon_menu](../common/icon_menu.svg). +2. Select **Eye protection mode**, and choose a preset from the submenu: + - **Classic eye protection**: Warm beige background, simulating paper texture and reducing blue light, ideal for prolonged reading. + - **Green eye protection**: Light green background, easing visual fatigue, suitable for daily office reading. + - **Night eye protection**: Dark background with light text, reducing screen contrast glare in dim environments. + +> ![notes](../common/notes.svg)Notes: +> - Eye protection mode only adjusts the background rendering of the reading view area. It does not alter the document's original content or affect print output. + ### Tools 1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. diff --git a/assets/deepin-reader/document-viewer/en_US/document-viewer.md b/assets/deepin-reader/document-viewer/en_US/document-viewer.md deleted file mode 100755 index 31abcd67e..000000000 --- a/assets/deepin-reader/document-viewer/en_US/document-viewer.md +++ /dev/null @@ -1,287 +0,0 @@ -# Document Viewer|deepin-reader| - -## Overview - -Document Viewer is a powerful and easy-to-use software built-in the system for opening and viewing files quickly, supporting operations such as adding bookmarks, adding notes, and highlighting some text. - - -## Guide - -You can run, close or create a shortcut of Document Viewer as follows. - - -### Run Document Viewer - -1. Click ![deepin_launcher](../common/deepin_launcher.svg) in the lower left corner of the dock to enter launcher interface. -2. Locate ![deepin_reader_24](../common/deepin_reader_24.svg) by scrolling up and down the mouse wheel or search “Document Viewer” in launcher, and click it to run. -3. Right-click ![deepin_reader_24](../common/deepin_reader_24.svg) to: - - - Select **Send to desktop** to create a shortcut on the desktop. - - Select **Send to dock** to fix it onto the dock. - - Select **Add to startup** to add it to startup. When the computer starts up, it runs automatically. - - - - -### Exit Document Viewer - -- On Document Viewer interface, click![close_icon](../common/close_icon.svg) to exit. -- Right-click ![deepin_reader_24](../common/deepin_reader_24.svg) on Dock and select **Close All** to exit. -- On Document Viewer interface, click ![icon_menu](../common/icon_menu.svg) and select **Exit**. - - -### View Shortcut Keys - -On Document Viewer interface, press **Ctrl + Shift+ ?** to view all shortcut keys quickly, which helps you to use them skillfully and improves your working efficiency. - -![1|hotkey](fig/hotkey.png) - - -## Basic functions - -Document Viewer realizes basic document management such as opening files, saving files, printing files, as well as managing tabs, bookmarks and notes. - - -### Open files - -Document Viewer supports DOCX, PDF, DJVU, and XPS formats. You can open a file by: - -- Dragging it directly into the interface or onto the icon. -- Right-clicking it and selecting **Open with** > **Document Viewer**. After setting Document Viewer as the default program, you can open it by double-clicking it directly. - -- Clicking **Select File** and selecting a file on Document Viewer interface. -- On Document Viewer interface, pressing **Ctrl+O** and selecting the file you want to open. - -### Save documents - -To save the document that has been edited and modified, you can - -- Press **Ctrl+S** or click ![icon_menu](../common/icon_menu.svg) > **Save**. -- Press **Ctrl + Shift + S** or click ![icon_menu](../common/icon_menu.svg) > **Save as**. - -### Print documents - -To print you have to connect and configure a printer. - -1. Open a document in Document Viewer, right-click and select **Print**, or press **Ctrl + P** to open the preview page. -2. In this previewing interface, you can preview and set the printing page. -3. In this previewing interface, click **Advanced** to set the page size, print method and other parameters. -4. Click **Print** then the document will be sent to the printer for printing. - -![preview](fig/printer.png) - -### Manage tabs - -New tab - -- Click ![icon_menu](../common/icon_menu.svg) > **New tab** to add a tab. -- When there are two or more tabs, you will see ![add](../common/add.svg) button. And you can click it to add new tabs. - -To switch/adjust tabs, you can: - -- Drag within the window to adjust the sequence of tabs. -- Click the ![previous](../common/previous.svg) or ![next](../common/next.svg)button to move left and right. -- Scroll the mouse wheel to switch tabs automatically. - - -Operations among windows - -- Drag any tab to move it out of the current window and create a new one. -- Drag a tab from one window to another. - - - -### Manage bookmarks - -On Document Viewer interface, open a file. - -- Add bookmark: - - Right-click any page in Document Viewer, select **Add bookmark** to mark this page. - - Move the cursor to the top right corner of the page until ![view](../common/bookmark.svg) appears, click this icon to add a bookmark for this page, and this icon will be filled in blue ![view](../common/bookmarkbig_checked_light.svg). -- Delete bookmark: - - Right-click the bookmark and select **Remove bookmark**. - - Click the colored bookmark icon ![view](../common/bookmarkbig_checked_light.svg) to cancel/delete the bookmark. - -> ![notes](../common/notes.svg)Notes: The bookmark icon appears only when the cursor moves to the bookmark area, and it disappears when the cursor moves out of the area. When a bookmark is added successfully, the icon would be displayed always. - -### Manage annotation - -On Document Viewer interface, open a file. - -- Add annotation - - - Select text using the selecting tool and right-click, select **Add annotation**. The selected text will be highlighted after the annotation is added successfully. - - Right-click at any blank area or the place you want to add an annotation and select **Add annotation**. After a note is successfully added, a highlighted note icon appears. - - > ![notes](../common/notes.svg)Notes: - > - Click in any blank area outside the window without inputing any content, then the note is not added successfully or is deleted automatically. - > - Click in any blank area outside the window after inputing some content, the content will be saved automatically. - -- Copy note - - Right-click the highlighted text to which a note is successfully added and select **Copy**. - - Right-click the note icon, select **Copy**. - - Click![menu](../common/thumbnail_normal_light.svg) and the catalog icon ![view](../common/comments_normal_light.svg) on the left and select a note, right-click and select **Copy**. - -- Show note - 1. Hove the cursor over the note icon to show the content. - 2. Click the note icon to pop up a window, you can view and re-edit. - -- Delete note - - Right-click the highlighted text to which you have added a note, and select **Remove highlight**. - - Right-click the note icon and select **Remove annotation**. - - Click the catalog icon ![view](../common/comments_normal_light.svg) on the left column, and select a note, right-click to select **Remove annotation**, this note is deleted and so is its content. - - > ![notes](../common/notes.svg)Notes: - > + You can move the note icon in the current page. - > + You can not add annotations to DJVU files. - > + You can not add annotations to XPS files. - -## Common operations - -Document Viewer integrates many features to make document management simpler and more efficient. - -### Search -This function is only applicable for the current tab. -1. On Document Viewer interface, open a file. -2. Right-click and select **Search** or press **Ctrl**+**F** to open a searching window. - -3. In the searching box, you can click ![search](../common/search.svg) to input keywords. - -4. Press **Enter** to locate quickly. - - All matching information will be displayed in a list and are highlighted in the document. - - If searching fails, "No search results" will be displayed. - -5. When matching results are found, click![search](../common/previousup.svg) or ![search](../common/nextdown.svg) to view results one by one. - -6. Click one result, you can skip to the page where it's located, and it's highlighted. -> ![attention](../common/attention.svg)Attention: Searching fails in case the text is coded in pictures in some PDF files. - -7. Clear up words in the searching box to clear up all results. - -> ![notes](../common/notes.svg)Notes: You can not search in DJVU files. - - - -### Flip pages quickly - -To move from page to page quickly, you can: - -- Right-click and select **Previous page** or **Next page**. -- To go the beginning or the end of the file, you can right-click and select **First page** or **Last page**. -- Press ![Down](../common/Down.svg) or ![Up](../common/Up.svg) on the keyboard. -- Input the page number and press **Enter** key. - - -### Switch catalog - -Using thumbnails you can switch file thumbnails catalog![view](../common/view_normal.svg), file catalog![catalog](../common/catalog.svg), bookmark catalog![view](../common/bookmark_normal.svg) and annotation catalog![view](../common/comments_normal_light.svg). - -### Fullscreen - -1. On Document Viewer interface, right-click and select **Fullscreen** or press shortcut key **F11**. -2. Move the cursor to the top or the left part of the window to call out the top tool bar or the left tool bar. Otherwise, the tool bar will be hidden. -3. After you call out the side tool bar under **Fullscreen** mode, click ![icon](../common/thumbnail_normal_light.svg) to keep it shown. -4. Press **Esc** or **F11** key to exit **Fullscreen** mode. - -### Slide show - -1. On Document Viewer interface, right-click and select **Slide show** to display the file as slides. -3. Click![play](../common/previous.svg)or![play](../common/next.svg) to switch pages, or click ![play](../common/suspend_normal.svg)to pause. -4. Press **Esc** key to exit. - -### Zoom in and out - -On Document Viewer interface, to zoom in or out a page, you can: - -- Press **Ctrl +“+”** or **Ctrl +“-”** . -- Press **Ctrl** and scroll the mouse wheel up and down at the same time. -- Click "**+**" or "**-**" in the title bar. -- Manual input the display percentage in the title bar or select one from the drop-down box of the menu bar, according to which the file is zoomed in and out. - - - -### Adjust view - -In the scaling drop-down box of tool bar, you can: - -- Click **Two-page View** to view two pages at a time. -- Click **1:1 size** to display the file in 100% ratio. -- Click **Fit Page** to display a whole page in the current window. -- Click **Fit Height** to display the page in the window fully in vertical direction. -- Click **Fit Width** to display the page in the window fully in horizontal direction. - -### Highlight - -1. On Document Viewer interface, select some text and right-click, select **Highlight**, there are several colors for you to choose. - -2. Select a color, the text selected will be highlighted in that color. - -3. Select the highlighted text, click **Remove highlight** to restore it to the status it was. - -> ![notes](../common/notes.svg)Notes: -> -> - Document Viewer memorizes the color choice of the user, which will be the default color used when the user highlights any text the next time. -> - You can not highlight in DJVU files. -> - You can not highlight in XPS files. - - - -### Rotate - -1. On Document Viewer interface, open a document. -2. Right-click and select **Rotate Left** or **Rotate Right** from the submenu, the page will rotate to the left or right by 90°. - - - -### Document info -1. On Document Viewer interface, open a document. -2. Right-click and select **Document info** to check the relevant information such as properties about the document. - -## Main Menu - -In the main menu, you can create new window and new tabs, [save documents](#Save documents), [search](#Search), [print documents](#Print documents) switch themes, view help to know more about Document Viewer. - -### Display in file manager - -1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. -2. Click **Display in file manager** to open and show the file's storing location in File Manager. - -### Magnifier - -1. On Document Viewer interface, open a document. -2. Click![icon_menu](../common/icon_menu.svg) > **Magnifier**. -3. Move the cursor to the area you want to view to magnify. -4. Press **Esc** or right-click to cancel magnifying. - -### Tools - -1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. -2. Select **Tools** to switch from two tools. - - Click **Select Text** to select text. - - Click **Hand Tool** to move the document. - -### Theme - -There are options including light theme, dark theme and system theme. - - 1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. - 2. Click **Theme** to select one. - -### Help - -Select **Help** to get the manual, which will help you further know and use Document Viewer. - - 1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. - 2. Click **Help** to view the manual. - - -### About - -1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. -2. Click **About** to view version information and introduction about Document Viewer. - -### Exit - -1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. -2. Click **Exit**. - diff --git a/assets/deepin-reader/document-viewer/en_US/p_document-viewer.md b/assets/deepin-reader/document-viewer/en_US/p_document-viewer.md index 31abcd67e..a989c419c 100755 --- a/assets/deepin-reader/document-viewer/en_US/p_document-viewer.md +++ b/assets/deepin-reader/document-viewer/en_US/p_document-viewer.md @@ -32,9 +32,7 @@ You can run, close or create a shortcut of Document Viewer as follows. ### View Shortcut Keys -On Document Viewer interface, press **Ctrl + Shift+ ?** to view all shortcut keys quickly, which helps you to use them skillfully and improves your working efficiency. - -![1|hotkey](fig/hotkey.png) +On Document Viewer interface, press **Ctrl + Shift+ ?** to view all shortcut keys quickly, which helps you to use them skillfully and improves your working efficiency. ## Basic functions @@ -44,13 +42,24 @@ Document Viewer realizes basic document management such as opening files, saving ### Open files -Document Viewer supports DOCX, PDF, DJVU, and XPS formats. You can open a file by: +Document Viewer supports PDF, DJVU, DOCX, XPS and OFD formats. You can open a file by: - Dragging it directly into the interface or onto the icon. - Right-clicking it and selecting **Open with** > **Document Viewer**. After setting Document Viewer as the default program, you can open it by double-clicking it directly. - - Clicking **Select File** and selecting a file on Document Viewer interface. -- On Document Viewer interface, pressing **Ctrl+O** and selecting the file you want to open. +- On Document Viewer interface, pressing **Ctrl + O** and selecting the file you want to open. + +> ![notes](../common/notes.svg)Notes: +> - OFD (Open Fixed-layout Document) format supports basic viewing, zooming, page turning, and document info. Annotations, highlights, search, and printing are not supported currently. +> - XPS format supports viewing, text selection, search, page turning, and printing. + +### Restore reading position + +Document Viewer automatically remembers your reading state, including the last viewed page, scroll position, zoom ratio, display mode (single/dual page), rotation angle, sidebar status, and tab order. + +- When you reopen a previously viewed document, it automatically restores to your last reading position and interface state. +- Once the document is loaded, a prompt bar appears at the top of the window: "Restored to last reading position, click to jump to first page". Click it to return to the first page quickly. +- When a document is renamed or moved, Document Viewer will attempt to match and restore the reading progress based on file characteristics. ### Save documents @@ -63,13 +72,28 @@ To save the document that has been edited and modified, you can To print you have to connect and configure a printer. -1. Open a document in Document Viewer, right-click and select **Print**, or press **Ctrl + P** to open the preview page. +#### Regular printing + +1. Open a document in Document Viewer, right-click and select **Print**, or press **Ctrl + P** to open the preview page. 2. In this previewing interface, you can preview and set the printing page. 3. In this previewing interface, click **Advanced** to set the page size, print method and other parameters. -4. Click **Print** then the document will be sent to the printer for printing. +4. Click **Print** then the document will be sent to the printer for printing. ![preview](fig/printer.png) +#### Batch print + +You can print multiple documents from File Manager in one click without opening them one by one: + +1. In File Manager, select one or more documents to print (supports PDF, DJVU, DOCX, XPS formats). +2. Right-click and select **Batch print**. +3. Document Viewer will process and submit them directly to the system print queue (CUPS) using default parameters, without opening the application window or print preview. + +> ![notes](../common/notes.svg)Notes: +> - **Default print parameters**: System default printer, all pages, A4 paper, 1 copy, single-sided, actual size, original document orientation, color mode (automatically black-and-white if the printer only supports monochrome). +> - **Independent task processing**: Each document corresponds to an independent print task. Multiple batches are queued in order without interrupting each other. +> - **System notification feedback**: A system notification banner pops up on the right side of the screen to indicate progress. If conversion takes longer (over 1 minute), additional progress notifications will be sent. Once submitted, you can check task status in system **Print Manager**. + ### Manage tabs New tab @@ -133,8 +157,7 @@ On Document Viewer interface, open a file. > ![notes](../common/notes.svg)Notes: > + You can move the note icon in the current page. - > + You can not add annotations to DJVU files. - > + You can not add annotations to XPS files. + > + You can not add annotations to DJVU and OFD files. ## Common operations @@ -158,7 +181,7 @@ This function is only applicable for the current tab. 7. Clear up words in the searching box to clear up all results. -> ![notes](../common/notes.svg)Notes: You can not search in DJVU files. +> ![notes](../common/notes.svg)Notes: You can not search in DJVU and OFD files. @@ -221,8 +244,7 @@ In the scaling drop-down box of tool bar, you can: > ![notes](../common/notes.svg)Notes: > > - Document Viewer memorizes the color choice of the user, which will be the default color used when the user highlights any text the next time. -> - You can not highlight in DJVU files. -> - You can not highlight in XPS files. +> - You can not highlight in DJVU and OFD files. @@ -239,7 +261,7 @@ In the scaling drop-down box of tool bar, you can: ## Main Menu -In the main menu, you can create new window and new tabs, [save documents](#Save documents), [search](#Search), [print documents](#Print documents) switch themes, view help to know more about Document Viewer. +In the main menu, you can create new window and new tabs, [save documents](#Save documents), [search](#Search), [print documents](#Print documents), enable [eye protection mode](#Eye protection mode), switch themes, view help to know more about Document Viewer. ### Display in file manager @@ -253,6 +275,19 @@ In the main menu, you can create new window and new tabs, [save documents](#Save 3. Move the cursor to the area you want to view to magnify. 4. Press **Esc** or right-click to cancel magnifying. +### Eye protection mode + +When reading for a long time, you can enable eye protection mode to reduce visual glare and eye strain. + +1. On Document Viewer interface, click ![icon_menu](../common/icon_menu.svg). +2. Select **Eye protection mode**, and choose a preset from the submenu: + - **Classic eye protection**: Warm beige background, simulating paper texture and reducing blue light, ideal for prolonged reading. + - **Green eye protection**: Light green background, easing visual fatigue, suitable for daily office reading. + - **Night eye protection**: Dark background with light text, reducing screen contrast glare in dim environments. + +> ![notes](../common/notes.svg)Notes: +> - Eye protection mode only adjusts the background rendering of the reading view area. It does not alter the document's original content or affect print output. + ### Tools 1. Click ![icon_menu](../common/icon_menu.svg) on the main interface. diff --git a/assets/deepin-reader/document-viewer/zh_CN/d_document-viewer.md b/assets/deepin-reader/document-viewer/zh_CN/d_document-viewer.md index 9f2d5a924..597db7ec0 100755 --- a/assets/deepin-reader/document-viewer/zh_CN/d_document-viewer.md +++ b/assets/deepin-reader/document-viewer/zh_CN/d_document-viewer.md @@ -33,8 +33,6 @@ 在文档查看器界面,使用快捷键 **Ctrl + Shift + ?** 打开快捷键预览界面。熟练地使用快捷键,将大大提升您的操作效率。 -![1|hotkey](fig/hotkey.png) - ## 基本功能 @@ -43,13 +41,25 @@ ### 打开文件 -文档查看器支持查看 PDF、DJVU、DOCX、XPS 等格式的文件,您可以采用以下方式打开文件。 +文档查看器支持查看PDF、DJVU、DOCX、XPS以及OFD格式的文件,您可以采用以下方式打开文件。 - 直接将文件拖拽到界面或其图标上。 - 右键单击文件,选择 **打开方式 > 文档查看器**。将文档查看器设为默认打开程序后,可以直接双击打开。 - 在文档查看器初始界面,单击 **选择文件**。 - 在文档查看器界面,使用快捷键 **Ctrl + O**,选择文件打开。 +> ![notes](../common/notes.svg)说明: +> - OFD(国家版式文档标准)格式支持基础查看、缩放、翻页及查看文档信息,暂不支持注释、高亮、搜索及打印功能。 +> - XPS格式支持浏览、文本选择、搜索、翻页及打印。 + +### 恢复阅读位置 + +文档查看器会自动记录您的阅读状态,包括最后浏览的页码、页面滚动位置、缩放比例、显示模式(单页/双页)、旋转角度、侧边栏展开状态与标签页排序等。 + +- 当您再次打开曾浏览过的文档时,系统将自动恢复至上次离开时的阅读位置与界面状态。 +- 文档加载完成后,窗口顶部会弹出提示条:“已恢复上次阅读位置,点击跳转到首页”,单击该提示条可快速回到文档首页。 +- 文档重命名或移动位置后,文档查看器会尝试基于文件特征自动匹配并恢复阅读进度。 + ### 保存文件 对当前正在编辑、修改的文档进行保存。 @@ -62,6 +72,8 @@ 在文档查看器中使用打印,需要提前连接并配置好打印机。 +#### 常规打印 + 1. 在文档查看器中打开一个文档,在文档界面单击鼠标右键选择 **打印**,也可以使用快捷键 **Ctrl + P** 打开打印预览。 2. 在打印预览界面,您可以预览文件,选择打印机并设置打印页面。 3. 在打印预览界面,单击 **高级设置**,可配置纸张大小、打印方式等相关参数。 @@ -69,6 +81,19 @@ ![printer](fig/printer.png) +#### 批量打印 + +您无需逐一打开文档,即可在文件管理器中一键将多个文档提交打印: + +1. 在文件管理器中,选中需要打印的一个或多个文档(支持 PDF、DJVU、DOCX、XPS 格式)。 +2. 单击鼠标右键,选择 **批量打印**。 +3. 文档查看器将直接按默认参数处理并提交至系统打印队列(CUPS),无需打开应用界面或打印预览。 + +> ![notes](../common/notes.svg)说明: +> - **默认打印参数**:使用系统默认打印机、全部页码、A4纸张、打印1份、单面打印、实际大小、按文档实际方向、色彩模式为彩色(黑白打印机自动采用黑白)。 +> - **任务独立处理**:每个文档对应独立的打印任务,多批次打印按序排队,不会相互打断。 +> - **系统通知反馈**:任务提交后屏幕右侧将弹出系统通知横幅提示处理进度。若文档转换耗时较长(超过1分钟),系统将追加发送进度通知。文档提交完成后,可打开系统 **打印管理器** 查看打印任务与进度。 + ### 管理标签页 新增标签页 @@ -133,8 +158,7 @@ > ![notes](../common/notes.svg)说明: > + 支持在当前页移动注释图标。 -> + DJVU格式的文件不支持添加注释。 -> + XPS格式的文件不支持添加注释。 +> + DJVU和OFD格式的文件不支持添加注释。 ## 常用操作 @@ -154,7 +178,7 @@ > ![attention](../common/attention.svg)注意:不可搜索文档中由文本转换成图片的内容。 7. 清除搜索框中的信息,即可清除搜索结果。 - > ![notes](../common/notes.svg)说明:DJVU格式的文件不支持搜索功能。 + > ![notes](../common/notes.svg)说明:DJVU和OFD格式的文件不支持搜索功能。 @@ -222,8 +246,7 @@ 3. 选中已经高亮显示的文本,单击 **取消高亮**,可以删除文字高亮显示效果。 > ![notes](../common/notes.svg)说明: > - 当再次高亮文本时,可右键直接选择 **高亮**,默认使用您上次选择的高亮颜色。 - > - DJVU格式的文件不支持高亮设置。 - > - XPS格式的文件不支持高亮设置。 + > - DJVU和OFD格式的文件不支持高亮设置。 @@ -243,7 +266,7 @@ ## 主菜单 -在主菜单中,您可以新建窗口、新建标签页、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、切换窗口主题、查看帮助手册、了解文档查看器的更多信息。 +在主菜单中,您可以新建窗口、新建标签页、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、开启[护眼模式](#护眼模式)、切换窗口主题、查看帮助手册、了解文档查看器的更多信息。 ### 在文件管理器中显示 @@ -256,6 +279,19 @@ 2. 选择 **放大镜**,将鼠标移动到页面需要查看的区域,则该区域内容放大。 3. 按下键盘上的 **Esc** 键或右键单击,取消放大镜功能。 +### 护眼模式 + +长时间阅读文档时,您可以开启护眼模式降低屏幕视觉刺激,缓解眼睛疲劳。 + +1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 +2. 选择 **护眼模式**,在子菜单中选择预设样式: + - **经典护眼**:米黄色背景,模拟纸质柔和质感,减少蓝光刺激,适合长时间阅读。 + - **绿色护眼**:浅绿色背景,缓解视觉疲劳,适合日常办公阅读。 + - **夜间护眼**:深色背景搭配浅色文字,降低暗光环境下的屏幕对比刺激。 + +> ![notes](../common/notes.svg)说明: +> - 护眼模式仅作用于应用阅读视图区域的背景渲染,不会修改文档本身内容,亦不影响打印输出。 + ### 切换工具 1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 diff --git a/assets/deepin-reader/document-viewer/zh_CN/document-viewer.md b/assets/deepin-reader/document-viewer/zh_CN/document-viewer.md deleted file mode 100755 index 9f2d5a924..000000000 --- a/assets/deepin-reader/document-viewer/zh_CN/document-viewer.md +++ /dev/null @@ -1,292 +0,0 @@ -# 文档查看器|deepin-reader| - -## 概述 - -文档查看器是系统自带的文档查看软件,不仅可以打开、查看文件,还可以对文档进行添加书签、添加注释以及高亮文本等操作。 - - -## 使用入门 - -通过以下方式运行或关闭文档查看器,或者创建文档查看器的快捷方式。 - - -### 运行文档查看器 - -1. 单击任务栏上的启动器图标 ![deepin_launcher](../common/deepin_launcher.svg),进入启动器界面。 -2. 上下滚动鼠标滚轮浏览或通过搜索,找到文档查看器图标 ![deepin_reader_24](../common/deepin_reader_24.svg),单击运行。 -3. 右键单击 ![deepin_reader_24](../common/deepin_reader_24.svg),您可以: - - - 单击 **发送到桌面**,在桌面创建快捷方式。 - - 单击 **发送到任务栏**,将应用程序固定到任务栏。 - - 单击 **开机自动启动**,将应用程序添加到开机启动项,在电脑开机时自动运行该应用。 - - - -### 关闭文档查看器 - -- 在文档查看器界面单击 ![close_icon](../common/close_icon.svg),退出文档查看器。 -- 在任务栏右键单击 ![deepin_reader_24](../common/deepin_reader_24.svg),选择 **关闭所有**,退出文档查看器。 -- 在文档查看器界面单击 ![icon_menu](../common/icon_menu.svg),选择 **退出**,退出文档查看器。 - - -### 查看快捷键 - -在文档查看器界面,使用快捷键 **Ctrl + Shift + ?** 打开快捷键预览界面。熟练地使用快捷键,将大大提升您的操作效率。 - -![1|hotkey](fig/hotkey.png) - - -## 基本功能 - -文档查看器具备基本的文件管理功能,可以执行打开、保存、打印文件、管理标签页、书签、注释等操作。 - - -### 打开文件 - -文档查看器支持查看 PDF、DJVU、DOCX、XPS 等格式的文件,您可以采用以下方式打开文件。 - -- 直接将文件拖拽到界面或其图标上。 -- 右键单击文件,选择 **打开方式 > 文档查看器**。将文档查看器设为默认打开程序后,可以直接双击打开。 -- 在文档查看器初始界面,单击 **选择文件**。 -- 在文档查看器界面,使用快捷键 **Ctrl + O**,选择文件打开。 - -### 保存文件 - -对当前正在编辑、修改的文档进行保存。 - -- 单击 ![icon_menu](../common/icon_menu.svg) > **保存** 或使用快捷键 **Ctrl + S** 保存文件。 -- 单击 ![icon_menu](../common/icon_menu.svg) > **另存为** 或使用快捷键 **Ctrl + Shift + S**,另存文件。 - - -### 打印文件 - -在文档查看器中使用打印,需要提前连接并配置好打印机。 - -1. 在文档查看器中打开一个文档,在文档界面单击鼠标右键选择 **打印**,也可以使用快捷键 **Ctrl + P** 打开打印预览。 -2. 在打印预览界面,您可以预览文件,选择打印机并设置打印页面。 -3. 在打印预览界面,单击 **高级设置**,可配置纸张大小、打印方式等相关参数。 -4. 单击 **打印** 即可将文件发送到打印机打印。 - -![printer](fig/printer.png) - -### 管理标签页 - -新增标签页 - -- 单击 ![icon_menu](../common/icon_menu.svg) > **新标签页**,新增一个标签页。 -- 当标签页达两个或两个以上时,会显示按钮 ![icon](../common/add.svg) ,单击该按钮添加新标签页。 - -切换/调整标签页 - -- 同一窗口内拖拽标签页调整排序。 -- 当标签页过多时会显示按钮 ![previous](../common/previous.svg) 或 ![next](../common/next.svg) ,单击可左右移动。 -- 滚动鼠标切换标签页。 - - -窗口间的操作 - -- 拖拽标签页移出当前窗口,创建一个新的窗口。 -- 拖拽标签页从一个窗口到另一个窗口中。 - - - -### 管理书签 - -在文档查看器界面,打开一个文档。 - -- 添加书签 - - 右键单击文档查看器中的文件页,选择 **添加书签**,为当前正在浏览的页面添加书签。 - - 将鼠标移至浏览页面右上角书签区域,显示图标 ![view](../common/bookmark.svg),单击书签图标为当前页添加书签,书签图标变为蓝色填充的图标 ![view](../common/bookmarkbig_checked_light.svg)。 -- 删除书签: - - 在已添加书签的页面,单击鼠标右键,选择 **删除书签**,删除当前页的书签。 - - 在已添加书签的页面,单击书签图标 ![view](../common/bookmarkbig_checked_light.svg),删除当前页的书签。 - - > ![notes](../common/notes.svg)说明:鼠标移到书签位置附近才会显示书签图标。鼠标移出书签区域,书签图标消失。当添加书签后,该图标一直显示。 - -### 管理注释 - -在文档查看器界面,打开一个文档。 - -- 添加注释 - - + 使用选择工具选择一段文本内容,单击鼠标右键,选择 **添加注释**,完成注释后被选中的文本内容会被高亮显示。 - + 在文档空白处或者需要添加注释的地方,单击鼠标右键,选择 **添加注释**,完成注释后该处会显示一个高亮注释图标。 - -> ![notes](../common/notes.svg)说明:如果注释窗口不输入内容,直接单击其他区域,则添加注释不成功或该条注释自动删除。输入文本内容后,单击其他区域,注释内容自动保存。 - -- 复制注释 - - + 在页面上,右键单击已添加注释的文本内容,选择 **复制**,复制该条注释的全部内容。 - + 在页面上,右键单击注释图标,选择 **复制**,复制该条注释的全部内容。 - + 单击图标 ![menu](../common/thumbnail_normal_light.svg) 打开左侧工具栏,在工具栏下方单击图标 ![view](../common/comments_normal_light.svg) 打开注释目录,右键单击某一个注释,选择 **复制**,复制该条注释的全部内容。 - -- 显示注释 - - 1. 将鼠标悬停至注释图标上,在出现的浮框中显示部分注释内容。 - 2. 单击注释图标,弹出注释窗口,可以查看、重新编辑注释内容。 - -- 删除注释 - - + 右键单击已添加注释的高亮文本内容,选择 **取消高亮**,删除该条注释内容。 - + 右键单击注释图标,选择 **删除注释**,删除该条注释内容。 - + 单击图标 ![menu](../common/thumbnail_normal_light.svg) 打开左侧工具栏,在工具栏下方单击图标 ![view](../common/comments_normal_light.svg) 打开注释目录,右键单击某一个注释,选择 **删除注释**,删除该条注释内容,对应页面上的这条注释也会被删除。 - -> ![notes](../common/notes.svg)说明: -> + 支持在当前页移动注释图标。 -> + DJVU格式的文件不支持添加注释。 -> + XPS格式的文件不支持添加注释。 - -## 常用操作 - -文档查看器具备很多特色功能,这些功能都是为了让文件管理更加简单、高效。 - -### 搜索 - -1. 在文档查看器界面,打开一个文档。 -2. 单击鼠标右键,选择 **搜索** 或使用快捷键 **Ctrl + F** 打开搜索窗口。 -3. 在搜索框中,单击 ![search](../common/search.svg),输入关键字。 -4. 按下键盘上的 **Enter** 键进行搜索。 - - 当搜索到匹配的信息时,侧边栏会显示全部搜索结果,文档中会高亮显示匹配项。 - - 当没有搜索到匹配的信息时,侧边栏会显示“无搜索结果”。 -5. 当搜索到匹配信息后,单击按钮 ![search](../common/previousup.svg) 或 ![search](../common/nextdown.svg) 可逐个查找上一个或下一个匹配项。 -6. 单击某条搜索结果,跳转到对应页面,该页面的搜索结果高亮显示。 - - > ![attention](../common/attention.svg)注意:不可搜索文档中由文本转换成图片的内容。 -7. 清除搜索框中的信息,即可清除搜索结果。 - - > ![notes](../common/notes.svg)说明:DJVU格式的文件不支持搜索功能。 - - - -### 快速翻页 - -使用下列方法之一快速翻页: - -- 在右键菜单中选择 **前一页** 或 **后一页** 。 -- 如果您想直接浏览文档的开头或结尾,可在右键菜单中选择 **第一页** 或 **最后一页**。 -- 按下键盘上的 ![Down](../common/Down.svg) 或 ![Up](../common/Up.svg) 键。 -- 在侧边栏缩略图目录下,输入页码数后按下 **Enter** 键。 - - - -### 切换目录 - -在侧边栏,您可以切换文档缩略图目录 ![view](../common/view_normal.svg)、文档目录 ![catalog](../common/catalog.svg) 、书签目录 ![view](../common/bookmark_normal.svg)、注释目录 ![view](../common/comments_normal_light.svg) 。 - - - -### 全屏 - -1. 在文档查看器界面,单击鼠标右键选择 **全屏** 或使用快捷键 **F11**,文档将以全屏形式展示。 -2. 将鼠标移到窗口顶部或者左侧区域,呼出顶部工具栏或侧边工具栏;将鼠标移出区域外,工具栏自动隐藏。 -3. 在全屏状态下,呼出顶部工具栏后单击缩略图 ![icon](../common/thumbnail_normal_light.svg),侧边工具栏会一直显示。 -4. 按下键盘上的 **Esc** 键或使用快捷键 **F11** 退出全屏。 - - - -### 幻灯片放映 - -1. 在文档查看器界面,单击鼠标右键选择 **幻灯片放映**,文档页面将以幻灯片形式进行播放。 -2. 单击 ![play](../common/previous.svg) 或 ![play](../common/next.svg) 切换文档页面,也可以点击 ![play](../common/suspend_normal.svg) 停止播放。 -3. 单击按钮 **×** 或按下键盘上的 **Esc** 键退出播放。 - - - -### 放大和缩小 - -在文档查看器界面,使用下列方法之一放大或缩小页面: - -- 按下键盘上的 **Ctrl + “+”** 或 **Ctrl + “-”** 。 -- 按下键盘上的 **Ctrl** 键,同时使用鼠标滚轮滚动。 -- 在标题栏中单击 **+** 放大或单击 **-** 缩小 。 -- 在标题栏中手动输入缩略比例,或者在下拉框选择缩略比例,文档跟着比例依次放大或缩小。 - - - -### 调整页面视图 - -在标题栏缩放比例下拉框中,您可以: - -- 单击 **双页显示**,进入双页显示模式。 -- 单击 **默认大小**,页面以100%比例显示。 -- 单击 **适合页面**,当前窗口显示整页。 -- 单击 **适应高度**,页面高度在视窗内全部显示。 -- 单击 **适应宽度**,页面宽度在视窗内全部显示。 - - - -### 高亮文本 - -1. 在文档查看器界面选中文本,单击鼠标右键选择 **高亮**,此时有不同的高亮颜色可供选择。 -2. 选定一种颜色,被选中的文本内容将以该颜色为底纹高亮显示。 -3. 选中已经高亮显示的文本,单击 **取消高亮**,可以删除文字高亮显示效果。 - > ![notes](../common/notes.svg)说明: - > - 当再次高亮文本时,可右键直接选择 **高亮**,默认使用您上次选择的高亮颜色。 - > - DJVU格式的文件不支持高亮设置。 - > - XPS格式的文件不支持高亮设置。 - - - -### 旋转 - -1. 在文档查看器界面,打开一个文件。 -2. 单击鼠标右键选择 **左旋转** 或 **右旋转**,页面全部同时向左或向右旋转90°。 - - - -### 查看文档信息 - -1. 在文档查看器界面,打开一个文件。 -2. 单击鼠标右键选择 **文档信息**,查看文档相关参数信息。 - - - -## 主菜单 - -在主菜单中,您可以新建窗口、新建标签页、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、切换窗口主题、查看帮助手册、了解文档查看器的更多信息。 - -### 在文件管理器中显示 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 -2. 选择 **在文件管理器中显示**,定位该文件的存储位置。 - -### 放大镜 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg) 。 -2. 选择 **放大镜**,将鼠标移动到页面需要查看的区域,则该区域内容放大。 -3. 按下键盘上的 **Esc** 键或右键单击,取消放大镜功能。 - -### 切换工具 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 -2. 选择 **工具**,支持两种工具切换。 - - **选择工具** 支持选择文本内容。 - - **手形工具** 支持在文档中移动。 - -### 主题 - -窗口主题包含浅色主题、深色主题和系统主题。 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 -2. 选择 **主题**,选择一个主题颜色。 - -### 帮助 - -查看帮助手册,进一步了解和使用文档查看器。 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 -2. 选择 **帮助**。 -3. 查看文档查看器的帮助手册。 - - -### 关于 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 -2. 选择 **关于**。 -3. 查看文档查看器的版本和介绍。 - -### 退出 - -1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 -2. 选择 **退出**。 - diff --git a/assets/deepin-reader/document-viewer/zh_CN/p_document-viewer.md b/assets/deepin-reader/document-viewer/zh_CN/p_document-viewer.md index 9f2d5a924..597db7ec0 100755 --- a/assets/deepin-reader/document-viewer/zh_CN/p_document-viewer.md +++ b/assets/deepin-reader/document-viewer/zh_CN/p_document-viewer.md @@ -33,8 +33,6 @@ 在文档查看器界面,使用快捷键 **Ctrl + Shift + ?** 打开快捷键预览界面。熟练地使用快捷键,将大大提升您的操作效率。 -![1|hotkey](fig/hotkey.png) - ## 基本功能 @@ -43,13 +41,25 @@ ### 打开文件 -文档查看器支持查看 PDF、DJVU、DOCX、XPS 等格式的文件,您可以采用以下方式打开文件。 +文档查看器支持查看PDF、DJVU、DOCX、XPS以及OFD格式的文件,您可以采用以下方式打开文件。 - 直接将文件拖拽到界面或其图标上。 - 右键单击文件,选择 **打开方式 > 文档查看器**。将文档查看器设为默认打开程序后,可以直接双击打开。 - 在文档查看器初始界面,单击 **选择文件**。 - 在文档查看器界面,使用快捷键 **Ctrl + O**,选择文件打开。 +> ![notes](../common/notes.svg)说明: +> - OFD(国家版式文档标准)格式支持基础查看、缩放、翻页及查看文档信息,暂不支持注释、高亮、搜索及打印功能。 +> - XPS格式支持浏览、文本选择、搜索、翻页及打印。 + +### 恢复阅读位置 + +文档查看器会自动记录您的阅读状态,包括最后浏览的页码、页面滚动位置、缩放比例、显示模式(单页/双页)、旋转角度、侧边栏展开状态与标签页排序等。 + +- 当您再次打开曾浏览过的文档时,系统将自动恢复至上次离开时的阅读位置与界面状态。 +- 文档加载完成后,窗口顶部会弹出提示条:“已恢复上次阅读位置,点击跳转到首页”,单击该提示条可快速回到文档首页。 +- 文档重命名或移动位置后,文档查看器会尝试基于文件特征自动匹配并恢复阅读进度。 + ### 保存文件 对当前正在编辑、修改的文档进行保存。 @@ -62,6 +72,8 @@ 在文档查看器中使用打印,需要提前连接并配置好打印机。 +#### 常规打印 + 1. 在文档查看器中打开一个文档,在文档界面单击鼠标右键选择 **打印**,也可以使用快捷键 **Ctrl + P** 打开打印预览。 2. 在打印预览界面,您可以预览文件,选择打印机并设置打印页面。 3. 在打印预览界面,单击 **高级设置**,可配置纸张大小、打印方式等相关参数。 @@ -69,6 +81,19 @@ ![printer](fig/printer.png) +#### 批量打印 + +您无需逐一打开文档,即可在文件管理器中一键将多个文档提交打印: + +1. 在文件管理器中,选中需要打印的一个或多个文档(支持 PDF、DJVU、DOCX、XPS 格式)。 +2. 单击鼠标右键,选择 **批量打印**。 +3. 文档查看器将直接按默认参数处理并提交至系统打印队列(CUPS),无需打开应用界面或打印预览。 + +> ![notes](../common/notes.svg)说明: +> - **默认打印参数**:使用系统默认打印机、全部页码、A4纸张、打印1份、单面打印、实际大小、按文档实际方向、色彩模式为彩色(黑白打印机自动采用黑白)。 +> - **任务独立处理**:每个文档对应独立的打印任务,多批次打印按序排队,不会相互打断。 +> - **系统通知反馈**:任务提交后屏幕右侧将弹出系统通知横幅提示处理进度。若文档转换耗时较长(超过1分钟),系统将追加发送进度通知。文档提交完成后,可打开系统 **打印管理器** 查看打印任务与进度。 + ### 管理标签页 新增标签页 @@ -133,8 +158,7 @@ > ![notes](../common/notes.svg)说明: > + 支持在当前页移动注释图标。 -> + DJVU格式的文件不支持添加注释。 -> + XPS格式的文件不支持添加注释。 +> + DJVU和OFD格式的文件不支持添加注释。 ## 常用操作 @@ -154,7 +178,7 @@ > ![attention](../common/attention.svg)注意:不可搜索文档中由文本转换成图片的内容。 7. 清除搜索框中的信息,即可清除搜索结果。 - > ![notes](../common/notes.svg)说明:DJVU格式的文件不支持搜索功能。 + > ![notes](../common/notes.svg)说明:DJVU和OFD格式的文件不支持搜索功能。 @@ -222,8 +246,7 @@ 3. 选中已经高亮显示的文本,单击 **取消高亮**,可以删除文字高亮显示效果。 > ![notes](../common/notes.svg)说明: > - 当再次高亮文本时,可右键直接选择 **高亮**,默认使用您上次选择的高亮颜色。 - > - DJVU格式的文件不支持高亮设置。 - > - XPS格式的文件不支持高亮设置。 + > - DJVU和OFD格式的文件不支持高亮设置。 @@ -243,7 +266,7 @@ ## 主菜单 -在主菜单中,您可以新建窗口、新建标签页、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、切换窗口主题、查看帮助手册、了解文档查看器的更多信息。 +在主菜单中,您可以新建窗口、新建标签页、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、开启[护眼模式](#护眼模式)、切换窗口主题、查看帮助手册、了解文档查看器的更多信息。 ### 在文件管理器中显示 @@ -256,6 +279,19 @@ 2. 选择 **放大镜**,将鼠标移动到页面需要查看的区域,则该区域内容放大。 3. 按下键盘上的 **Esc** 键或右键单击,取消放大镜功能。 +### 护眼模式 + +长时间阅读文档时,您可以开启护眼模式降低屏幕视觉刺激,缓解眼睛疲劳。 + +1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 +2. 选择 **护眼模式**,在子菜单中选择预设样式: + - **经典护眼**:米黄色背景,模拟纸质柔和质感,减少蓝光刺激,适合长时间阅读。 + - **绿色护眼**:浅绿色背景,缓解视觉疲劳,适合日常办公阅读。 + - **夜间护眼**:深色背景搭配浅色文字,降低暗光环境下的屏幕对比刺激。 + +> ![notes](../common/notes.svg)说明: +> - 护眼模式仅作用于应用阅读视图区域的背景渲染,不会修改文档本身内容,亦不影响打印输出。 + ### 切换工具 1. 在文档查看器界面,单击 ![icon_menu](../common/icon_menu.svg)。 diff --git a/assets/deepin-reader/document-viewer/zh_HK/d_document-viewer.md b/assets/deepin-reader/document-viewer/zh_HK/d_document-viewer.md index c62b94fd6..a26a7f0fa 100755 --- a/assets/deepin-reader/document-viewer/zh_HK/d_document-viewer.md +++ b/assets/deepin-reader/document-viewer/zh_HK/d_document-viewer.md @@ -34,8 +34,6 @@ 在文檔查看器界面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽界面。熟練地使用快捷鍵,將大大提升您的操作效率。 -![1|hotkey](fig/hotkey.png) - ## 基本功能 @@ -44,13 +42,25 @@ ### 打開文件 -文檔查看器支持查看PDF、DJVU和DOCX格式的文件,您可以採用以下方式打開文件。 +文檔查看器支持查看PDF、DJVU、DOCX、XPS以及OFD格式的文件,您可以採用以下方式打開文件。 - 直接將文件拖拽到界面或其圖標上。 - 右鍵單擊文件,選擇 **打開方式 > 文檔查看器**。將文檔查看器設為默認打開程序後,可以直接雙擊打開。 - 在文檔查看器初始界面,單擊 **選擇文件**。 - 在文檔查看器界面,使用快捷鍵 **Ctrl + O**,選擇文件打開。 +> ![notes](../common/notes.svg)說明: +> - OFD(國家版式文檔標準)格式支持基礎查看、縮放、翻頁及查看文檔信息,暫不支持注釋、高亮、搜索及打印功能。 +> - XPS格式支持瀏覽、文本選擇、搜索、翻頁及打印。 + +### 恢復閱讀位置 + +文檔查看器會自動記錄您的閱讀狀態,包括最後瀏覽的頁碼、頁面滾動位置、縮放比例、顯示模式(單頁/雙頁)、旋轉角度、側邊欄展開狀態與標籤頁排序等。 + +- 當您再次打開曾瀏覽過的文檔時,系統將自動恢復至上次離開時的閱讀位置與界面狀態。 +- 文檔加載完成後,窗口頂部會彈出提示條:「已恢復上次閱讀位置,點擊跳轉到首頁」,單擊該提示條可快速回到文檔首頁。 +- 文檔重命名或移動位置後,文檔查看器會嘗試基於文件特徵自動匹配並恢復閱讀進度。 + ### 保存文件 對當前正在編輯、修改的文檔進行保存。 @@ -63,10 +73,27 @@ 在文檔查看器中使用打印,需要您連接並配置好打印機。 +#### 常規打印 + 1. 在文檔查看器中打開一個文檔,在文檔界面單擊鼠標右鍵選擇 **打印**,也可以使用快捷鍵 **Ctrl + P** 打開打印預覽。 2. 在打印預覽界面,您可以預覽文件,選擇打印機並設置打印頁面。 3. 在打印預覽界面,單擊 **進階**,可配置紙張大小、打印方式等相關參數。 -4. 單擊 **打印** 即可將文件發送到打印機打印。 +4. 單擊 **打印** 即可将文件發送到打印機打印。 + +![printer](fig/printer.png) + +#### 批量打印 + +您無需逐一打開文檔,即可在檔案管理員中一鍵將多個文檔提交打印: + +1. 在檔案管理員中,選中需要打印的一個或多個文檔(支持 PDF、DJVU、DOCX、XPS 格式)。 +2. 單擊鼠標右鍵,選擇 **批量打印**。 +3. 文檔查看器將直接按默認參數處理並提交至系統打印隊列(CUPS),無需打開應用界面或打印預覽。 + +> ![notes](../common/notes.svg)說明: +> - **默認打印參數**:使用系統默認打印機、全部頁碼、A4紙張、打印1份、單面打印、實際大小、按文檔實際方向、色彩模式為彩色(黑白打印機自動採用黑白)。 +> - **任務獨立處理**:每個文檔對應獨立的打印任務,多批次打印按序排隊,不會相互打斷。 +> - **系統通知反饋**:任務提交後屏幕右側將彈出系統通知橫幅提示處理進度。若文檔轉換耗時較長(超過1分鐘),系統將追加發送進度通知。文檔提交完成後,可打開系統 **打印管理器** 查看打印任務與進度。 @@ -129,8 +156,7 @@ > ![notes](../common/notes.svg)說明: > + 支持在當前頁移動注釋圖標。 - > + DJVU格式的文件不支持添加注釋。 - > + XPS格式的文件不支持添加注釋。 + > + DJVU和OFD格式的文件不支持添加注釋。 ## 常用操作 @@ -150,7 +176,7 @@ > ![attention](../common/attention.svg)注意:不可搜索文檔中由文本轉換成圖片的內容。 7. 清除搜索框中的訊息,即可清除搜索結果。 - > ![notes](../common/notes.svg)說明:DJVU格式的文件不支持搜索功能。 + > ![notes](../common/notes.svg)說明:DJVU和OFD格式的文件不支持搜索功能。 @@ -210,8 +236,7 @@ > ![notes](../common/notes.svg)說明: > - 當再次高亮文本時,可右鍵直接選擇 **高亮**,默認使用您上次選擇的高亮顏色。 -> - DJVU格式的文件不支持高亮設置。 -> - XPS格式的文件不支持高亮設置。 +> - DJVU和OFD格式的文件不支持高亮設置。 ### 旋轉 @@ -227,7 +252,7 @@ ## 主菜單 -在主菜單中,您可以新建窗口、新建標籤頁、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、切換窗口主題、查看幫助手冊,了解文檔查看器的更多信息。 +在主菜單中,您可以新建窗口、新建標籤頁、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、開啟[護眼模式](#護眼模式)、切換窗口主題、查看幫助手冊,了解文檔查看器的更多信息。 ### 在檔案管理員中顯示 @@ -239,7 +264,20 @@ 1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg) 2. 選擇 **放大鏡**,將鼠標移動到頁面需要查看的區域,則該區域內容放大。 -4. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 +3. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 + +### 護眼模式 + +長時間閱讀文檔時,您可以開啟護眼模式降低屏幕視覺刺激,緩解眼睛疲勞。 + +1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **護眼模式**,在子菜單中選擇預設樣式: + - **經典護眼**:米黃色背景,模擬紙質柔和質感,減少藍光刺激,適合長時間閱讀。 + - **綠色護眼**:淺綠色背景,緩解視覺疲勞,適合日常辦公閱讀。 + - **夜間護眼**:深色背景搭配淺色文字,降低暗光環境下的屏幕對比刺激。 + +> ![notes](../common/notes.svg)說明: +> - 護眼模式僅作用於應用閱讀視圖區域的背景渲染,不會修改文檔本身內容,亦不影響打印輸出。 ### 切換工具 diff --git a/assets/deepin-reader/document-viewer/zh_HK/document-viewer.md b/assets/deepin-reader/document-viewer/zh_HK/document-viewer.md deleted file mode 100755 index c62b94fd6..000000000 --- a/assets/deepin-reader/document-viewer/zh_HK/document-viewer.md +++ /dev/null @@ -1,277 +0,0 @@ -# 文檔查看器|deepin-reader| - -## 概述 - -文檔查看器是系統自帶的文檔查看軟件。不僅可以打開、查看文件,還可以對文檔進行添加書籤、添加注釋以及對選擇的文本進行高亮顯示等操作。 - - -## 使用入門 - -通過以下方式運行或關閉文檔查看器,或者創建文檔查看器的快捷方式。 - - -### 運行文檔查看器 - -1. 單擊任務欄上的啟動器圖標 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器界面。 -2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到文檔查看器圖標 ![deepin_reader_24](../common/deepin_reader_24.svg),單擊運行。 -3. 右鍵單擊 ![deepin_reader_24](../common/deepin_reader_24.svg),您可以: - - - 單擊 **傳送到桌面**,在桌面創建快捷方式。 - - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。 - - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用。 - - - - -### 關閉文檔查看器 - -- 在文檔查看器界面單擊 ![close_icon](../common/close_icon.svg),關閉文檔查看器。 -- 在任務欄右鍵單擊 ![deepin_reader_24](../common/deepin_reader_24.svg),選擇 **關閉所有**,關閉文檔查看器。 -- 在文檔查看器界面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,關閉文檔查看器。 - - -### 查看快捷鍵 - -在文檔查看器界面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽界面。熟練地使用快捷鍵,將大大提升您的操作效率。 - -![1|hotkey](fig/hotkey.png) - - -## 基本功能 - -文檔查看器具備基本的文件管理功能,可以執行打開、保存、打印文件,管理標籤頁、書籤、注釋等操作。 - - -### 打開文件 - -文檔查看器支持查看PDF、DJVU和DOCX格式的文件,您可以採用以下方式打開文件。 - -- 直接將文件拖拽到界面或其圖標上。 -- 右鍵單擊文件,選擇 **打開方式 > 文檔查看器**。將文檔查看器設為默認打開程序後,可以直接雙擊打開。 -- 在文檔查看器初始界面,單擊 **選擇文件**。 -- 在文檔查看器界面,使用快捷鍵 **Ctrl + O**,選擇文件打開。 - -### 保存文件 - -對當前正在編輯、修改的文檔進行保存。 - -- 單擊 ![icon_menu](../common/icon_menu.svg) > **保存** 或使用快捷鍵 **Ctrl + S** 保存文件。 -- 單擊 ![icon_menu](../common/icon_menu.svg) > **另存為** 或使用快捷鍵 **Ctrl + Shift + S** 另存文件。 - - -### 打印文件 - -在文檔查看器中使用打印,需要您連接並配置好打印機。 - -1. 在文檔查看器中打開一個文檔,在文檔界面單擊鼠標右鍵選擇 **打印**,也可以使用快捷鍵 **Ctrl + P** 打開打印預覽。 -2. 在打印預覽界面,您可以預覽文件,選擇打印機並設置打印頁面。 -3. 在打印預覽界面,單擊 **進階**,可配置紙張大小、打印方式等相關參數。 -4. 單擊 **打印** 即可將文件發送到打印機打印。 - - - -### 管理標籤頁 - -新增標籤頁 - -- 單擊 ![icon_menu](../common/icon_menu.svg) > **新標籤頁**,新增一個標籤頁。 -- 當標籤頁達兩個或兩個以上時,可單擊按鈕 ![icon](../common/add.svg),添加新標籤頁。 - -切換/調整標籤頁 - -- 同一窗口內拖拽標籤頁調整排序。 -- 當標籤頁過多時會顯示按鈕 ![previous](../common/previous.svg) 或 ![next](../common/next.svg),單擊可左右移動。 -- 滾動鼠標切換標籤頁。 - - -窗口間的操作 - -- 拖拽標籤頁移出當前窗口,創建一個新的窗口。 -- 拖拽標籤頁從一個窗口到另一個窗口中。 - - -### 管理書籤 - -在文檔查看器界面,打開一個文檔。 - -- 添加書籤 - - 右鍵單擊文檔查看器中的文件頁,選擇 **添加書籤**,為當前正在瀏覽的頁面添加書籤。 - - 將鼠標移至瀏覽頁面右上角書籤區域,顯示圖標 ![view](../common/bookmark.svg),單擊書籤圖標為當前頁添加書籤,書籤圖標變為藍色填充的圖標 ![view](../common/bookmarkbig_checked_light.svg)。 -- 刪除書籤: - - 在已添加書籤的頁面,單擊鼠標右鍵,選擇 **刪除書籤**,刪除當前頁的書籤。 - - 在已添加書籤的頁面,單擊書籤圖標 ![view](../common/bookmarkbig_checked_light.svg),刪除當前頁的書籤。 - - > ![notes](../common/notes.svg)說明:鼠標移到書籤位置附近才會顯示書籤圖標。鼠標移出書籤區域,書籤圖標消失。當添加書籤後,該圖標一直顯示。 - -### 管理注釋 - -在文檔查看器界面,打開一個文檔。 - -- 添加注釋 - - 使用選擇工具選擇文本內容,單擊鼠標右鍵,選擇 **添加注釋**,完成注釋後被選中的文本內容被高亮顯示。 - - 在文檔空白處或者需要添加注釋的地方,單擊鼠標右鍵,選擇 **添加注釋**,完成注釋後該處會顯示一個高亮的注釋圖標。 - - > ![notes](../common/notes.svg)說明:如果注釋窗口不輸入內容,直接單擊其他區域,則添加注釋不成功或該條注釋自動刪除。輸入文本內容後,單擊其他區域,注釋內容自動保存。 - -- 複製注釋 - + 在頁面上,右鍵單擊已添加注釋的文本內容,選擇 **複製**,複製該條注釋的全部內容。 - + 在頁面上,右鍵單擊注釋圖標,選擇 **複製**,複製該條注釋的全部內容。 - + 單擊圖標 ![menu](../common/thumbnail_normal_light.svg) 打開左側工具欄,右鍵單擊某一個注釋,選擇 **複製**,複製該條注釋的全部內容。 - -- 顯示注釋 - 1. 將鼠標懸停至注釋圖標上,在出現的浮框中顯示部分注釋內容。 - 2. 單擊注釋圖標,彈出注釋窗口,可以查看、重新編輯注釋內容。 - -- 刪除注釋 - + 右鍵單擊已添加注釋的高亮文本內容,選擇 **取消高亮**,刪除該條注釋內容。 - + 右鍵單擊注釋圖標,選擇 **刪除注釋**,刪除該條注釋內容。 - + 單擊圖標 ![menu](../common/thumbnail_normal_light.svg) 打開左側工具欄,在工具欄下方單擊圖標 ![view](../common/comments_normal_light.svg) 打開注釋目錄,右鍵單擊某一個注釋,選擇 **刪除注釋**,刪除該條注釋內容,對應頁面上的這條注釋也會被刪除。 - - > ![notes](../common/notes.svg)說明: - > + 支持在當前頁移動注釋圖標。 - > + DJVU格式的文件不支持添加注釋。 - > + XPS格式的文件不支持添加注釋。 - -## 常用操作 - -文檔查看器具備很多特色功能,這些功能都是為了讓文件管理更加簡單、高效。 - -### 搜索 - -1. 在文檔查看器界面,打開一個文檔。 -2. 在文檔頁面單擊鼠標右鍵,選擇 **搜索** 或使用快捷鍵 **Ctrl + F** 打開搜索窗口。 -3. 在搜索框中,單擊 ![search](../common/search.svg),輸入關鍵字。 -4. 按下鍵盤上的 **Enter** 鍵進行搜索。 - - 當搜索到匹配的訊息時,側邊欄會顯示全部搜索結果,文檔中會高亮顯示匹配項。 - - 當沒有搜索到匹配的訊息時,側邊欄會顯示「無搜索結果」。 -5. 當搜索到匹配訊息後,單擊按鈕 ![search](../common/previousup.svg) 或 ![search](../common/nextdown.svg) 可逐個查找上一個或下一個匹配項。 -6. 單擊某條搜索結果,跳轉到對應頁面,該頁面的搜索結果高亮顯示。 - - > ![attention](../common/attention.svg)注意:不可搜索文檔中由文本轉換成圖片的內容。 -7. 清除搜索框中的訊息,即可清除搜索結果。 - - > ![notes](../common/notes.svg)說明:DJVU格式的文件不支持搜索功能。 - - - -### 快速翻頁 - -使用下列方法之一快速翻頁: - -- 在右鍵菜單中選擇 **前一頁** 或 **後一頁** 。 -- 如果想直接瀏覽文檔的開頭或結尾,可在右鍵菜單中選擇 **第一頁** 或 **最後一頁**。 -- 按下鍵盤上的 ![Down](../common/Down.svg) 或 ![Up](../common/Up.svg) 鍵。 -- 在側邊欄縮略圖目錄下,輸入頁碼數後按下 **Enter** 鍵。 - -### 切換目錄 - -通過縮略圖可以進行文檔縮略圖目錄 ![view](../common/view_normal.svg)、文檔目錄 ![catalog](../common/catalog.svg) 、書籤目錄 ![view](../common/bookmark_normal.svg) 的切換。手動拖拽目錄邊框,縮略圖跟隨可拖拽寬度大小的變化而變化。 - -### 全屏 - -1. 在文檔查看器界面,單擊鼠標右鍵選擇 **全屏** 或使用快捷鍵 **F11**,文檔將以全屏形式展示。 -2. 將鼠標移到窗口頂部或者左側區域,呼出頂部工具列或側邊工具列;將鼠標移出區域外,工具列自動隱藏。 -3. 在全屏狀態下,呼出頂部工具列後單擊縮略圖 ![icon](../common/thumbnail_normal_light.svg),側邊工具列會一直顯示。 -4. 按下鍵盤上的 **Esc** 鍵或使用快捷鍵 **F11** 退出全屏。 - -### 幻燈片放映 - -1. 在文檔查看器界面,單擊鼠標右鍵選擇 **幻燈片放映**,文檔頁面將以幻燈片形式進行播放。 -3. 單擊 ![play](../common/previous.svg) 或 ![play](../common/next.svg) 切換文檔頁面,也可以單擊 ![play](../common/suspend_normal.svg) 停止播放。 -4. 按下鍵盤上的 **Esc** 鍵退出播放。 - - -### 放大和縮小 - -在文檔查看器界面,使用下列方法之一放大或縮小頁面: - -- 按下鍵盤上的 **Ctrl** + 「+」 或 **Ctrl** + 「-」 。 -- 按下鍵盤上的 **Ctrl** 鍵,同時按住鼠標中鍵向上或向下滑動。 -- 在標題欄中單擊 **+** 放大或單擊 **-** 縮小 。 -- 在標題欄中手動輸入縮略比例,或者在下拉框選擇縮略比例,文檔跟着比例依次放大縮小。 - - -### 調整頁面視圖 - -在標題欄縮放比例下拉框中,您可以: - -- 單擊 **雙頁顯示**,進入雙頁顯示模式。 -- 單擊 **默認大小**,頁面以100%比例顯示。 -- 單擊 **適合頁面**,當前窗口顯示整頁。 -- 單擊 **適應高度**,頁面高度在視窗內全部顯示。 -- 單擊 **適應寬度**,頁面寬度在視窗內全部顯示。 - -### 設置高亮 - -1. 在文檔查看器界面選中文本,單擊鼠標右鍵選擇 **高亮**,此時有不同的高亮顏色可供選擇。 - -2. 選定一種顏色,被選中的文本內容將以該顏色為底紋高亮顯示。 -3. 選中已經高亮顯示的文本,單擊 **取消高亮**,可以刪除文字高亮顯示效果。 - -> ![notes](../common/notes.svg)說明: -> - 當再次高亮文本時,可右鍵直接選擇 **高亮**,默認使用您上次選擇的高亮顏色。 -> - DJVU格式的文件不支持高亮設置。 -> - XPS格式的文件不支持高亮設置。 - - -### 旋轉 - -1. 在文檔查看器界面,打開一個文件。 -2. 單擊鼠標右鍵選擇 **左旋轉** 或 **右旋轉**,頁面全部同時向左或向右旋轉90°。 - - -### 查看文檔訊息 - -1. 在文檔查看器界面,打開一個文件。 -2. 單擊鼠標右鍵選擇 **文檔訊息**,展示文檔的基本訊息。 - -## 主菜單 - -在主菜單中,您可以新建窗口、新建標籤頁、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、切換窗口主題、查看幫助手冊,了解文檔查看器的更多信息。 - - -### 在檔案管理員中顯示 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **在檔案管理員中顯示**,定位該文件的存儲位置。 - -### 放大鏡 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg) -2. 選擇 **放大鏡**,將鼠標移動到頁面需要查看的區域,則該區域內容放大。 -4. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 - -### 切換工具 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **工具**,支持兩種工具切換。 - - **選擇工具** 支持選擇文本內容。 - - **手形工具** 支持在文檔中移動。 - -### 主題 - -窗口主題包含淺色主題、深色主題和系統主題。 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **主題**,選擇一個主題顏色。 - -### 幫助 - -查看幫助手冊,進一步了解和使用文檔查看器。 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **幫助**。 -3. 查看文檔查看器的幫助手冊。 - - -### 關於 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **關於**。 -3. 查看文檔查看器的版本和介紹。 - -### 退出 - -1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **退出**。 - diff --git a/assets/deepin-reader/document-viewer/zh_HK/p_document-viewer.md b/assets/deepin-reader/document-viewer/zh_HK/p_document-viewer.md index c62b94fd6..a26a7f0fa 100755 --- a/assets/deepin-reader/document-viewer/zh_HK/p_document-viewer.md +++ b/assets/deepin-reader/document-viewer/zh_HK/p_document-viewer.md @@ -34,8 +34,6 @@ 在文檔查看器界面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽界面。熟練地使用快捷鍵,將大大提升您的操作效率。 -![1|hotkey](fig/hotkey.png) - ## 基本功能 @@ -44,13 +42,25 @@ ### 打開文件 -文檔查看器支持查看PDF、DJVU和DOCX格式的文件,您可以採用以下方式打開文件。 +文檔查看器支持查看PDF、DJVU、DOCX、XPS以及OFD格式的文件,您可以採用以下方式打開文件。 - 直接將文件拖拽到界面或其圖標上。 - 右鍵單擊文件,選擇 **打開方式 > 文檔查看器**。將文檔查看器設為默認打開程序後,可以直接雙擊打開。 - 在文檔查看器初始界面,單擊 **選擇文件**。 - 在文檔查看器界面,使用快捷鍵 **Ctrl + O**,選擇文件打開。 +> ![notes](../common/notes.svg)說明: +> - OFD(國家版式文檔標準)格式支持基礎查看、縮放、翻頁及查看文檔信息,暫不支持注釋、高亮、搜索及打印功能。 +> - XPS格式支持瀏覽、文本選擇、搜索、翻頁及打印。 + +### 恢復閱讀位置 + +文檔查看器會自動記錄您的閱讀狀態,包括最後瀏覽的頁碼、頁面滾動位置、縮放比例、顯示模式(單頁/雙頁)、旋轉角度、側邊欄展開狀態與標籤頁排序等。 + +- 當您再次打開曾瀏覽過的文檔時,系統將自動恢復至上次離開時的閱讀位置與界面狀態。 +- 文檔加載完成後,窗口頂部會彈出提示條:「已恢復上次閱讀位置,點擊跳轉到首頁」,單擊該提示條可快速回到文檔首頁。 +- 文檔重命名或移動位置後,文檔查看器會嘗試基於文件特徵自動匹配並恢復閱讀進度。 + ### 保存文件 對當前正在編輯、修改的文檔進行保存。 @@ -63,10 +73,27 @@ 在文檔查看器中使用打印,需要您連接並配置好打印機。 +#### 常規打印 + 1. 在文檔查看器中打開一個文檔,在文檔界面單擊鼠標右鍵選擇 **打印**,也可以使用快捷鍵 **Ctrl + P** 打開打印預覽。 2. 在打印預覽界面,您可以預覽文件,選擇打印機並設置打印頁面。 3. 在打印預覽界面,單擊 **進階**,可配置紙張大小、打印方式等相關參數。 -4. 單擊 **打印** 即可將文件發送到打印機打印。 +4. 單擊 **打印** 即可将文件發送到打印機打印。 + +![printer](fig/printer.png) + +#### 批量打印 + +您無需逐一打開文檔,即可在檔案管理員中一鍵將多個文檔提交打印: + +1. 在檔案管理員中,選中需要打印的一個或多個文檔(支持 PDF、DJVU、DOCX、XPS 格式)。 +2. 單擊鼠標右鍵,選擇 **批量打印**。 +3. 文檔查看器將直接按默認參數處理並提交至系統打印隊列(CUPS),無需打開應用界面或打印預覽。 + +> ![notes](../common/notes.svg)說明: +> - **默認打印參數**:使用系統默認打印機、全部頁碼、A4紙張、打印1份、單面打印、實際大小、按文檔實際方向、色彩模式為彩色(黑白打印機自動採用黑白)。 +> - **任務獨立處理**:每個文檔對應獨立的打印任務,多批次打印按序排隊,不會相互打斷。 +> - **系統通知反饋**:任務提交後屏幕右側將彈出系統通知橫幅提示處理進度。若文檔轉換耗時較長(超過1分鐘),系統將追加發送進度通知。文檔提交完成後,可打開系統 **打印管理器** 查看打印任務與進度。 @@ -129,8 +156,7 @@ > ![notes](../common/notes.svg)說明: > + 支持在當前頁移動注釋圖標。 - > + DJVU格式的文件不支持添加注釋。 - > + XPS格式的文件不支持添加注釋。 + > + DJVU和OFD格式的文件不支持添加注釋。 ## 常用操作 @@ -150,7 +176,7 @@ > ![attention](../common/attention.svg)注意:不可搜索文檔中由文本轉換成圖片的內容。 7. 清除搜索框中的訊息,即可清除搜索結果。 - > ![notes](../common/notes.svg)說明:DJVU格式的文件不支持搜索功能。 + > ![notes](../common/notes.svg)說明:DJVU和OFD格式的文件不支持搜索功能。 @@ -210,8 +236,7 @@ > ![notes](../common/notes.svg)說明: > - 當再次高亮文本時,可右鍵直接選擇 **高亮**,默認使用您上次選擇的高亮顏色。 -> - DJVU格式的文件不支持高亮設置。 -> - XPS格式的文件不支持高亮設置。 +> - DJVU和OFD格式的文件不支持高亮設置。 ### 旋轉 @@ -227,7 +252,7 @@ ## 主菜單 -在主菜單中,您可以新建窗口、新建標籤頁、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、切換窗口主題、查看幫助手冊,了解文檔查看器的更多信息。 +在主菜單中,您可以新建窗口、新建標籤頁、[保存文件](#保存文件)、[搜索文件](#搜索)、[打印文件](#打印文件)、開啟[護眼模式](#護眼模式)、切換窗口主題、查看幫助手冊,了解文檔查看器的更多信息。 ### 在檔案管理員中顯示 @@ -239,7 +264,20 @@ 1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg) 2. 選擇 **放大鏡**,將鼠標移動到頁面需要查看的區域,則該區域內容放大。 -4. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 +3. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 + +### 護眼模式 + +長時間閱讀文檔時,您可以開啟護眼模式降低屏幕視覺刺激,緩解眼睛疲勞。 + +1. 在文檔查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **護眼模式**,在子菜單中選擇預設樣式: + - **經典護眼**:米黃色背景,模擬紙質柔和質感,減少藍光刺激,適合長時間閱讀。 + - **綠色護眼**:淺綠色背景,緩解視覺疲勞,適合日常辦公閱讀。 + - **夜間護眼**:深色背景搭配淺色文字,降低暗光環境下的屏幕對比刺激。 + +> ![notes](../common/notes.svg)說明: +> - 護眼模式僅作用於應用閱讀視圖區域的背景渲染,不會修改文檔本身內容,亦不影響打印輸出。 ### 切換工具 diff --git a/assets/deepin-reader/document-viewer/zh_TW/d_document-viewer.md b/assets/deepin-reader/document-viewer/zh_TW/d_document-viewer.md index cae1ff4f1..1b338b634 100755 --- a/assets/deepin-reader/document-viewer/zh_TW/d_document-viewer.md +++ b/assets/deepin-reader/document-viewer/zh_TW/d_document-viewer.md @@ -34,8 +34,6 @@ 在文件查看器介面上,按下鍵盤上的 **Ctrl + Shift + ?** 組合鍵來查看快捷鍵,熟練地使用快捷鍵,將大大提升您的操作效率。 -![1|hotkey](fig/hotkey.png) - ## 基本功能 @@ -44,13 +42,25 @@ ### 開啟文件 -文件查看器支援查看PDF、DJVU和DOCX格式的文件,您可以採用以下方式開啟文件。 +文件查看器支援查看PDF、DJVU、DOCX、XPS以及OFD格式的文件,您可以採用以下方式開啟文件。 - 直接將文件拖曳到介面或其圖示上。 - 右鍵單擊文件,選擇 **用其他程式開啟 > 文件查看器**。將文件查看器設為預設開啟程式後,可以直接雙擊打開。 - 在文件查看器初始介面,單擊 **選擇文件**。 - 在文件查看器介面,使用快捷鍵 **Ctrl + O**,選擇文件開啟。 +> ![notes](../common/notes.svg)說明: +> - OFD(國家版式文件標準)格式支援基礎查看、縮放、翻頁及查看文件訊息,暫不支援注釋、突顯、搜尋及列印功能。 +> - XPS格式支援瀏覽、文字選取、搜尋、翻頁及列印。 + +### 恢復閱讀位置 + +文件查看器會自動記錄您的閱讀狀態,包括最後瀏覽的頁碼、頁面捲動位置、縮放比例、顯示模式(單頁/雙頁)、旋轉角度、側邊欄展開狀態與分頁排序等。 + +- 當您再次開啟曾瀏覽過的文件時,系統將自動恢復至上次離開時的閱讀位置與介面狀態。 +- 文件載入完成後,視窗頂部會彈出提示條:「已恢復上次閱讀位置,點擊跳轉到首頁」,單擊該提示條可快速回到文件首頁。 +- 文件重新命名或移動位置後,文件查看器會嘗試基於文件特徵自動匹配並恢復閱讀進度。 + ### 儲存文件 對目前正在編輯、修改的文件進行儲存。 @@ -62,6 +72,8 @@ 在文件查看器中使用列印,需要您連接並配置好印表機。 +#### 常規列印 + 1. 在文件查看器中打開一個文件,在文件介面單擊滑鼠右鍵選擇 **列印**,也可以使用組合鍵 **Ctrl + P** 打開列印預覽。 2. 在列印預覽介面,您可以預覽文件,選擇印表機並設定列印頁面。 3. 在列印預覽介面,單擊 **進階設定**,可配置紙張大小、列印方式等相關參數。 @@ -69,7 +81,19 @@ ![printer](fig/printer.png) -![printer](fig/setting.png) + +#### 批量列印 + +您無需逐一打開文件,即可在檔案管理器中一鍵將多個文件提交列印: + +1. 在檔案管理器中,選中需要列印的一個或多個文件(支援 PDF、DJVU、DOCX、XPS 格式)。 +2. 單擊滑鼠右鍵,選擇 **批量列印**。 +3. 文件查看器將直接按預設參數處理並提交至系統列印佇列(CUPS),無需打開應用介面或列印預覽。 + +> ![notes](../common/notes.svg)說明: +> - **預設列印參數**:使用系統預設印表機、全部頁碼、A4紙張、列印1份、單面列印、實際大小、按文件實際方向、色彩模式為彩色(黑白印表機自動採用黑白)。 +> - **任務獨立處理**:每個文件對應獨立的列印任務,多批次列印按序排隊,不會相互打斷。 +> - **系統通知反饋**:任務提交後螢幕右側將彈出系統通知橫幅提示處理進度。若文件轉換耗時較長(超過1分鐘),系統將追加發送進度通知。文件提交完成後,可打開系統 **印表機管理** 查看列印任務與進度。 ### 管理分頁 @@ -132,8 +156,7 @@ > ![notes](../common/notes.svg)說明: > + 支援在目前頁移動注釋圖示。 - > + DJVU格式的文件不支援添加注釋。 - > + XPS格式的文件不支援添加注釋。 + > + DJVU和OFD格式的文件不支援添加注釋。 ## 常用操作 @@ -158,7 +181,7 @@ 7. 清除搜尋框中的訊息,即可清除搜尋結果。 - > ![notes](../common/notes.svg)說明:DJVU格式的文件不支援搜尋功能。 + > ![notes](../common/notes.svg)說明:DJVU和OFD格式的文件不支援搜尋功能。 ### 快速翻頁 @@ -219,8 +242,7 @@ > ![notes](../common/notes.svg)說明: > - 當再次突顯文字時,可右鍵直接選擇 **突顯**,預設使用您上次選擇的突顯顏色。 - > - DJVU格式的文件不支援突顯設定。 - > - XPS格式的文件不支援突顯設定。 + > - DJVU和OFD格式的文件不支援突顯設定。 ### 旋轉 @@ -236,7 +258,7 @@ ## 主選單 -在主選單中,您可以建立視窗、建立分頁、 [儲存文件](#儲存文件)、[搜尋](#搜尋)、[列印文件](#列印文件)、切換視窗主題、查看說明手冊,了解文件查看器的更多訊息。 +在主選單中,您可以建立視窗、建立分頁、 [儲存文件](#儲存文件)、[搜尋](#搜尋)、[列印文件](#列印文件)、開啟[護眼模式](#護眼模式)、切換視窗主題、查看說明手冊,了解文件查看器的更多訊息。 ### 在檔案管理器中顯示 @@ -250,6 +272,19 @@ 2. 單擊 ![icon_menu](../common/icon_menu.svg) > **放大鏡**。將滑鼠移動到頁面需要查看的區域,則該區域內容放大。 3. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 +### 護眼模式 + +長時間閱讀文件時,您可以開啟護眼模式降低螢幕視覺刺激,緩解眼睛疲勞。 + +1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **護眼模式**,在子選單中選擇預設樣式: + - **經典護眼**:米黃色背景,模擬紙質柔和質感,減少藍光刺激,適合長時間閱讀。 + - **綠色護眼**:淺綠色背景,緩解視覺疲勞,適合日常辦公閱讀。 + - **夜間護眼**:深色背景搭配淺色文字,降低暗光環境下的螢幕對比刺激。 + +> ![notes](../common/notes.svg)說明: +> - 護眼模式僅作用於應用閱讀檢視區域的背景渲染,不會修改文件本身內容,亦不影響列印輸出。 + ### 切換工具 1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 diff --git a/assets/deepin-reader/document-viewer/zh_TW/document-viewer.md b/assets/deepin-reader/document-viewer/zh_TW/document-viewer.md deleted file mode 100755 index cae1ff4f1..000000000 --- a/assets/deepin-reader/document-viewer/zh_TW/document-viewer.md +++ /dev/null @@ -1,287 +0,0 @@ -# 文件查看器|deepin-reader| - -## 概述 - -文件查看器是系統自帶的文件查看軟體。不僅可以打開、查看文件,還可以對文件進行添加書籤、添加注釋以及對選擇的文字進行突顯顯示等操作。 - - -## 使用入門 - -透過以下方式執行或關閉文件查看器,或者建立文件查看器的捷徑。 - - -### 執行文件查看器 - -1. 單擊桌面底部的 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器介面。 -2. 上下滾動滑鼠滾輪瀏覽或透過搜尋,找到文件查看器 ![deepin_reader_24](../common/deepin_reader_24.svg)單擊執行。 -3. 右鍵單擊 ![deepin_reader_24](../common/deepin_reader_24.svg),您可以: - - - 單擊 **建立桌面捷徑**,在桌面建立捷徑。 - - 單擊 **釘選到Dock**,將應用程式固定到Dock。 - - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動執行該應用。 - - - - -### 關閉文件查看器 - -- 在文件查看器介面單擊 ![close_icon](../common/close_icon.svg),關閉文件查看器。 -- 在任務欄右鍵單擊 ![deepin_reader_24](../common/deepin_reader_24.svg),選擇 **全部關閉** 來關閉文件查看器。 -- 在文件查看器介面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出** 來關閉文件查看器。 - - -### 查看快捷鍵 - -在文件查看器介面上,按下鍵盤上的 **Ctrl + Shift + ?** 組合鍵來查看快捷鍵,熟練地使用快捷鍵,將大大提升您的操作效率。 - -![1|hotkey](fig/hotkey.png) - - -## 基本功能 - -文件查看器具備基本的文件管理功能,可以執行開啟、儲存、列印文件,管理分頁、書籤、注釋等操作。 - - -### 開啟文件 - -文件查看器支援查看PDF、DJVU和DOCX格式的文件,您可以採用以下方式開啟文件。 - -- 直接將文件拖曳到介面或其圖示上。 -- 右鍵單擊文件,選擇 **用其他程式開啟 > 文件查看器**。將文件查看器設為預設開啟程式後,可以直接雙擊打開。 -- 在文件查看器初始介面,單擊 **選擇文件**。 -- 在文件查看器介面,使用快捷鍵 **Ctrl + O**,選擇文件開啟。 - -### 儲存文件 - -對目前正在編輯、修改的文件進行儲存。 - -- 單擊 ![icon_menu](../common/icon_menu.svg) > **儲存** 或 **Ctrl + S** 組合鍵儲存文件。 -- 單擊 ![icon_menu](../common/icon_menu.svg) > **另存為** 或 **Ctrl + Shift + S** ,另存文件。 - -### 列印文件 - -在文件查看器中使用列印,需要您連接並配置好印表機。 - -1. 在文件查看器中打開一個文件,在文件介面單擊滑鼠右鍵選擇 **列印**,也可以使用組合鍵 **Ctrl + P** 打開列印預覽。 -2. 在列印預覽介面,您可以預覽文件,選擇印表機並設定列印頁面。 -3. 在列印預覽介面,單擊 **進階設定**,可配置紙張大小、列印方式等相關參數。 -4. 單擊 **列印** 即可將文件發送到印表機列印。 - -![printer](fig/printer.png) - -![printer](fig/setting.png) - -### 管理分頁 - -新增分頁 - -- 單擊 ![icon_menu](../common/icon_menu.svg) > **新分頁**,新增一個分頁。 -- 當分頁達兩個或兩個以上時,單擊 ![add](../common/add.svg) 按鈕添加新分頁。 - -切換/調整分頁 - -- 支援在同一視窗內拖曳調整分頁排序。 -- 當分頁過多時會顯示 ![previous](../common/previous.svg) 或 ![next](../common/next.svg) 按鈕,單擊可左右移動。 -- 滾動滑鼠切換分頁。 - - -視窗間的操作 - -- 支援拖曳分頁移出目前視窗,建立一個新的視窗。 -- 支援拖曳一個分頁從一個視窗移動到另外一個視窗中。 - - -### 管理書籤 - -在文件查看器介面,開啟一個文件。 - -- 添加書籤 - - 右鍵單擊文件查看器中的文件頁,選擇 **添加書籤**,可以為目前正在瀏覽的頁面添加書籤。 - - 將滑鼠移至瀏覽頁面右上角書籤區域顯示 ![view](../common/bookmark.svg),單擊書籤圖示為目前頁添加書籤,書籤圖示變為藍色填充色![view](../common/bookmarkbig_checked_light.svg)。 -- 刪除書籤: - - 在已添加書籤的頁面,右鍵單擊書籤,選擇 **刪除書籤** 來刪除書籤。 - - 滑鼠移到書籤位置, 單擊有填充顏色的書籤圖示![view](../common/bookmarkbig_checked_light.svg),可以取消(刪除)該書籤。 - - > ![notes](../common/notes.svg)說明:滑鼠移到書籤位置附近才會顯示書籤圖示。滑鼠移出書籤區域,書籤圖示消失。當添加書籤後,該圖示一直顯示。 - - -### 管理注釋 - -在文件查看器介面,開啟一個文件。 - -- 添加注釋 - - + 使用選擇工具選擇一段文字內容,單擊滑鼠右鍵選擇 **添加注釋**,完成注釋後被選中的文字內容會被突顯顯示。 - + 在文件空白處或者需要添加注釋的地方,單擊滑鼠右鍵選擇 **添加注釋**,完成注釋後該處會顯示一個突顯注釋圖示。 - - > ![notes](../common/notes.svg)說明:如果注釋視窗不輸入內容,直接單擊其他區域,則添加注釋不成功或該條注釋自動刪除。輸入文字內容後,單擊其他區域,注釋內容自動儲存。 - -- 複製注釋 - - 在頁面上,右鍵單擊已完成注釋的突顯文字內容,在右鍵選單中選擇 **複製**,可以複製該條注釋的全部內容。 - - 在頁面上,右鍵單擊注釋圖示,在右鍵選單中選擇 **複製**,可以複製該條注釋的全部內容。 - - 單擊圖示 ![menu](../common/thumbnail_normal_light.svg) 打開左側工具列,在工具列下方單擊圖示 ![view](../common/comments_normal_light.svg) 打開注釋目錄,右鍵單擊某一個注釋,選擇 **複製**,複製該條注釋的全部內容。 - -- 顯示注釋 - 1. 將滑鼠懸停至注釋圖示上,在出現的浮框中顯示部分注釋內容。 - 2. 單擊注釋圖示,彈出注釋視窗,可以查看、重新編輯注釋內容。 - -- 刪除注釋 - - 右鍵單擊已完成注釋的突顯文字內容,在右鍵選單中選擇 **取消突顯**,可以刪除該條注釋內容。 - - 右鍵單擊注釋圖示,在右鍵選單中選擇 **刪除注釋**,可以刪除該條注釋內容。 - - 單擊圖示 ![menu](../common/thumbnail_normal_light.svg) 打開左側工具列,在工具列下方單擊圖示 ![view](../common/comments_normal_light.svg) 打開注釋目錄,右鍵單擊某一個注釋,選擇 **刪除注釋**,刪除該條注釋內容,對應頁面上的這條注釋也會被刪除。 - - > ![notes](../common/notes.svg)說明: - > + 支援在目前頁移動注釋圖示。 - > + DJVU格式的文件不支援添加注釋。 - > + XPS格式的文件不支援添加注釋。 - -## 常用操作 - -文件查看器具備很多特色功能,這些功能都是為了讓文件管理更加簡單、高效。 - -### 搜尋 - -目前搜尋只針對目前分頁。 - -1. 在文件查看器介面,開啟一個文件。 -2. 在文件頁面單擊滑鼠右鍵,選擇 **搜尋** 或使用快捷鍵 **Ctrl + F** 打開搜尋視窗。 -3. 在搜尋框中,单击![search](../common/search.svg),输入关键字。 -4. 按下鍵盤上的 **Enter** 鍵進行搜尋。 - - - 當搜尋到匹配的訊息時,側邊欄會顯示全部搜尋結果,文件中會突顯顯示匹配項。 - - 當沒有搜尋到匹配的訊息時,側邊欄會顯示「無搜尋結果」。 - -5. 當搜尋到匹配訊息後,單擊搜尋視窗的 ![search](../common/previousup.svg) 或 ![search](../common/nextdown.svg) 可逐個尋找上一個或下一個匹配項。 -6. 單擊某條搜尋結果,跳轉到對應頁面,該頁面的搜尋結果突顯顯示。 - - > ![attention](../common/attention.svg)注意:不可搜尋文件中由文字轉換成圖片的內容。 - -7. 清除搜尋框中的訊息,即可清除搜尋結果。 - - > ![notes](../common/notes.svg)說明:DJVU格式的文件不支援搜尋功能。 - -### 快速翻頁 - -您能夠使用下列方法之一在文件的頁面中移動: - -- 右鍵單擊,在快捷選單中選擇 **前一頁** 或 **後一頁** 。 - -- 如果您想直接瀏覽文件的開頭或結尾,可在右鍵選單中選擇 **第一頁** 或 **最後一頁**。 - -- 按下鍵盤上的 ![Down](../common/Down.svg) 或 ![Up](../common/Up.svg) 鍵。 - -- 在側邊欄縮圖目錄下,輸入頁碼數後按下 **Enter** 鍵。 - -### 切換目錄 - -在側邊欄,您可以切換文件縮圖目錄 ![view](../common/view_normal.svg)、文件目錄 ![catalog](../common/catalog.svg) 、書籤目錄 ![view](../common/bookmark_normal.svg)、注釋目錄 ![view](../common/comments_normal_light.svg) 。 - -### 全螢幕 - -1. 在文件查看器介面,單擊滑鼠右鍵選擇 **全螢幕** 或使用快捷鍵 **F11**,文件將以全螢幕形式展示。 -2. 將滑鼠移到視窗頂部或者左側區域,呼出頂部工具列或側邊工具列;將滑鼠移出區域外,工具列自動隱藏。 -3. 在全螢幕狀態下,呼出頂部工具列後單擊縮圖 ![icon](../common/thumbnail_normal_light.svg),側邊工具列會一直顯示。 -4. 按下鍵盤上的 **Esc** 鍵或使用快捷鍵 **F11** 退出全螢幕。 - -### 幻燈片秀 - -1. 在文件查看器介面,單擊滑鼠右鍵選擇 **幻燈片秀**,文件頁面將以幻燈片形式進行播放。 -2. 單擊 ![play](../common/previous.svg) 或 ![play](../common/next.svg)切換文件頁面,也可以單擊 ![play](../common/suspend_normal.svg) 停止播放。 -3. 按下鍵盤上的 **Esc** 鍵退出播放。 - - -### 放大和縮小 - -在文件查看器介面,使用下列方法之一放大或縮小頁面: - -- 按下鍵盤上的 **Ctrl** + **+** 或 **Ctrl** + **-** 。 -- 按下鍵盤上的 **Ctrl** 鍵的同時按住滑鼠中鍵向上或向下滑動。 -- 在標題欄中單擊 **+** 放大或單擊 **-** 縮小 。 -- 在標題欄中手動輸入縮略比例,或在下拉框選擇縮略比例,文件跟著比例依次放大縮小。 - - - -### 調整頁面檢視 - -在工具列縮放比例下拉框中,您可以: - -- 單擊 **雙頁顯示**,進入雙頁顯示模式。 -- 單擊 **預設大小**,頁面以100%比例顯示。 -- 單擊 **適合頁面**,目前視窗顯示整頁。 -- 單擊 **適應高度**,頁面高度在視窗內全部顯示。 -- 單擊 **適應寬度**,頁面寬度在視窗內全部顯示。 - -### 設定突顯 - -1. 在文件查看器介面選中文字,單擊滑鼠右鍵選擇 **突顯**,此時有不同的突顯顏色可供選擇。 -2. 選定一種顏色,被選中的文字內容將以該顏色為底紋突顯顯示。 -3. 選中已經突顯顯示的文字,單擊 **取消突顯**,可以刪除文字突顯顯示效果。 - - > ![notes](../common/notes.svg)說明: - > - 當再次突顯文字時,可右鍵直接選擇 **突顯**,預設使用您上次選擇的突顯顏色。 - > - DJVU格式的文件不支援突顯設定。 - > - XPS格式的文件不支援突顯設定。 - -### 旋轉 - -1. 在文件查看器介面,開啟一個文件。 -2. 單擊滑鼠右鍵選擇 **左旋轉** 或 **右旋轉**,頁面全部同時向左或向右旋轉90°。 - - - -### 查看文件訊息 - -1. 在文件查看器介面,開啟一個文件。 -2. 單擊滑鼠右鍵選擇 **文件訊息**,展示文件的屬性相關參數訊息。 - -## 主選單 - -在主選單中,您可以建立視窗、建立分頁、 [儲存文件](#儲存文件)、[搜尋](#搜尋)、[列印文件](#列印文件)、切換視窗主題、查看說明手冊,了解文件查看器的更多訊息。 - - -### 在檔案管理器中顯示 - -1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **在檔案管理器中顯示**,定位該文件存放的位置。 - -### 放大鏡 - -1. 在文件查看器介面,開啟一個文件。 -2. 單擊 ![icon_menu](../common/icon_menu.svg) > **放大鏡**。將滑鼠移動到頁面需要查看的區域,則該區域內容放大。 -3. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 - -### 切換工具 - -1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 選擇 **工具**,支援兩種工具切換。 - - **選擇工具** 支援選擇文字內容。 - - **手形工具** 支援在文件中移動。 - - -### 主題 - -視窗主題包含亮色主題、暗色主題和系統主題。 - -1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **主題**,選擇一個主題顏色。 - -### 說明 - -查看說明手冊,進一步了解和使用文件查看器。 - -1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **說明**。 -3. 查看文件查看器的說明手冊。 - - -### 關於 - -1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **關於**。 -3. 查看文件查看器的版本和介紹。 - -### 退出 - -1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **退出**。 - diff --git a/assets/deepin-reader/document-viewer/zh_TW/p_document-viewer.md b/assets/deepin-reader/document-viewer/zh_TW/p_document-viewer.md index cae1ff4f1..1b338b634 100755 --- a/assets/deepin-reader/document-viewer/zh_TW/p_document-viewer.md +++ b/assets/deepin-reader/document-viewer/zh_TW/p_document-viewer.md @@ -34,8 +34,6 @@ 在文件查看器介面上,按下鍵盤上的 **Ctrl + Shift + ?** 組合鍵來查看快捷鍵,熟練地使用快捷鍵,將大大提升您的操作效率。 -![1|hotkey](fig/hotkey.png) - ## 基本功能 @@ -44,13 +42,25 @@ ### 開啟文件 -文件查看器支援查看PDF、DJVU和DOCX格式的文件,您可以採用以下方式開啟文件。 +文件查看器支援查看PDF、DJVU、DOCX、XPS以及OFD格式的文件,您可以採用以下方式開啟文件。 - 直接將文件拖曳到介面或其圖示上。 - 右鍵單擊文件,選擇 **用其他程式開啟 > 文件查看器**。將文件查看器設為預設開啟程式後,可以直接雙擊打開。 - 在文件查看器初始介面,單擊 **選擇文件**。 - 在文件查看器介面,使用快捷鍵 **Ctrl + O**,選擇文件開啟。 +> ![notes](../common/notes.svg)說明: +> - OFD(國家版式文件標準)格式支援基礎查看、縮放、翻頁及查看文件訊息,暫不支援注釋、突顯、搜尋及列印功能。 +> - XPS格式支援瀏覽、文字選取、搜尋、翻頁及列印。 + +### 恢復閱讀位置 + +文件查看器會自動記錄您的閱讀狀態,包括最後瀏覽的頁碼、頁面捲動位置、縮放比例、顯示模式(單頁/雙頁)、旋轉角度、側邊欄展開狀態與分頁排序等。 + +- 當您再次開啟曾瀏覽過的文件時,系統將自動恢復至上次離開時的閱讀位置與介面狀態。 +- 文件載入完成後,視窗頂部會彈出提示條:「已恢復上次閱讀位置,點擊跳轉到首頁」,單擊該提示條可快速回到文件首頁。 +- 文件重新命名或移動位置後,文件查看器會嘗試基於文件特徵自動匹配並恢復閱讀進度。 + ### 儲存文件 對目前正在編輯、修改的文件進行儲存。 @@ -62,6 +72,8 @@ 在文件查看器中使用列印,需要您連接並配置好印表機。 +#### 常規列印 + 1. 在文件查看器中打開一個文件,在文件介面單擊滑鼠右鍵選擇 **列印**,也可以使用組合鍵 **Ctrl + P** 打開列印預覽。 2. 在列印預覽介面,您可以預覽文件,選擇印表機並設定列印頁面。 3. 在列印預覽介面,單擊 **進階設定**,可配置紙張大小、列印方式等相關參數。 @@ -69,7 +81,19 @@ ![printer](fig/printer.png) -![printer](fig/setting.png) + +#### 批量列印 + +您無需逐一打開文件,即可在檔案管理器中一鍵將多個文件提交列印: + +1. 在檔案管理器中,選中需要列印的一個或多個文件(支援 PDF、DJVU、DOCX、XPS 格式)。 +2. 單擊滑鼠右鍵,選擇 **批量列印**。 +3. 文件查看器將直接按預設參數處理並提交至系統列印佇列(CUPS),無需打開應用介面或列印預覽。 + +> ![notes](../common/notes.svg)說明: +> - **預設列印參數**:使用系統預設印表機、全部頁碼、A4紙張、列印1份、單面列印、實際大小、按文件實際方向、色彩模式為彩色(黑白印表機自動採用黑白)。 +> - **任務獨立處理**:每個文件對應獨立的列印任務,多批次列印按序排隊,不會相互打斷。 +> - **系統通知反饋**:任務提交後螢幕右側將彈出系統通知橫幅提示處理進度。若文件轉換耗時較長(超過1分鐘),系統將追加發送進度通知。文件提交完成後,可打開系統 **印表機管理** 查看列印任務與進度。 ### 管理分頁 @@ -132,8 +156,7 @@ > ![notes](../common/notes.svg)說明: > + 支援在目前頁移動注釋圖示。 - > + DJVU格式的文件不支援添加注釋。 - > + XPS格式的文件不支援添加注釋。 + > + DJVU和OFD格式的文件不支援添加注釋。 ## 常用操作 @@ -158,7 +181,7 @@ 7. 清除搜尋框中的訊息,即可清除搜尋結果。 - > ![notes](../common/notes.svg)說明:DJVU格式的文件不支援搜尋功能。 + > ![notes](../common/notes.svg)說明:DJVU和OFD格式的文件不支援搜尋功能。 ### 快速翻頁 @@ -219,8 +242,7 @@ > ![notes](../common/notes.svg)說明: > - 當再次突顯文字時,可右鍵直接選擇 **突顯**,預設使用您上次選擇的突顯顏色。 - > - DJVU格式的文件不支援突顯設定。 - > - XPS格式的文件不支援突顯設定。 + > - DJVU和OFD格式的文件不支援突顯設定。 ### 旋轉 @@ -236,7 +258,7 @@ ## 主選單 -在主選單中,您可以建立視窗、建立分頁、 [儲存文件](#儲存文件)、[搜尋](#搜尋)、[列印文件](#列印文件)、切換視窗主題、查看說明手冊,了解文件查看器的更多訊息。 +在主選單中,您可以建立視窗、建立分頁、 [儲存文件](#儲存文件)、[搜尋](#搜尋)、[列印文件](#列印文件)、開啟[護眼模式](#護眼模式)、切換視窗主題、查看說明手冊,了解文件查看器的更多訊息。 ### 在檔案管理器中顯示 @@ -250,6 +272,19 @@ 2. 單擊 ![icon_menu](../common/icon_menu.svg) > **放大鏡**。將滑鼠移動到頁面需要查看的區域,則該區域內容放大。 3. 按下鍵盤上的 **Esc** 鍵或右鍵單擊,即可取消放大鏡功能。 +### 護眼模式 + +長時間閱讀文件時,您可以開啟護眼模式降低螢幕視覺刺激,緩解眼睛疲勞。 + +1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **護眼模式**,在子選單中選擇預設樣式: + - **經典護眼**:米黃色背景,模擬紙質柔和質感,減少藍光刺激,適合長時間閱讀。 + - **綠色護眼**:淺綠色背景,緩解視覺疲勞,適合日常辦公閱讀。 + - **夜間護眼**:深色背景搭配淺色文字,降低暗光環境下的螢幕對比刺激。 + +> ![notes](../common/notes.svg)說明: +> - 護眼模式僅作用於應用閱讀檢視區域的背景渲染,不會修改文件本身內容,亦不影響列印輸出。 + ### 切換工具 1. 在文件查看器介面,單擊 ![icon_menu](../common/icon_menu.svg)。 From 19f6d86ab3b5112cee45680797265ccb52fb725d Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Sat, 10 Oct 2026 11:28:36 +0800 Subject: [PATCH 52/63] fix: replace function-static pinch state with member variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pinch gesture state (canRotate, currentStepScaleFactor, tempScalefactor) in SheetBrowser::pinchTriggered lived in function-level statics: they leaked across SheetBrowser instances (multi-window pollution), survived across unit-test runs, and left a stale scale baseline behind when a gesture was interrupted without GestureFinished, making the next pinch jump (too-sensitive scaling, BUG44491 deep cause). Move them to SheetBrowser members, reset the scale baseline on GestureStarted, and also clean up on GestureCanceled. Log: 捏合手势状态由函数级 static 改为成员变量,手势开始时重置缩放基线,取消时同样清理 Influence: 修复多窗口捏合互相污染与手势打断后下次捏合缩放过灵敏的问题(BUG44491 深层根因) --- reader/browser/SheetBrowser.cpp | 26 +++++++++++++------------- reader/browser/SheetBrowser.h | 3 +++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/reader/browser/SheetBrowser.cpp b/reader/browser/SheetBrowser.cpp index 433304ac4..3677d4f33 100644 --- a/reader/browser/SheetBrowser.cpp +++ b/reader/browser/SheetBrowser.cpp @@ -946,22 +946,22 @@ bool SheetBrowser::gestureEvent(QGestureEvent *event) void SheetBrowser::pinchTriggered(QPinchGesture *gesture) { // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Starting pinch triggered"; - static bool canRotate = false; - static qreal currentStepScaleFactor = 1.0; - static qreal tempScalefactor = 1.0; if (gesture->state() == Qt::GestureStarted) { // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Gesture started"; m_startPinch = true; - canRotate = true; - tempScalefactor = m_lastScaleFactor; + m_canRotate = true; + m_tempScalefactor = m_lastScaleFactor; + // Reset the scale baseline so a previously interrupted gesture + // cannot pollute this new pinch (too-sensitive scaling, BUG44491). + m_currentStepScaleFactor = 1.0; this->setProperty("pinchgetsturing", true); scene()->setSelectionArea(QPainterPath()); } QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags(); if (changeFlags & QPinchGesture::RotationAngleChanged) { - if (canRotate && qAbs(gesture->rotationAngle()) > 35.0) { + if (m_canRotate && qAbs(gesture->rotationAngle()) > 35.0) { if (gesture->rotationAngle() < 0.0) { // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Rotation angle is less than 0, rotating left"; m_sheet->rotateLeft(); @@ -969,18 +969,18 @@ void SheetBrowser::pinchTriggered(QPinchGesture *gesture) // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Rotation angle is greater than 0, rotating right"; m_sheet->rotateRight(); } - canRotate = false; + m_canRotate = false; return; } } if (changeFlags & QPinchGesture::ScaleFactorChanged) { // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Scale factor changed"; - currentStepScaleFactor = gesture->totalScaleFactor(); + m_currentStepScaleFactor = gesture->totalScaleFactor(); } - qreal curscalfactor = currentStepScaleFactor * tempScalefactor; - if (gesture->state() == Qt::GestureFinished) { + qreal curscalfactor = m_currentStepScaleFactor * m_tempScalefactor; + if (gesture->state() == Qt::GestureFinished || gesture->state() == Qt::GestureCanceled) { // qCDebug(appLog) << "SheetBrowser::pinchTriggered() - Gesture finished"; this->setProperty("pinchgetsturing", false); // 必须传 receiver=this:否则 browser 在定时器触发前被销毁时,lambda 仍会执行并写已死对象(UAF) @@ -988,9 +988,9 @@ void SheetBrowser::pinchTriggered(QPinchGesture *gesture) //稍微延迟下,不然还是会引起mouse事件触发 m_startPinch = false; }); - canRotate = false; - currentStepScaleFactor = 1.0; - tempScalefactor = m_lastScaleFactor; + m_canRotate = false; + m_currentStepScaleFactor = 1.0; + m_tempScalefactor = m_lastScaleFactor; } m_sheet->setScaleFactor(curscalfactor); diff --git a/reader/browser/SheetBrowser.h b/reader/browser/SheetBrowser.h index f50698443..43aa4e611 100644 --- a/reader/browser/SheetBrowser.h +++ b/reader/browser/SheetBrowser.h @@ -752,6 +752,9 @@ private slots: QBasicTimer m_repeatTimer; bool m_startPinch = false; //开始收缩 + bool m_canRotate = false; //捏合手势中是否允许旋转 + qreal m_currentStepScaleFactor = 1.0; //当前捏合手势的缩放因子(成员变量避免跨实例/跨手势残留) + qreal m_tempScalefactor = 1.0; //捏合手势起始时的基准缩放因子 bool m_canTouchScreen = false; QScroller *m_scroller = nullptr; }; From df66b81db7f4ac379a35bf4bd27ada9fa8d1b5ed Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Sat, 10 Oct 2026 11:28:44 +0800 Subject: [PATCH 53/63] docs: declare DPdfDoc::page ownership contract in headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DPdfDoc::page() caches the returned DPdfPage in the document (freed by qDeleteAll in ~DPdfDocPrivate), so deleting it from the caller side is a double-free. Declare the ownership contract in dpdfdoc.h page() and the DPdfPage class docs in dpdfpage.h. Log: 在 dpdfdoc.h/dpdfpage.h 注释中声明 DPdfDoc::page 返回指针的所有权契约 Influence: 仅文档注释变更,提示调用方不得 delete page() 返回的 DPdfPage,避免双重释放 --- 3rdparty/deepin-pdfium/include/dpdfdoc.h | 3 ++- 3rdparty/deepin-pdfium/include/dpdfpage.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/3rdparty/deepin-pdfium/include/dpdfdoc.h b/3rdparty/deepin-pdfium/include/dpdfdoc.h index fc00ac432..32ffd365b 100755 --- a/3rdparty/deepin-pdfium/include/dpdfdoc.h +++ b/3rdparty/deepin-pdfium/include/dpdfdoc.h @@ -81,7 +81,8 @@ class DPdfDoc : public QObject /** * @brief 创建新的page返回 * @param i - * @return + * @return 所有权归文档:返回的 DPdfPage 由文档缓存并在析构时释放, + * 调用方不得 delete(重复释放将导致 double-free)。 */ DPdfPage *page(int i, qreal xRes, qreal yRes); diff --git a/3rdparty/deepin-pdfium/include/dpdfpage.h b/3rdparty/deepin-pdfium/include/dpdfpage.h index f7cf6f40c..612b2f6dc 100755 --- a/3rdparty/deepin-pdfium/include/dpdfpage.h +++ b/3rdparty/deepin-pdfium/include/dpdfpage.h @@ -14,6 +14,13 @@ class DPdfAnnot; class DPdfPagePrivate; class DPdfDocHandler; +/** + * @brief PDF 页面对象 + * + * 所有权契约:DPdfPage 实例由 DPdfDoc::page() 创建并缓存于文档内部, + * 生命周期由所属 DPdfDoc 管理(文档析构时统一释放)。 + * 调用方不得 delete 该指针,否则将与文档析构产生双重释放。 + */ class DPdfPage : public QObject { Q_OBJECT From d89644274e04a38653693d98198962b250467df0 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Sat, 10 Oct 2026 11:29:01 +0800 Subject: [PATCH 54/63] fix: replace mechanical-safe Qt6 deprecated API usages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Application.cpp: guard AA_UseHighDpiPixmaps with Qt5-only check (no effect in Qt6) and replace deprecated isTopLevel() with isWindow() - MainWindow.cpp: replace deprecated QHoverEvent::pos() with position().toPoint() (Qt6 branch) and QLibraryInfo::location() with path() (same pattern as Model.cpp) - XpsDocumentAdapter.cpp: pass QTimeZone::UTC to fromSecsSinceEpoch instead of the deprecated Qt::UTC overload (behavior equivalent) - SecurityDialog.cpp / TransparentTextEdit.cpp: replace deprecated QString::count() with size() Deferred (structural, behavior-sensitive): QMouseEvent deprecated constructor in Application.cpp (new ctor needs a global position the synthesized cursor point cannot provide); the 4 fontChanged connects in CatalogTreeView/RestoreTipWidget/PagingWidget/ScaleWidget (replacing the signal with QEvent::ApplicationFontChange handling restructures event processing). Log: 替换机械安全的 Qt6 废弃 API:AA_UseHighDpiPixmaps/isTopLevel/pos/location/fromSecsSinceEpoch/count Influence: 消除 9 处 Qt6 废弃 API 警告,行为不变(等价替换);fontChanged 4 处与 QMouseEvent 构造评估后暂缓 --- reader/Application.cpp | 7 +++++-- reader/MainWindow.cpp | 15 +++++++++++++-- reader/document/XpsDocumentAdapter.cpp | 8 +++++++- reader/widgets/SecurityDialog.cpp | 6 +++--- reader/widgets/TransparentTextEdit.cpp | 2 +- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/reader/Application.cpp b/reader/Application.cpp index faf628a23..dec309db0 100644 --- a/reader/Application.cpp +++ b/reader/Application.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -22,7 +22,10 @@ Application::Application(int &argc, char **argv) qCDebug(appLog) << "Initializing application"; loadTranslator(); qCDebug(appLog) << "Translations loaded"; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + // Qt5 下该属性控制 HiDPI 图标渲染;Qt6 中始终启用,属性已废弃无效果 setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif setApplicationName("deepin-reader"); setOrganizationName("deepin"); //setWindowIcon(QIcon::fromTheme("deepin-reader")); //耗时40ms @@ -103,7 +106,7 @@ bool Application::notify(QObject *object, QEvent *event) QFocusEvent *fe = dynamic_cast(event); QWidget *widget = qobject_cast(object); - if (widget && fe && fe->reason() == Qt::ActiveWindowFocusReason && !widget->isTopLevel() + if (widget && fe && fe->reason() == Qt::ActiveWindowFocusReason && !widget->isWindow() && (widget->focusPolicy() & Qt::StrongFocus) != Qt::StrongFocus) { // 针对激活窗口所获得的焦点,为了避免被默认给到窗口内部的控件上,此处将焦点还给主窗口 // 并且只设置一次 diff --git a/reader/MainWindow.cpp b/reader/MainWindow.cpp index b709ebbba..da543c17e 100755 --- a/reader/MainWindow.cpp +++ b/reader/MainWindow.cpp @@ -232,16 +232,22 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) if (m_TitleAnimation->state() != QPropertyAnimation::Running) { // qCDebug(appLog) << "MainWindow::eventFilter() - Starting title animation"; m_TitleAnimation->stop(); +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) + // Qt6 中 QHoverEvent::pos() 已废弃,用 position() 替代 + const int hoverPosY = mouseEvent->position().toPoint().y(); +#else + const int hoverPosY = mouseEvent->pos().y(); +#endif int duration = 200 * (50 + m_FullTitleWidget->pos().y()) / 50; duration = duration <= 0 ? 200 : duration; m_TitleAnimation->setDuration(duration); m_TitleAnimation->setStartValue(QRect(0, m_FullTitleWidget->pos().y(), dApp->primaryScreen()->size().width(), m_FullTitleWidget->height())); - if (m_FullTitleWidget->pos().y() >= 0 && mouseEvent->pos().y() > m_FullTitleWidget->height()) { + if (m_FullTitleWidget->pos().y() >= 0 && hoverPosY > m_FullTitleWidget->height()) { // qCDebug(appLog) << "MainWindow::eventFilter() - Hiding title widget"; m_TitleAnimation->setEndValue(QRect(0, -m_FullTitleWidget->height(), dApp->primaryScreen()->size().width(), m_FullTitleWidget->height())); m_TitleAnimation->start(); - } else if (m_FullTitleWidget->pos().y() < 0 && mouseEvent->pos().y() < 2) { + } else if (m_FullTitleWidget->pos().y() < 0 && hoverPosY < 2) { // qCDebug(appLog) << "MainWindow::eventFilter() - Showing title widget"; setTitleBarFocusEnable(true); if (m_docTabWidget && m_FullTitleWidget->height() > titlebar()->height()) @@ -592,7 +598,12 @@ QString MainWindow::libPath(const QString &strlib) { qCDebug(appLog) << "MainWindow::libPath() - Searching for library:" << strlib; QDir dir; +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) + // Qt6 中 QLibraryInfo::location() 已废弃,用 path() 替代 + QString path = QLibraryInfo::path(QLibraryInfo::LibrariesPath); +#else QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); +#endif dir.setPath(path); QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib diff --git a/reader/document/XpsDocumentAdapter.cpp b/reader/document/XpsDocumentAdapter.cpp index 9b7616cc7..07719e9f3 100644 --- a/reader/document/XpsDocumentAdapter.cpp +++ b/reader/document/XpsDocumentAdapter.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2025 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -276,7 +277,12 @@ QDateTime fromUnixTime(time_t value) if (value <= 0) { return QDateTime(); } +#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)) + // Qt6 中传 Qt::UTC 的重载已废弃,改传 QTimeZone::UTC(行为等价,均为 UTC 时间规范) + return QDateTime::fromSecsSinceEpoch(static_cast(value), QTimeZone::UTC).toLocalTime(); +#else return QDateTime::fromSecsSinceEpoch(static_cast(value), Qt::UTC).toLocalTime(); +#endif } void logGError(const QString &prefix, GError *error) diff --git a/reader/widgets/SecurityDialog.cpp b/reader/widgets/SecurityDialog.cpp index 4b062f989..6124b2081 100644 --- a/reader/widgets/SecurityDialog.cpp +++ b/reader/widgets/SecurityDialog.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. +// Copyright (C) 2019 ~ 2026 Uniontech Software Technology Co.,Ltd. // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -35,11 +35,11 @@ NewStr autoCutText(const QString &text, DLabel *pDesLbl) newstr.resultStr += strText; } else { qCDebug(appLog) << "Text width is greater than label width"; - for (int i = 0; i < strText.count(); i++) { + for (int i = 0; i < strText.size(); i++) { str += strText.at(i); if (font_label.horizontalAdvance(str) > width) { //根据label宽度调整每行字符数 - str.remove(str.count() - 1, 1); + str.remove(str.size() - 1, 1); newstr.strList.append(str); newstr.resultStr += str + "\n"; str.clear(); diff --git a/reader/widgets/TransparentTextEdit.cpp b/reader/widgets/TransparentTextEdit.cpp index 0ea20380f..1977011d7 100644 --- a/reader/widgets/TransparentTextEdit.cpp +++ b/reader/widgets/TransparentTextEdit.cpp @@ -55,7 +55,7 @@ void TransparentTextEdit::slotTextEditMaxContantNum() qCDebug(appLog) << "Checking text content length, max:" << m_nMaxContantLen; QString textContent = this->toPlainText(); - int length = textContent.count(); + int length = textContent.size(); if (length > m_nMaxContantLen) { qCDebug(appLog) << "Text length exceeds limit, trimming content"; From f92e8a4ca4c852c744b18d1621101a43392e79fa Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Thu, 8 Oct 2026 18:36:24 +0000 Subject: [PATCH 55/63] [skip CI] Translate deepin-reader.ts in ru 100% translated source file: 'deepin-reader.ts' on 'ru'. --- translations/deepin-reader_ru.ts | 60 +++++++++++++------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/translations/deepin-reader_ru.ts b/translations/deepin-reader_ru.ts index 5f2e6616a..851b4f407 100755 --- a/translations/deepin-reader_ru.ts +++ b/translations/deepin-reader_ru.ts @@ -1,6 +1,4 @@ - - - + Application @@ -89,7 +87,7 @@ Warnings - + Предупреждения @@ -301,7 +299,7 @@ OK button - ОК + Хорошо @@ -359,7 +357,7 @@ OK button - ОК + Хорошо @@ -372,22 +370,22 @@ No eye protection - + Без защиты глаз Classic eye protection - + Классическая защита глаз Green eye protection - + Зелёная защита глаз Night eye protection - + Ночная защита глаз @@ -395,7 +393,7 @@ Eye protection mode - + Режим защиты глаз @@ -466,17 +464,17 @@ Restored to last reading position - + Восстановлена последняя позиция чтения Jump to first page - + Перейти к первой странице Close - + Закрыть @@ -927,70 +925,62 @@ CUPS is not available. Please check if the printing service is running. - + CUPS недоступен. Пожалуйста, проверьте, запущена ли служба печати. No default printer found. Please set a default printer first. - + Принтер по умолчанию не найден. Сначала установите принтер по умолчанию. Failed to convert file: %1 - + Не удалось преобразовать файл: %1 Failed to print file: %1 - + Не удалось напечатать файл: %1 Batch Print - + Пакетная печать All %n file(s) printed successfully. - - - - - + Все %n файлов успешно напечатаны.Все %n файла успешно напечатаны.Все %n файлов успешно напечатаны.Все %n файлов успешно напечатаны. %1 file(s) printed successfully, %2 file(s) failed. - + %1 файлов успешно напечатано, %2 файлов не удалось напечатать. All %n file(s) failed to print. - - - - - + Все %n файлов не удалось напечатать.Все %n файла не удалось напечатать.Все %n файлов не удалось напечатать.Все %n файлов не удалось напечатать. Batch print documents silently - + Тихая пакетная печать документов Document files to print - + Файлы документов для печати No files specified. - + Файлы не указаны. and %1 more file(s) failed. - + и ещё %1 файлов не удалось. @@ -1017,4 +1007,4 @@ Сгенерировать эскиз. - + \ No newline at end of file From 5afe64b72c05ff6806c6a40287bb340ecd907892 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Fri, 16 Oct 2026 22:09:17 +0800 Subject: [PATCH 56/63] fix: sync CMake version to 6.6.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: project() VERSION and APP_VERSION defaults were never-updated "1.0.0" placeholders, and the linglong build invoked plain cmake with no version flags, so the About dialog showed "1.0.0" for installed packages 2. Fix: make project(VERSION) and the submodule APP_VERSION defaults read the injectable VERSION variable, and bridge the changelog version into the linglong build via -DVERSION (same as deepin-editor's linglong.yaml) 3. Impact: About dialog shows the release version on the deb and linglong build paths Log: Fix About dialog showing version 1.0.0 instead of 6.6.2 fix: 同步 CMake 版本号至 6.6.2 1. 根因:project() VERSION 与子模块 APP_VERSION 默认值是从未更新的 "1.0.0" 占位符,且玲珑构建以裸 cmake 调用不传版本参数,导致安装后 "关于"对话框显示 "1.0.0" 2. 方案:project(VERSION) 与子模块 APP_VERSION 默认值改为读取可注入 的 VERSION 变量;linglong.yaml 参照 deepin-editor 以 -DVERSION 传入 changelog 版本 3. 影响:deb 与玲珑构建路径的"关于"对话框均显示发版版本 Log: 修复"关于"对话框显示版本号 1.0.0 而非 6.6.2 的问题 PMS: BUG-378351 --- CMakeLists.txt | 2 +- batch-print/CMakeLists.txt | 2 +- linglong.yaml | 4 +++- reader/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25087b613..5efd5f2d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13) # 项目基本信息 project(deepin-reader - VERSION 1.0.0 + VERSION ${VERSION} DESCRIPTION "Deepin Document Viewer" LANGUAGES CXX C ) diff --git a/batch-print/CMakeLists.txt b/batch-print/CMakeLists.txt index 33d919451..ca321439c 100644 --- a/batch-print/CMakeLists.txt +++ b/batch-print/CMakeLists.txt @@ -77,7 +77,7 @@ target_include_directories(batchprint-convert PUBLIC target_compile_definitions(batchprint-convert PRIVATE INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" - APP_VERSION="1.0.0" + APP_VERSION="${VERSION}" ) target_link_libraries(batchprint-convert PUBLIC diff --git a/linglong.yaml b/linglong.yaml index 6eb1e935d..eeed0bd82 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -73,6 +73,7 @@ build: | # pkg-config 探测的第三方 -dev 库由 buildext.apt.build_depends 安装到 /usr; # 显式补充 PKG_CONFIG_PATH,确保 /usr 与 $PREFIX 下的 .pc 无论环境默认值如何均可见。 export PKG_CONFIG_PATH="${PREFIX}/lib/${TRIPLET}/pkgconfig:/usr/lib/${TRIPLET}/pkgconfig:/usr/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') rm -rf build && mkdir -p build && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ @@ -81,7 +82,8 @@ build: | -DCMAKE_PREFIX_PATH="${PREFIX};/runtime" \ -DROFD_ROOT=${PREFIX} \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" \ - -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" \ + -DVERSION=${VERSION} make -j$(nproc) make install > ../install.log 2>&1 diff --git a/reader/CMakeLists.txt b/reader/CMakeLists.txt index b918d89cd..5fca11a34 100644 --- a/reader/CMakeLists.txt +++ b/reader/CMakeLists.txt @@ -109,7 +109,7 @@ if(NOT QT_VERSION_MAJOR MATCHES 6) endif() if (NOT APP_VERSION) - set(APP_VERSION "1.0.0") + set(APP_VERSION "${VERSION}") endif() # 定义安装前缀 From 40e856380742f897cc6ad1d5bd4c899a0a33abb3 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Tue, 20 Oct 2026 16:59:54 +0800 Subject: [PATCH 57/63] chore: update version to 6.6.3 - bump version to 6.6.3 Log : bump version to 6.6.3 --- debian/changelog | 19 ++++++++++++++++++- linglong.yaml | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 90ebd86ce..f9da60654 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +deepin-reader (6.6.3) unstable; urgency=medium + + * [skip CI] Translate deepin-reader.ts in ru + * fix: replace mechanical-safe Qt6 deprecated API usages + * docs: declare DPdfDoc::page ownership contract in headers + * fix: replace function-static pinch state with member variables + * docs(manual): update user manual for OFD support and new features + * test(sidebar): isolate bookmark UT cases from shared test data + * test: add tests for deepin-reader batch 2 (20 bugs, 38 cases) + * fix: correct batch print context menu text + * fix: walk the parent chain safely in CentralDocPage + * fix: clear *pprocess when file copy fails in DocumentFactory::getDocument + * chore: Update version to 6.6.2 + * test: add tests for deepin-reader batch 1 (7/7 classes) + + -- xiepengfei Tue, 20 Oct 2026 16:59:41 +0800 + deepin-reader (6.6.2) unstable; urgency=medium * chore: Update version to 6.6.2 @@ -642,4 +659,4 @@ deepin-reader (5.8.0.1) unstable; urgency=low * Autobuild Tag 5.8.0.1 - -- TagBuilder Fri, 30 oct 2020 18:46:29 +0000 + -- TagBuilder Fri, 30 oct 2020 18:46:29 +0000 \ No newline at end of file diff --git a/linglong.yaml b/linglong.yaml index eeed0bd82..331a62c82 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.6.2.1 + version: 6.6.3.1 kind: app description: | reader for deepin os. From 0d6a90c90041405acdfd65b574609197ca7b1ffc Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 20 Oct 2026 22:06:46 +0800 Subject: [PATCH 58/63] fix(log): unify all logs to category appLog for DConfig filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace bare qInfo/qDebug/qWarning/qCritical with categorized qC* variants in reader, batch-print and htmltopdf modules - Refine ddlog.h into a pure Qt header and share it across all three executables, keeping only one appLog definition - Update SPDX copyright years Log: 统一全项目日志为分类日志并收敛ddlog.h定义 PMS: TASK-396789 Influence: 三个进程日志均带org.deepin.reader分类,可被DConfig日志规则统一过滤。 --- 3rdparty/deepin-pdfium/src/dpdfdoc.cpp | 13 ++++++------ 3rdparty/deepin-pdfium/src/dpdfglobal.cpp | 9 ++++++--- 3rdparty/deepin-pdfium/src/dpdflog.h | 14 +++++++++++++ batch-print/CMakeLists.txt | 2 ++ batch-print/batchprintapp.cpp | 8 +++++--- batch-print/cupsclient.cpp | 8 +++++--- htmltopdf/CMakeLists.txt | 7 +++++++ htmltopdf/htmltopdfconverter.cpp | 16 ++++++++------- htmltopdf/main.cpp | 24 ++++++++++++----------- reader/app/Database.cpp | 2 +- reader/ddlog.h | 21 +++++++++++--------- reader/document/DjVuModel.cpp | 8 ++++---- reader/document/Model.cpp | 24 +++++++++++------------ reader/document/PDFModel.cpp | 8 ++++---- reader/sidebar/CatalogTreeView.cpp | 6 +++--- reader/sidebar/CatalogWidget.cpp | 2 +- 16 files changed, 105 insertions(+), 67 deletions(-) create mode 100644 3rdparty/deepin-pdfium/src/dpdflog.h diff --git a/3rdparty/deepin-pdfium/src/dpdfdoc.cpp b/3rdparty/deepin-pdfium/src/dpdfdoc.cpp index b7e359dd9..d1e22586d 100755 --- a/3rdparty/deepin-pdfium/src/dpdfdoc.cpp +++ b/3rdparty/deepin-pdfium/src/dpdfdoc.cpp @@ -3,6 +3,7 @@ // SPDX-License-Identifier: LGPL-3.0-or-later #include "dpdfdoc.h" +#include "dpdflog.h" #include "dpdfpage.h" #include "public/fpdfview.h" @@ -131,14 +132,14 @@ DPdfDoc::Status DPdfDocPrivate::loadFile(const QString &filePath, const QString DPdfMutexLocker locker("DPdfDocPrivate::loadFile"); - qDebug() << "deepin-pdfium正在加载PDF文档... 文档名称: " << filePath; + qCDebug(dpfLog) << "deepin-pdfium正在加载PDF文档... 文档名称: " << filePath; void *ptr = FPDF_LoadDocument(m_filePath.toUtf8().constData(), password.toUtf8().constData()); m_docHandler = static_cast(ptr); m_status = m_docHandler ? DPdfDoc::SUCCESS : parseError(static_cast(FPDF_GetLastError())); - qDebug() << "文档(" << filePath << ")文档加载状态: " << m_status; + qCDebug(dpfLog) << "文档(" << filePath << ")文档加载状态: " << m_status; if (m_docHandler) { m_pageCount = FPDF_GetPageCount(reinterpret_cast(m_docHandler)); @@ -202,7 +203,7 @@ bool DPdfDoc::isLinearized(const QString &fileName) { QFile file(fileName); if (!file.open(QFile::ReadOnly)) { - qInfo() << "file open failed when isLinearized" << fileName; + qCInfo(dpfLog) << "file open failed when isLinearized" << fileName; } QByteArray content = file.readAll(); int len = content.length(); @@ -279,7 +280,7 @@ bool DPdfDoc::save() // Rename original file to backup instead of deleting (avoids SMB file handle issues) if (targetFile.exists()) { if (!targetFile.rename(backupPath)) { - qWarning() << "Failed to rename original file to backup:" << targetPath; + qCWarning(dpfLog) << "Failed to rename original file to backup:" << targetPath; return false; } } @@ -287,7 +288,7 @@ bool DPdfDoc::save() // Write new file QFile newFile(targetPath); if (!newFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - qWarning() << "Failed to open file for writing:" << targetPath; + qCWarning(dpfLog) << "Failed to open file for writing:" << targetPath; // Restore original file on failure if (QFile::exists(backupPath)) { QFile::rename(backupPath, targetPath); @@ -296,7 +297,7 @@ bool DPdfDoc::save() } if (array.size() != newFile.write(array)) { - qWarning() << "Failed to write data to file:" << targetPath; + qCWarning(dpfLog) << "Failed to write data to file:" << targetPath; result = false; newFile.close(); newFile.remove(); diff --git a/3rdparty/deepin-pdfium/src/dpdfglobal.cpp b/3rdparty/deepin-pdfium/src/dpdfglobal.cpp index 524654ac0..bf9146d7f 100755 --- a/3rdparty/deepin-pdfium/src/dpdfglobal.cpp +++ b/3rdparty/deepin-pdfium/src/dpdfglobal.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -6,10 +6,13 @@ #include #include #include "dpdfglobal.h" +#include "dpdflog.h" #include "public/fpdfview.h" #include +Q_LOGGING_CATEGORY(dpfLog, "org.deepin.reader.pdfium") + static bool initialized = false; const static DPdfGlobal instance = DPdfGlobal(); @@ -60,11 +63,11 @@ DPdfMutexLocker::DPdfMutexLocker(const QString &tmpLog): QMutexLocker(m_cupsApi); if (cups) { if (!cups->init()) { - qWarning() << "CUPS init failed"; + qCWarning(batchprintLog) << "CUPS init failed"; NotifyClient::notifyError(ErrorMessages::cupsUnavailable()); return 2; } if (!cups->checkEnvironment()) { - qWarning() << "CUPS environment check failed"; + qCWarning(batchprintLog) << "CUPS environment check failed"; NotifyClient::notifyError(ErrorMessages::noDefaultPrinter()); return 2; } @@ -64,7 +66,7 @@ int BatchPrintApp::run(const QStringList &fileList) QString errorMsg; if (!FormatConverter::convertToPdf(filePath, tempDir.path(), outputPdfPath, errorMsg)) { - qWarning() << errorMsg; + qCWarning(batchprintLog) << errorMsg; failedFiles.append(QFileInfo(filePath).fileName()); continue; } diff --git a/batch-print/cupsclient.cpp b/batch-print/cupsclient.cpp index dda4b1a74..a6236bfba 100644 --- a/batch-print/cupsclient.cpp +++ b/batch-print/cupsclient.cpp @@ -10,6 +10,8 @@ #include #include +#include "ddlog.h" + #include typedef int (*cupsGetDests_fn)(cups_dest_t **dests); @@ -55,13 +57,13 @@ bool CupsClient::init() { m_lib.setFileName(QStringLiteral("cups")); if (!m_lib.load()) { - qWarning() << "Failed to dlopen libcups:" << m_lib.errorString(); + qCWarning(batchprintLog) << "Failed to dlopen libcups:" << m_lib.errorString(); return false; } m_loaded = loadSymbols(); if (!m_loaded) { - qWarning() << "Failed to resolve CUPS symbols"; + qCWarning(batchprintLog) << "Failed to resolve CUPS symbols"; return false; } @@ -76,7 +78,7 @@ bool CupsClient::checkEnvironment() cups_dest_t *dests = nullptr; int numDest = ((cupsGetDests_fn)m_cupsGetDests)(&dests); if (numDest <= 0) { - qWarning() << "No printers found"; + qCWarning(batchprintLog) << "No printers found"; return false; } diff --git a/htmltopdf/CMakeLists.txt b/htmltopdf/CMakeLists.txt index e42619e9e..733c4ba2c 100644 --- a/htmltopdf/CMakeLists.txt +++ b/htmltopdf/CMakeLists.txt @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0-or-later + # 定义htmltopdf可执行文件 add_executable(htmltopdf main.cpp @@ -14,6 +18,9 @@ set_target_properties(htmltopdf PROPERTIES find_package(Qt${QT_DESIRED_VERSION} REQUIRED COMPONENTS WebEngineWidgets) +# 引用 reader/ddlog.h 的日志分类定义 +target_include_directories(htmltopdf PRIVATE ${CMAKE_SOURCE_DIR}/reader) + # 链接Qt模块 target_link_libraries(htmltopdf PRIVATE Qt${QT_VERSION_MAJOR}::WebEngineWidgets diff --git a/htmltopdf/htmltopdfconverter.cpp b/htmltopdf/htmltopdfconverter.cpp index 0ace65617..63eae2bfc 100644 --- a/htmltopdf/htmltopdfconverter.cpp +++ b/htmltopdf/htmltopdfconverter.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,12 +7,14 @@ #include +#include "ddlog.h" + HtmltoPdfConverter::HtmltoPdfConverter(const QString &inputPath, const QString &outputPath) : m_inputPath(inputPath) , m_outputPath(outputPath) , m_page(new QWebEnginePage) { - qDebug() << "HtmltoPdfConverter initialized with input:" << inputPath << "output:" << outputPath; + qCDebug(htmltopdfLog) << "HtmltoPdfConverter initialized with input:" << inputPath << "output:" << outputPath; connect(m_page.data(), &QWebEnginePage::loadFinished, this, &HtmltoPdfConverter::loadFinished); @@ -22,9 +24,9 @@ HtmltoPdfConverter::HtmltoPdfConverter(const QString &inputPath, const QString & int HtmltoPdfConverter::run() { - qDebug() << "Starting HTML to PDF conversion process"; + qCDebug(htmltopdfLog) << "Starting HTML to PDF conversion process"; QUrl url = QUrl::fromUserInput(m_inputPath); - qDebug() << "Loading HTML file from path:" << url; + qCDebug(htmltopdfLog) << "Loading HTML file from path:" << url; m_page->load(url); return QCoreApplication::exec(); } @@ -32,17 +34,17 @@ int HtmltoPdfConverter::run() void HtmltoPdfConverter::loadFinished(bool ok) { if (!ok) { - qWarning() << QString("Failed to load URL '%1'").arg(m_inputPath); + qCWarning(htmltopdfLog) << QString("Failed to load URL '%1'").arg(m_inputPath); QCoreApplication::exit(1); } - qInfo() << QString("Successfully loaded URL '%1'").arg(m_inputPath); + qCInfo(htmltopdfLog) << QString("Successfully loaded URL '%1'").arg(m_inputPath); m_page->printToPdf(m_outputPath); } void HtmltoPdfConverter::pdfPrintingFinished(const QString &filePath, bool success) { if (!success) { - qWarning() << QString("Failed to print to output file '%1'").arg(filePath); + qCWarning(htmltopdfLog) << QString("Failed to print to output file '%1'").arg(filePath); QCoreApplication::exit(1); } else { QCoreApplication::quit(); diff --git a/htmltopdf/main.cpp b/htmltopdf/main.cpp index 80aed2571..2d4b3be85 100644 --- a/htmltopdf/main.cpp +++ b/htmltopdf/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -10,26 +10,28 @@ #include #include +#include "ddlog.h" + bool isWayland(); int main(int argc, char *argv[]) { - qDebug() << "Starting html2pdf converter application"; + qCDebug(htmltopdfLog) << "Starting html2pdf converter application"; QApplication app(argc, argv); QApplication::setApplicationName("html2pdf"); QApplication::setApplicationVersion("v1.0"); bool wayland = isWayland(); - qDebug() << "Wayland environment detected:" << wayland; + qCDebug(htmltopdfLog) << "Wayland environment detected:" << wayland; if (wayland) { - qDebug() << "Wayland detected, disabling GPU"; + qCDebug(htmltopdfLog) << "Wayland detected, disabling GPU"; // 解决klu panguV平台使用QWebEnginePage崩溃的问题,不支持gpu渲染 qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu"); } // 解决__sw_64__平台使用QWebEnginePage崩溃的问题 #ifdef __sw_64__ - qDebug() << "Running on __sw_64__ platform, --js-flags=--jitless"; + qCDebug(htmltopdfLog) << "Running on __sw_64__ platform, --js-flags=--jitless"; qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--js-flags=--jitless"); #endif @@ -50,28 +52,28 @@ int main(int argc, char *argv[]) const QStringList requiredArguments = parser.positionalArguments(); if (requiredArguments.size() != 2) { - qCritical() << "Invalid number of arguments, expected 2 but got" << requiredArguments.size(); + qCCritical(htmltopdfLog) << "Invalid number of arguments, expected 2 but got" << requiredArguments.size(); parser.showHelp(1); } - qInfo() << "Input file:" << requiredArguments.at(0) << "Output PDF:" << requiredArguments.at(1); + qCInfo(htmltopdfLog) << "Input file:" << requiredArguments.at(0) << "Output PDF:" << requiredArguments.at(1); - qInfo() << "Creating PDF converter instance"; + qCInfo(htmltopdfLog) << "Creating PDF converter instance"; HtmltoPdfConverter converter(requiredArguments.at(0), requiredArguments.at(1)); return converter.run(); } bool isWayland() { - qDebug() << "Checking display environment"; + qCDebug(htmltopdfLog) << "Checking display environment"; auto e = QProcessEnvironment::systemEnvironment(); QString XDG_SESSION_TYPE = e.value(QStringLiteral("XDG_SESSION_TYPE")); QString WAYLAND_DISPLAY = e.value(QStringLiteral("WAYLAND_DISPLAY")); if (XDG_SESSION_TYPE == QLatin1String("wayland") || WAYLAND_DISPLAY.contains(QLatin1String("wayland"), Qt::CaseInsensitive)) { - qDebug() << "Wayland session detected"; + qCDebug(htmltopdfLog) << "Wayland session detected"; return true; } else { - qDebug() << "X11 session detected"; + qCDebug(htmltopdfLog) << "X11 session detected"; return false; } } diff --git a/reader/app/Database.cpp b/reader/app/Database.cpp index 53823fb2e..1e49440a0 100644 --- a/reader/app/Database.cpp +++ b/reader/app/Database.cpp @@ -1195,7 +1195,7 @@ Database::Database(QObject *parent) : QObject(parent) m_database.setDatabaseName(QDir(path).filePath("user.db")); qCDebug(appLog) << "Opening database:" << m_database.databaseName(); if (!m_database.open()) { - qCritical() << "Failed to open database:" << m_database.lastError(); + qCCritical(appLog) << "Failed to open database:" << m_database.lastError(); } if (m_database.isOpen()) { diff --git a/reader/ddlog.h b/reader/ddlog.h index 7d592a0ca..fe0b45e30 100644 --- a/reader/ddlog.h +++ b/reader/ddlog.h @@ -1,18 +1,21 @@ -// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2025 - 2026 UnionTech Software Technology Co., Ltd. // -// SPDX-Liteense-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-3.0-or-later #ifndef DDLOG_H #define DDLOG_H -#ifdef DTKCORE_CLASS_DConfigFile -#include -#endif -#include -DCORE_USE_NAMESPACE +#include +#include -// namespace DDLog { +// 全项目统一的日志分类:reader / batch-print / htmltopdf 共用此定义, +// 便于 DConfig(deepin-log-viewer) 按应用统一过滤 inline Q_LOGGING_CATEGORY(appLog, "org.deepin.reader") -// } + +// 模块分离:batch-print 批量打印进程 +inline Q_LOGGING_CATEGORY(batchprintLog, "org.deepin.reader.batchprint") + +// 模块分离:htmltopdf 转换进程 +inline Q_LOGGING_CATEGORY(htmltopdfLog, "org.deepin.reader.htmltopdf") #endif // DDLOG_H diff --git a/reader/document/DjVuModel.cpp b/reader/document/DjVuModel.cpp index 5429ce7de..3b3529dd5 100644 --- a/reader/document/DjVuModel.cpp +++ b/reader/document/DjVuModel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2019 ~ 2020 Uniontech Software Technology Co.,Ltd. -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -524,7 +524,7 @@ deepin_reader::DjVuDocument *DjVuDocument::loadDocument(const QString &filePath, ddjvu_context_t *context = ddjvu_context_create("deepin_reader"); if (context == nullptr) { - qCritical() << "Failed to create DjVu context"; + qCCritical(appLog) << "Failed to create DjVu context"; error = Document::FileError; return nullptr; } @@ -536,7 +536,7 @@ deepin_reader::DjVuDocument *DjVuDocument::loadDocument(const QString &filePath, #endif // DDJVUAPI_VERSION if (document == nullptr) { - qCritical() << "Failed to create DjVu document from file:" << filePath; + qCCritical(appLog) << "Failed to create DjVu document from file:" << filePath; ddjvu_context_release(context); error = Document::FileError; @@ -546,7 +546,7 @@ deepin_reader::DjVuDocument *DjVuDocument::loadDocument(const QString &filePath, waitForMessageTag(context, DDJVU_DOCINFO); if (ddjvu_document_decoding_error(document)) { - qCritical() << "Document decoding error occurred"; + qCCritical(appLog) << "Document decoding error occurred"; ddjvu_document_release(document); ddjvu_context_release(context); diff --git a/reader/document/Model.cpp b/reader/document/Model.cpp index 09dbd8718..92229d28e 100644 --- a/reader/document/Model.cpp +++ b/reader/document/Model.cpp @@ -112,7 +112,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & QFile::remove(localFilePath); if (!QFile::copy(filePath, localFilePath)) { - qCritical() << "Failed to copy network DJVU file from" << filePath << "to" << localFilePath; + qCCritical(appLog) << "Failed to copy network DJVU file from" << filePath << "to" << localFilePath; error = deepin_reader::Document::FileError; } else { qCInfo(appLog) << "Copied network DJVU to local:" << localFilePath; @@ -134,7 +134,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & } else if (Dr::DOCX == fileType) { qCDebug(appLog) << "Starting DOCX document conversion process"; if (nullptr == pprocess) { - qCritical() << "Invalid process pointer for DOCX conversion"; + qCCritical(appLog) << "Invalid process pointer for DOCX conversion"; error = deepin_reader::Document::ConvertFailed; return nullptr; } @@ -158,7 +158,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & QFile file(filePath); if (!file.copy(targetDoc)) { - qCritical() << "Failed to copy file from" << filePath << "to" << targetDoc; + qCCritical(appLog) << "Failed to copy file from" << filePath << "to" << targetDoc; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; @@ -184,19 +184,19 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & qCDebug(appLog) << "执行命令: unzip" << unzipArgs; decompressor.start("unzip", unzipArgs); if (!decompressor.waitForStarted()) { - qCritical() << "Failed to start unzip process for file:" << targetDoc; + qCCritical(appLog) << "Failed to start unzip process for file:" << targetDoc; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; } if (!decompressor.waitForFinished(unzipTimeout)) { - qCritical() << "Unzip process failed for file:" << targetDoc; + qCCritical(appLog) << "Unzip process failed for file:" << targetDoc; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; } if (!QDir(convertedFileDir + "/word").exists()) { - qCritical() << "Unzip failed! Directory not found:" << (convertedFileDir + "/word"); + qCCritical(appLog) << "Unzip failed! Directory not found:" << (convertedFileDir + "/word"); error = deepin_reader::Document::ConvertFailed; if (!(QProcess::CrashExit == decompressor.exitStatus() && 9 == decompressor.exitCode())) { *pprocess = nullptr; @@ -225,20 +225,20 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & qCDebug(appLog) << "执行命令: pandoc" << pandocArgs; converter.start("pandoc", pandocArgs); if (!converter.waitForStarted()) { - qCritical() << "Failed to start pandoc conversion process"; + qCCritical(appLog) << "Failed to start pandoc conversion process"; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; } if (!converter.waitForFinished(pandocTimeout)) { - qCritical() << "Pandoc conversion process failed"; + qCCritical(appLog) << "Pandoc conversion process failed"; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; } QFile tmpHtmlFile(tmpHtmlFilePath); if (!tmpHtmlFile.exists()) { - qCritical() << "Pandoc conversion failed! Output file not found:" << tmpHtmlFilePath; + qCCritical(appLog) << "Pandoc conversion failed! Output file not found:" << tmpHtmlFilePath; error = deepin_reader::Document::ConvertFailed; // 转换过程中关闭应用,docsheet被释放,对应的*pprocess已不存在 if (!(QProcess::CrashExit == converter.exitStatus() && 9 == converter.exitCode())) { @@ -259,13 +259,13 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & qCDebug(appLog) << "执行命令:" << getHtmlToPdfPath() << htmltopdfArgs; converter2.start(getHtmlToPdfPath(), htmltopdfArgs); if (!converter2.waitForStarted()) { - qCritical() << "Failed to start htmltopdf conversion process"; + qCCritical(appLog) << "Failed to start htmltopdf conversion process"; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; } if (!converter2.waitForFinished(htmlToPdfTimeout)) { - qCritical() << "Htmltopdf conversion process failed"; + qCCritical(appLog) << "Htmltopdf conversion process failed"; error = deepin_reader::Document::ConvertFailed; *pprocess = nullptr; return nullptr; @@ -273,7 +273,7 @@ deepin_reader::Document *deepin_reader::DocumentFactory::getDocument(const int & QFile realFile(realFilePath); if (!realFile.exists()) { - qCritical() << "Htmltopdf conversion failed! Output file not found:" << realFilePath; + qCCritical(appLog) << "Htmltopdf conversion failed! Output file not found:" << realFilePath; error = deepin_reader::Document::ConvertFailed; if (!(QProcess::CrashExit == converter.exitStatus() && 9 == converter.exitCode())) { *pprocess = nullptr; diff --git a/reader/document/PDFModel.cpp b/reader/document/PDFModel.cpp index cd5595c5e..faf6ddafd 100644 --- a/reader/document/PDFModel.cpp +++ b/reader/document/PDFModel.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 -2026 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -397,7 +397,7 @@ Annotation *PDFPage::addIconAnnotation(const QRectF &rect, const QString &text) qCInfo(appLog) << "Adding icon annotation at rect:" << rect << "with text:" << text; if (nullptr == m_page) { - qCritical() << "Attempt to add icon annotation to null page"; + qCCritical(appLog) << "Attempt to add icon annotation to null page"; return nullptr; } @@ -409,7 +409,7 @@ Annotation *PDFPage::moveIconAnnotation(Annotation *annot, const QRectF &rect) qCInfo(appLog) << "Moving icon annotation to rect:" << rect; if (nullptr == m_page || nullptr == annot) { - qCritical() << "Attempt to move icon annotation with null page or annotation"; + qCCritical(appLog) << "Attempt to move icon annotation with null page or annotation"; return nullptr; } @@ -586,7 +586,7 @@ PDFDocument *PDFDocument::loadDocument(const QString &filePath, const QString &p error = Document::WrongPassword; } } else { - qCritical() << "Failed to load PDF document, error code:" << document->status(); + qCCritical(appLog) << "Failed to load PDF document, error code:" << document->status(); error = Document::FileError; } diff --git a/reader/sidebar/CatalogTreeView.cpp b/reader/sidebar/CatalogTreeView.cpp index 91d2e55c3..ddb4b6449 100644 --- a/reader/sidebar/CatalogTreeView.cpp +++ b/reader/sidebar/CatalogTreeView.cpp @@ -186,7 +186,7 @@ void CatalogTreeView::handleOpenSuccess() model->clear(); if (nullptr == m_sheet) { - qCritical() << "Cannot build catalog tree - document sheet is null"; + qCCritical(appLog) << "Cannot build catalog tree - document sheet is null"; return; } @@ -295,7 +295,7 @@ void CatalogTreeView::currentChanged(const QModelIndex ¤t, const QModelInd && !current.data(deepin_reader::CatalogNavigationRole).isValid()) { if (nullptr == m_sheet) { - qCritical() << "Cannot navigate - document sheet is null"; + qCCritical(appLog) << "Cannot navigate - document sheet is null"; return; } @@ -317,7 +317,7 @@ void CatalogTreeView::onItemClicked(const QModelIndex ¤t) qCDebug(appLog) << "Catalog item clicked:" << current.data().toString() << "page:" << current.data(Qt::UserRole + 1).toInt(); if (nullptr == m_sheet) { - qCritical() << "Cannot navigate to clicked item - document sheet is null"; + qCCritical(appLog) << "Cannot navigate to clicked item - document sheet is null"; return; } if (m_populating || !current.isValid()) diff --git a/reader/sidebar/CatalogWidget.cpp b/reader/sidebar/CatalogWidget.cpp index 1071b9579..4392da348 100644 --- a/reader/sidebar/CatalogWidget.cpp +++ b/reader/sidebar/CatalogWidget.cpp @@ -90,7 +90,7 @@ void CatalogWidget::handleOpenSuccess() qCDebug(appLog) << "Handling document open success, loading catalog"; if (nullptr == m_sheet) { - qCritical() << "Cannot load catalog - document sheet is null"; + qCCritical(appLog) << "Cannot load catalog - document sheet is null"; return; } if (bIshandOpenSuccess) { From 94d0520a2b1071bbf07c166948be14d8e5b8aa67 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Tue, 27 Oct 2026 15:26:10 +0800 Subject: [PATCH 59/63] fix: shorten file manager batch print menu name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Simplify default menu entry from "Batch Print with Document Viewer" to "Batch Print" 2. Unify zh_CN/zh_HK/zh_TW menu labels to "批量打印" Log: The file manager context menu for batch printing now shows a shorter name Influence: 1. Right-click PDF/DOCX/DjVu/XPS files in file manager, verify the entry shows "Batch Print" in English 2. Switch system language to zh_CN/zh_HK/zh_TW, verify the entry shows "批量打印" 3. Click the menu entry, verify deepin-reader-batchprint still launches and prints selected files fix: 精简文管右键批量打印菜单名称 1. 文管右键菜单「使用文档查看器批量打印」简化为「批量打印」 2. 默认英文名由 Batch Print with Document Viewer 简化为 Batch Print 3. zh_CN/zh_HK/zh_TW 三个语言的菜单文案统一为「批量打印」 Log: 文管右键批量打印菜单项显示名称简化为「批量打印」 Influence: 1. 在文管中右键单个或多个 PDF、DOCX、DjVu、XPS 文件,确认英文环境菜单显示 Batch Print 2. 分别切换系统语言为简体中文、繁体(香港、台湾),确认菜单均显示「批量打印」 3. 点击该菜单项,确认仍能正常拉起批量打印功能并打印所选文件 --- src/context-menus/deepin-reader-batchprint.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/context-menus/deepin-reader-batchprint.conf b/src/context-menus/deepin-reader-batchprint.conf index b4e33bce8..b8f498f5d 100644 --- a/src/context-menus/deepin-reader-batchprint.conf +++ b/src/context-menus/deepin-reader-batchprint.conf @@ -5,12 +5,12 @@ Version=1.0 [Menu Action Zero] Exec=deepin-reader-batchprint %F MimeType=application/pdf:application/vnd.openxmlformats-officedocument.wordprocessingml.document:application/wps-office.docx:image/vnd.djvu:application/vnd.ms-xpsdocument:application/oxps -Name=Batch Print with Document Viewer +Name=Batch Print PosNum=6 Separator=Top X-DFM-ExcludeMimeTypes=inode/directory:application/x-desktop X-DFM-MenuTypes=SingleFile:MultiFiles X-DFM-SupportSchemes=file -Name[zh_CN]=使用文档查看器批量打印 -Name[zh_HK]=使用文檔查看器批量打印 -Name[zh_TW]=使用文件查看器批量打印 +Name[zh_CN]=批量打印 +Name[zh_HK]=批量打印 +Name[zh_TW]=批量打印 From 376999f4f389ac7fb9d6ba56e29d331d0ddf13ee Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Thu, 29 Oct 2026 09:25:03 +0800 Subject: [PATCH 60/63] chore: update version to 6.6.4 - bump version to 6.6.4 Log : bump version to 6.6.4 --- debian/changelog | 8 ++++++++ linglong.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f9da60654..9bc4763bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +deepin-reader (6.6.4) unstable; urgency=medium + + * chore: update version to 6.6.3 + * fix(log): unify all logs to category appLog for DConfig filtering + * fix: shorten file manager batch print menu name + + -- xiepengfei Thu, 29 Oct 2026 09:24:14 +0800 + deepin-reader (6.6.3) unstable; urgency=medium * [skip CI] Translate deepin-reader.ts in ru diff --git a/linglong.yaml b/linglong.yaml index 331a62c82..0867b9ce7 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.reader name: "deepin-reader" - version: 6.6.3.1 + version: 6.6.4.1 kind: app description: | reader for deepin os. From 08d08634df23a041cc6b61660b5d210ea192721a Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 16:14:47 +0000 Subject: [PATCH 61/63] [skip CI] Translate deepin-reader.ts in pt 96% of minimum 50% translated source file: 'deepin-reader.ts' on 'pt'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format --- translations/deepin-reader_pt.ts | 54 ++++++++++++++------------------ 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/translations/deepin-reader_pt.ts b/translations/deepin-reader_pt.ts index 6b1393e5b..aa70cb0f8 100755 --- a/translations/deepin-reader_pt.ts +++ b/translations/deepin-reader_pt.ts @@ -1,6 +1,4 @@ - - - + Application @@ -89,7 +87,7 @@ Warnings - + Avisos @@ -372,22 +370,22 @@ No eye protection - + Sem proteção ocular Classic eye protection - + Proteção ocular clássica Green eye protection - + Proteção ocular verde Night eye protection - + Proteção ocular noturna @@ -395,7 +393,7 @@ Eye protection mode - + Modo de proteção da visão @@ -466,17 +464,17 @@ Restored to last reading position - + Restaurado para a última posição de leitura Jump to first page - + Saltar para a primeira página Close - + Fechar @@ -927,68 +925,62 @@ CUPS is not available. Please check if the printing service is running. - + O CUPS não está disponível. Por favor verifique se o serviço de impressão está em execução. No default printer found. Please set a default printer first. - + Nenhuma impressora predefinida. Por favor defina uma impressora predefinida primeiro. Failed to convert file: %1 - + Falha ao converter ficheiro: %1 Failed to print file: %1 - + Falha ao imprimir ficheiro: %1 Batch Print - + Impressão em Lote All %n file(s) printed successfully. - - - - + Todos os %n ficheiro(s) imprimidos com sucesso.Todos os %n ficheiro(s) imprimidos com sucesso.Todos os %n ficheiro(s) imprimidos com sucesso. %1 file(s) printed successfully, %2 file(s) failed. - + All %n file(s) failed to print. - - - - + Batch print documents silently - + Document files to print - + No files specified. - + and %1 more file(s) failed. - + @@ -1015,4 +1007,4 @@ Generate thumbnail. - + \ No newline at end of file From 9d4f32ef4d5d8b19317d3f8066d51458f945d125 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 16:19:56 +0000 Subject: [PATCH 62/63] [skip CI] Translate deepin-reader.ts in pt 100% translated source file: 'deepin-reader.ts' on 'pt'. --- translations/deepin-reader_pt.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translations/deepin-reader_pt.ts b/translations/deepin-reader_pt.ts index aa70cb0f8..22a66b25c 100755 --- a/translations/deepin-reader_pt.ts +++ b/translations/deepin-reader_pt.ts @@ -955,32 +955,32 @@ %1 file(s) printed successfully, %2 file(s) failed. - + %1 ficheiro(s) imprimido com sucesso, %2 ficheiro(s) falharam. All %n file(s) failed to print. - + Todos %n ficheiro(s) falharam ao imprimir.Todos %n ficheiro(s) falharam ao imprimir.Todos %n ficheiro(s) falharam ao imprimir. Batch print documents silently - + Imprimir documentos em lote silenciosamente Document files to print - + Ficheiros de documentos a imprimir No files specified. - + Sem ficheiros especificados. and %1 more file(s) failed. - + e mais %1 ficheiro(s) falharam.
From 927baf3b9e314a9d815b778a9e6467e8a2239200 Mon Sep 17 00:00:00 2001 From: dengzhongyuan365-dev Date: Fri, 20 Nov 2026 22:47:13 +0800 Subject: [PATCH 63/63] fix: skip fsync on network filesystem paths to prevent UI freeze MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: DPdfDoc::save() and saveAs() call fsync() on the main thread for files on SMB/CIFS network mounts, blocking the Qt event loop for seconds while waiting for remote disk sync 2. Fix: add isNetworkFileSystem() helper using QStorageInfo to detect cifs/smb/fuse.gvfs paths, skip fsync for network paths while keeping flush() for userspace-to-kernel buffer transfer 3. Impact: local disk save behavior unchanged (fsync still called); network path save no longer blocks UI; temp-file-then-rename preserves atomicity and backup recovery Log: 修复SMB网络路径保存PDF时文档查看器卡死问题 Influence: 1. Test saving PDF with bookmarks/annotations on local disk 2. Test saving PDF on SMB mount and verify no UI freeze 3. Test saveAs to SMB path 4. Test save failure recovery on network disconnect fix: 跳过网络文件系统路径的fsync以防止界面卡死 1. 根因:DPdfDoc::save()和saveAs()在主线程对SMB/CIFS网络挂载 路径的文件调用fsync(),等待远端刷盘时阻塞Qt事件循环数秒 2. 方案:新增isNetworkFileSystem()辅助函数,使用QStorageInfo检测 cifs/smb/fuse.gvfs路径,网络路径跳过fsync,保留flush()完成 用户态到内核态的缓冲刷入 3. 影响:本地磁盘保存行为不变(仍执行fsync);网络路径保存不再 阻塞界面;temp-file-then-rename保证原子性和备份恢复 Log: 修复SMB网络路径保存PDF时文档查看器卡死问题 Influence: 1. 测试本地磁盘上保存带书签/注释的PDF 2. 测试SMB挂载路径保存PDF,验证不再卡死 3. 测试另存为到SMB路径 4. 测试网络断开时保存失败的恢复 PMS: BUG-380239 --- 3rdparty/deepin-pdfium/src/dpdfdoc.cpp | 20 ++++++++- tests/document/ut_networkfilesystem.cpp | 57 +++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 tests/document/ut_networkfilesystem.cpp diff --git a/3rdparty/deepin-pdfium/src/dpdfdoc.cpp b/3rdparty/deepin-pdfium/src/dpdfdoc.cpp index d1e22586d..fd668b0a8 100755 --- a/3rdparty/deepin-pdfium/src/dpdfdoc.cpp +++ b/3rdparty/deepin-pdfium/src/dpdfdoc.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include /** @@ -232,6 +233,19 @@ bool DPdfDoc::isLinearized(const QString &fileName) static QFile saveWriter; +static bool isNetworkFileSystem(const QString &path) +{ + if (path.contains(QLatin1String("/gvfs/"))) + return true; + + QStorageInfo storage(path); + QByteArray fsType = storage.fileSystemType(); + if (fsType.contains("cifs") || fsType.contains("smb") || fsType.contains("fuse.gvfs")) + return true; + + return false; +} + int writeFile(struct FPDF_FILEWRITE_* pThis, const void *pData, unsigned long size) { Q_UNUSED(pThis) @@ -309,7 +323,8 @@ bool DPdfDoc::save() } newFile.flush(); // Flush user buffer to kernel buffer - fsync(newFile.handle()); // Sync kernel buffer to disk + if (!isNetworkFileSystem(targetPath)) + fsync(newFile.handle()); // Sync kernel buffer to disk (skip on network FS to avoid UI freeze) newFile.close(); // Remove backup file after successful write @@ -336,7 +351,8 @@ bool DPdfDoc::saveAs(const QString &filePath) locker.unlock(); saveWriter.flush(); // Flush user buffer to kernel buffer - fsync(saveWriter.handle()); // Sync kernel buffer to disk + if (!isNetworkFileSystem(filePath)) + fsync(saveWriter.handle()); // Sync kernel buffer to disk (skip on network FS to avoid UI freeze) saveWriter.close(); return result; diff --git a/tests/document/ut_networkfilesystem.cpp b/tests/document/ut_networkfilesystem.cpp new file mode 100644 index 000000000..2343f1d12 --- /dev/null +++ b/tests/document/ut_networkfilesystem.cpp @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include + +#include +#include +#include +#include + +// Replicate the static helper from dpdfdoc.cpp for unit testing. +// The original isNetworkFileSystem() is file-local (static) in +// 3rdparty/deepin-pdfium/src/dpdfdoc.cpp and cannot be linked from +// test code; this copy verifies the decision logic. +static bool isNetworkFileSystem(const QString &path) +{ + if (path.contains(QLatin1String("/gvfs/"))) + return true; + + QStorageInfo storage(path); + QByteArray fsType = storage.fileSystemType(); + if (fsType.contains("cifs") || fsType.contains("smb") || fsType.contains("fuse.gvfs")) + return true; + + return false; +} + +TEST(TestNetworkFileSystem, LocalPathIsNotNetwork) +{ + QTemporaryFile tmp; + ASSERT_TRUE(tmp.open()); + EXPECT_FALSE(isNetworkFileSystem(tmp.fileName())); +} + +TEST(TestNetworkFileSystem, GvfsPathIsNetwork) +{ + QString gvfsPath = QStringLiteral("/run/user/1000/gvfs/smb-share:server=fileserver,share=public/doc.pdf"); + EXPECT_TRUE(isNetworkFileSystem(gvfsPath)); +} + +TEST(TestNetworkFileSystem, RootIsNotNetwork) +{ + EXPECT_FALSE(isNetworkFileSystem(QStringLiteral("/"))); +} + +TEST(TestNetworkFileSystem, TmpDirIsNotNetwork) +{ + EXPECT_FALSE(isNetworkFileSystem(QStringLiteral("/tmp"))); +} + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +}