diff --git a/.github/workflows/release-macos-homebrew.yml b/.github/workflows/release-macos-homebrew.yml index 15c2290fb..8fbd55869 100644 --- a/.github/workflows/release-macos-homebrew.yml +++ b/.github/workflows/release-macos-homebrew.yml @@ -160,28 +160,14 @@ jobs: release_name: GoldenDict-ng-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} prerelease: ${{env.prerelease}} body: | - #### Install instructions for Windows, macOS and Linux - - . - - #### Filename pattern (文件名模式): **[Qt version]-GoldenDict-ng-[OS]-[release-date].[ext]** - - Windows users can use either `****-installer.exe` (for installer) or `****.zip` (unzip and run). - The `goldendict.exe` can be dropped into previous installation's folder (if dependencies aren't changed). - - Linux users can use Flatpak or build from source. - https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng - - macOS users can use `.dmg` installer. - - `6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive. - - #### Build Details - - macOS: macOS-12 (x86_64) and macOS-14 (Arm) - Windows: Visual studio 2019 - based on: ${{github.ref_name}} - + [Install instructions for Windows, macOS and Linux](https://xiaoyifang.github.io/goldendict-ng/install/). + + Filaname pattern: GoldenDict-[version]-[Qt version]-[system name]-... + + For Linux, released vesion is on Flathub -> [io.github.xiaoyifang.goldendict_ng](https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng). + + Based on branch: ${{github.ref_name}} + #### Changes - ${{steps.build_changelog.outputs.changelog}} + ${{steps.build_changelog.outputs.changelog}} \ No newline at end of file diff --git a/.github/workflows/release-windows-vcpkg-cmake.yml b/.github/workflows/release-windows-vcpkg-cmake.yml new file mode 100644 index 000000000..dfc65bc7b --- /dev/null +++ b/.github/workflows/release-windows-vcpkg-cmake.yml @@ -0,0 +1,182 @@ +name: Release Windows Vcpkg CMake +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +on: + workflow_dispatch: + push: + branches: + - dev + - master + - experimental + paths-ignore: + - 'docs/**' + - "*.md" + - ".*" + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022] + qt_ver: [ 6.7.2 ] + qt_arch: [win64_msvc2019_64] + env: + version: 24.05.13 + versionSuffix: ${{ !contains(github.ref_name,'master') && 'alpha' || 'NextNameHere' }} + prerelease: ${{ !contains(github.ref_name,'master') }} + steps: + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt_ver }} + # target: ${{ matrix.qt_target }} + arch: ${{ matrix.qt_arch }} + modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtspeech + setup-python: 'false' + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + + - name: Setup changelog + id: changelog + shell: bash + env: + prerelease: ${{env.prerelease}} + run: | + if [[ "$prerelease" == 'true' ]] + then + echo "This is a pre-release" + previousTag=$(git tag --sort=-creatordate | grep "^v" | sed -n 2p) + currentTag=$(git tag --sort=-creatordate | grep "^v" | sed -n 1p) + else + echo "This is not a pre-release" + previousTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "alpha" | sed -n 2p) + currentTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "alpha" | sed -n 1p) + fi + echo "prev_tag=$previousTag" >> $GITHUB_OUTPUT + echo "curr_tag=$currentTag" >> $GITHUB_OUTPUT + echo "previousTag : $previousTag" + echo "currentTag : $currentTag" + + - name: "Build Changelog" + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + commitMode: false + fromTag: "${{ steps.changelog.outputs.prev_tag }}" + toTag: "${{ steps.changelog.outputs.curr_tag }}" + configurationJson: | + { + "template": "#{{CHANGELOG}}\n\n
\n🔴 Uncategorized\n\n#{{UNCATEGORIZED}}\n
", + "categories": [ + { + "title": "## 🚀 Features", + "labels": ["feature","feat","opt"] + }, + { + "title": "## 🐛 Fixes", + "labels": ["fix","bug"] + } + , + { + "title": "## 🤖 Github action", + "labels": ["action"] + } + , + { + "title": "## 🧼 Clean Code", + "labels": ["clean"] + } + + + ], + "label_extractor": [ + { + "pattern": "([^:]*):.*", + "target": "$1", + "on_property": "title", + "flags": "gu" + } + ] + } + - name: setup vcpkg github caches variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Build binaries + id: build + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + run: | + # Launch-VsDevShell also provides Ninja + & 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1' ` + -SkipAutomaticLocation -Arch amd64 -HostArch amd64 + New-Item -Path './build_dir' -ItemType Directory + + # RelWithDebInfo + msvc's = .pdb file beside program file. + cmake -S . -B "./build_dir" ` + -G Ninja ` + -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ` + -DCMAKE_BUILD_TYPE=RelWithDebInfo ` + -DWITH_FFMPEG_PLAYER=OFF ` + -DUSE_VCPKG=ON ` + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" ` + -DWITH_VCPKG_BREAKPAD=ON + cmake --build "./build_dir" + - name: CPack create package + run: | + cd './build_dir' + cpack --verbose --trace + cd .. + pwd + - name: Upload packages + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $tagName = "v$env:version-$env:versionSuffix.$(git rev-parse --short=8 HEAD)" + + $changeNotes = " + [Install instructions for Windows, macOS and Linux](https://xiaoyifang.github.io/goldendict-ng/install/). + + Filaname pattern: GoldenDict-[version]-[Qt version]-[system name]-... + + For Linux, released vesion is on Flathub -> [io.github.xiaoyifang.goldendict_ng](https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng). + + Based on branch: ${{github.ref_name}} + + #### Changes + + ${{steps.build_changelog.outputs.changelog}} + " + + $tagExist = gh api --silent "repos/:owner/:repo/git/refs/tags/${{github.ref_name}}" + if (-not $?) { + if ($env:prerelease -eq "true") { + gh release create ${tagName} --target ${{github.ref_name}} --notes "${changeNotes}" --latest=false --prerelease + } else { + gh release create ${tagName} --target ${{github.ref_name}} --notes "${changeNotes}" --latest=true + } + } + + # file name after # is display label + + $namePrefix="GoldenDict-${{env.version}}-Qt${{matrix.qt_ver}}" + + cd './build_dir' + gh release upload "${tagName}" "${namePrefix}.7z#${namePrefix}-Windows.7z" --clobber + gh release upload "${tagName}" "${namePrefix}.exe#${namePrefix}-Windows-installer.exe" --clobber + + cd './goldendict' + gh release upload "${tagName}" "goldendict.exe#${namePrefix}-Windows-main-exe-file-only.exe" --clobber + gh release upload "${tagName}" "goldendict.pdb#${namePrefix}-Windows-debug-file.pdb" --clobber + cd .. + diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 0ff799486..cae496ba5 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -7,18 +7,18 @@ on: # workflows: [AutoTag] # types: [completed] workflow_dispatch: - push: - branches: - - dev - - master - - experimental - # - staged - paths-ignore: - - 'docs/**' - # - ".github/**" - - "howto/**" - - "*.md" - - ".clang-format" +# push: +# branches: +# - dev +# - master +# - experimental +# # - staged +# paths-ignore: +# - 'docs/**' +# # - ".github/**" +# - "howto/**" +# - "*.md" +# - ".clang-format" jobs: build: diff --git a/CMakeLists.txt b/CMakeLists.txt index e5b2de350..a7e918224 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,7 +270,7 @@ if (APPLE) --volicon ${CMAKE_SOURCE_DIR}/icons/macicon.icns \ --icon \"${App_Name}\" 100 100 --app-drop-link 300 100 \ - \"GoldenDict-${CMAKE_PROJECT_VERSION}-Qt${Qt6_VERSION}-${CMAKE_SYSTEM_PROCESSOR}.dmg\" \ + \"GoldenDict-${CMAKE_PROJECT_VERSION}-Qt${Qt6_VERSION}-macOS-${CMAKE_SYSTEM_PROCESSOR}.dmg\" \ \"${Assembling_Dir}\")" ) else () @@ -353,12 +353,23 @@ if (WIN32) PATTERN "*.ilk" EXCLUDE) - set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-Qt${Qt6Widgets_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") - set(CPACK_GENERATOR "7Z;NSIS") + set(CPACK_PACKAGE_FILE_NAME "GoldenDict-${PROJECT_VERSION}-Qt${Qt6Widgets_VERSION}") + set(CPACK_GENERATOR "7Z;NSIS64") + + # override the default install path, which is $PROGRAMFILES64\${project-name} ${project-version} in NSIS + set(CPACK_PACKAGE_INSTALL_DIRECTORY "GoldenDict-ng") + + # NSIS specificS set(CPACK_NSIS_MANIFEST_DPI_AWARE ON) + set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/icons/programicon.ico") + set(CPACK_NSIS_PACKAGE_NAME "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}") + set(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}") + set(CPACK_NSIS_URL_INFO_ABOUT [=[https://xiaoyifang.github.io/goldendict-ng/]=]) set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") - include(CPack) + set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\GoldenDict-ng.lnk' '$INSTDIR\\\\${GOLDENDICT}.exe'") + set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$START_MENU\\\\GoldenDict-ng.lnk'") + include(CPack) endif () feature_summary(WHAT ALL DESCRIPTION "Build configuration:") diff --git a/locale/ar_SA.ts b/locale/ar_SA.ts index 38b1cb9a3..70372eba6 100644 --- a/locale/ar_SA.ts +++ b/locale/ar_SA.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + حدد الحد الأقصى للكلمات الرئيسية المصفاة التي تم إرجاعها. Filter max results: - Filter max results: + تصفية النتائج الأقصى: Unique headwords total: %1. - Unique headwords total: %1. + مجموع الكلمات الرئيسية الفريدة: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + مجموع الكلمات الرئيسية الفريدة: %1, filtered(محدود): %2 diff --git a/locale/ay_BO.ts b/locale/ay_BO.ts index 355b532cd..c358b82a0 100644 --- a/locale/ay_BO.ts +++ b/locale/ay_BO.ts @@ -583,19 +583,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Uñacht’ayaña jilpacha filtrado p’iqinchawinaka kutt’ayata. Filter max results: - Filter max results: + Filtro max ukax akhamawa: Unique headwords total: %1. - Unique headwords total: %1. + Jan uñt’at p’iqinchäwinak taqpachax: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Sapa p’iqinchawi taqpacha: %1, filtrado(limitado): %2 diff --git a/locale/be_BY.ts b/locale/be_BY.ts index 64103a0a8..30ba3f68b 100644 --- a/locale/be_BY.ts +++ b/locale/be_BY.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Укажыце максімальную колькасць вернутых адфільтраваных загалоўных слоў. Filter max results: - Filter max results: + Максімальныя вынікі фільтра: Unique headwords total: %1. - Unique headwords total: %1. + Усяго унікальных загалоўных слоў: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Усяго унікальных загалоўных слоў: %1, адфільтравана (абмежавана): %2 diff --git a/locale/bg_BG.ts b/locale/bg_BG.ts index 3440b6afe..e65aa0c9b 100644 --- a/locale/bg_BG.ts +++ b/locale/bg_BG.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Посочете максималния брой върнати филтрирани заглавни думи. Filter max results: - Filter max results: + Филтриране на макс. резултати: Unique headwords total: %1. - Unique headwords total: %1. + Общо уникални заглавни думи: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Общо уникални заглавни думи: %1, филтрирано (ограничено): %2 diff --git a/locale/cs_CZ.ts b/locale/cs_CZ.ts index 99375852b..0381b6e2b 100644 --- a/locale/cs_CZ.ts +++ b/locale/cs_CZ.ts @@ -581,19 +581,19 @@ a školní ortografií v cyrilici) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Zadejte maximální filtrovaná slova hlaviček. Filter max results: - Filter max results: + Filtrovat maximální výsledky: Unique headwords total: %1. - Unique headwords total: %1. + Jedinečná hlavičková slova: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Jedinečná hlavičková slova: %1, filtrováno(omezená): %2 diff --git a/locale/de_CH.ts b/locale/de_CH.ts index 7886b9723..33e515189 100644 --- a/locale/de_CH.ts +++ b/locale/de_CH.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Geben Sie die maximale Anzahl gefilterter Schlagwörter zurück. Filter max results: - Filter max results: + Maximale Ergebnisse filtern: Unique headwords total: %1. - Unique headwords total: %1. + Einzigartige Schlagworte insgesamt: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Einzigartige Schlagwörter insgesamt: %1, gefiltert(begrenzt): %2 diff --git a/locale/de_DE.ts b/locale/de_DE.ts index 9b032de10..d7e5cd9e9 100644 --- a/locale/de_DE.ts +++ b/locale/de_DE.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Geben Sie die maximale Anzahl gefilterter Schlagwörter zurück. Filter max results: - Filter max results: + Maximale Ergebnisse filtern: Unique headwords total: %1. - Unique headwords total: %1. + Einzigartige Schlagworte insgesamt: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Einzigartige Schlagwörter insgesamt: %1, gefiltert(begrenzt): %2 diff --git a/locale/el_GR.ts b/locale/el_GR.ts index fe3275c8e..63b3bfee6 100644 --- a/locale/el_GR.ts +++ b/locale/el_GR.ts @@ -583,19 +583,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Καθορίστε τα μέγιστα φιλτραρισμένα headwords που επιστρέφονται. Filter max results: - Filter max results: + Φιλτράρισμα μέγιστων αποτελεσμάτων: Unique headwords total: %1. - Unique headwords total: %1. + Μοναδικό σύνολο κεφαλών: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Μοναδικά headwords total: %1, φιλτραρισμένο(περιορισμένο): %2 diff --git a/locale/eo_UY.ts b/locale/eo_UY.ts index 0a675efdf..2e5c58b2a 100644 --- a/locale/eo_UY.ts +++ b/locale/eo_UY.ts @@ -581,19 +581,19 @@ inter klasika kaj lerneja ortografio en cirila) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Indiku la maksimumajn filtritajn kapvortojn resenditajn. Filter max results: - Filter max results: + Filtrilaj maksimumaj rezultoj: Unique headwords total: %1. - Unique headwords total: %1. + Unika kapvortoj entute: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Unika kapvortoj entute: %1, filtrita (limigita): %2 diff --git a/locale/es_AR.ts b/locale/es_AR.ts index 730237774..6f8d76dd9 100644 --- a/locale/es_AR.ts +++ b/locale/es_AR.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Especifique el máximo filtrado de palabras de cabecera devueltas. Filter max results: - Filter max results: + Filtrar máximos resultados: Unique headwords total: %1. - Unique headwords total: %1. + Total de palabras de cabecera: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Total de palabras de cabecera: %1, filtrado(limitado): %2 diff --git a/locale/es_BO.ts b/locale/es_BO.ts index d1d82c598..df4afb043 100644 --- a/locale/es_BO.ts +++ b/locale/es_BO.ts @@ -581,19 +581,19 @@ entre la ortografía clásica y la escolar en cirílico) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Especifique el máximo filtrado de palabras de cabecera devueltas. Filter max results: - Filter max results: + Filtrar máximos resultados: Unique headwords total: %1. - Unique headwords total: %1. + Total de palabras de cabecera: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Total de palabras de cabecera: %1, filtrado(limitado): %2 diff --git a/locale/es_ES.ts b/locale/es_ES.ts index 3761d7992..8d87b0ac6 100644 --- a/locale/es_ES.ts +++ b/locale/es_ES.ts @@ -581,19 +581,19 @@ entre ortografía clásica y escolar en cirílico) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Especifique el máximo filtrado de palabras de cabecera devueltas. Filter max results: - Filter max results: + Filtrar máximos resultados: Unique headwords total: %1. - Unique headwords total: %1. + Total de palabras de cabecera: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Total de palabras de cabecera: %1, filtrado(limitado): %2 diff --git a/locale/fa_IR.ts b/locale/fa_IR.ts index 4018ec119..49000bf5f 100644 --- a/locale/fa_IR.ts +++ b/locale/fa_IR.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + حداکثر عبارات فیلتر شده بازگشتی را مشخص کنید. Filter max results: - Filter max results: + فیلتر حداکثر نتایج: Unique headwords total: %1. - Unique headwords total: %1. + کل سر واژه های منحصر به فرد: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + کل کلمات منحصر به فرد: %1، فیلتر شده (محدود): %2 diff --git a/locale/fi_FI.ts b/locale/fi_FI.ts index b1ce87756..6e12953dc 100644 --- a/locale/fi_FI.ts +++ b/locale/fi_FI.ts @@ -581,19 +581,19 @@ klassisen ja kouluortografian välillä kyrillisessä) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Määritä suurin suodatetut otsikot. Filter max results: - Filter max results: + Suodatin max tulokset: Unique headwords total: %1. - Unique headwords total: %1. + Ainutlaatuiset kuulokkeet yhteensä: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Ainutlaatuiset otsikot yhteensä: %1, filtered(limited): %2 diff --git a/locale/fr_FR.ts b/locale/fr_FR.ts index 139467d1d..f20dd1459 100644 --- a/locale/fr_FR.ts +++ b/locale/fr_FR.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Spécifiez le nombre maximum de mots clés filtrés retournés. Filter max results: - Filter max results: + Filtrer les résultats max : Unique headwords total: %1. - Unique headwords total: %1. + Total des mots-clés uniques : %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Mots clés uniques totaux : %1, filtrés (limités) : %2 diff --git a/locale/hi_IN.ts b/locale/hi_IN.ts index ca5ea71c9..c53550ccd 100644 --- a/locale/hi_IN.ts +++ b/locale/hi_IN.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + लौटाए गए अधिकतम फ़िल्टर किए गए हेडवर्ड निर्दिष्ट करें. Filter max results: - Filter max results: + अधिकतम परिणाम फ़िल्टर करें: Unique headwords total: %1. - Unique headwords total: %1. + अद्वितीय हेडवर्ड्स कुल: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + अद्वितीय हेडवर्ड्स की कुल संख्या: %1, फ़िल्टर किया गया (सीमित): %2 diff --git a/locale/it_IT.ts b/locale/it_IT.ts index a0cff2b67..26bc60b76 100644 --- a/locale/it_IT.ts +++ b/locale/it_IT.ts @@ -581,19 +581,19 @@ tra l'ortografia classica e scolastica in cirillico) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Specifica la massima intestazione filtrata restituita. Filter max results: - Filter max results: + Filtro max risultati: Unique headwords total: %1. - Unique headwords total: %1. + Totale parole chiave unice: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Totale delle headwords unice: %1, filtrato(limitato): %2 diff --git a/locale/ja_JP.ts b/locale/ja_JP.ts index c88acaac6..55cc6d712 100644 --- a/locale/ja_JP.ts +++ b/locale/ja_JP.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + 返される最大フィルタリングされたヘッドワードを指定します。 Filter max results: - Filter max results: + 最大検索結果: Unique headwords total: %1. - Unique headwords total: %1. + ユニークなヘッドワードの合計: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + ユニークなヘッドワードの合計: %1, filtered(limited): %2 diff --git a/locale/ko_KR.ts b/locale/ko_KR.ts index 1c10d4f75..6fb0106eb 100644 --- a/locale/ko_KR.ts +++ b/locale/ko_KR.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + 반환된 최대 필터링된 표제어를 지정합니다. Filter max results: - Filter max results: + 최대 결과 필터링: Unique headwords total: %1. - Unique headwords total: %1. + 고유 표제어 총계: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + 고유 표제어 총계: %1, 필터링됨(제한적): %2 diff --git a/locale/lt_LT.ts b/locale/lt_LT.ts index a744c9d19..b1a438d95 100644 --- a/locale/lt_LT.ts +++ b/locale/lt_LT.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Nurodykite maksimalų grąžinamų filtruotų antraščių skaičių. Filter max results: - Filter max results: + Filtruoti maks. rezultatus: Unique headwords total: %1. - Unique headwords total: %1. + Iš viso unikalių antraščių: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Iš viso unikalių antraščių: %1, filtruota (ribota): %2 diff --git a/locale/mk_MK.ts b/locale/mk_MK.ts index c616780d4..5a30ae850 100644 --- a/locale/mk_MK.ts +++ b/locale/mk_MK.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Наведете ги максималните вратени филтрирани зборови. Filter max results: - Filter max results: + Филтрирајте ги максималните резултати: Unique headwords total: %1. - Unique headwords total: %1. + Вкупно уникатни наслови: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Вкупно уникатни насловни зборови: %1, филтрирани(ограничено): %2 diff --git a/locale/nl_NL.ts b/locale/nl_NL.ts index a273f052b..c259e2a55 100644 --- a/locale/nl_NL.ts +++ b/locale/nl_NL.ts @@ -581,19 +581,19 @@ traditionele en hedendaagse spelling in het cyrillisch) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Specificeer de maximale gefilterde kopwoorden geretourneerd. Filter max results: - Filter max results: + Maximale resultaten filteren: Unique headwords total: %1. - Unique headwords total: %1. + Unieke kopwoorden totaal: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Unieke hoofdwoorden totaal: %1, gefilterd (beperkt): %2 diff --git a/locale/pl_PL.ts b/locale/pl_PL.ts index 009adffe7..4f24dc2f1 100644 --- a/locale/pl_PL.ts +++ b/locale/pl_PL.ts @@ -581,19 +581,19 @@ między ortografią klasyczną i szkolną w cyrylicy) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Określ maksymalny zwrócony filtrowany nagłówek. Filter max results: - Filter max results: + Filtr maks. wyników: Unique headwords total: %1. - Unique headwords total: %1. + Unikalne słowa w sumie: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Unikalne słowa w sumie: %1, filtrowane(ograniczone): %2 diff --git a/locale/pt_BR.ts b/locale/pt_BR.ts index f6379f997..5326af0b4 100644 --- a/locale/pt_BR.ts +++ b/locale/pt_BR.ts @@ -581,19 +581,19 @@ entre clássico e ortografia escolar em cirílico) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Especifique o número máximo de cabeçalhos retornados. Filter max results: - Filter max results: + Filtrar resultados máximos: Unique headwords total: %1. - Unique headwords total: %1. + Total de cabeçalhos únicos: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Total de cabeçalhos únicos: %1, filtrado(limitado): %2 diff --git a/locale/pt_PT.ts b/locale/pt_PT.ts index 3d2716566..a7c46fef3 100644 --- a/locale/pt_PT.ts +++ b/locale/pt_PT.ts @@ -581,19 +581,19 @@ entre ortografia clássica e escolar em ciílico) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Especifique o número máximo de cabeçalhos retornados. Filter max results: - Filter max results: + Filtrar resultados máximos: Unique headwords total: %1. - Unique headwords total: %1. + Total de cabeçalhos únicos: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Total de cabeçalhos únicos: %1, filtrado(limitado): %2 diff --git a/locale/qu_PE.ts b/locale/qu_PE.ts index 53e3ff2be..6d8207062 100644 --- a/locale/qu_PE.ts +++ b/locale/qu_PE.ts @@ -581,19 +581,19 @@ chiqan kayninta sumaqyachin) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Aswan filtrasqa uma simikuna kutichisqa kaqta willay. Filter max results: - Filter max results: + Filtro max ruwasqakuna: Unique headwords total: %1. - Unique headwords total: %1. + Sapaq umalliq simikuna llapanpi: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Sapaq uma simikuna llapanpi: %1, filtrado(limitado): %2 diff --git a/locale/ru_RU.ts b/locale/ru_RU.ts index 16b5f0f91..582f9b685 100644 --- a/locale/ru_RU.ts +++ b/locale/ru_RU.ts @@ -583,19 +583,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Укажите максимальное количество возвращаемых отфильтрованных заголовков. Filter max results: - Filter max results: + Максимальное количество фильтров: Unique headwords total: %1. - Unique headwords total: %1. + Уникальные заголовки: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Уникальные заголовки всего: %1, отфильтрован(ограничено): %2 diff --git a/locale/sk_SK.ts b/locale/sk_SK.ts index e65f290db..40af7ba30 100644 --- a/locale/sk_SK.ts +++ b/locale/sk_SK.ts @@ -581,19 +581,19 @@ medzi klasickou a školskou ortografiou v azbuke) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Zadajte maximálny počet vrátených filtrovaných hesiel. Filter max results: - Filter max results: + Filtrovať maximálne výsledky: Unique headwords total: %1. - Unique headwords total: %1. + Celkový počet jedinečných hesiel: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Celkom jedinečných hesiel: %1, filtrované (obmedzene): %2 diff --git a/locale/sq_AL.ts b/locale/sq_AL.ts index 600cf98f4..e740ec5b6 100644 --- a/locale/sq_AL.ts +++ b/locale/sq_AL.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Specifikoni kryefjalët maksimale të filtruara të kthyera. Filter max results: - Filter max results: + Filtro rezultatet maksimale: Unique headwords total: %1. - Unique headwords total: %1. + Gjithsej kryefjalë unike: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Gjithsej kryefjalë unike: %1, filtruar (i kufizuar): %2 diff --git a/locale/sr_SP.ts b/locale/sr_SP.ts index cfb62b069..7a5b8b469 100644 --- a/locale/sr_SP.ts +++ b/locale/sr_SP.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Одредите максималан број враћених филтрираних наслова. Filter max results: - Filter max results: + Филтрирајте максималне резултате: Unique headwords total: %1. - Unique headwords total: %1. + Укупно јединствених наслова: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Укупно јединствених наслова: %1, филтрирано (ограничено): %2 diff --git a/locale/sv_SE.ts b/locale/sv_SE.ts index b4be1f593..76fe557e5 100644 --- a/locale/sv_SE.ts +++ b/locale/sv_SE.ts @@ -581,19 +581,19 @@ klassisk rättstavning och skolrättstavning i kyrillisk skrift) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Ange de maximalt filtrerade headwords som returnerats. Filter max results: - Filter max results: + Filtrera max resultat: Unique headwords total: %1. - Unique headwords total: %1. + Unika huvudord totalt: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Unika huvudord totalt: %1, filtrerade (begränsade): %2 diff --git a/locale/tg_TJ.ts b/locale/tg_TJ.ts index 2987e991a..59647ebb7 100644 --- a/locale/tg_TJ.ts +++ b/locale/tg_TJ.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Сарлавҳаҳои ҳадди аксар филтршудаи баргардонидашударо муайян кунед. Filter max results: - Filter max results: + Натиҷаҳои максималии филтр: Unique headwords total: %1. - Unique headwords total: %1. + Ҳама сарлавҳаҳои беназир: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Ҳама сарлавҳаҳои беназир: %1, филтршуда(маҳдуд): %2 diff --git a/locale/tk_TM.ts b/locale/tk_TM.ts index 48e0bd1b1..ad17946a9 100644 --- a/locale/tk_TM.ts +++ b/locale/tk_TM.ts @@ -580,11 +580,11 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Iň köp süzülen söz sözlerini görkeziň. Filter max results: - Filter max results: + Iň ýokary netijeleri süzüň: Unique headwords total: %1. diff --git a/locale/tr_TR.ts b/locale/tr_TR.ts index 713a465be..75115488f 100644 --- a/locale/tr_TR.ts +++ b/locale/tr_TR.ts @@ -581,19 +581,19 @@ arasındaki farkı giderir) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Döndürülen maksimum filtrelenmiş başlık kelimelerini belirtin. Filter max results: - Filter max results: + Maksimum sonuçları filtrele: Unique headwords total: %1. - Unique headwords total: %1. + Benzersiz başlık kelimelerinin toplamı: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Benzersiz başlık kelimeleri toplamı: %1, filtrelenmiş(sınırlı): %2 diff --git a/locale/uk_UA.ts b/locale/uk_UA.ts index 4005e0aa9..27c622b89 100644 --- a/locale/uk_UA.ts +++ b/locale/uk_UA.ts @@ -581,19 +581,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Вкажіть максимальну кількість відфільтрованих заголовків (серверів). Filter max results: - Filter max results: + Фільтрувати макс. результати: Unique headwords total: %1. - Unique headwords total: %1. + Унікальний загальний заголовок: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Унікальний загальний заголовк: %1, відфільтрований(обмежений): %2 diff --git a/locale/vi_VN.ts b/locale/vi_VN.ts index 29a9e4fcd..0429efee8 100644 --- a/locale/vi_VN.ts +++ b/locale/vi_VN.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + Chỉ định số lượng tiêu đề được lọc tối đa được trả về. Filter max results: - Filter max results: + Lọc kết quả tối đa: Unique headwords total: %1. - Unique headwords total: %1. + Tổng số từ khóa duy nhất: %1. Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + Tổng số từ khóa duy nhất: %1, được lọc (giới hạn): %2 diff --git a/locale/zh_CN.ts b/locale/zh_CN.ts index 098552470..049d3ed65 100644 --- a/locale/zh_CN.ts +++ b/locale/zh_CN.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + 指定返回的最大过滤头字。 Filter max results: - Filter max results: + 最多过滤: Unique headwords total: %1. - Unique headwords total: %1. + 唯一的头字总数: %1 Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + 唯一的头词总计: %1, 过滤(有限): %2 diff --git a/locale/zh_TW.ts b/locale/zh_TW.ts index a03b48c34..9c3dd40ef 100644 --- a/locale/zh_TW.ts +++ b/locale/zh_TW.ts @@ -580,19 +580,19 @@ between classic and school orthography in cyrillic) Specify the maximum filtered headwords returned. - Specify the maximum filtered headwords returned. + 指定傳回的最大過濾詞條。 Filter max results: - Filter max results: + 過濾最大結果: Unique headwords total: %1. - Unique headwords total: %1. + 獨特詞條總數: %1。 Unique headwords total: %1, filtered(limited): %2 - Unique headwords total: %1, filtered(limited): %2 + 唯一詞條總數: %1,過濾(有限): %2 diff --git a/src/config.cc b/src/config.cc index 92cafb879..20cb9505a 100644 --- a/src/config.cc +++ b/src/config.cc @@ -176,18 +176,6 @@ bool InternalPlayerBackend::isQtmultimedia() const #endif } -ScanPopupWindowFlags spwfFromInt( int id ) -{ - if ( id == SPWF_Popup ) - return SPWF_Popup; - if ( id == SPWF_Tool ) - return SPWF_Tool; - - if ( id != SPWF_default ) - gdWarning( "Invalid ScanPopup unpinned window flags: %d\n", id ); - return SPWF_default; -} - QString Preferences::sanitizeInputPhrase( QString const & inputWord ) const { QString result = inputWord; diff --git a/src/config.hh b/src/config.hh index add8bf4a4..186529904 100644 --- a/src/config.hh +++ b/src/config.hh @@ -321,22 +321,6 @@ private: QString name; }; -#if defined( HAVE_X11 ) - // The ScanPopup window flags customization code has been tested - // only in X11 desktop environments and window managers. - // None of the window flags configurations I have tried works perfectly well - // in XFCE with Qt4. Let us enable customization code for Qt5 exclusively to - // avoid regressions with Qt4. - #define ENABLE_SPWF_CUSTOMIZATION -#endif - -enum ScanPopupWindowFlags { - SPWF_default = 0, - SPWF_Popup, - SPWF_Tool -}; -ScanPopupWindowFlags spwfFromInt( int id ); - /// Various user preferences struct Preferences { diff --git a/src/main.cc b/src/main.cc index 5b64efe0c..b40656cf4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -556,6 +556,8 @@ int main( int argc, char ** argv ) QLocale locale( localeName ); QLocale::setDefault( locale ); + QApplication::setLayoutDirection( locale.textDirection() ); + if ( !qtTranslator.load( "qt_extra_" + localeName, Config::getLocDir() ) ) { qtTranslator.load( "qt_extra_" + localeName, QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ); app.installTranslator( &qtTranslator ); diff --git a/src/stylesheets/article-style.css b/src/stylesheets/article-style.css index fef811a54..825b13202 100644 --- a/src/stylesheets/article-style.css +++ b/src/stylesheets/article-style.css @@ -29,6 +29,13 @@ h5, h6 { unicode-bidi: plaintext; } + +p, +em, +span, +div { + unicode-bidi: plaintext; +} /* This stylesheet is used to highligh current selection when doing a search. It changes the default selection color (e.g. blue under Windows, orange under Ubuntu) */ diff --git a/src/stylesheets/qt-classic.css b/src/stylesheets/qt-classic.css index 6aeeb106b..952ff83c4 100644 --- a/src/stylesheets/qt-classic.css +++ b/src/stylesheets/qt-classic.css @@ -20,22 +20,6 @@ QTabBar::close-button:hover { image: url(:/icons/closetab-hover.png); } -MainStatusBar #text { - border-top-right-radius: 3px; - border-top: 1px solid palette(dark); - border-right: 1px solid palette(dark); - background: palette(window); - padding: 2px; -} - -MainStatusBar #icon { - border-top: 1px solid palette(dark); - background: palette(window); - padding: 2px; - padding-left: 4px; - padding-right: 0px; -} - ScanPopup #translateLine { margin: 0px; padding: 1px 3px 1px 3px; diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index 591089241..048fcc5a9 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -1324,7 +1324,7 @@ void ArticleView::syncBackgroundColorWithCfgDarkReader() const // Only works Qt6.6.3+ https://bugreports.qt.io/browse/QTBUG-112013 #if QT_VERSION >= QT_VERSION_CHECK( 6, 6, 3 ) if ( cfg.preferences.darkReaderMode ) { - webview->page()->setBackgroundColor( Qt::black ); + webview->page()->setBackgroundColor( QColor( 39, 40, 40 ) ); } else { webview->page()->setBackgroundColor( Qt::white ); @@ -1610,32 +1610,34 @@ void ArticleView::contextMenuRequested( QPoint const & pos ) unsigned refsAdded = 0; bool maxDictionaryRefsReached = false; - for ( QStringList::const_iterator i = ids.constBegin(); i != ids.constEnd(); ++i, ++refsAdded ) { - // Find this dictionary - - auto dictionary = dictionaryGroup->getDictionaryById( i->toUtf8().data() ); - if ( dictionary ) { - QAction * action = nullptr; - if ( refsAdded == cfg.preferences.maxDictionaryRefsInContextMenu ) { - // Enough! Or the menu would become too large. - maxDictionaryRefsAction = new QAction( ".........", &menu ); - action = maxDictionaryRefsAction; - maxDictionaryRefsReached = true; - } - else { - action = new QAction( dictionary->getIcon(), QString::fromUtf8( dictionary->getName().c_str() ), &menu ); - // Force icons in menu on all platforms, - // since without them it will be much harder - // to find things. - action->setIconVisibleInMenu( true ); + if ( cfg.preferences.maxDictionaryRefsInContextMenu > 0 ) { + for ( QStringList::const_iterator i = ids.constBegin(); i != ids.constEnd(); ++i, ++refsAdded ) { + // Find this dictionary + + auto dictionary = dictionaryGroup->getDictionaryById( i->toUtf8().data() ); + if ( dictionary ) { + QAction * action = nullptr; + if ( refsAdded == cfg.preferences.maxDictionaryRefsInContextMenu ) { + // Enough! Or the menu would become too large. + maxDictionaryRefsAction = new QAction( ".........", &menu ); + action = maxDictionaryRefsAction; + maxDictionaryRefsReached = true; + } + else { + action = new QAction( dictionary->getIcon(), QString::fromUtf8( dictionary->getName().c_str() ), &menu ); + // Force icons in menu on all platforms, + // since without them it will be much harder + // to find things. + action->setIconVisibleInMenu( true ); + } + menu.addAction( action ); + + tableOfContents[ action ] = *i; } - menu.addAction( action ); - tableOfContents[ action ] = *i; + if ( maxDictionaryRefsReached ) + break; } - - if ( maxDictionaryRefsReached ) - break; } menu.addSeparator(); diff --git a/src/ui/mainstatusbar.cc b/src/ui/mainstatusbar.cc index 9b557a5aa..b63d94975 100644 --- a/src/ui/mainstatusbar.cc +++ b/src/ui/mainstatusbar.cc @@ -10,7 +10,8 @@ #include MainStatusBar::MainStatusBar( QWidget * parent ): - QWidget( parent ) + QWidget( parent ), + timer( new QTimer( this ) ) { textWidget = new QLabel( QString(), this ); textWidget->setObjectName( "text" ); @@ -23,7 +24,7 @@ MainStatusBar::MainStatusBar( QWidget * parent ): picWidget->setScaledContents( true ); picWidget->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Ignored ); - timer = new QTimer( this ); + timer->setSingleShot( true ); // layout @@ -31,7 +32,7 @@ MainStatusBar::MainStatusBar( QWidget * parent ): layout->setSpacing( 0 ); layout->setSizeConstraint( QLayout::SetFixedSize ); layout->setAlignment( Qt::AlignLeft | Qt::AlignVCenter ); - layout->setContentsMargins( 0, 0, 0, 0 ); + layout->setContentsMargins( 5, 5, 5, 5 ); layout->addWidget( picWidget ); layout->addWidget( textWidget ); setLayout( layout ); @@ -46,9 +47,10 @@ MainStatusBar::MainStatusBar( QWidget * parent ): void MainStatusBar::clearMessage() { message.clear(); - textWidget->setText( backgroungMessage ); + textWidget->setText( backgroundMessage ); picWidget->setPixmap( QPixmap() ); timer->stop(); + hide(); } QString MainStatusBar::currentMessage() const @@ -58,14 +60,16 @@ QString MainStatusBar::currentMessage() const void MainStatusBar::setBackgroundMessage( const QString & bkg_message ) { - backgroungMessage = bkg_message; + show(); + backgroundMessage = bkg_message; if ( message.isEmpty() ) { - textWidget->setText( backgroungMessage ); + textWidget->setText( backgroundMessage ); } } void MainStatusBar::showMessage( const QString & str, int timeout, const QPixmap & pixmap ) { + show(); textWidget->setText( message = str ); picWidget->setPixmap( pixmap ); @@ -81,6 +85,8 @@ void MainStatusBar::showMessage( const QString & str, int timeout, const QPixmap } if ( parentWidget() ) { + raise(); + move( 0, parentWidget()->height() - height() ); } } @@ -94,6 +100,8 @@ bool MainStatusBar::eventFilter( QObject *, QEvent * e ) { switch ( e->type() ) { case QEvent::Resize: + raise(); + move( QPoint( 0, parentWidget()->height() - height() ) ); break; default: diff --git a/src/ui/mainstatusbar.hh b/src/ui/mainstatusbar.hh index 921d0554c..3052d674b 100644 --- a/src/ui/mainstatusbar.hh +++ b/src/ui/mainstatusbar.hh @@ -25,7 +25,7 @@ public slots: void setBackgroundMessage( QString const & message ); protected: - virtual void mousePressEvent( QMouseEvent * event ); + void mousePressEvent( QMouseEvent * event ) override; private: // component to display a small picture @@ -35,10 +35,10 @@ private: QLabel * textWidget; QTimer * timer; - QString backgroungMessage; + QString backgroundMessage; QString message; - bool eventFilter( QObject * obj, QEvent * event ); + bool eventFilter( QObject * obj, QEvent * event ) override; }; #endif // MAINSTATUSBAR_HH diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index dfcfad124..5f22c2497 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -1774,7 +1774,16 @@ ArticleView * MainWindow::createNewTab( bool switchToIt, QString const & name ) connect( view, &ArticleView::zoomOut, this, &MainWindow::zoomout ); connect( view, &ArticleView::saveBookmarkSignal, this, &MainWindow::addBookmarkToFavorite ); - connect( ui.searchInPageAction, &QAction::triggered, view, &ArticleView::openSearch ); + connect( ui.searchInPageAction, &QAction::triggered, this, [ this, view ]() { +#ifdef Q_OS_MACOS + //workaround to fix macos popup page search Ctrl + F + if ( scanPopup && scanPopup->isActiveWindow() ) { + scanPopup->openSearch(); + return; + } +#endif + view->openSearch(); + } ); view->setSelectionBySingleClick( cfg.preferences.selectWordBySingleClick ); @@ -2225,6 +2234,7 @@ void MainWindow::editPreferences() auto & view = dynamic_cast< ArticleView & >( *( ui.tabWidget->widget( x ) ) ); view.setSelectionBySingleClick( p.selectWordBySingleClick ); + view.syncBackgroundColorWithCfgDarkReader(); if ( needReload ) { view.reload(); } diff --git a/src/ui/scanpopup.cc b/src/ui/scanpopup.cc index b649f8724..01e49e113 100644 --- a/src/ui/scanpopup.cc +++ b/src/ui/scanpopup.cc @@ -113,6 +113,7 @@ ScanPopup::ScanPopup( QWidget * parent, connect( definition, &ArticleView::typingEvent, this, &ScanPopup::typingEvent ); openSearchAction.setShortcut( QKeySequence( "Ctrl+F" ) ); + openSearchAction.setShortcutContext( Qt::WidgetWithChildrenShortcut ); addAction( &openSearchAction ); connect( &openSearchAction, &QAction::triggered, definition, &ArticleView::openSearch ); @@ -1126,6 +1127,11 @@ void ScanPopup::setGroupByName( QString const & name ) const gdWarning( "Group \"%s\" for popup window is not found\n", name.toUtf8().data() ); } +void ScanPopup::openSearch() +{ + definition->openSearch(); +} + void ScanPopup::alwaysOnTopClicked( bool checked ) { bool wasVisible = isVisible(); diff --git a/src/ui/scanpopup.hh b/src/ui/scanpopup.hh index aa26b762b..adcaa0add 100644 --- a/src/ui/scanpopup.hh +++ b/src/ui/scanpopup.hh @@ -81,7 +81,6 @@ signals: /// Put translated word into Favorites void sendWordToFavorites( QString const & word, unsigned groupId, bool ); - #ifdef Q_OS_WIN32 /// Ask for source window is current translate tab bool isGoldenDictWindow( HWND hwnd ); @@ -102,6 +101,8 @@ public slots: #ifdef HAVE_X11 void showEngagePopup(); #endif + void openSearch(); + private: diff --git a/website/docs/howto/build_from_source.md b/website/docs/howto/build_from_source.md index 99f6fe655..fccd0aa84 100644 --- a/website/docs/howto/build_from_source.md +++ b/website/docs/howto/build_from_source.md @@ -96,6 +96,8 @@ You can * manually run windeployqt * add `${Qt's install path}\Qt\6.5.2\msvc2019_64\bin` to your PATH environment variable +Note that `-G Ninja` in CMake is assumed to be used. MSBuild has minor bugs for being "Multi-Config". + ### macOS If you build in an IDE, then the created `GoldenDict.app` will be runnable from the IDE which set up necessary magics for you.