diff --git a/.github/workflows/backup-to-gitlab.yml b/.github/workflows/backup-to-gitlab.yml index c1763359..9863040f 100644 --- a/.github/workflows/backup-to-gitlab.yml +++ b/.github/workflows/backup-to-gitlab.yml @@ -8,10 +8,8 @@ concurrency: jobs: backup-to-gitlabwh: uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master - secrets: - BRIDGETOKEN: ${{ secrets.BRIDGETOKEN }} + secrets: inherit backup-to-gitee: uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master - secrets: - GITEE_SYNC_TOKEN: ${{ secrets.GITEE_SYNC_TOKEN }} + secrets: inherit diff --git a/.github/workflows/call-api-check.yml b/.github/workflows/call-api-check.yml new file mode 100644 index 00000000..3f9cde70 --- /dev/null +++ b/.github/workflows/call-api-check.yml @@ -0,0 +1,13 @@ +name: apiCheck +on: + pull_request_target: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + api-check: + uses: linuxdeepin/.github/.github/workflows/api-check.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/call-build-deb.yml b/.github/workflows/call-build-deb.yml deleted file mode 100644 index fd67cbec..00000000 --- a/.github/workflows/call-build-deb.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Call build-deb -on: - pull_request_target: - paths-ignore: - - ".github/workflows/**" - types: [ opened, closed, synchronize ] - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - check_job: - if: github.event.action != 'closed' || github.event.pull_request.merged - uses: linuxdeepin/.github/.github/workflows/build-deb.yml@master - secrets: - BridgeToken: ${{ secrets.BridgeToken }} diff --git a/.github/workflows/call-build-distribution.yml b/.github/workflows/call-build-distribution.yml index c4c277ef..a509d5f8 100644 --- a/.github/workflows/call-build-distribution.yml +++ b/.github/workflows/call-build-distribution.yml @@ -10,8 +10,4 @@ on: jobs: check_job: uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master - secrets: - BUILD_GPG_PRIVATE_KEY: ${{ secrets.BUILD_GPG_PRIVATE_KEY }} - BUILD_SSH_PRIVATE_KEY: ${{ secrets.BUILD_SSH_PRIVATE_KEY }} - WEBDAV_PASSWD: ${{ secrets.WEBDAV_PASSWD }} - WEBDAV_USER: ${{ secrets.WEBDAV_USER }} + secrets: inherit diff --git a/.github/workflows/call-chatOps.yml b/.github/workflows/call-chatOps.yml index 0eb0b7bc..18c76bc3 100644 --- a/.github/workflows/call-chatOps.yml +++ b/.github/workflows/call-chatOps.yml @@ -6,5 +6,4 @@ on: jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master - secrets: - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} + secrets: inherit diff --git a/.github/workflows/call-clacheck.yml b/.github/workflows/call-clacheck.yml index 3fa07a30..fe16a073 100644 --- a/.github/workflows/call-clacheck.yml +++ b/.github/workflows/call-clacheck.yml @@ -12,5 +12,4 @@ concurrency: jobs: clacheck: uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master - secrets: - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} + secrets: inherit diff --git a/.github/workflows/call-debian-check.yml b/.github/workflows/call-debian-check.yml new file mode 100644 index 00000000..a35159d8 --- /dev/null +++ b/.github/workflows/call-debian-check.yml @@ -0,0 +1,13 @@ +name: debianCheck +on: + pull_request_target: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + debian-check: + uses: linuxdeepin/.github/.github/workflows/debian-check.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/call-static-check.yml b/.github/workflows/call-static-check.yml new file mode 100644 index 00000000..4ed86831 --- /dev/null +++ b/.github/workflows/call-static-check.yml @@ -0,0 +1,13 @@ +name: staticCheck +on: + pull_request_target: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + static-check: + uses: linuxdeepin/.github/.github/workflows/static-check.yml@master + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 6a92b546..e808a89b 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - run: export - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false diff --git a/.obs/workflows.yml b/.obs/workflows.yml new file mode 100644 index 00000000..8c18fe03 --- /dev/null +++ b/.obs/workflows.yml @@ -0,0 +1,43 @@ +test_build: + steps: + - link_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:CI + + - configure_repositories: + project: deepin:CI + repositories: + - name: deepin_develop + paths: + - target_project: deepin:CI + target_repository: deepin_develop + architectures: + - x86_64 + - aarch64 + + - name: debian + paths: + - target_project: deepin:CI + target_repository: debian_sid + architectures: + - x86_64 + + filters: + event: pull_request + +tag_build: + steps: + - trigger_services: + project: deepin:Unstable:dde + package: %{SCM_REPOSITORY_NAME} + filters: + event: tag_push + +commit_build: + steps: + - trigger_services: + project: deepin:Develop:dde + package: %{SCM_REPOSITORY_NAME} + filters: + event: push diff --git a/.reuse/dep5 b/.reuse/dep5 index 5316519b..b801cdae 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -4,7 +4,7 @@ Upstream-Contact: UnionTech Software Technology Co., Ltd. <> Source: https://github.com/linuxdeepin/deepin-editor # ci -Files: .github/* +Files: .github/* .obs/workflows.yml Copyright: UnionTech Software Technology Co., Ltd. License: CC0-1.0 @@ -39,7 +39,7 @@ Copyright: UnionTech Software Technology Co., Ltd. License: CC0-1.0 # config files -Files: com.deepin.editor.daemon.service com.deepin.editor.policy deepin-editor.desktop +Files: com.deepin.editor.daemon.service com.deepin.editor.policy deepin-editor.desktop misc/* Copyright: UnionTech Software Technology Co., Ltd. License: CC0-1.0 @@ -71,4 +71,4 @@ License: GPL-2.0-or-later # cpp-stub Files: tests/src/stub.h Copyright: 2019 coolxv -License: MIT \ No newline at end of file +License: MIT diff --git a/.tx/config b/.tx/config index 7a1e5f3d..0588eaed 100644 --- a/.tx/config +++ b/.tx/config @@ -3,13 +3,13 @@ host = https://www.transifex.com minimum_perc = 80 mode = developer -[deepin-editor.deepin-editor] +[o:linuxdeepin:p:deepin-editor:r:deepin-editor] file_filter = translations/deepin-editor_.ts source_file = translations/deepin-editor.ts source_lang = en type = QT -[deepin-editor.deepin-editor-desktop-ts] +[o:linuxdeepin:p:deepin-editor:r:deepin-editor-desktop-ts] file_filter = translations/desktop/desktop_.ts source_file = translations/desktop/desktop.ts source_lang = en diff --git a/.tx/deepin.conf b/.tx/deepin.conf new file mode 100644 index 00000000..f963e07b --- /dev/null +++ b/.tx/deepin.conf @@ -0,0 +1,3 @@ +[transifex] +branch = m20 + diff --git a/CMakeLists.txt b/CMakeLists.txt index e5c15356..c4017b1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,13 @@ cmake_minimum_required(VERSION 3.7) -if (NOT DEFINED VERSION) - set(VERSION 1.2.2) -endif () +set(VERSION "6.0.0" CACHE STRING "Application version") -project(deepin-editor) +project(deepin-editor + VERSION ${VERSION} + DESCRIPTION "Text editor for DDE" + HOMEPAGE_URL "https://github.com/linuxdeepin/deepin-editor" + LANGUAGES CXX C +) #set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_CXX_STANDARD 11) @@ -18,6 +21,16 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw_64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mieee") endif () +# 设置软件版本 +include_directories(${PROJECT_BINARY_DIR}) +configure_file(${PROJECT_SOURCE_DIR}/src/environments.h.in ${PROJECT_BINARY_DIR}/environments.h @ONLY) + +# 玲珑路径配置 +add_definitions(-DLINGLONG_PREFIX=\"${CMAKE_INSTALL_PREFIX}/\") +# 高亮文件路径配置 +set(KF5_HIGHLIGHT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/deepin-editor/org.kde.syntax-highlighing) +add_definitions(-DKF5_HIGHLIGHT_PATH=\"${KF5_HIGHLIGHT_INSTALL_PATH}\") + add_subdirectory(src) if (CMAKE_BUILD_TYPE STREQUAL "Debug") diff --git a/com.deepin.editor.policy b/com.deepin.editor.policy index 36011064..0240563c 100644 --- a/com.deepin.editor.policy +++ b/com.deepin.editor.policy @@ -4,8 +4,8 @@ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> - write file to /etc - Save file to filesystem + Save file with administrator privilege + Save file with administrator privilege no auth_admin diff --git a/debian/changelog b/debian/changelog index fa7e2d67..3d71b88f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,152 @@ -deepin-editor (5.9.6-1) unstable; urgency=low +deepin-editor (6.0.18) unstable; urgency=medium + + * fix: Change default search to be case insensitive(Bug: 262733) + * fix: Wrong case sensitive config(Bug: 262733) + + -- renbin Wed, 03 Jul 2024 18:14:32 +0800 + +deepin-editor (6.0.17) unstable; urgency=medium + + * feat: Change default shortcuts popup position(Task: 332267)(Influence: Shortcuts) + + -- renbin Wed, 27 Mar 2024 15:37:32 +0800 + +deepin-editor (6.0.16) unstable; urgency=medium + + * feat: add new tab to the end + Thanks to Cloud + * chore: remove duplicate value for key "MimeType" in desktop file + Thanks to hotime + * fix: Shortcut 'Ctrl + M cursor' move to row indentation + not implemented (Bug: 233877) + * fix: Shortcuts Alt + P / N match the help (Bug: 233883) + * fix: the Column Edit cannot align the selected columns (Bug: 234517) + * fix: After column editing,lines are not withdrawn together (Bug: 241475) + + -- renbin Thu, 01 Feb 2024 14:10:32 +0800 + +deepin-editor (6.0.15) unstable; urgency=medium + + * fix: Tab height error under low version dtk. + + -- renbin Wed, 25 Oct 2023 13:28:05 +0800 + +deepin-editor (6.0.14) unstable; urgency=medium + + * fix: Add support mimetype mod/toml.(Bug: 210815, 212273)(Influence: SupportFormat) + * fix: Add mimetype toml in .desktop(Bug: 210815) + * feat: adapt compact mode.(Task: 292061)(Influence: UI) + * fix: Adapt compact mode for findbar and replacebar.(Bug: 220159) + + -- renbin Thu, 19 Oct 2023 13:25:37 +0800 + +deepin-editor (6.0.13) unstable; urgency=medium + + * fix: Add support mimetype mod/toml.(Bug: 210815, 212273)(Influence: SupportFormat) + * fix: Add mimetype toml in .desktop(Bug: 210815) + + -- Deepin Packages Builder Fri, 08 Sep 2023 14:21:02 +0800 + +deepin-editor (6.0.12) unstable; urgency=medium + + * fix: onPressedLineNumber() may cause process hangs.(Bug: 215591)(Influence: LineNumber) + + -- renbin Thu, 31 Aug 2023 16:04:59 +0800 + +deepin-editor (6.0.11) unstable; urgency=medium + + * fix: Document in maximumized window is incomplete.(Bug: 172681)(Influence: SyntaxHighlight) + * fix: Redo drag text error.(Bug: 196349)(Influence: DragText UnitTest) + * fix: Redo drag text from other app error.(Influence: DragText) + * fix: Roll back gb18030 midification.(Influence: GB18030 Encoding) + * feat: Merge zpd requirement.(Task: 29499) + * fix: failed unit test case.(Influence: UT) + + -- Deepin Packages Builder Fri, 21 Jul 2023 14:29:57 +0800 + +deepin-editor (6.0.10) unstable; urgency=medium + + * chore: 更新翻译配置和翻译文件(Influence: 翻译配置 翻译文件) + * chore: 更新藏文翻译文件 (#251)(Influence: 翻译文件) + + -- Deepin Packages Builder Wed, 24 May 2023 13:20:03 +0800 + +deepin-editor (6.0.9) unstable; urgency=medium + + * fix: deepin-editor searching problem(Bug: 4203) + + -- Deepin Packages Builder Thu, 11 May 2023 13:36:30 +0800 + +deepin-editor (6.0.8) unstable; urgency=medium + + * fix: 修复未正确记录日志(Influence: 日志文件) + + -- Deepin Packages Builder Tue, 25 Apr 2023 10:52:41 +0800 + +deepin-editor (6.0.7) unstable; urgency=medium + + * fix: 修复最小化后,双击文件无法弹出编辑器窗口(Bug: 194029)(Influence: 激活窗口) + * fix: 修复另存255长度文件名的文件权限不足问题(Bug: 192375)(Influence: 长文件名另存) + * fix: 修复设置界面中字体和字号选项未对齐(Influence: 设置界面) + * fix: 修复高分屏1.5缩放下图标模糊(Bug: 171749)(Influence: 高分屏缩放显示) + * fix: 修复VBScript文件未高亮问题(Bug: 154719)(Influence: vbs格式高亮 授权文件) + * chore: remove redundant code for linglong. + + -- Deepin Packages Builder Thu, 20 Apr 2023 15:02:15 +0800 + +deepin-editor (6.0.6) unstable; urgency=medium + + * fix: 修复使用特殊字体时,序号显示不全(Bug: 188417)(Influence: 序号显示) + * fix: 修复加载完小文件时,行号显示不全问题(Influence: 行号显示) + * fix: 修复GB18030部分编码转换错误问题(Influence: 编码转换) + * fix: 修复源编码为UTF-8时编码转换空白的问题(Influence: 编码转换) + * feat: 适配GB18030-2022规范兼容2005标准(Bug: 193311)(Influence: 编码转换 GB18030显示 另存) + * fix: 更新翻译显示(Bug: 110761) + + -- Deepin Packages Builder Thu, 13 Apr 2023 13:51:25 +0800 + +deepin-editor (6.0.5) unstable; urgency=medium + + * Fix application palette change bug. + + -- Deepin Packages Builder Thu, 16 Mar 2023 09:42:02 +0800 + +deepin-editor (6.0.4) unstable; urgency=medium + + * Update version to distinguish pro/community. + * Fix cursor position error when editing multi-byte encoding text. + + -- Deepin Packages Builder Fri, 10 Mar 2023 10:19:21 +0800 + +deepin-editor (6.0.3) unstable; urgency=medium + + * Improve GB18030 text encoding recognition rate. + * Fix print large document bug. + + -- Deepin Packages Builder Tue, 07 Mar 2023 10:43:27 +0800 + +deepin-editor (6.0.2) unstable; urgency=medium + + * Improve text search and highlight color. + + -- renbin Thu, 16 Feb 2023 14:42:04 +0800 + +deepin-editor (6.0.1) unstable; urgency=medium + + * Improve convert text encoding. + * Adaptor V23 DDE DBus interface. + * Fix debian rules error. + + -- renbin Tue, 14 Feb 2023 15:04:06 +0800 + +deepin-editor (6.0.0) unstable; urgency=low + + * New version 6.0.0 + * Sync v23 source code from gerrit. + + -- renbin Wed, 11 Jan 2023 14:04:01 +0000 + +deepin-editor (5.10.13) unstable; urgency=low [ Hu Feng Fri, 19 Feb 2021 15:32:28 +0800 ] * debian/control diff --git a/debian/copyright b/debian/copyright index 4f92c6b4..779dd021 100644 --- a/debian/copyright +++ b/debian/copyright @@ -39,7 +39,7 @@ Copyright: UnionTech Software Technology Co., Ltd. License: CC0-1.0 # config files -Files: com.deepin.editor.daemon.service com.deepin.editor.policy deepin-editor.desktop +Files: com.deepin.editor.daemon.service com.deepin.editor.policy deepin-editor.desktop misc/* Copyright: UnionTech Software Technology Co., Ltd. License: CC0-1.0 diff --git a/debian/rules b/debian/rules index 5802f5b4..8b8761ce 100755 --- a/debian/rules +++ b/debian/rules @@ -3,17 +3,20 @@ export QT_SELECT=5 include /usr/share/dpkg/default.mk -DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) -DH_AUTO_ARGS = --parallel --buildsystem=cmake +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +VERSION = $(DEB_VERSION_UPSTREAM) +PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}') # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 %: - dh $@ --parallel + dh $@ override_dh_auto_configure: dh_auto_configure -- \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \ - -DAPP_VERSION=$(DEB_VERSION_UPSTREAM) -DVERSION=$(DEB_VERSION_UPSTREAM) LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) + -DVERSION=$(PACK_VER) diff --git a/debian/source/format b/debian/source/format index 163aaf8d..89ae9db8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff --git a/deepin-editor.desktop b/deepin-editor.desktop index 5398cdd9..c7f76689 100644 --- a/deepin-editor.desktop +++ b/deepin-editor.desktop @@ -75,7 +75,7 @@ GenericName[uk]=Текстовий редактор GenericName[zh_CN]=文本编辑器 GenericName[zh_HK]=文本編輯器 GenericName[zh_TW]=文字編輯器 -MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json; +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/css;application/x-desktop;text/x-fortran;text/html;text/x-objcsrc;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;application/toml; Name[ar]=محرر نصوص ديبين Name[bo]=གཏིང་ཟབ་ཡིག་ཆ་རྩོམ་སྒྲིག་ཆས། Name[br]=Aozer testennoù Deepin diff --git a/linglong.yaml b/linglong.yaml new file mode 100644 index 00000000..6cc53543 --- /dev/null +++ b/linglong.yaml @@ -0,0 +1,47 @@ +package: + id: org.deepin.editor + name: "deepin-editor" + version: 5.10.13 + kind: app + description: | + editor for deepin os. + +runtime: + id: org.deepin.Runtime + version: 23.0.0 + +depends: + - id: "dde-qt-dbus-factory" + version: 5.5.12 + type: runtime + - id: libchardet + version: 1.0.4 + type: runtime + - id: kcodecs + version: 5.54.0 + type: runtime + - id: "ksyntax-highlighting" + version: 5.54.0 + type: runtime + - id: googletest + version: 1.8.1 + - id: xcb-util + type: runtime +variables: + extra_args: | + -DVERSION=${VERSION} +source: + kind: local + + +build: + kind: manual + manual: + configure: | + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ${extra_args} .. + make -j6 + #make test -j6 + #test 用例包含从/usr/share读取内容,会导致失败 + make -j install diff --git a/misc/configs/org.deepin.editor.json b/misc/configs/org.deepin.editor.json new file mode 100644 index 00000000..ec2698ee --- /dev/null +++ b/misc/configs/org.deepin.editor.json @@ -0,0 +1,39 @@ +{ + "magic": "dsg.config.meta", + "version": "1.0", + "contents": { + "disableImproveGB18030": { + "value": false, + "serial": 0, + "flags": [], + "name": "Block improtve GB18030", + "name[zh_CN]": "屏蔽提高GB18030编码识别率", + "description[zh_CN]": "屏蔽提高中文环境下GB18030编码的识别率的策略,默认不屏蔽", + "description": "Block the strategy to improve the recognition rate of GB18030 encoding in the Chinese environment, the default is not blocked", + "permissions": "readwrite", + "visibility": "private" + }, + "enablePatchedIconv": { + "value": false, + "serial": 0, + "flags": [], + "name": "Use iconv patch", + "name[zh_CN]": "使用iconv补丁", + "description[zh_CN]": "使用上层应用适配2022标准的iconv设置补丁,2005标准下此选项无效", + "description": "Use the iconv settings patch that adapts to the 2022 standard,the default is false", + "permissions": "readwrite", + "visibility": "private" + }, + "defaultEncoding": { + "value": "UTF-8", + "serial": 0, + "flags": [], + "name": "Default text encoding", + "name[zh_CN]": "文件识别默认编码", + "description[zh_CN]": "文件识别默认编码,ASCII及未知编码将使用配置的默认编码,默认UTF-8", + "description": "Default text encoding, ASCII and unknown encoding will use the configured default encoding,the default is UTF-8", + "permissions": "readwrite", + "visibility": "private" + } + } +} \ No newline at end of file diff --git a/misc/org.kde.syntax-highlighing/syntax/vbscript.xml b/misc/org.kde.syntax-highlighing/syntax/vbscript.xml new file mode 100644 index 00000000..b56e969a --- /dev/null +++ b/misc/org.kde.syntax-highlighing/syntax/vbscript.xml @@ -0,0 +1,823 @@ + + + + + + + And + + + As + + + Boolean + + + ByRef + + + Byte + + + ByVal + + + Call + + + Case + + + Class + + + Const + + + Currency + + + Debug + + + Dim + + + Do + + + Double + + + Each + + + Else + + + ElseIf + + + Empty + + + End + + + EndIf + + + Enum + + + Eqv + + + Event + + + Exit + + + Explicit + + + False + + + For + + + Function + + + Get + + + Goto + + + If + + + Imp + + + Implements + + + In + + + Integer + + + Is + + + Let + + + Like + + + Long + + + Loop + + + LSet + + + Me + + + Mod + + + New + + + Next + + + Not + + + Nothing + + + Null + + + On + + + Option + + + Optional + + + Or + + + ParamArray + + + Preserve + + + Private + + + Property + + + Public + + + RaiseEvent + + + ReDim + + + Resume + + + RSet + + + Select + + + Set + + + Shared + + + Single + + + Static + + + Stop + + + Sub + + + Then + + + To + + + True + + + Type + + + TypeOf + + + Until + + + Variant + + + WEnd + + + While + + + With + + + Xor + + + + + Abs + + + Array + + + Asc + + + Atn + + + CBool + + + CByte + + + CCur + + + CDate + + + CDbl + + + CInt + + + CLng + + + CSng + + + CStr + + + Chr + + + Cos + + + CreateObject + + + Date + + + DateAdd + + + DateDiff + + + DatePart + + + DateSerial + + + DateValue + + + Day + + + Escape + + + Eval + + + Exp + + + Filter + + + Fix + + + FormatCurrency + + + FormatDateTime + + + FormatNumber + + + FormatPercent + + + GetLocale + + + GetObject + + + GetRef + + + Hex + + + Hour + + + InStr + + + InStrRev + + + InputBox + + + Int + + + IsArray + + + IsDate + + + IsEmpty + + + IsNull + + + IsNumeric + + + IsObject + + + Join + + + LBound + + + LCase + + + LTrim + + + Left + + + Len + + + LoadPicture + + + Log + + + Mid + + + Minute + + + Month + + + MonthName + + + MsgBox + + + Now + + + Oct + + + Randomize + + + RGB + + + RTrim + + + Replace + + + Right + + + Rnd + + + Round + + + ScriptEngine + + + ScriptEngineBuildVersion + + + ScriptEngineMajorVersion + + + ScriptEngineMinorVersion + + + Second + + + SetLocale + + + Sgn + + + Sin + + + Space + + + Split + + + Sqr + + + StrComp + + + StrReverse + + + String + + + Tan + + + Time + + + TimeSerial + + + TimeValue + + + Timer + + + Trim + + + TypeName + + + UBound + + + UCase + + + Unescape + + + VarType + + + Weekday + + + WeekdayName + + + Year + + + + + vbBlack + + + vbRed + + + vbGreen + + + vbYellow + + + vbBlue + + + vbMagenta + + + vbCyan + + + vbWhite + + + vbBinaryCompare + + + vbTextCompare + + + vbSunday + + + vbMonday + + + vbTuesday + + + vbWednesday + + + vbThursday + + + vbFriday + + + vbSaturday + + + vbUseSystemDayOfWeek + + + vbFirstJan1 + + + vbFirstFourDays + + + vbFirstFullWeek + + + vbGeneralDate + + + vbLongDate + + + vbShortDate + + + vbLongTime + + + vbShortTime + + + vbObjectError + + + vbOKOnly + + + vbOKCancel + + + vbAbortRetryIgnore + + + vbYesNoCancel + + + vbYesNo + + + vbRetryCancel + + + vbCritical + + + vbQuestion + + + vbExclamation + + + vbInformation + + + vbDefaultButton1 + + + vbDefaultButton2 + + + vbDefaultButton3 + + + vbDefaultButton4 + + + vbApplicationModal + + + vbSystemModal + + + vbOK + + + vbCancel + + + vbAbort + + + vbRetry + + + vbIgnore + + + vbYes + + + vbNo + + + vbCr + + + vbCrLf + + + vbFormFeed + + + vbLf + + + vbNewLine + + + vbNullChar + + + vbNullString + + + vbTab + + + vbVerticalTab + + + vbUseDefault + + + vbTrue + + + vbFalse + + + vbEmpty + + + vbNull + + + vbInteger + + + vbLong + + + vbSingle + + + vbDouble + + + vbCurrency + + + vbDate + + + vbString + + + vbObject + + + vbError + + + vbBoolean + + + vbVariant + + + vbDataObject + + + vbDecimal + + + vbByte + + + vbArray + + + WScript + + + Wsh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 25305832..0be9f84a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,11 +4,9 @@ if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug")) execute_process(COMMAND bash "${CMAKE_SOURCE_DIR}/translate_generation.sh" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) endif () -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/environments.h.in ${CMAKE_CURRENT_SOURCE_DIR}/environments.h @ONLY) - # Sources files -file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "encodes/*.h" "common/*.h" "controls/*.h" "editor/*.h" "thememodule/*.h" "widgets/*.h") -file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "encodes/*.cpp" "common/*.cpp" "controls/*.cpp" "editor/*.cpp" "thememodule/*.cpp" "widgets/*.cpp") +file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "encodes/*.h" "common/*.h" "controls/*.h" "editor/*.h" "thememodule/*.h" "widgets/*.h" "basepub/*.h") +file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "encodes/*.cpp" "common/*.cpp" "controls/*.cpp" "editor/*.cpp" "thememodule/*.cpp" "widgets/*.cpp" "basepub/*.c") include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/encodes) @@ -17,6 +15,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/controls) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/editor) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thememodule) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/widgets) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/basepub) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/lib/include) # Find the library @@ -59,10 +58,10 @@ target_link_libraries(deepin-editor ICU::uc -lm uchardet + dl chardet ) -set(CMAKE_INSTALL_PREFIX /usr) # Install qm files file(GLOB QM_FILES "${CMAKE_SOURCE_DIR}/translations/*.qm") @@ -80,11 +79,26 @@ endif() #if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64") # install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/loongarch64/deepin-editor DESTINATION /usr/share/deepin-manual/manual-assets/application/) if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw_64") - install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/loongarch64/deepin-editor DESTINATION /usr/share/deepin-manual/manual-assets/application/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/loongarch64/deepin-editor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/) else() - install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/deepin-editor DESTINATION /usr/share/deepin-manual/manual-assets/application/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/deepin-editor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/) endif() install(TARGETS deepin-editor DESTINATION bin/) install(FILES ${CMAKE_SOURCE_DIR}/deepin-editor.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/) install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/themes DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-editor/) + +# 安装 DConfig 配置文件,1040及以下的默认DTK环境不支持DConfig +set(DCONFIG_APPID org.deepin.editor) +file(GLOB DCONFIG_FILES "${CMAKE_SOURCE_DIR}/misc/configs/*.json") +if(DEFINED DSG_DATA_DIR) + dconfig_meta_files(APPID ${DCONFIG_APPID} FILES ${DCONFIG_FILES}) + message("-- DConfig is supported by DTK") +else() + install(FILES ${DCONFIG_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dsg/configs/${DCONFIG_APPID}) + message("-- DConfig is not supported by DTK") +endif() + +# 添加KF5格式高亮配置文件,/usr/share/org.kde.syntax-highlighting/syntax/ 为所有用户可读取高亮配置的路径 +install(DIRECTORY ${CMAKE_SOURCE_DIR}/misc/org.kde.syntax-highlighing/syntax + DESTINATION ${KF5_HIGHLIGHT_INSTALL_PATH}) diff --git a/src/basepub/load_libs.c b/src/basepub/load_libs.c new file mode 100644 index 00000000..e9957f3b --- /dev/null +++ b/src/basepub/load_libs.c @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: 2022-2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include +#include +#include +#include +#include "load_libs.h" + +#include + +void PrintError(){ + char *error; + if ((error = dlerror()) != NULL) { + fprintf (stderr, "%s ", error); + } +} +static LoadLibNames g_ldnames; +static LoadLibs *pLibs = NULL; +static LoadLibs *newClass(void) +{ + pLibs = (LoadLibs *)malloc(sizeof(LoadLibs)); +// RTLD_NOW:在dlopen返回前,解析出全部没有定义的符号,解析不出来返回NULL。 +// RTLD_LAZY:暂缓决定,等有需要时再解出符号 + void *handle = dlopen(g_ldnames.chZPDDLL/*"libavcodec.so.58"*/,RTLD_LAZY); + if (!handle) { + PrintError(); + } + + pLibs->m_document_clip_copy = (uos_document_clip_copy)dlsym(handle, "document_clip_copy"); + PrintError(); + pLibs->m_document_close = (uos_document_close)dlsym(handle, "document_close"); + PrintError(); + + assert(pLibs != NULL); + return pLibs; +} + +/** + * 饿汉式 + * 支持延迟加载,但是为了多线程安全,性能有所降低 + * 注意:方法内部要加锁,防止多线程多次创建 + * */ +LoadLibs *getLoadZPDLibsInstance() +{ + static pthread_mutex_t mutex; + //双检锁 + if (pLibs == NULL) { + // 这里要对pLibs加锁 + pthread_mutex_lock(&mutex); + if (pLibs == NULL) + pLibs = newClass(); + + //退出时解锁 + pthread_mutex_unlock(&mutex); + } + + return pLibs; +} + +void setLibNames(LoadLibNames tmp) +{ + g_ldnames.chZPDDLL = ( char*)malloc(strlen(tmp.chZPDDLL)+1); + strcpy(g_ldnames.chZPDDLL,tmp.chZPDDLL); +} diff --git a/src/basepub/load_libs.h b/src/basepub/load_libs.h new file mode 100644 index 00000000..2d817871 --- /dev/null +++ b/src/basepub/load_libs.h @@ -0,0 +1,25 @@ +// SPDX-FileCopyrightText: 2022-2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef LOAD_LIBS_H +#define LOAD_LIBS_H +#include + +typedef void (*uos_document_clip_copy)(const char *path, int *intercept); +typedef void (*uos_document_close)(const char *path); + +typedef struct _LoadLibNames { + char *chZPDDLL; +} LoadLibNames; + +void setLibNames(LoadLibNames tmp); + +typedef struct _LoadLibs { + uos_document_clip_copy m_document_clip_copy; + uos_document_close m_document_close; +} LoadLibs; + +LoadLibs *getLoadZPDLibsInstance();//饿汉式不支持延迟加载 + +#endif//LOAD_LIBS_H diff --git a/src/common/config.cpp b/src/common/config.cpp new file mode 100644 index 00000000..42c72e9b --- /dev/null +++ b/src/common/config.cpp @@ -0,0 +1,142 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "config.h" + +#include + +#include + +#ifdef DTKCORE_CLASS_DConfigFile +#include + +const QString g_keyDisableImproveGB18030 = "disableImproveGB18030"; +const QString g_keyDefaultEncoding = "defaultEncoding"; +const QString g_keyEnablePatchedIconv = "enablePatchedIconv"; +#endif + +/** + @brief 检测当前iconv使用的GB18030编码是否为2005标准,2005标准强制使用上层补丁版本 + 通过检测2005和2022编码转的差异,以附录D中的编码为例验证 + 2005标准 0xFE51 --> \u20087 + 2022标准 0xFE51 --> \uE816 + @return iconv使用GB18030编码是否为2005标准,默认返回true + */ +bool detectIconvUse2005Standard() +{ + iconv_t handle = iconv_open("UTF-8", "GB18030"); + if (handle == reinterpret_cast(-1)) { + return true; + } + + QByteArray input("\xFE\x51"); + QByteArray output(input.size() * 2, 0); + char *inputData = input.data(); + char *outputData = output.data(); + size_t inputLen = static_cast(input.count()); + size_t outputLen = static_cast(output.count()); + + const size_t ret = iconv(handle, &inputData, &inputLen, &outputData, &outputLen); + iconv_close(handle); + + if (ret == static_cast(-1)) { + return true; + } + + if (!output.contains("\uE816")) { + qInfo() << "Current iconv gb18030 standard is 2005."; + return true; + } + + qInfo() << "Current iconv gb18030 standard is 2022."; + return false; +} + +/** + @class Config + @brief 获取DConfig配置 + @details 取得DConfig配置,目前主要用于配置是否提高GB18030识别率。 + 配置文件路径为 /usr/share/dsg/configs/org.deepin.editor/org.deepin.editor.json + */ + +Config::Config(QObject *parent) + : QObject(parent) + , encoding("UTF-8") +{ +#ifdef DTKCORE_CLASS_DConfigFile + dconfig = DConfig::create("org.deepin.editor", "org.deepin.editor"); + if (dconfig->isValid()) { + // 默认提高GB18030识别率 + improveGB18030 = !dconfig->value(g_keyDisableImproveGB18030).toBool(); + qInfo() << qPrintable("DConfig::ImproveGB18030:") << improveGB18030; + + patchedIconv = dconfig->value(g_keyEnablePatchedIconv).toBool(); + qInfo() << qPrintable("DConfig::enablePatchedIconv:") << patchedIconv; + + encoding = dconfig->value(g_keyDefaultEncoding).toByteArray().toUpper(); + qInfo() << qPrintable("DConfig::defaultEncoding") << encoding; + + connect(dconfig, &DConfig::valueChanged, this, [this](const QString &key) { + if (key == g_keyDisableImproveGB18030) { + this->improveGB18030 = !this->dconfig->value(g_keyDisableImproveGB18030).toBool(); + qInfo() << qPrintable("DConfig::ImproveGB18030 changed:") << improveGB18030; + } else if (key == g_keyEnablePatchedIconv) { + this->patchedIconv = dconfig->value(g_keyEnablePatchedIconv).toBool(); + qInfo() << qPrintable("DConfig::enablePatchedIconv changed:") << patchedIconv; + } else if (key == g_keyDefaultEncoding) { + this->encoding = dconfig->value(g_keyDefaultEncoding).toByteArray().toUpper(); + qInfo() << qPrintable("DConfig::defaultEncoding changed:") << encoding; + } + }); + + } else { + qWarning() << qPrintable("org.deepin.editor DConfig not valid!"); + } +#else + qWarning() << "DConfig is not supported by DTK!"; +#endif + + // 检测当前iconv使用的GB18030编码是否为2005标准(2005标准强制使用上层补丁版本) + iocnvUse2005Standard = detectIconvUse2005Standard(); +} + +Config::~Config() +{ +#ifdef DTKCORE_CLASS_DConfigFile + if (dconfig) { + delete dconfig; + } +#endif +} + +Config *Config::instance() +{ + static Config config; + return &config; +} + +/** + @return 返回是否提高GB18030编码识别率 + */ +bool Config::enableImproveGB18030() const +{ + return improveGB18030; +} + +/** + @return 返回是否使用上层修改的适配2022标准的iconv设置, + 2005标准强制使用上层补丁版本,以适配2022要求 + */ +bool Config::enablePatchedIconv() const +{ + return patchedIconv || iocnvUse2005Standard; +} + +/** + @return 返回配置的默认编码,默认UTF-8 + */ +QByteArray Config::defaultEncoding() const +{ + return encoding.isEmpty() ? QByteArray("UTF-8") : encoding; +} diff --git a/src/common/config.h b/src/common/config.h new file mode 100644 index 00000000..669282eb --- /dev/null +++ b/src/common/config.h @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef CONFIG_H +#define CONFIG_H + +#include + +#include +#ifdef DTKCORE_CLASS_DConfigFile +#include +DCORE_USE_NAMESPACE +#endif + +class Config : public QObject +{ + Q_OBJECT + explicit Config(QObject *parent = nullptr); + ~Config() override; + +public: + static Config *instance(); + bool enableImproveGB18030() const; + bool enablePatchedIconv() const; + QByteArray defaultEncoding() const; + +private: +#ifdef DTKCORE_CLASS_DConfigFile + DConfig *dconfig = nullptr; +#endif + bool improveGB18030 = true; ///< 默认提高GB18030编码识别率 + bool patchedIconv = false; ///< 默认不再使用上层修改的iconv + bool iocnvUse2005Standard = false; ///< 检测当前iconv使用的GB18030编码是否为2005标准(2005标准强制使用上层补丁版本) + QByteArray encoding; ///< 缺省编码设置 +}; + +#endif // CONFIG_H diff --git a/src/common/fileloadthread.cpp b/src/common/fileloadthread.cpp index fc7c4ab2..ed0b1902 100644 --- a/src/common/fileloadthread.cpp +++ b/src/common/fileloadthread.cpp @@ -78,4 +78,7 @@ void FileLoadThread::run() emit sigLoadFinished(encode, outData, false); } } + + this->quit(); + this->deleteLater(); } diff --git a/src/common/performancemonitor.cpp b/src/common/performancemonitor.cpp index cdbf9df4..f5fffbde 100644 --- a/src/common/performancemonitor.cpp +++ b/src/common/performancemonitor.cpp @@ -25,22 +25,22 @@ PerformanceMonitor::PerformanceMonitor() void PerformanceMonitor::initializeAppStart() { QDateTime current = QDateTime::currentDateTime(); - qDebug() << "LOG_FLAG" + qDebug() << qPrintable(LOG_FLAG) << QDateTime::currentDateTime().toString(Qt::ISODateWithMs) - << "start to initaalize app"; + << "start to initialize app"; initializeAppStartMs = current.toMSecsSinceEpoch(); } void PerformanceMonitor::initializAppFinish() { QDateTime current = QDateTime::currentDateTime(); - qDebug() << "LOG_FLAG" + qDebug() << qPrintable(LOG_FLAG) << QDateTime::currentDateTime().toString(Qt::ISODateWithMs) << " finish to initialize app"; inittalizeApoFinishMs = current.toMSecsSinceEpoch(); qint64 time = inittalizeApoFinishMs - initializeAppStartMs; - qInfo() << QString("%1 startduration=%2ms #(Init app time)").arg(GRAB_POINT_INIT_APP_TIME).arg(time); + qInfo() << qPrintable(QString("%1 startduration=%2ms #(Init app time)").arg(GRAB_POINT_INIT_APP_TIME).arg(time)); } void PerformanceMonitor::closeAppStart() @@ -52,19 +52,19 @@ void PerformanceMonitor::closeAppStart() void PerformanceMonitor::closeAPPFinish() { QDateTime current = QDateTime::currentDateTime(); - qDebug() << "LOG_FLAG" + qDebug() << qPrintable(LOG_FLAG) << QDateTime::currentDateTime().toString(Qt::ISODateWithMs) << " finish to close app"; closeAppFinishMs = current.toMSecsSinceEpoch(); qint64 time = closeAppFinishMs - closeAppStartMs; - qInfo() << QString("%1 closeduration=%2ms #(Close app time)").arg(GRAB_POINT_CLOSE_APP_TIME).arg(time); + qInfo() << qPrintable(QString("%1 closeduration=%2ms #(Close app time)").arg(GRAB_POINT_CLOSE_APP_TIME).arg(time)); } void PerformanceMonitor::openFileStart() { QDateTime current = QDateTime::currentDateTime(); - qDebug() << "LOG_FLAG" + qDebug() << qPrintable(LOG_FLAG) << QDateTime::currentDateTime().toString(Qt::ISODateWithMs) << "start to open file"; openFileStartMs = current.toMSecsSinceEpoch(); @@ -73,12 +73,12 @@ void PerformanceMonitor::openFileStart() void PerformanceMonitor::openFileFinish(const QString &strFileName, qint64 iFileSize) { QDateTime current = QDateTime::currentDateTime(); - qDebug() << "LOG_FLAG" + qDebug() << qPrintable(LOG_FLAG) << QDateTime::currentDateTime().toString(Qt::ISODateWithMs) << " finish to open file"; openFileFinishMs = current.toMSecsSinceEpoch(); qint64 time = openFileFinishMs - openFileStartMs; float fFilesize = iFileSize; - qInfo() << QString("%1 filename=%2 filezise=%3M opentime=%4ms #(Open file time)").arg(GRAB_POINT_OPEN_FILE_TIME).arg(strFileName).arg(QString::number(fFilesize/(1024*1024), 'f', 6)).arg(time); + qInfo() << qPrintable(QString("%1 filename=%2 filezise=%3M opentime=%4ms #(Open file time)").arg(GRAB_POINT_OPEN_FILE_TIME).arg(strFileName).arg(QString::number(fFilesize/(1024*1024), 'f', 6)).arg(time)); } diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 893cf077..bed9c3b3 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,6 +7,7 @@ #include "dthememanager.h" #include "../controls/fontitemdelegate.h" +#include "../widgets/pathsettintwgt.h" #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include Settings *Settings::s_pSetting = nullptr; @@ -131,6 +133,63 @@ Settings::Settings(QWidget *parent) connect(settings, &Dtk::Core::DSettings::valueChanged, this, &Settings::slotCustomshortcut); } +void Settings::setSavePath(int id,const QString& path) +{ + switch (id) { + case PathSettingWgt::LastOptBox:{ + auto opt = settings->option("advance.open_save_setting.open_save_lastopt_path"); + opt->setValue(path); + break; + } + case PathSettingWgt::CurFileBox:{ + auto opt = settings->option("advance.open_save_setting.open_save_curfile_path"); + opt->setValue(path); + break; + } + case PathSettingWgt::CustomBox:{ + auto opt = settings->option("advance.open_save_setting.open_save_custom_path"); + opt->setValue(path); + break; + } + default: + break; + } +} + + +QString Settings::getSavePath(int id) +{ + QString path; + switch (id) { + case PathSettingWgt::LastOptBox:{ + path = settings->option("advance.open_save_setting.open_save_lastopt_path")->value().toString(); + break; + } + case PathSettingWgt::CurFileBox:{ + path = settings->option("advance.open_save_setting.open_save_curfile_path")->value().toString(); + break; + } + case PathSettingWgt::CustomBox:{ + path = settings->option("advance.open_save_setting.open_save_custom_path")->value().toString(); + break; + } + default: + break; + } + + return path; +} + +void Settings::setSavePathId(int id) +{ + auto opt = settings->option("advance.open_save_setting.savingpathwgt"); + opt->setValue(QString::number(id)); +} +int Settings::getSavePathId() +{ + return settings->option("advance.open_save_setting.savingpathwgt")->value().toInt(); + +} Settings::~Settings() { if (m_backend != nullptr) { @@ -159,19 +218,17 @@ void Settings::dtkThemeWorkaround(QWidget *parent, const QString &theme) } } -//QWidget *Settings::createFontComBoBoxHandle(QObject *obj) QPair Settings::createFontComBoBoxHandle(QObject *obj) { auto option = qobject_cast(obj); QComboBox *comboBox = new QComboBox; - //QWidget *optionWidget = DSettingsWidgetFactory::createTwoColumWidget(option, comboBox); QPair optionWidget = DSettingsWidgetFactory::createStandardItem(QByteArray(), option, comboBox); QFontDatabase fontDatabase; comboBox->addItems(fontDatabase.families()); - //comboBox->setItemDelegate(new FontItemDelegate); - //comboBox->setFixedSize(240, 36); + // 设置最小宽度,以保持和下方 OptionDSpinBox 一样的长度 + comboBox->setMinimumSize(240, 36); if (option->value().toString().isEmpty()) { option->setValue(QFontDatabase::systemFont(QFontDatabase::FixedFont).family()); @@ -188,9 +245,39 @@ QPair Settings::createFontComBoBoxHandle(QObject *obj) option->setValue(text); }); +#ifdef DTKWIDGET_CLASS_DSizeMode + // 适配紧凑模式,不同布局下调整高度 + const int defaultHeight = 36; + const int compactHeight = 24; + comboBox->setFixedHeight(DGuiApplicationHelper::isCompactMode() ? compactHeight : defaultHeight); + QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, comboBox, [ = ](){ + comboBox->setFixedHeight(DGuiApplicationHelper::isCompactMode() ? compactHeight : defaultHeight); + }); +#endif + return optionWidget; } +QWidget* Settings::createSavingPathWgt(QObject* obj) +{ + auto option = qobject_cast(obj); + QString name = option->name(); + PathSettingWgt* pathwgt = new PathSettingWgt; + QPair optionWidget = DSettingsWidgetFactory::createStandardItem(QByteArray(), option, pathwgt); + + connect(option, &DSettingsOption::valueChanged, pathwgt, [ = ](QVariant var) { + int id = var.toInt(); + pathwgt->onSaveIdChanged(id); + }); + + auto custompath = s_pSetting->settings->option("advance.open_save_setting.open_save_custom_path"); + connect(custompath, &Dtk::Core::DSettingsOption::valueChanged, [=](QVariant var){ + //pathwgt->setEditText(var.toString()); + }); + + return optionWidget.second; +} + QPair Settings::createKeySequenceEditHandle(QObject *obj) { auto option = qobject_cast(obj); @@ -211,10 +298,19 @@ QPair Settings::createKeySequenceEditHandle(QObject *obj) QStringList keySplitList = option->key().split("."); keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap->value().toString()); - if (!instance()->checkShortcutValid(checkName, sequence.toString(), reason, bIsConflicts)) { + // 获取默认设置的组合键序列 + QString defaultKey; + auto defaultOption = instance()->settings->option(keySplitList.join(".")); + if (defaultOption) { + defaultKey = defaultOption->defaultValue().toString(); + } + + // 判断新设置的组合键序列是否允许 + if (!instance()->checkShortcutValid(checkName, sequence.toString(), reason, bIsConflicts, defaultKey)) { instance()->m_pDialog = instance()->createDialog(reason, "", bIsConflicts); instance()->m_pDialog->exec(); - shortCutLineEdit->setKeySequence(QKeySequence(instance()->settings->value(keySplitList.join(".")).toString())); + // 恢复组合键序列 + shortCutLineEdit->setKeySequence(instance()->settings->value(keySplitList.join(".")).toString()); keymap->setValue("emacs"); keymap->setValue("customize"); return; @@ -227,36 +323,36 @@ QPair Settings::createKeySequenceEditHandle(QObject *obj) if (keymap->value().toString() != "customize") { instance()->m_bUserChangeKey = true; - for (auto option : instance()->settings->group("shortcuts.window_keymap_customize")->options()) { - QStringList keySplitList = option->key().split("."); - keySplitList[1] = QString("window_keymap_%1").arg(keymap->value().toString()); + for (auto loopOption : instance()->settings->group("shortcuts.window_keymap_customize")->options()) { + QStringList loopKeySplitList = loopOption->key().split("."); + loopKeySplitList[1] = QString("window_keymap_%1").arg(keymap->value().toString()); - if (option->value().toString() == sequence.toString()) { + if (loopOption->value().toString() == sequence.toString()) { - if (checkName.contains(keySplitList.last())) { + if (checkName.contains(loopKeySplitList.last())) { keymap->setValue("customize"); //return; } else { bIsConflicts = true; - keySplitList[1] = QString("window_keymap_%1").arg("customize"); - conflictsKeys = keySplitList.join("."); + loopKeySplitList[1] = QString("window_keymap_%1").arg("customize"); + conflictsKeys = loopKeySplitList.join("."); } } } - for (auto option : instance()->settings->group("shortcuts.editor_keymap_customize")->options()) { - QStringList keySplitList = option->key().split("."); - keySplitList[1] = QString("editor_keymap_%1").arg(keymap->value().toString()); + for (auto loopOption : instance()->settings->group("shortcuts.editor_keymap_customize")->options()) { + QStringList loopKeySplitList = loopOption->key().split("."); + loopKeySplitList[1] = QString("editor_keymap_%1").arg(keymap->value().toString()); - if (option->value().toString() == sequence.toString()) { + if (loopOption->value().toString() == sequence.toString()) { - if (checkName.contains(keySplitList.last())) { + if (checkName.contains(loopKeySplitList.last())) { keymap->setValue("customize"); //return; } else { bIsConflicts = true; - keySplitList[1] = QString("editor_keymap_%1").arg("customize"); - conflictsKeys = keySplitList.join("."); + loopKeySplitList[1] = QString("editor_keymap_%1").arg("customize"); + conflictsKeys = loopKeySplitList.join("."); } } } @@ -265,32 +361,32 @@ QPair Settings::createKeySequenceEditHandle(QObject *obj) } else { bIsCustomize = true; instance()->m_bUserChangeKey = true; - for (auto option : instance()->settings->group("shortcuts.window_keymap_customize")->options()) { - QStringList keySplitList = option->key().split("."); - keySplitList[1] = QString("window_keymap_%1").arg(keymap->value().toString()); + for (auto loopOption : instance()->settings->group("shortcuts.window_keymap_customize")->options()) { + QStringList loopKeySplitList = loopOption->key().split("."); + loopKeySplitList[1] = QString("window_keymap_%1").arg(keymap->value().toString()); - if (option->value().toString() == sequence.toString()) { + if (loopOption->value().toString() == sequence.toString()) { - if (checkName.contains(keySplitList.last())) { + if (checkName.contains(loopKeySplitList.last())) { //return; } else { bIsConflicts = true; - conflictsKeys = keySplitList.join("."); + conflictsKeys = loopKeySplitList.join("."); } } } - for (auto option : instance()->settings->group("shortcuts.editor_keymap_customize")->options()) { - QStringList keySplitList = option->key().split("."); - keySplitList[1] = QString("editor_keymap_%1").arg(keymap->value().toString()); + for (auto loopOption : instance()->settings->group("shortcuts.editor_keymap_customize")->options()) { + QStringList loopKeySplitList = loopOption->key().split("."); + loopKeySplitList[1] = QString("editor_keymap_%1").arg(keymap->value().toString()); - if (option->value().toString() == sequence.toString()) { + if (loopOption->value().toString() == sequence.toString()) { - if (checkName.contains(keySplitList.last())) { + if (checkName.contains(loopKeySplitList.last())) { //return; } else { bIsConflicts = true; - conflictsKeys = keySplitList.join("."); + conflictsKeys = loopKeySplitList.join("."); } } } @@ -416,13 +512,23 @@ void Settings::updateAllKeysWithKeymap(QString keymap) for (auto option : settings->group("shortcuts.window")->options()) { QStringList keySplitList = option->key().split("."); keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap); - option->setValue(settings->option(keySplitList.join("."))->value().toString()); + auto opt = settings->option(keySplitList.join(".")); + if (opt) { + option->setValue(opt->value().toString()); + } else { + qWarning() << "Unknown shortcut key:" << keySplitList.join("."); + } } for (auto option : settings->group("shortcuts.editor")->options()) { QStringList keySplitList = option->key().split("."); keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap); - option->setValue(settings->option(keySplitList.join("."))->value().toString()); + auto opt = settings->option(keySplitList.join(".")); + if (opt) { + option->setValue(opt->value().toString()); + } else { + qWarning() << "Unknown shortcut key:" << keySplitList.join("."); + } } m_bUserChangeKey = false; @@ -447,7 +553,7 @@ void Settings::copyCustomizeKeysFromKeymap(QString keymap) m_bUserChangeKey = false; } -bool Settings::checkShortcutValid(const QString &Name, QString Key, QString &Reason, bool &bIsConflicts) +bool Settings::checkShortcutValid(const QString &Name, QString Key, QString &Reason, bool &bIsConflicts, QString defaultValue) { Q_UNUSED(Name); @@ -474,14 +580,14 @@ bool Settings::checkShortcutValid(const QString &Name, QString Key, QString &Rea return false; } -// // 与设置里的快捷键冲突检测 -// if (isShortcutConflict(Name, Key)) { -// Reason = tr("This shortcut key conflicts with %1, click add to make this shortcut key take effect immediately").arg(style); -// bIsConflicts = true; -// return false; -// } + // 屏蔽Shift组合键处理,但允许恢复为默认组合键序列 + if (Key.contains("Shift") + && Key != defaultValue) { + Reason = tr("The shortcut %1 is invalid, please set another one.").arg(style); + bIsConflicts = false; + return false; + } -// bIsConflicts = true; return true; } @@ -572,7 +678,7 @@ void Settings::slotsigAdjustFont(QVariant value) void Settings::slotsigAdjustFontSize(QVariant value) { - emit sigAdjustFontSize(value.toInt()); + emit sigAdjustFontSize(value.toReal()); } void Settings::slotsigAdjustWordWrap(QVariant value) diff --git a/src/common/settings.h b/src/common/settings.h index 8f601d37..b3c9fb35 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -53,6 +53,7 @@ class Settings : public QObject //static QWidget *createFontComBoBoxHandle(QObject *obj); static QPair createFontComBoBoxHandle(QObject *obj); static QPair createKeySequenceEditHandle(QObject *obj); + static QWidget* createSavingPathWgt(QObject* objg); static Settings* instance(); void setSettingDialog(DSettingsDialog *settingsDialog); @@ -61,9 +62,14 @@ class Settings : public QObject int m_iMinFontSize = 8; DSettings *settings {nullptr}; + void setSavePath(int id,const QString& path); + QString getSavePath(int id); + void setSavePathId(int id); + int getSavePathId(); + signals: void sigAdjustFont(QString name); - void sigAdjustFontSize(int fontSize); + void sigAdjustFontSize(qreal fontSize); void sigAdjustTabSpaceNumber(int number); void sigAdjustWordWrap(bool enable); void sigAdjustBookmark(bool enable); @@ -93,7 +99,7 @@ public slots: private: void updateAllKeysWithKeymap(QString keymap); void copyCustomizeKeysFromKeymap(QString keymap); - bool checkShortcutValid(const QString &Name, QString Key, QString &Reason, bool &bIsConflicts); + bool checkShortcutValid(const QString &Name, QString Key, QString &Reason, bool &bIsConflicts, QString defaultValue = QString::null); bool isShortcutConflict(const QString &Name, const QString &Key); DDialog *createDialog(const QString &title, const QString &content, const bool &bIsConflicts); void removeLockFiles(); diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 7094427e..994aa593 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,6 +7,9 @@ #include #include #include +#include +#include + #include #include #include @@ -26,6 +29,14 @@ #include #include "qprocess.h" +#include + +extern "C" { +#include "../basepub/load_libs.h" +} + +DCORE_USE_NAMESPACE + QT_BEGIN_NAMESPACE extern Q_WIDGETS_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0); QT_END_NAMESPACE @@ -561,7 +572,9 @@ bool Utils::isMimeTypeSupport(const QString &filepath) << "model/vrml" << "application/pkix-cert+pem" << "application/x-pak" - << "application/x-code-workspace"; + << "application/x-code-workspace" + << "application/toml" + << "audio/x-mod"; if (textMimeTypes.contains(mimeType)) { return true; @@ -601,6 +614,18 @@ QStringList Utils::cleanPath(const QStringList &filePaths) return paths; } +/** + * @return 返回程序使用的默认数据(存放临时、备份文件)存放位置,不同环境下路径不同 + * [debian] /home/user/.local/share/deepin/deepin-editor/ + * [linglong] /home/user/.linglong/org.deepin.editor/share/deepin/deepin-editor/ + */ +QString Utils::localDataPath() +{ + auto dataPaths = Utils::cleanPath(QStandardPaths::standardLocations(QStandardPaths::DataLocation)); + return dataPaths.isEmpty() ? QDir::homePath() + "/.local/share/deepin/deepin-editor/" + : dataPaths.first(); +} + const QStringList Utils::getEncodeList() { QStringList encodeList; @@ -767,15 +792,31 @@ QString Utils::getStringMD5Hash(const QString &input) bool Utils::activeWindowFromDock(quintptr winId) { - bool bRet = true; - // new interface use application as id - QDBusInterface dockDbusInterface("com.deepin.dde.daemon.Dock", - "/com/deepin/dde/daemon/Dock", - "com.deepin.dde.daemon.Dock"); - QDBusReply reply = dockDbusInterface.call("ActivateWindow", winId); - if (!reply.isValid()) { - qDebug() << "call com.deepin.dde.daemon.Dock failed" << reply.error(); - bRet = false; + bool bRet = false; + // 优先采用V23接口 + QDBusInterface dockDbusInterfaceV23("org.deepin.dde.daemon.Dock1", + "/org/deepin/dde/daemon/Dock1", + "org.deepin.dde.daemon.Dock1"); + if (dockDbusInterfaceV23.isValid()) { + QDBusReply reply = dockDbusInterfaceV23.call("ActivateWindow", winId); + if (!reply.isValid()) { + qDebug() << "call v23 org.deepin.dde.daemon.Dock1 failed" << reply.error(); + } else { + return true; + } + } + + QDBusInterface dockDbusInterfaceV20("com.deepin.dde.daemon.Dock", + "/com/deepin/dde/daemon/Dock", + "com.deepin.dde.daemon.Dock"); + if (dockDbusInterfaceV20.isValid() && !bRet) { + QDBusReply reply = dockDbusInterfaceV20.call("ActivateWindow", winId); + if (!reply.isValid()) { + qDebug() << "call v20 com.deepin.dde.daemon.Dock failed" << reply.error(); + bRet = false; + } else { + return true; + } } return bRet; @@ -810,16 +851,39 @@ QString Utils::getSystemLan() if (!m_systemLanguage.isEmpty()) { return m_systemLanguage; } else { - QDBusInterface ie("com.deepin.daemon.LangSelector", - "/com/deepin/daemon/LangSelector", - "com.deepin.daemon.LangSelector", - QDBusConnection::sessionBus()); + switch (getSystemVersion()) { + case V23: + m_systemLanguage = QLocale::system().name(); + break; + default: { + QDBusInterface ie("com.deepin.daemon.LangSelector", + "/com/deepin/daemon/LangSelector", + "com.deepin.daemon.LangSelector", + QDBusConnection::sessionBus()); + m_systemLanguage = ie.property("CurrentLocale").toString(); + break; + } + } - m_systemLanguage = ie.property("CurrentLocale").toString(); + qWarning() << "getSystemLan is" << m_systemLanguage; return m_systemLanguage; } } +/** + * @return 获取当前系统版本并返回 + */ +Utils::SystemVersion Utils::getSystemVersion() +{ + QString version = DSysInfo::majorVersion(); + if ("23" == version) { + return V23; + } + + // 其它版本默认V20 + return V20; +} + //judge whether the protocol is wayland bool Utils::isWayland() @@ -900,3 +964,143 @@ Utils::RegionIntersectType Utils::checkRegionIntersect(int x1, int y1, int x2, i } } } + +/** + * @return 取得当前文本编辑器支持的编码格式,按区域划分,从文件 :/encodes/encodes.ini 中读取 + * @note 非多线程安全,仅在 gui 线程调用 + */ +QVector > Utils::getSupportEncoding() +{ + static QVector > s_groupEncodeVec; + if (s_groupEncodeVec.isEmpty()) { + QVector > tmpEncodeVec; + + QFile file(":/encodes/encodes.ini"); + QString data; + if (file.open(QIODevice::ReadOnly)) { + data = QString::fromUtf8(file.readAll()); + file.close(); + } + + QTextStream readStream(&data,QIODevice::ReadOnly); + while (!readStream.atEnd()) { + QString group = readStream.readLine(); + QString key = group.mid(1,group.length()-2); + QString encodes = readStream.readLine(); + QString value = encodes.mid(8,encodes.length()-2); + tmpEncodeVec.append(QPair(key, value.split(","))); + } + + s_groupEncodeVec = tmpEncodeVec; + } + + return s_groupEncodeVec; +} + +/** + * @return 取得当前文本编辑器支持的编码格式列表 + */ +QStringList Utils::getSupportEncodingList() +{ + QStringList encodingList; + auto supportEncoding = getSupportEncoding(); + for (auto encodingData : supportEncoding) { + encodingList.append(encodingData.second); + } + std::sort(encodingList.begin(), encodingList.end()); + + return encodingList; +} + +QString Utils::libPath(const QString &strlib) +{ + QDir dir; + QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath); + dir.setPath(path); + QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib + + if (list.contains(strlib)) + return strlib; + + list.sort(); + if (list.size() <= 0) + return ""; + return list.last(); +} + +void Utils::loadCustomDLL() +{ + // 解析ZPD定制需求提供的库libzpdcallback.so + LoadLibNames tmp; + QByteArray zpdDll = Utils::libPath("libzpdcallback.so").toLatin1(); + tmp.chZPDDLL = zpdDll.data(); + setLibNames(tmp); +} + +/** + * @brief 根据传入的文件路径 \a filePath 返回是否允许对此文件内容进行剪切或拷贝 + * @param filePath 文件完整路径 + * @return 是否允许剪切或拷贝 + */ +bool Utils::enableClipCopy(const QString &filePath) +{ + if (getLoadZPDLibsInstance()->m_document_clip_copy) { + // intercept 输出为1,拦截操作 + static const int disableFlag = 1; + int intercept = 1; + getLoadZPDLibsInstance()->m_document_clip_copy(filePath.toUtf8().data(), &intercept); + + if (disableFlag == intercept) { + qWarning() << qPrintable("ZPD access control! Disable clip or copy document!"); + return false; + } + } + + return true; +} + +/** + * @brief 文件关闭前记录当前关闭的文件路径 \a filePath + * @param filePath 文件完整路径 + */ +void Utils::recordCloseFile(const QString &filePath) +{ + if (getLoadZPDLibsInstance()->m_document_close) { + getLoadZPDLibsInstance()->m_document_close(filePath.toUtf8().data()); + } +} + +/** + @brief 发送弹窗提示消息 \a message , 使用 \a icon 设置提示图标,\a par 是浮动窗口计算位置的父窗口。 + 这个函数效果和 DMessageManager::sendMessage() 类似,但是提示信息的文字字体将跟随 qApp 变化, + 而不是直接使用父窗口的字体。 + */ +void Utils::sendFloatMessageFixedFont(QWidget *par, const QIcon &icon, const QString &message) +{ + // 以下代码和 DMessageManager::sendMessage() 流程一致。 + QWidget *content = par->findChild("_d_message_manager_content", Qt::FindDirectChildrenOnly); + auto msgWidgets = content->findChildren(QString(), Qt::FindDirectChildrenOnly); + auto text_message_count = std::count_if(msgWidgets.begin(), msgWidgets.end(), [](DFloatingMessage *msg){ + return bool(msg->messageType() == DFloatingMessage::TransientType); + }); + + // TransientType 类型的通知消息,最多只允许同时显示三个 + if (text_message_count >= 3) + return; + + // 浮动临时提示信息,自动销毁 + DFloatingMessage *floMsg = new DFloatingMessage(DFloatingMessage::TransientType); + floMsg->setAttribute(Qt::WA_DeleteOnClose); + floMsg->setIcon(icon); + floMsg->setMessage(message); + floMsg->setFont(qApp->font()); + +#ifdef DTKWIDGET_CLASS_DSizeMode + // 绑定 qApp 字体变更信号 + QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::fontChanged, floMsg, [ = ](const QFont &font){ + floMsg->setFont(font); + }); +#endif + + DMessageManager::instance()->sendMessage(par, floMsg); +} diff --git a/src/common/utils.h b/src/common/utils.h index 6978cb9d..0ef87b17 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -18,8 +18,8 @@ #define SAFE_DELETE(p) if((p)) { delete (p); (p) = nullptr;} #endif -#define DEEPIN_THEME "/usr/share/deepin-editor/themes/deepin.theme" -#define DEEPIN_DARK_THEME "/usr/share/deepin-editor/themes/deepin_dark.theme" +#define DEEPIN_THEME QString("%1share/deepin-editor/themes/deepin.theme").arg(LINGLONG_PREFIX) +#define DEEPIN_DARK_THEME QString("%1share/deepin-editor/themes/deepin_dark.theme").arg(LINGLONG_PREFIX) #define DATA_SIZE_1024 1024 #define TEXT_EIDT_MARK_ALL "MARK_ALL" #define PROC_MEMINFO_PATH "/proc/meminfo" @@ -42,6 +42,14 @@ class Utils EIntersectInner, ///< 活动区间处于固定区间内部 例如 [0, 9] 和 [5, 6] }; + /** + * @brief 当前运行时系统环境 + */ + enum SystemVersion { + V20, + V23, + }; + static QString getQrcPath(const QString &imageName); static QString getQssPath(const QString &qssName); static QSize getRenderSize(int fontSize, const QString &string); @@ -68,6 +76,8 @@ class Utils // 返回文件是否为备份文件 static bool isBackupFile(const QString &filepath); static QStringList cleanPath(const QStringList &filePaths); + // 返回程序使用的本地数据路径(存放临时、备份文件) + static QString localDataPath(); static const QStringList getEncodeList(); static QPixmap renderSVG(const QString &filePath, const QSize &size, bool bIsScale = true); static QList getHiglightColorList(); @@ -95,11 +105,12 @@ class Utils //判断是否共享文件夹且只读 static bool isShareDirAndReadOnly(const QString &filePath); - static float codecConfidenceForData(const QTextCodec *codec, const QByteArray &data, const QLocale::Country &country); //return system language static QString getSystemLan(); + // 取得系统版本是否为 V23 + static SystemVersion getSystemVersion(); static bool isWayland(); @@ -108,6 +119,25 @@ class Utils // 判断 [x1, y1] 和 [x2, y2] 区间是否存在交集,返回交集类型 static RegionIntersectType checkRegionIntersect(int x1, int y1, int x2, int y2); + // 取得当前文本编辑器支持的编码格式,从文件 :/encodes/encodes.ini 中读取 + static QVector> getSupportEncoding(); + static QStringList getSupportEncodingList(); + + /** + * @brief libPath 动态库路径 + * @param strlib 路径的字符串 + */ + static QString libPath(const QString &strlib); + + // 加载外部定制库,如ZPD定制库的等 + static void loadCustomDLL(); + // 根据传入的文件路径返回是否允许对此文件内容进行剪切或拷贝 + static bool enableClipCopy(const QString &filePath); + // 文件关闭前记录当前关闭的文件路径 + static void recordCloseFile(const QString &filePath); + + // 发送浮动提示信息,并且字体大小跟随 qApp 应用默认字体而不是父窗口字体 + static void sendFloatMessageFixedFont(QWidget *par, const QIcon &icon, const QString &message); private: static QString m_systemLanguage; diff --git a/src/controls/findbar.cpp b/src/controls/findbar.cpp index f67ec495..5c422046 100644 --- a/src/controls/findbar.cpp +++ b/src/controls/findbar.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,6 +7,15 @@ #include +// 不同布局模式下界面参数,不完全对应设计图固定值,调整后实际像素值和设计图对应 +const int s_FBHeight = 60; +const QMargins s_FBContentMargins = {16, 0, 10, 0}; +const int s_FBCloseBtnSize = 30; +const int s_FBHeightCompact = 40; +const QMargins s_FBContentMarginsCompact = {16, 0, 6, 0}; +const int s_FBCloseBtnSizeCompact = 26; +const int s_FBCloseIconSizeCompact = 27; + FindBar::FindBar(QWidget *parent) : DFloatingWidget(parent) { @@ -19,14 +28,11 @@ FindBar::FindBar(QWidget *parent) m_layout = new QHBoxLayout(); m_layout->setSpacing(10); + m_layout->setAlignment(Qt::AlignVCenter); m_findLabel = new QLabel(tr("Find")); - m_findLabel->setMinimumHeight(36); m_editLine = new LineBar(); - m_editLine->lineEdit()->setMinimumHeight(36); m_findPrevButton = new QPushButton(tr("Previous")); - //m_findPrevButton->setFixedSize(80, 36); m_findNextButton = new QPushButton(tr("Next")); - //m_findNextButton->setFixedSize(80, 36); m_closeButton = new DIconButton(DStyle::SP_CloseButton); m_closeButton->setIconSize(QSize(30, 30)); m_closeButton->setFixedSize(30, 30); @@ -35,7 +41,14 @@ FindBar::FindBar(QWidget *parent) m_layout->setContentsMargins(16, 6, 10, 6); m_layout->addWidget(m_findLabel); - m_layout->addWidget(m_editLine); + + // 单独处理输入框,由于Qt坐标机制,奇数处理存在累计误差,导致显示效果和预期存在差异,添加 spacer 强制输入框居中 + QVBoxLayout *lineBarLayout = new QVBoxLayout(); + lineBarLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); + lineBarLayout->addWidget(m_editLine); + lineBarLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); + m_layout->addLayout(lineBarLayout); + m_layout->addWidget(m_findPrevButton); m_layout->addWidget(m_findNextButton); m_layout->addWidget(m_closeButton); @@ -58,6 +71,11 @@ FindBar::FindBar(QWidget *parent) //connect(m_findPrevButton, &QPushButton::clicked, this, &FindBar::findPrev, Qt::QueuedConnection); connect(m_closeButton, &DIconButton::clicked, this, &FindBar::findCancel, Qt::QueuedConnection); + +#ifdef DTKWIDGET_CLASS_DSizeMode + updateSizeMode(); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &FindBar::updateSizeMode); +#endif } bool FindBar::isFocus() @@ -145,6 +163,31 @@ void FindBar::keyPressEvent(QKeyEvent *e) } } +/** + @brief 根据界面布局模式 `DGuiApplicationHelper::isCompactMode()` 切换当前界面布局参数。 + 需要注意,界面参数同设计图参数并非完全一致,而是按照实际的显示像素值进行比对。 + */ +void FindBar::updateSizeMode() +{ +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + setFixedHeight(s_FBHeightCompact); + m_closeButton->setFixedSize(s_FBCloseBtnSizeCompact, s_FBCloseBtnSizeCompact); + m_closeButton->setIconSize(QSize(s_FBCloseIconSizeCompact, s_FBCloseIconSizeCompact)); + + m_layout->setContentsMargins(s_FBContentMarginsCompact); + m_layout->invalidate(); + } else { + setFixedHeight(s_FBHeight); + m_closeButton->setFixedSize(s_FBCloseBtnSize, s_FBCloseBtnSize); + m_closeButton->setIconSize(QSize(s_FBCloseBtnSize, s_FBCloseBtnSize)); + + m_layout->setContentsMargins(s_FBContentMargins); + m_layout->invalidate(); + } +#endif +} + void FindBar::setMismatchAlert(bool isAlert) { m_editLine->setAlert(isAlert); diff --git a/src/controls/findbar.h b/src/controls/findbar.h index d971a7b0..a7185efa 100644 --- a/src/controls/findbar.h +++ b/src/controls/findbar.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -42,7 +42,7 @@ class FindBar : public DFloatingWidget void setSearched(bool _); void findPreClicked(); -signals: +Q_SIGNALS: void pressEsc(); void findNext(const QString &keyword); void findPrev(const QString &keyword); @@ -53,7 +53,7 @@ class FindBar : public DFloatingWidget //add guoshao void sigFindbarClose(); -public slots: +public Q_SLOTS: void findCancel(); void handleContentChanged(); void handleFindNext(); @@ -64,6 +64,9 @@ public slots: bool focusNextPrevChild(bool next) override; void keyPressEvent(QKeyEvent *e) override; +private: + Q_SLOT void updateSizeMode(); + private: QPushButton *m_findNextButton; QPushButton *m_findPrevButton; diff --git a/src/controls/jumplinebar.cpp b/src/controls/jumplinebar.cpp index d17e6744..6cef8b8c 100644 --- a/src/controls/jumplinebar.cpp +++ b/src/controls/jumplinebar.cpp @@ -1,29 +1,45 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "jumplinebar.h" #include +#include #include // 各项组件的默认大小 -const int nJumpLineBarWidth = 212; -const int nJumpLineBarHeight = 60; +const int s_nJumpLineBarWidth = 232; +const int s_nJumpLineBarHeight = 60; +const QMargins s_JLBDefaultMarigins = {10, 0, 10, 0}; const int s_nJumpLineBarSpinBoxWidth = 124; const int s_nJumpLineBarSPinBoxHeight = 36; +const int s_nCloseButtonSize = 30; // 水平方向与边界间距 const int s_nJumpLineBarHorizenMargin = 10; +// 紧凑模式下的控件高度调整(相较设计图调整,以使得实际像素与设计图一致) +const int s_nJumpLineBarWidthCompact = 212; +const int s_nJumpLineBarHeightCompact = 40; +const QMargins s_JLBCompactMarigins = {10, 0, 0, 0}; +const int s_nJumpLineBarSPinBoxHeightCompact = 28; +const int s_nCloseButtonSizeCompact = 27; JumpLineBar::JumpLineBar(DFloatingWidget *parent) : DFloatingWidget(parent) { // Init layout and widgets. m_layout = new QHBoxLayout(); - m_layout->setContentsMargins(10, 6, 10, 6); + m_layout->setContentsMargins(10, 0, 10, 0); + m_layout->setAlignment(Qt::AlignVCenter); m_layout->setSpacing(5); + m_closeButton = new DIconButton(DStyle::SP_CloseButton); + m_closeButton->setIconSize(QSize(30, 30)); + m_closeButton->setFixedSize(30, 30); + m_closeButton->setEnabledCircle(true); + m_closeButton->setFlat(true); + m_label = new QLabel(); m_label->setText(tr("Go to Line: ")); // 按文本长度计算显示宽度,不同语言下翻译文本长度不一,需完整显示 @@ -36,15 +52,23 @@ JumpLineBar::JumpLineBar(DFloatingWidget *parent) m_layout->addWidget(m_label); m_layout->addWidget(m_pSpinBoxInput); + m_layout->addWidget(m_closeButton); this->setLayout(m_layout); // 初始化浮动条宽度,根据文本长度计算 - setFixedHeight(nJumpLineBarHeight); + setFixedHeight(s_nJumpLineBarHeight); setFixedWidth(m_layout->sizeHint().width() + s_nJumpLineBarHorizenMargin); connect(this, &JumpLineBar::pressEsc, this, &JumpLineBar::jumpCancel, Qt::QueuedConnection); connect(m_pSpinBoxInput->lineEdit(), &QLineEdit::returnPressed, this, &JumpLineBar::jumpConfirm, Qt::QueuedConnection); connect(m_pSpinBoxInput->lineEdit(), &QLineEdit::textChanged, this, &JumpLineBar::handleLineChanged, Qt::QueuedConnection); + connect(m_closeButton, &DIconButton::clicked, this, &JumpLineBar::close, Qt::QueuedConnection); + +#ifdef DTKWIDGET_CLASS_DSizeMode + // 初始化布局模式 + updateSizeMode(); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &JumpLineBar::updateSizeMode); +#endif } JumpLineBar::~JumpLineBar() @@ -153,3 +177,28 @@ bool JumpLineBar::eventFilter(QObject *pObject, QEvent *pEvent) return DFloatingWidget::eventFilter(pObject, pEvent); } +/** + @brief 根据界面布局模式 `DGuiApplicationHelper::isCompactMode()` 切换当前界面布局参数。 + 需要注意,界面参数同设计图参数并非完全一致,而是按照实际的显示像素值进行比对。 + */ +void JumpLineBar::updateSizeMode() +{ +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + m_layout->setContentsMargins(s_JLBCompactMarigins); + m_closeButton->setIconSize(QSize(s_nCloseButtonSizeCompact, s_nCloseButtonSizeCompact)); + m_closeButton->setFixedSize(QSize(s_nCloseButtonSizeCompact, s_nCloseButtonSizeCompact)); + m_pSpinBoxInput->setFixedHeight(s_nJumpLineBarSPinBoxHeightCompact); + setMinimumWidth(s_nJumpLineBarWidthCompact); + setFixedHeight(s_nJumpLineBarHeightCompact); + } else { + m_layout->setContentsMargins(s_JLBDefaultMarigins); + m_closeButton->setIconSize(QSize(s_nCloseButtonSize, s_nCloseButtonSize)); + m_closeButton->setFixedSize(QSize(s_nCloseButtonSize, s_nCloseButtonSize)); + m_pSpinBoxInput->setFixedHeight(s_nJumpLineBarSPinBoxHeight); + setMinimumWidth(s_nJumpLineBarWidth); + setFixedHeight(s_nJumpLineBarHeight); + } +#endif +} + diff --git a/src/controls/jumplinebar.h b/src/controls/jumplinebar.h index 17f2e4fa..00813303 100644 --- a/src/controls/jumplinebar.h +++ b/src/controls/jumplinebar.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -14,6 +14,7 @@ #include #include #include +#include DWIDGET_USE_NAMESPACE @@ -36,7 +37,7 @@ public slots: void hide(); int getLineCount(); -signals: +Q_SIGNALS: void backToPosition(QString file, int row, int column, int scrollOffset); void jumpToLine(QString file, int line, bool focusEditor); void lostFocusExit(); @@ -44,6 +45,7 @@ public slots: protected: bool eventFilter(QObject *pObject, QEvent *pEvent); + Q_SLOT void updateSizeMode(); private: DSpinBox *m_pSpinBoxInput {nullptr}; @@ -55,6 +57,7 @@ public slots: int m_columnBeforeJump; int m_lineCount; QColor m_backgroundColor; + DIconButton *m_closeButton=nullptr; }; #endif diff --git a/src/controls/linebar.cpp b/src/controls/linebar.cpp index d9df662a..8b372f83 100644 --- a/src/controls/linebar.cpp +++ b/src/controls/linebar.cpp @@ -1,12 +1,18 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "linebar.h" #include "../common/utils.h" +#include + #include +// 不同布局模式(紧凑) +const int s_nLineBarHeight = 36; +const int s_nLineBarHeightCompact = 24; + LineBar::LineBar(DLineEdit *parent) : DLineEdit(parent) { @@ -20,6 +26,13 @@ LineBar::LineBar(DLineEdit *parent) connect(m_autoSaveTimer, &QTimer::timeout, this, &LineBar::handleTextChangeTimer); connect(this, &DLineEdit::textEdited, this, &LineBar::sendText, Qt::QueuedConnection); connect(this, &DLineEdit::textChanged, this, &LineBar::handleTextChanged, Qt::QueuedConnection); + +#ifdef DTKWIDGET_CLASS_DSizeMode + setFixedHeight(DGuiApplicationHelper::isCompactMode() ? s_nLineBarHeightCompact : s_nLineBarHeight); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [this](){ + setFixedHeight(DGuiApplicationHelper::isCompactMode() ? s_nLineBarHeightCompact : s_nLineBarHeight); + }); +#endif } void LineBar::handleTextChangeTimer() diff --git a/src/controls/replacebar.cpp b/src/controls/replacebar.cpp index 9c5c2824..898717ee 100644 --- a/src/controls/replacebar.cpp +++ b/src/controls/replacebar.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,6 +7,15 @@ #include +// 不同布局模式下界面参数,不完全对应设计图固定值,调整后实际像素值和设计图对应 +const int s_RBHeight = 60; +const QMargins s_RBContetsMargins = {16, 0, 10, 0}; +const int s_RBCloseBtnSize = 30; +const int s_RBHeight_Compact = 40; +const QMargins s_RBContetsMarginsCompact = {16, 0, 6, 0}; +const int s_RBCloseBtnSizeCompact = 26; +const int s_RBCloseIconSizeCompact = 27; + ReplaceBar::ReplaceBar(QWidget *parent) : DFloatingWidget(parent) { @@ -17,27 +26,16 @@ ReplaceBar::ReplaceBar(QWidget *parent) // Init layout and widgets. m_layout = new QHBoxLayout(); m_layout->setSpacing(10); - m_layout->setContentsMargins(16, 6, 10, 6); + m_layout->setContentsMargins(16, 0, 10, 0); + m_layout->setAlignment(Qt::AlignVCenter); m_replaceLabel = new QLabel(tr("Find")); - //m_replaceLabel->setMinimumHeight(36); m_replaceLine = new LineBar(); - //m_replaceLine->lineEdit()->setMinimumHeight(36); m_withLabel = new QLabel(tr("Replace With")); - //m_withLabel->setMinimumHeight(36); m_withLine = new LineBar(); - //m_withLine->lineEdit()->setMinimumHeight(36); m_replaceButton = new QPushButton(tr("Replace")); - //m_replaceButton->setMinimumWidth(66); - //m_replaceButton->setMinimumHeight(36); m_replaceSkipButton = new QPushButton(tr("Skip")); - //m_replaceSkipButton->setMinimumWidth(66); - //m_replaceSkipButton->setMinimumHeight(36); m_replaceRestButton = new QPushButton(tr("Replace Rest")); - //m_replaceRestButton->setMinimumWidth(80); - //m_replaceRestButton->setMinimumHeight(36); m_replaceAllButton = new QPushButton(tr("Replace All")); - //m_replaceAllButton->setMinimumWidth(80); - //m_replaceAllButton->setMinimumHeight(36); m_closeButton = new DIconButton(DStyle::SP_CloseButton); m_closeButton->setFlat(true); m_closeButton->setFixedSize(30, 30); @@ -45,9 +43,9 @@ ReplaceBar::ReplaceBar(QWidget *parent) m_closeButton->setIconSize(QSize(30, 30)); m_layout->addWidget(m_replaceLabel); - m_layout->addWidget(m_replaceLine); + m_layout->addLayout(createVerticalLine(m_replaceLine)); m_layout->addWidget(m_withLabel); - m_layout->addWidget(m_withLine); + m_layout->addLayout(createVerticalLine(m_withLine)); m_layout->addWidget(m_replaceButton); m_layout->addWidget(m_replaceSkipButton); m_layout->addWidget(m_replaceRestButton); @@ -82,6 +80,11 @@ ReplaceBar::ReplaceBar(QWidget *parent) connect(m_replaceAllButton, &QPushButton::clicked, this, &ReplaceBar::handleReplaceAll, Qt::QueuedConnection); connect(m_closeButton, &DIconButton::clicked, this, &ReplaceBar::replaceClose, Qt::QueuedConnection); + +#ifdef DTKWIDGET_CLASS_DSizeMode + updateSizeMode(); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &ReplaceBar::updateSizeMode); +#endif } bool ReplaceBar::isFocus() @@ -205,6 +208,44 @@ void ReplaceBar::keyPressEvent(QKeyEvent *e) } } +/** + @brief 根据界面布局模式 `DGuiApplicationHelper::isCompactMode()` 切换当前界面布局参数。 + 需要注意,界面参数同设计图参数并非完全一致,而是按照实际的显示像素值进行比对。 + */ +void ReplaceBar::updateSizeMode() +{ +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + setFixedHeight(s_RBHeight_Compact); + m_closeButton->setFixedSize(s_RBCloseBtnSizeCompact, s_RBCloseBtnSizeCompact); + m_closeButton->setIconSize(QSize(s_RBCloseIconSizeCompact, s_RBCloseIconSizeCompact)); + + m_layout->setContentsMargins(s_RBContetsMarginsCompact); + m_layout->invalidate(); + } else { + setFixedHeight(s_RBHeight); + m_closeButton->setFixedSize(s_RBCloseBtnSize, s_RBCloseBtnSize); + m_closeButton->setIconSize(QSize(s_RBCloseBtnSize, s_RBCloseBtnSize)); + + m_layout->setContentsMargins(s_RBContetsMargins); + m_layout->invalidate(); + } +#endif +} + +/** + @brief 单独处理输入框 \a bar,由于Qt坐标机制,奇数处理存在累计误差, + 导致显示效果和预期存在差异,添加 spacer 强制输入框居中,组合完成返回布局。 + */ +QVBoxLayout *ReplaceBar::createVerticalLine(QWidget *content) const +{ + QVBoxLayout *lineBarLayout = new QVBoxLayout(); + lineBarLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); + lineBarLayout->addWidget(content); + lineBarLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); + return lineBarLayout; +} + void ReplaceBar::setMismatchAlert(bool isAlert) { m_replaceLine->setAlert(isAlert); diff --git a/src/controls/replacebar.h b/src/controls/replacebar.h index bc8d1783..724ecd8d 100644 --- a/src/controls/replacebar.h +++ b/src/controls/replacebar.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -33,7 +33,7 @@ class ReplaceBar : public DFloatingWidget void setMismatchAlert(bool isAlert); void setsearched(bool _); -signals: +Q_SIGNALS: void pressEsc(); void replaceNext(QString file, QString replaceText, QString withText); void replaceSkip(QString file, QString keyword); @@ -48,7 +48,7 @@ class ReplaceBar : public DFloatingWidget void sigReplacebarClose(); -public slots: +public Q_SLOTS: void change(); void replaceClose(); void handleContentChanged(); @@ -62,6 +62,10 @@ public slots: bool focusNextPrevChild(bool next); void keyPressEvent(QKeyEvent *e); +private: + Q_SLOT void updateSizeMode(); + QVBoxLayout *createVerticalLine(QWidget *content) const; + private: QPushButton *m_replaceAllButton; QPushButton *m_replaceButton; diff --git a/src/controls/settingsdialog.cpp b/src/controls/settingsdialog.cpp index 26579671..4a7f246d 100644 --- a/src/controls/settingsdialog.cpp +++ b/src/controls/settingsdialog.cpp @@ -30,6 +30,8 @@ void GenerateSettingTranslate() auto shortcuts_window_help = QObject::tr("Help"); auto shortcuts_window_togglefullscreenName = QObject::tr("Toggle fullscreen"); auto shortcuts_window_findName = QObject::tr("Find"); + Q_UNUSED(QObject::tr("Find Next")); + Q_UNUSED(QObject::tr("Find Previous")); auto shortcuts_window_replaceName = QObject::tr("Replace"); auto shortcuts_window_jumptolineName = QObject::tr("Go to line"); auto shortcuts_window_savepositionName = QObject::tr("Save cursor position"); @@ -92,6 +94,12 @@ void GenerateSettingTranslate() auto advance_windowName = QObject::tr("Window"); auto advance_window_windowstateName = QObject::tr("Window size"); auto advance_editor_tabspacenumberName = QObject::tr("Tab width"); + auto allow_midbutton_paste_name = QObject::tr("Paste by pressing a middle mouse button"); + + auto advance_startup_name = QObject::tr("Startup"); + auto advance_startup_saveTabBeforeCloseName = QObject::tr("Reopen last closed tabs"); + + auto advance_open_save_setting_name = QObject::tr("Open/Save Settings"); auto base_font_wordwrapText = QObject::tr("Word wrap"); auto base_font_codeflod = QObject::tr("Code folding flag"); diff --git a/src/controls/tabbar.cpp b/src/controls/tabbar.cpp index f7c45499..255d83eb 100644 --- a/src/controls/tabbar.cpp +++ b/src/controls/tabbar.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -16,9 +16,14 @@ #include #include #include +#include QPixmap *Tabbar::sm_pDragPixmap = nullptr; +// 不同模式下的界面调整 +const int s_TabbarHeight = 40; +const int s_TabbarHeightCompact = 26; + /** * @brief ‘&’在Qt中被标记为助记符,替换 \a str 中的‘&’字符为“&&”,以正确显示文件名中的‘&’符号 * painter 绘制 CE_ToolButtonLabel 时设置了 Qt::TextShowMnemonic @@ -64,6 +69,13 @@ Tabbar::Tabbar(QWidget *parent) connect(this, &DTabBar::tabIsRemoved, this, &Tabbar::handleTabIsRemoved); connect(this, &DTabBar::tabReleaseRequested, this, &Tabbar::handleTabReleased); connect(this, &DTabBar::dragActionChanged, this, &Tabbar::handleDragActionChanged); + +#ifdef DTKWIDGET_CLASS_DSizeMode + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [ this ](){ + // 更新当前控件,自动调用 sizeHint() 更新界面参数 + this->update(); + }); +#endif } Tabbar::~Tabbar() @@ -80,7 +92,7 @@ Tabbar::~Tabbar() void Tabbar::addTab(const QString &filePath, const QString &tabName, const QString &tipPath) { - addTabWithIndex(currentIndex() + 1, filePath, tabName, tipPath); + addTabWithIndex(count(), filePath, tabName, tipPath); } void Tabbar::addTabWithIndex(int index, const QString &filePath, const QString &tabName, const QString &tipPath) @@ -97,8 +109,8 @@ void Tabbar::addTabWithIndex(int index, const QString &filePath, const QString & QString trimmedName = replaceMnemonic(tabName.simplified()); DTabBar::insertTab(index, trimmedName); DTabBar::setCurrentIndex(index); - if (filePath.contains("/.local/share/deepin/deepin-editor/")) { - if (filePath.contains("/.local/share/deepin/deepin-editor/backup-files") && !tipPath.isNull() && tipPath.length() > 0) { + if (filePath.contains(Utils::localDataPath())) { + if (Utils::isBackupFile(filePath) && !tipPath.isNull() && tipPath.length() > 0) { setTabToolTip(index, tipPath); } else { setTabToolTip(index, tabName); @@ -235,9 +247,9 @@ void Tabbar::updateTab(int index, const QString &filePath, const QString &tabNam setTabText(index, tabName); m_tabPaths[index] = filePath; m_tabTruePaths[index] = filePath; - //show file path at tab,blank file only show it's name. - if (filePath.contains("/.local/share/deepin/deepin-editor/")) { + //show file path at tab,blank file only show it's name. + if (filePath.contains(Utils::localDataPath())) { setTabToolTip(index, tabName); } else { QString path = filePath; @@ -692,7 +704,6 @@ void Tabbar::dropEvent(QDropEvent *e) QSize Tabbar::tabSizeHint(int index) const { - if (index >= 0) { int total = this->width(); @@ -706,7 +717,11 @@ QSize Tabbar::tabSizeHint(int index) const aveargeWidth = 110; } +#ifdef DTKWIDGET_CLASS_DSizeMode + return QSize(aveargeWidth, DGuiApplicationHelper::isCompactMode() ? s_TabbarHeightCompact : s_TabbarHeight); +#else return QSize(aveargeWidth, 40); +#endif } return DTabBar::tabSizeHint(index); @@ -715,13 +730,21 @@ QSize Tabbar::tabSizeHint(int index) const QSize Tabbar::minimumTabSizeHint(int index) const { Q_UNUSED(index) +#ifdef DTKWIDGET_CLASS_DSizeMode + return QSize(110, DGuiApplicationHelper::isCompactMode() ? s_TabbarHeightCompact : s_TabbarHeight); +#else return QSize(110, 40); +#endif } QSize Tabbar::maximumTabSizeHint(int index) const { Q_UNUSED(index) +#ifdef DTKWIDGET_CLASS_DSizeMode + return QSize(160, DGuiApplicationHelper::isCompactMode() ? s_TabbarHeightCompact : s_TabbarHeight); +#else return QSize(160, 40); +#endif } void Tabbar::handleTabMoved(int fromIndex, int toIndex) diff --git a/src/controls/warningnotices.cpp b/src/controls/warningnotices.cpp index 0f7e9555..ef9e4ab3 100644 --- a/src/controls/warningnotices.cpp +++ b/src/controls/warningnotices.cpp @@ -1,38 +1,51 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "warningnotices.h" -#include + +#include +#include + +#ifdef DTKWIDGET_CLASS_DSizeMode +#include +#endif + +const int s_WNCloseBtnSize = 32; +const int s_WNCloseBtnSizeCompact = 26; WarningNotices::WarningNotices(MessageType notifyType, QWidget *parent) - : DFloatingMessage(notifyType,parent) + : DFloatingMessage(notifyType, parent) { - QFont font; - font.setPixelSize(14); - font.setFamily("SourceHanSansSC-Medium"); - this->setFont(font); - - this->setContentsMargins(7, 7, 7, 7); + this->setFont(qApp->font()); setIcon(QIcon(":/images/warning.svg")); - m_reloadBtn = new QPushButton(tr("Reload"),this); - //m_reloadBtn->setFixedSize(80, 36); - m_saveAsBtn = new QPushButton(qApp->translate("Window", "Save as"),this); - - //m_saveAsBtn->setFixedSize(80, 36); + m_reloadBtn = new QPushButton(tr("Reload"), this); + m_saveAsBtn = new QPushButton(qApp->translate("Window", "Save as"), this); m_reloadBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_saveAsBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); connect(m_reloadBtn, &QPushButton::clicked, this, &WarningNotices::slotreloadBtnClicked); connect(m_saveAsBtn, &QPushButton::clicked, this, &WarningNotices::slotsaveAsBtnClicked); -} -WarningNotices::~WarningNotices() -{ +#ifdef DTKWIDGET_CLASS_DSizeMode + DDialogCloseButton *closeBtn = findChild(); + if (closeBtn) { + closeBtn->setIconSize(DSizeModeHelper::element(QSize(26, 26), QSize(32, 32))); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [=]() { + closeBtn->setIconSize(DSizeModeHelper::element(QSize(26, 26), QSize(32, 32))); + }); + } + // 紧凑模式下字体切换同样处理 + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::fontChanged, this, [this](const QFont &font) { + this->setFont(font); + }); +#endif } +WarningNotices::~WarningNotices() {} + void WarningNotices::setReloadBtn() { if (!m_reloadBtn->isVisible()) { diff --git a/src/editor/deletebackcommond.cpp b/src/editor/deletebackcommond.cpp index 030db8a1..98b7dab9 100644 --- a/src/editor/deletebackcommond.cpp +++ b/src/editor/deletebackcommond.cpp @@ -1,11 +1,11 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "deletebackcommond.h" #include -DeleteBackCommond::DeleteBackCommond(QTextCursor cursor, QPlainTextEdit *edit): +DeleteBackCommand::DeleteBackCommand(QTextCursor cursor, QPlainTextEdit *edit): m_cursor(cursor), m_edit(edit) { @@ -14,21 +14,23 @@ DeleteBackCommond::DeleteBackCommond(QTextCursor cursor, QPlainTextEdit *edit): m_insertPos = m_delPos; } -DeleteBackCommond::~DeleteBackCommond() +DeleteBackCommand::~DeleteBackCommand() { } -void DeleteBackCommond::undo() +void DeleteBackCommand::undo() { m_cursor.setPosition(m_insertPos); m_cursor.insertText(m_delText); - m_cursor.setPosition(m_delPos); - m_edit->setTextCursor(m_cursor); + QTextCursor cursor = m_edit->textCursor(); + cursor.setPosition(m_insertPos); + cursor.setPosition(m_insertPos + m_delText.size(), QTextCursor::KeepAnchor); + m_edit->setTextCursor(cursor); } -void DeleteBackCommond::redo() +void DeleteBackCommand::redo() { m_cursor.setPosition(m_delPos); m_cursor.setPosition(m_delPos+m_delText.size(), QTextCursor::KeepAnchor); @@ -38,7 +40,7 @@ void DeleteBackCommond::redo() m_edit->setTextCursor(m_cursor); } -DeleteBackAltCommond::DeleteBackAltCommond(QList &selections,QPlainTextEdit* edit): +DeleteBackAltCommand::DeleteBackAltCommand(QList &selections,QPlainTextEdit* edit): m_ColumnEditSelections(selections), m_edit(edit) { @@ -49,7 +51,7 @@ DeleteBackAltCommond::DeleteBackAltCommond(QList &sel auto cursor = m_ColumnEditSelections[i].cursor; if(!cursor.hasSelection() && !cursor.atBlockEnd()){ - cursor.movePosition(QTextCursor::Right,QTextCursor::KeepAnchor,1); + cursor.setPosition(cursor.position() + 1, QTextCursor::KeepAnchor); } text = cursor.selectedText(); @@ -68,12 +70,12 @@ DeleteBackAltCommond::DeleteBackAltCommond(QList &sel } } -DeleteBackAltCommond::~DeleteBackAltCommond() +DeleteBackAltCommand::~DeleteBackAltCommand() { } -void DeleteBackAltCommond::undo() +void DeleteBackAltCommand::undo() { int size = m_deletions.size(); @@ -92,7 +94,7 @@ void DeleteBackAltCommond::undo() } -void DeleteBackAltCommond::redo() +void DeleteBackAltCommand::redo() { int size = m_deletions.size(); diff --git a/src/editor/deletebackcommond.h b/src/editor/deletebackcommond.h index 3dd4c783..db0e1e1d 100644 --- a/src/editor/deletebackcommond.h +++ b/src/editor/deletebackcommond.h @@ -9,11 +9,11 @@ #include #include //向后删除单一文字或选中文字的撤销重做 -class DeleteBackCommond:public QUndoCommand +class DeleteBackCommand:public QUndoCommand { public: - DeleteBackCommond(QTextCursor cursor,QPlainTextEdit* edit); - virtual ~DeleteBackCommond(); + DeleteBackCommand(QTextCursor cursor,QPlainTextEdit* edit); + virtual ~DeleteBackCommand(); virtual void undo(); virtual void redo(); @@ -28,11 +28,11 @@ class DeleteBackCommond:public QUndoCommand }; //列模式下向后删除的撤销重做 -class DeleteBackAltCommond:public QUndoCommand +class DeleteBackAltCommand:public QUndoCommand { public: - DeleteBackAltCommond(QList &selections,QPlainTextEdit* edit); - virtual ~DeleteBackAltCommond(); + DeleteBackAltCommand(QList &selections,QPlainTextEdit* edit); + virtual ~DeleteBackAltCommand(); virtual void undo(); virtual void redo(); diff --git a/src/editor/deletetextundocommand.cpp b/src/editor/deletetextundocommand.cpp index bcb579b7..74516ff2 100644 --- a/src/editor/deletetextundocommand.cpp +++ b/src/editor/deletetextundocommand.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,43 +7,43 @@ #include #include -DeleteTextUndoCommand::DeleteTextUndoCommand(QTextCursor textcursor, QPlainTextEdit* edit, QUndoCommand *parent) +DeleteTextUndoCommand::DeleteTextUndoCommand(QTextCursor textcursor, QPlainTextEdit *edit, QUndoCommand *parent) : QUndoCommand(parent) , m_edit(edit) , m_textCursor(textcursor) - , m_beginPos(m_textCursor.position()) + , m_beginPos(m_textCursor.selectionStart()) { - if(m_textCursor.hasSelection()){ + if (m_textCursor.hasSelection()) { m_sInsertText = m_textCursor.selectedText(); - //qDebug()<= 0){ + } else { + int pos = m_textCursor.positionInBlock() - 1; + if (pos >= 0) { m_sInsertText = m_textCursor.block().text().at(pos); - }else { + } else { //上一行lastQChar m_sInsertText = "\n"; } } } -DeleteTextUndoCommand::DeleteTextUndoCommand(QList &selections, QPlainTextEdit *edit, QUndoCommand *parent) +DeleteTextUndoCommand::DeleteTextUndoCommand(QList &selections, + QPlainTextEdit *edit, + QUndoCommand *parent) : QUndoCommand(parent) , m_edit(edit) , m_ColumnEditSelections(selections) - , m_beginPos(m_textCursor.position()) + , m_beginPos(m_textCursor.selectionStart()) { int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { - QTextCursor textCursor =m_ColumnEditSelections[i].cursor; - if(textCursor.hasSelection()) - { + QTextCursor textCursor = m_ColumnEditSelections[i].cursor; + if (textCursor.hasSelection()) { m_selectTextList.append(textCursor.selectedText()); - }else { - int pos = textCursor.positionInBlock()-1; - if(pos >= 0){ + } else { + int pos = textCursor.positionInBlock() - 1; + if (pos >= 0) { m_selectTextList.append(textCursor.block().text().at(pos)); - }else { + } else { //上一行lastQChar m_selectTextList.append("\n"); } @@ -51,34 +51,32 @@ DeleteTextUndoCommand::DeleteTextUndoCommand(QList &s } } - void DeleteTextUndoCommand::undo() { - if(m_ColumnEditSelections.isEmpty()){ + if (m_ColumnEditSelections.isEmpty()) { // 插入前将光标恢复到删除前位置 m_textCursor.setPosition(m_beginPos); m_textCursor.insertText(m_sInsertText); - m_textCursor.movePosition(QTextCursor::Left,QTextCursor::KeepAnchor,m_sInsertText.length()); + m_textCursor.setPosition(m_textCursor.position() - m_sInsertText.length(), QTextCursor::KeepAnchor); // 进行撤销/恢复时将光标移动到撤销位置 if (m_edit) { m_edit->setTextCursor(m_textCursor); } - }else { + } else { int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { m_ColumnEditSelections[i].cursor.insertText(m_selectTextList[i]); - m_ColumnEditSelections[i].cursor.movePosition(QTextCursor::Left,QTextCursor::KeepAnchor,m_selectTextList[i].length()); + m_ColumnEditSelections[i].cursor.setPosition( + m_ColumnEditSelections[i].cursor.position() - m_selectTextList[i].length(), QTextCursor::KeepAnchor); } if (m_edit && !m_ColumnEditSelections.isEmpty()) { m_edit->setTextCursor(m_ColumnEditSelections.last().cursor); } } - } - void DeleteTextUndoCommand::redo() { if (m_ColumnEditSelections.isEmpty()) { @@ -88,7 +86,7 @@ void DeleteTextUndoCommand::redo() if (m_edit) { m_edit->setTextCursor(m_textCursor); } - }else { + } else { int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { m_ColumnEditSelections[i].cursor.deletePreviousChar(); @@ -100,33 +98,35 @@ void DeleteTextUndoCommand::redo() } } - -DeleteTextUndoCommand2::DeleteTextUndoCommand2(QTextCursor textcursor,QString text,QPlainTextEdit* edit,bool currLine): - m_textCursor(textcursor), - m_sInsertText(text), - m_edit(edit), - m_iscurrLine(currLine) +DeleteTextUndoCommand2::DeleteTextUndoCommand2(QTextCursor textcursor, QString text, QPlainTextEdit *edit, bool currLine) + : m_textCursor(textcursor) + , m_sInsertText(text) + , m_edit(edit) + , m_iscurrLine(currLine) { - + m_sInsertText.replace("\r\n", "\n"); } -DeleteTextUndoCommand2::DeleteTextUndoCommand2(QList &selections,QString text,QPlainTextEdit* edit,bool currLine): - m_sInsertText(text), - m_ColumnEditSelections(selections), - m_edit(edit), - m_iscurrLine(currLine) +DeleteTextUndoCommand2::DeleteTextUndoCommand2(QList &selections, + QString text, + QPlainTextEdit *edit, + bool currLine) + : m_sInsertText(text) + , m_ColumnEditSelections(selections) + , m_edit(edit) + , m_iscurrLine(currLine) { + m_sInsertText.replace("\r\n", "\n"); int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { - QTextCursor textCursor =m_ColumnEditSelections[i].cursor; - if(textCursor.hasSelection()) - { + QTextCursor textCursor = m_ColumnEditSelections[i].cursor; + if (textCursor.hasSelection()) { m_selectTextList.append(textCursor.selectedText()); - }else { - int pos = textCursor.positionInBlock()-1; - if(pos >= 0){ + } else { + int pos = textCursor.positionInBlock() - 1; + if (pos >= 0) { m_selectTextList.append(textCursor.block().text().at(pos)); - }else { + } else { //上一行lastQChar m_selectTextList.append("\n"); } @@ -136,12 +136,12 @@ DeleteTextUndoCommand2::DeleteTextUndoCommand2(QList void DeleteTextUndoCommand2::undo() { - if(m_ColumnEditSelections.isEmpty()){ + if (m_ColumnEditSelections.isEmpty()) { m_textCursor.setPosition(m_beginPostion); m_textCursor.insertText(m_sInsertText); m_textCursor.setPosition(m_beginPostion); m_edit->setTextCursor(m_textCursor); - }else { + } else { int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { m_ColumnEditSelections[i].cursor.setPosition(m_beginPostion); @@ -154,26 +154,22 @@ void DeleteTextUndoCommand2::undo() void DeleteTextUndoCommand2::redo() { - if(m_ColumnEditSelections.isEmpty()){ - + if (m_ColumnEditSelections.isEmpty()) { bool isEmptyLine = (m_sInsertText.size() == 0); bool isBlankLine = (m_sInsertText.trimmed().size() == 0); - if(!m_iscurrLine) { + if (!m_iscurrLine) { //删除到行尾 if (isEmptyLine || m_textCursor.atBlockEnd()) { m_textCursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); - } - else if (isBlankLine && m_textCursor.atBlockStart()) { + } else if (isBlankLine && m_textCursor.atBlockStart()) { m_textCursor.movePosition(QTextCursor::StartOfBlock); m_textCursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); - } - else { + } else { m_textCursor.movePosition(QTextCursor::NoMove, QTextCursor::MoveAnchor); m_textCursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); } - } - else { + } else { //删除整行 m_textCursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor); m_textCursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); @@ -186,7 +182,7 @@ void DeleteTextUndoCommand2::redo() // 进行撤销/恢复时将光标移动到撤销位置 m_edit->setTextCursor(m_textCursor); - }else { + } else { int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { m_beginPostion = m_ColumnEditSelections[i].cursor.selectionStart(); diff --git a/src/editor/dtextedit.cpp b/src/editor/dtextedit.cpp index 392c2f8a..a9dd93d0 100644 --- a/src/editor/dtextedit.cpp +++ b/src/editor/dtextedit.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -16,6 +16,7 @@ #include "indenttextcommond.h" #include "undolist.h" #include "changemarkcommand.h" +#include "endlineformatcommond.h" #include #include @@ -51,6 +52,9 @@ TextEdit::TextEdit(QWidget *parent) : DPlainTextEdit(parent), m_wrapper(nullptr) { + // 更新单独添加的高亮格式文件 + m_repository.addCustomSearchPath(KF5_HIGHLIGHT_PATH); + setUndoRedoEnabled(false); //撤销重做栈 m_pUndoStack = new QUndoStack(); @@ -108,10 +112,20 @@ TextEdit::TextEdit(QWidget *parent) connect(m_pUndoStack, &QUndoStack::canUndoChanged, this, &TextEdit::slotCanUndoChanged); QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.systemBus().connect("com.deepin.daemon.Gesture", - "/com/deepin/daemon/Gesture", "com.deepin.daemon.Gesture", - "Event", - this, SLOT(fingerZoom(QString, QString, int))); + switch (Utils::getSystemVersion()) { + case Utils::V23: + dbus.systemBus().connect("org.deepin.dde.Gesture1", + "/org/deepin/dde/Gesture1", "org.deepin.dde.Gesture1", + "Event", + this, SLOT(fingerZoom(QString, QString, int))); + break; + default: + dbus.systemBus().connect("com.deepin.daemon.Gesture", + "/com/deepin/daemon/Gesture", "com.deepin.daemon.Gesture", + "Event", + this, SLOT(fingerZoom(QString, QString, int))); + break; + } //初始化右键菜单 initRightClickedMenu(); @@ -744,7 +758,7 @@ void TextEdit::forwardPair() setTextCursor(removeSelectionCursor); // Start search. - if (find(QRegExp("[\"'>)}]"))) { + if (find(QRegExp("[\]>)}]"))) { int findPos = textCursor().position(); QTextCursor cursor = textCursor(); @@ -778,7 +792,7 @@ void TextEdit::backwardPair() QTextDocument::FindFlags options; options |= QTextDocument::FindBackward; - if (find(QRegExp("[\"'<({]"), options)) { + if (find(QRegExp("[\[<({]"), options)) { QTextCursor cursor = textCursor(); auto moveMode = m_cursorMark ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor; @@ -837,7 +851,7 @@ void TextEdit::moveToEnd() } else { moveCursorNoBlink(QTextCursor::End); } - + // 移动展示区域,手动高亮文本 m_wrapper->OnUpdateHighlighter(); } @@ -868,48 +882,31 @@ void TextEdit::moveToLineIndentation() { // Init cursor and move type. QTextCursor cursor = textCursor(); - auto moveMode = m_cursorMark ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor; - // Get line start position. - cursor.movePosition(QTextCursor::StartOfBlock, moveMode); + cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor); int startColumn = cursor.columnNumber(); - // Get line end position. - cursor.movePosition(QTextCursor::EndOfBlock, moveMode); + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::MoveAnchor); int endColumn = cursor.columnNumber(); - - // Move to line start first. - cursor.movePosition(QTextCursor::StartOfBlock, moveMode); - int nStartPos = cursor.position(); - - if (nStartPos - 1 < 0) { - nStartPos = 0; - //cursor.setPosition(nStartPos, QTextCursor::MoveAnchor); - cursor.setPosition(nStartPos + 1, moveMode); - } else { - cursor.setPosition(nStartPos - 1, moveMode); - cursor.setPosition(nStartPos, QTextCursor::KeepAnchor); - } - - //cursor.movePosition(QTextCursor::PreviousCharacter,QTextCursor::KeepAnchor); - // Move to first non-blank char of line. + // Move the cursor to line start first while keep the anchor to end of block. + cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor); int column = startColumn; - while (column < endColumn) { + while (column < endColumn) + { QChar currentChar = *cursor.selection().toPlainText().data(); - //QChar currentChar = toPlainText().at(std::max(cursor.position() - 1, 0)); - - if (!currentChar.isSpace()) { - //cursor.setPosition(cursor.position(), QTextCursor::MoveAnchor); - cursor.setPosition(cursor.position() - 1, moveMode); + if (!currentChar.isSpace()) + { + //stop and reset anchor while be at row indentation. + cursor.setPosition(cursor.position(), QTextCursor::MoveAnchor); break; - } else { - //cursor.setPosition(cursor.position(), QTextCursor::MoveAnchor); - cursor.setPosition(cursor.position() + 1, moveMode); } - + else + { + //while including 'space',just move ahead. + cursor.setPosition(cursor.position() + 1, QTextCursor::KeepAnchor); + } column++; } - cursor.clearSelection(); setTextCursor(cursor); } @@ -1194,6 +1191,11 @@ void TextEdit::duplicateLine() void TextEdit::copyLines() { + // 添加权限判断是否允许拷贝,剪切;防止后续可能调用接口,冗余处理 + if (!Utils::enableClipCopy(getFilePath())) { + return; + } + // Record current cursor and build copy cursor. QTextCursor currentCursor = textCursor(); QTextCursor copyCursor = textCursor(); @@ -1230,7 +1232,7 @@ void TextEdit::copyLines() // Copy lines to system clipboard. setTextCursor(copyCursor); - copySelectedText(); + copySelectedText(true); // Reset cursor before copy lines. copyCursor.setPosition(currentCursor.position(), QTextCursor::MoveAnchor); @@ -1239,12 +1241,17 @@ void TextEdit::copyLines() void TextEdit::cutlines() { - if (m_isSelectAll) { + // 添加权限判断是否允许拷贝,剪切;防止后续可能调用接口,冗余处理 + if (!Utils::enableClipCopy(getFilePath())) { + return; + } + + if(m_isSelectAll) { QPlainTextEdit::selectAll(); } if (textCursor().hasSelection() || m_bIsAltMod) { - this->cut(); + this->cut(true); popupNotify(tr("Selected line(s) clipped")); } else { auto cursor = textCursor(); @@ -1310,7 +1317,7 @@ void TextEdit::killLine() } if (!cursor.selectedText().isEmpty()) { - DeleteBackCommond *com = new DeleteBackCommond(cursor, this); + DeleteBackCommand *com = new DeleteBackCommand(cursor, this); m_pUndoStack->push(com); } } @@ -1334,7 +1341,7 @@ void TextEdit::killCurrentLine() cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); } if (!cursor.selectedText().isEmpty()) { - DeleteBackCommond *com = new DeleteBackCommond(cursor, this); + DeleteBackCommand *com = new DeleteBackCommand(cursor, this); m_pUndoStack->push(com); } } @@ -1390,7 +1397,7 @@ void TextEdit::indentText() int line2 = cursor.blockNumber(); //do the indent operation - auto com = new IndentTextCommond(this, pos1, pos2, line1, line2); + auto com = new IndentTextCommand(this, pos1, pos2, line1, line2); m_pUndoStack->push(com); } } @@ -1404,7 +1411,7 @@ void TextEdit::unindentText() //the text in front of current line is '\t'. if ("\t" == cursor.selectedText()) { - DeleteBackCommond *com = new DeleteBackCommond(cursor, this); + DeleteBackCommand *com = new DeleteBackCommand(cursor, this); m_pUndoStack->push(com); } //the text in front of current line is ' '. @@ -1418,7 +1425,7 @@ void TextEdit::unindentText() } cursor.setPosition(startpos); cursor.setPosition(pos, QTextCursor::KeepAnchor); - DeleteBackCommond *com = new DeleteBackCommond(cursor, this); + DeleteBackCommand *com = new DeleteBackCommand(cursor, this); m_pUndoStack->push(com); } @@ -1549,8 +1556,8 @@ void TextEdit::convertWordCase(ConvertCase convertCase) // 如果没有实际文本更改效果,不进行文本替换操作 if (text != textCursor().selectedText()) { - InsertTextUndoCommand *insertCommond = new InsertTextUndoCommand(textCursor(), text, this); - m_pUndoStack->push(insertCommond); + InsertTextUndoCommand *insertCommand = new InsertTextUndoCommand(textCursor(), text, this); + m_pUndoStack->push(insertCommand); } } else { QTextCursor cursor; @@ -1574,8 +1581,8 @@ void TextEdit::convertWordCase(ConvertCase convertCase) text = capitalizeText(text); } - InsertTextUndoCommand *insertCommond = new InsertTextUndoCommand(cursor, text, this); - m_pUndoStack->push(insertCommond); + InsertTextUndoCommand *insertCommand = new InsertTextUndoCommand(cursor, text, this); + m_pUndoStack->push(insertCommand); setTextCursor(cursor); @@ -1648,7 +1655,7 @@ void TextEdit::setFontFamily(QString name) updateLeftAreaWidget(); } -void TextEdit::setFontSize(int size) +void TextEdit::setFontSize(qreal size) { // Update font. m_fontSize = size; @@ -1662,7 +1669,7 @@ void TextEdit::updateFont() { QFont font = document()->defaultFont(); font.setFixedPitch(true); - font.setPointSize(m_fontSize); + font.setPointSizeF(m_fontSize); font.setFamily(m_fontName); setFont(font); setTabStopWidth(m_tabSpaceNumber * QFontMetrics(font).width(QChar(0x2192))); @@ -1672,7 +1679,7 @@ void TextEdit::updateFont() } } -void TextEdit::replaceAll(const QString &replaceText, const QString &withText) +void TextEdit::replaceAll(const QString &replaceText, const QString &withText, Qt::CaseSensitivity caseFlag) { if (m_readOnlyMode || m_bReadOnlyPermission) { return; @@ -1687,8 +1694,6 @@ void TextEdit::replaceAll(const QString &replaceText, const QString &withText) return; } - QTextDocument::FindFlags flags; - flags &= QTextDocument::FindCaseSensitively; QTextCursor cursor = textCursor(); cursor.movePosition(QTextCursor::Start); QTextCursor startCursor = textCursor(); @@ -1699,20 +1704,20 @@ void TextEdit::replaceAll(const QString &replaceText, const QString &withText) QList backupMarkList = convertMarkToReplace(m_markOperations); auto replaceList = backupMarkList; // 计算替换颜色标记信息 - calcMarkReplaceList(replaceList, oldText, replaceText, withText); + calcMarkReplaceList(replaceList, oldText, replaceText, withText, 0, caseFlag); QString newText = oldText; - newText.replace(replaceText, withText); + newText.replace(replaceText, withText, caseFlag); if (oldText != newText) { ChangeMarkCommand *pChangeMark = new ChangeMarkCommand(this, backupMarkList, replaceList); // 设置替换撤销项为颜色标记变更撤销项的子项 - new ReplaceAllCommond(oldText, newText, cursor, pChangeMark); + new ReplaceAllCommand(oldText, newText, cursor, pChangeMark); m_pUndoStack->push(pChangeMark); } } -void TextEdit::replaceNext(const QString &replaceText, const QString &withText) +void TextEdit::replaceNext(const QString &replaceText, const QString &withText, Qt::CaseSensitivity caseFlag) { if (m_readOnlyMode || m_bReadOnlyPermission) { return; @@ -1751,7 +1756,7 @@ void TextEdit::replaceNext(const QString &replaceText, const QString &withText) // 获取替换文本区域和颜色标记区域的交叉关系 Utils::RegionIntersectType type = Utils::checkRegionIntersect( - cursor.selectionStart(), cursor.selectionStart() + replaceText.size(), info.start, info.end); + cursor.selectionStart(), cursor.selectionStart() + replaceText.size(), info.start, info.end); // 仅进行单次处理 switch (type) { case Utils::ELeft: @@ -1792,7 +1797,7 @@ void TextEdit::replaceNext(const QString &replaceText, const QString &withText) } QString strSelection(cursor.selectedText()); - if (!strSelection.compare(replaceText) || replaceText.contains("\n")) { + if (!strSelection.compare(replaceText, caseFlag) || replaceText.contains("\n")) { ChangeMarkCommand *pChangeMark = new ChangeMarkCommand(this, backupMarkList, replaceList); // 设置插入撤销项为颜色标记变更撤销项的子项 new InsertTextUndoCommand(cursor, withText, this, pChangeMark); @@ -1802,10 +1807,10 @@ void TextEdit::replaceNext(const QString &replaceText, const QString &withText) // Update cursor. setTextCursor(cursor); - highlightKeyword(replaceText, getPosition()); + highlightKeyword(replaceText, getPosition(), caseFlag); } -void TextEdit::replaceRest(const QString &replaceText, const QString &withText) +void TextEdit::replaceRest(const QString &replaceText, const QString &withText, Qt::CaseSensitivity caseFlag) { if (m_readOnlyMode || m_bReadOnlyPermission) { return; @@ -1821,9 +1826,6 @@ void TextEdit::replaceRest(const QString &replaceText, const QString &withText) return; } - QTextDocument::FindFlags flags; - flags &= QTextDocument::FindCaseSensitively; - QTextCursor cursor = textCursor(); QTextCursor startCursor = textCursor(); startCursor.beginEditBlock(); @@ -1837,15 +1839,15 @@ void TextEdit::replaceRest(const QString &replaceText, const QString &withText) QList backupMarkList = convertMarkToReplace(m_markOperations); auto replaceList = backupMarkList; // 计算替换颜色标记信息 - calcMarkReplaceList(replaceList, right, replaceText, withText, pos); + calcMarkReplaceList(replaceList, right, replaceText, withText, pos, caseFlag); - right.replace(replaceText, withText); + right.replace(replaceText, withText, caseFlag); newText += right; if (oldText != newText) { ChangeMarkCommand *pChangeMark = new ChangeMarkCommand(this, backupMarkList, replaceList); // 设置替换撤销项为颜色标记变更撤销项的子项 - new ReplaceAllCommond(oldText, newText, cursor, pChangeMark); + new ReplaceAllCommand(oldText, newText, cursor, pChangeMark); m_pUndoStack->push(pChangeMark); } @@ -1853,10 +1855,10 @@ void TextEdit::replaceRest(const QString &replaceText, const QString &withText) setTextCursor(startCursor); } -void TextEdit::beforeReplace(const QString &strReplaceText) +void TextEdit::beforeReplace(const QString &strReplaceText, Qt::CaseSensitivity caseFlag) { if (strReplaceText.isEmpty() || !m_findHighlightSelection.cursor.hasSelection()) { - highlightKeyword(strReplaceText, getPosition()); + highlightKeyword(strReplaceText, getPosition(), caseFlag); } } @@ -1872,8 +1874,9 @@ bool TextEdit::findKeywordForward(const QString &keyword) //setTextCursor(cursor); QTextDocument::FindFlags options; - options &= QTextDocument::FindCaseSensitively; - + if (Qt::CaseSensitive == defaultCaseSensitive) { + options |= QTextDocument::FindCaseSensitively; + } bool foundOne = find(keyword, options); cursor.setPosition(endPos, QTextCursor::MoveAnchor); @@ -1889,8 +1892,9 @@ bool TextEdit::findKeywordForward(const QString &keyword) //setTextCursor(cursor); QTextDocument::FindFlags options; - options &= QTextDocument::FindCaseSensitively; - + if (Qt::CaseSensitive == defaultCaseSensitive) { + options |= QTextDocument::FindCaseSensitively; + } bool foundOne = find(keyword, options); //setTextCursor(recordCursor); @@ -1913,22 +1917,22 @@ void TextEdit::removeKeywords() //setFocus(); } -bool TextEdit::highlightKeyword(QString keyword, int position) +bool TextEdit::highlightKeyword(const QString &keyword, int position, Qt::CaseSensitivity caseFlag) { Q_UNUSED(position) m_findMatchSelections.clear(); updateHighlightLineSelection(); updateCursorKeywordSelection(keyword, true); - bool bRet = updateKeywordSelectionsInView(keyword, m_findMatchFormat, &m_findMatchSelections); + bool bRet = updateKeywordSelectionsInView(keyword, m_findMatchFormat, &m_findMatchSelections, caseFlag); renderAllSelections(); return bRet; } -bool TextEdit::highlightKeywordInView(QString keyword) +bool TextEdit::highlightKeywordInView(const QString &keyword, Qt::CaseSensitivity caseFlag) { m_findMatchSelections.clear(); - bool bRet = updateKeywordSelectionsInView(keyword, m_findMatchFormat, &m_findMatchSelections); + bool bRet = updateKeywordSelectionsInView(keyword, m_findMatchFormat, &m_findMatchSelections, caseFlag); // 直接设置 setExtraSelections 会导致无法显示颜色标记,调用 renderAllSelections 进行显示更新 // setExtraSelections(m_findMatchSelections); renderAllSelections(); @@ -1981,7 +1985,9 @@ bool TextEdit::updateKeywordSelections(QString keyword, QTextCharFormat charForm if (!keyword.isEmpty()) { QTextCursor cursor(document()); QTextDocument::FindFlags flags; - //flags &= QTextDocument::FindCaseSensitively; + if (Qt::CaseSensitive == defaultCaseSensitive) { + flags |= QTextDocument::FindCaseSensitively; + } QTextEdit::ExtraSelection extra; extra.format = charFormat; cursor = document()->find(keyword, cursor, flags); @@ -2002,7 +2008,8 @@ bool TextEdit::updateKeywordSelections(QString keyword, QTextCharFormat charForm return false; } -bool TextEdit::updateKeywordSelectionsInView(QString keyword, QTextCharFormat charFormat, QList *listSelection) +bool TextEdit::updateKeywordSelectionsInView(QString keyword, QTextCharFormat charFormat, + QList *listSelection, Qt::CaseSensitivity caseFlag) { // Clear keyword selections first. listSelection->clear(); @@ -2027,18 +2034,46 @@ bool TextEdit::updateKeywordSelectionsInView(QString keyword, QTextCharFormat ch } int endPos = endBlock.position() + endBlock.length() - 1; - cursor = document()->find(keyword, beginPos); + // 内部计算时,均视为 \n 结尾 + QLatin1Char endLine('\n'); + QString multiLineText; + QTextDocument::FindFlags flags; + if (Qt::CaseSensitive == caseFlag) { + flags |= QTextDocument::FindCaseSensitively; + } + if (keyword.contains(endLine)) { + auto temp = this->textCursor(); + temp.setPosition(beginPos); + while (temp.position() < endPos) { + temp.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + multiLineText += temp.selectedText(); + multiLineText += endLine; + temp.setPosition(temp.position() + 1); + } + cursor = findCursor(keyword, multiLineText, 0, false, beginPos, caseFlag); + } else { + cursor = document()->find(keyword, beginPos, flags); + } + if (cursor.isNull()) { return false; } while (!cursor.isNull()) { extra.cursor = cursor; + // 调整为不区分大小写 + Qt::CaseSensitivity option = defaultCaseSensitive; /* 查找字符时,查找到完全相等的时候才高亮,如查找小写f时,大写的F不高亮 */ - if (!extra.cursor.selectedText().compare(keyword)) { + if (!extra.cursor.selectedText().compare(keyword, option) || keyword.contains(endLine, option)) { listSelection->append(extra); } - cursor = document()->find(keyword, cursor); + + if (keyword.contains(endLine)) { + int pos = std::max(extra.cursor.position(), extra.cursor.anchor()); + cursor = findCursor(keyword, multiLineText, pos - beginPos, false, beginPos, caseFlag); + } else { + cursor = document()->find(keyword, cursor, flags); + } if (cursor.position() > endPos) { break; @@ -2061,10 +2096,15 @@ bool TextEdit::searchKeywordSeletion(QString keyword, QTextCursor cursor, bool f int offsetLines = 3; if (findNext) { - QTextCursor next = document()->find(keyword, cursor,QTextDocument::FindCaseSensitively); - if(keyword.contains("\n")){ - int pos = std::max(cursor.position(),cursor.anchor()); - next = findCursor(keyword,this->toPlainText(),pos); + QTextDocument::FindFlags options; + if (Qt::CaseSensitive == defaultCaseSensitive) { + options |= QTextDocument::FindCaseSensitively; + } + + QTextCursor next = document()->find(keyword, cursor, options); + if (keyword.contains("\n")) { + int pos = std::max(cursor.position(), cursor.anchor()); + next = findCursor(keyword, this->toPlainText(), pos, false, 0, defaultCaseSensitive); } if (!next.isNull()) { m_findHighlightSelection.cursor = next; @@ -2073,10 +2113,15 @@ bool TextEdit::searchKeywordSeletion(QString keyword, QTextCursor cursor, bool f ret = true; } } else { - QTextCursor prev = document()->find(keyword, cursor, QTextDocument::FindBackward | QTextDocument::FindCaseSensitively); - if(keyword.contains("\n")){ - int pos = std::min(cursor.position(),cursor.anchor()); - prev = findCursor(keyword,this->toPlainText().mid(0,pos),-1,true); + QTextDocument::FindFlags options = QTextDocument::FindBackward; + if (Qt::CaseSensitive == defaultCaseSensitive) { + options |= QTextDocument::FindCaseSensitively; + } + + QTextCursor prev = document()->find(keyword, cursor, options); + if (keyword.contains("\n")) { + int pos = std::min(cursor.position(), cursor.anchor()); + prev = findCursor(keyword, this->toPlainText().mid(0, pos), -1, true, defaultCaseSensitive); } if (!prev.isNull()) { m_findHighlightSelection.cursor = prev; @@ -2216,6 +2261,7 @@ void TextEdit::lineNumberAreaPaintEvent(QPaintEvent *event) nPageLine = blockCount() - 1; } + auto currentCursor = this->textCursor(); cur = textCursor(); for (int i = nStartLine; i <= nPageLine; i++) { if (i + 1 == m_markStartLine) { @@ -2237,6 +2283,9 @@ void TextEdit::lineNumberAreaPaintEvent(QPaintEvent *event) if ("bo_CN" == Utils::getSystemLan()) { offset = 2; } + if (cur.blockNumber() == currentCursor.blockNumber()) { + painter.setPen(qApp->palette().highlight().color()); + } painter.drawText(0, cursorRect(cur).y() + offset, m_pLeftAreaWidget->m_pLineNumberArea->width(), cursorRect(cur).height(), Qt::AlignVCenter | Qt::AlignHCenter, QString::number(block.blockNumber() + 1)); @@ -2486,8 +2535,17 @@ void TextEdit::cursorPositionChanged() m_pLeftAreaWidget->m_pFlodArea->update(); } -void TextEdit::cut() +/** + * @brief 剪切光标选中的文本 + * @param ignoreCheck 是否忽略权限判断(外部已进行),默认false + */ +void TextEdit::cut(bool ignoreCheck) { + // 添加权限判断是否允许拷贝,剪切;防止后续可能调用接口,冗余处理 + if (!ignoreCheck && !Utils::enableClipCopy(getFilePath())) { + return; + } + if (m_isSelectAll) QPlainTextEdit::selectAll(); @@ -2501,12 +2559,9 @@ void TextEdit::cut() data += "\n"; } //删除有选择 - for (int i = 0; i < m_altModSelections.size(); i++) { - if (m_altModSelections[i].cursor.hasSelection()) { - QUndoCommand *pDeleteStack = new DeleteTextUndoCommand(m_altModSelections[i].cursor, this); + QUndoCommand *pDeleteStack = new DeleteTextUndoCommand(m_altModSelections, this); m_pUndoStack->push(pDeleteStack); - } - } + //设置到剪切板 QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 clipboard->setText(data); @@ -2514,7 +2569,7 @@ void TextEdit::cut() QTextCursor cursor = textCursor(); //有选择内容才剪切 if (cursor.hasSelection()) { - QString data = this->selectedText(); + QString data = this->selectedText(true); QUndoCommand *pDeleteStack = new DeleteTextUndoCommand(cursor, this); m_pUndoStack->push(pDeleteStack); QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 @@ -2524,8 +2579,17 @@ void TextEdit::cut() unsetMark(); } -void TextEdit::copy() +/** + * @brief 拷贝光标选中的文本 + * @param ignoreCheck 是否忽略权限判断(外部已进行),默认false + */ +void TextEdit::copy(bool ignoreCheck) { + // 添加权限判断是否允许拷贝,剪切;防止后续可能调用接口,冗余处理 + if (!ignoreCheck && !Utils::enableClipCopy(getFilePath())) { + return; + } + if (m_bIsAltMod && !m_altModSelections.isEmpty()) { QString data; for (auto it = m_altModSelections.begin(); it != m_altModSelections.end(); it++) { @@ -2542,7 +2606,7 @@ void TextEdit::copy() QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 if (textCursor().hasSelection()) { //clipboard->setText(textCursor().selection().toPlainText()); - clipboard->setText(this->selectedText()); + clipboard->setText(this->selectedText(true)); tryUnsetMark(); } else { clipboard->setText(m_highlightWordCacheCursor.selectedText()); @@ -2590,7 +2654,7 @@ void TextEdit::paste() int block = 1 * 1024 * 1024; int size = text.size(); if (size > block) { - InsertBlockByTextCommond *commond = new InsertBlockByTextCommond(text, this, m_wrapper); + InsertBlockByTextCommand *commond = new InsertBlockByTextCommand(text, this, m_wrapper); m_pUndoStack->push(commond); } else { QTextCursor cursor = textCursor(); @@ -2666,10 +2730,15 @@ void TextEdit::slotCutAction(bool checked) void TextEdit::slotCopyAction(bool checked) { Q_UNUSED(checked); + if (isAbleOperation(OperationType::CopyOperation)) { copy(); } else { +#ifdef DTKWIDGET_CLASS_DSizeMode + Utils::sendFloatMessageFixedFont(this, QIcon(":/images/warning.svg"), tr("Copy failed: not enough memory")); +#else DMessageManager::instance()->sendMessage(this, QIcon(":/images/warning.svg"), tr("Copy failed: not enough memory")); +#endif } } @@ -2679,7 +2748,11 @@ void TextEdit::slotPasteAction(bool checked) if (isAbleOperation(OperationType::PasteOperation)) { paste(); } else { +#ifdef DTKWIDGET_CLASS_DSizeMode + Utils::sendFloatMessageFixedFont(this, QIcon(":/images/warning.svg"), tr("Paste failed: not enough memory")); +#else DMessageManager::instance()->sendMessage(this, QIcon(":/images/warning.svg"), tr("Paste failed: not enough memory")); +#endif } } @@ -2753,7 +2826,11 @@ void TextEdit::slotdictationAction(bool checked) void TextEdit::slotColumnEditAction(bool checked) { Q_UNUSED(checked); +#ifdef DTKWIDGET_CLASS_DSizeMode + Utils::sendFloatMessageFixedFont(this, QIcon(":/images/ok.svg"), tr("Press ALT and click lines to edit in column mode")); +#else DMessageManager::instance()->sendMessage(this, QIcon(":/images/ok.svg"), tr("Press ALT and click lines to edit in column mode")); +#endif } void TextEdit::slotPreBookMarkAction(bool checked) @@ -2891,11 +2968,11 @@ void TextEdit::moveText(int from, int to, const QString &text, bool copy) // 拷贝模式下无需删除文本 if (!copy) { cursor.setPosition(from + text.size(), QTextCursor::KeepAnchor); - delCommand = new DeleteBackCommond(cursor, this); + delCommand = new DeleteBackCommand(cursor, this); } cursor.setPosition(to); - auto insertCommand = new InsertTextUndoCommand(cursor, text, this); + auto insertCommand = new DragInsertTextUndoCommand(cursor, text, this); //the positon of 'from' is on the left of the position of 'to', //therefore,firstly do the insert operation. @@ -2923,31 +3000,79 @@ void TextEdit::moveText(int from, int to, const QString &text, bool copy) * cursorPos: text起始位置在全文本中的位置 * @return */ -QTextCursor TextEdit::findCursor(const QString &substr, const QString &text, int from, bool backward, int cursorPos) +QTextCursor TextEdit::findCursor(const QString &substr, const QString &text, int from, bool backward, + int cursorPos, Qt::CaseSensitivity caseFlag) { + // 处理换行符为 \r\n (光标计算时被视为单个字符)的情况,移除多计算的字符数 + // text 均为 \n 结尾 + QString findSubStr = substr; + if (BottomBar::Windows == m_wrapper->bottomBar()->getEndlineFormat()) { + findSubStr.replace("\r\n", "\n"); + } + int index = -1; if (backward) { - index = text.lastIndexOf(substr, from); + index = text.lastIndexOf(findSubStr, from, caseFlag); } else { - index = text.indexOf(substr, from); + index = text.indexOf(findSubStr, from, caseFlag); } if (-1 != index) { auto cursor = this->textCursor(); cursor.setPosition(index + cursorPos); - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, substr.size()); + cursor.setPosition(cursor.position() + findSubStr.size(), QTextCursor::KeepAnchor); return cursor; } else { return QTextCursor(); } } +/** + * @brief 点击行号处理:选中当前行,光标置于下一行行首 + @param point 当前鼠标点击的位置 + @note 在 "bo_CN" 语言环境下,光标向上偏移2像素进行比较。 + */ +void TextEdit::onPressedLineNumber(const QPoint &point) +{ + // 在执行大文件加载过程中,由于 cursorForPosition() 计算耗时,不响应点击处理 + if (TextEdit::FileOpenBegin == m_LeftAreaUpdateState) { + return; + } + + if (point.x() < 0 || point.x() > m_pLeftAreaWidget->m_pLineNumberArea->width()) { + return; + } + + int offset = 0; + //the language currently set by the system is Tibetan. + if ("bo_CN" == Utils::getSystemLan()) { + offset = 2; + } + + QPoint checkPoint(point.x(), qMax(0, point.y() - offset)); + QTextBlock possibleBlock = cursorForPosition(checkPoint).block(); + + if (possibleBlock.isValid()) { + QTextCursor cursor = textCursor(); + cursor.setPosition(possibleBlock.position(), QTextCursor::MoveAnchor); + + // 尾行光标不调整到下一行 + if (possibleBlock == document()->lastBlock()) { + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + } else { + cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor); + } + + setTextCursor(cursor); + } +} + /** * @return 返回当前光标选中的内容 * @note 如果从编辑器获得的选中文本跨越换行符,则文本将包含 Unicode U+2029 段落分隔符而不是换行符 \n 字符。 * 可使用 QString::replace() 将这些字符替换为换行符,为避免文本原有 Unicode U+2029 分割符影响, * 手动调整换行符插入位置。 */ -QString TextEdit::selectedText() +QString TextEdit::selectedText(bool checkCRLF) { auto cursor = this->textCursor(); auto temp = cursor; @@ -2970,10 +3095,16 @@ QString TextEdit::selectedText() text += cursor.selectedText(); cursor.setPosition(cursor.position() + 1); + // 不同风格使用不同换行符,默认不替换,仅在剪贴板、保存文件等时设置 + QString endLine = "\n"; + if (checkCRLF && BottomBar::Windows == m_wrapper->bottomBar()->getEndlineFormat()) { + endLine = "\r\n"; + } + // 获取中间完整文本块内容 while ((cursor.position() + cursor.block().length()) < endpos) { cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); - text += "\n"; + text += endLine; text += cursor.selectedText(); cursor.setPosition(cursor.position() + 1); } @@ -2982,20 +3113,48 @@ QString TextEdit::selectedText() if (cursor.position() < endpos) { // 判断是否尾部文本块达到当前文本块末尾,到达末尾需要将 U+2029 替换为 \n bool needAdjustNewline = bool(cursor.position() + cursor.block().length() == endpos); - - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, endpos - cursor.position()); - text += "\n"; + cursor.setPosition(endpos, QTextCursor::KeepAnchor); + text += endLine; text += cursor.selectedText(); - if (needAdjustNewline - && text.endsWith("\u2029")) { - text.back() = QChar('\n'); + if (needAdjustNewline && text.endsWith("\u2029")) { + text.replace("\u2029", endLine); } } return text; } +/** + * @brief 行尾符号改变后处理函数; + * 1.这里并没有做"\n"和"\r\n"之间的替换,实际的替换动作在保存的时候才发生; + * @param + * @return + */ + +void TextEdit::onEndlineFormatChanged(BottomBar::EndlineFormat from, BottomBar::EndlineFormat to) +{ + //auto endlineCom = new EndlineFormartCommand(this,m_wrapper->bottomBar(),from,to); + //m_pUndoStack->push(endlineCom); + m_wrapper->bottomBar()->setEndlineMenuText(to); +} + +/** + * @brief 系统调色板更新时重绘部分组件,例如:列选取项 + */ +void TextEdit::onAppPaletteChanged() +{ + // 判断是否处于列选取状态 + if (m_bIsAltMod && !m_altModSelections.isEmpty()) { + QColor highlightBackground = DGuiApplicationHelper::instance()->applicationPalette().color(QPalette::Highlight); + for (auto &selection : m_altModSelections) { + selection.format.setBackground(highlightBackground); + } + // 更新高亮状态 + renderAllSelections(); + } +} + void TextEdit::updateHighlightBrackets(const QChar &openChar, const QChar &closeChar) { QTextDocument *doc = document(); @@ -3122,6 +3281,11 @@ void TextEdit::setLeftAreaUpdateState(TextEdit::UpdateOperationType statevalue) { if (statevalue != m_LeftAreaUpdateState) { m_LeftAreaUpdateState = statevalue; + + // 当文件读取完成时,手动触发更新界面 + if (TextEdit::FileOpenEnd == m_LeftAreaUpdateState) { + m_pLeftAreaWidget->updateAll(); + } } } @@ -3170,8 +3334,18 @@ bool TextEdit::getNeedControlLine(int line, bool isVisable) bool TextEdit::event(QEvent *event) { - if (event->type() == QEvent::Gesture) - gestureEvent(static_cast(event)); + switch (event->type()) { + case QEvent::Gesture: + gestureEvent(static_cast(event)); + break; + case QEvent::PaletteChange: + // 调色板更新时更新选取高亮颜色 + onAppPaletteChanged(); + break; + default: + break; + } + return DPlainTextEdit::event(event); } @@ -3412,9 +3586,17 @@ void TextEdit::setSettings(Settings *keySettings) m_settings = keySettings; } - -void TextEdit::copySelectedText() +/** + * @brief 拷贝选中的文本 + * @param ignoreCheck 是否忽略权限判断(外部已进行),默认false + */ +void TextEdit::copySelectedText(bool ignoreCheck) { + // 添加权限判断是否允许拷贝,剪切;防止后续可能调用接口,冗余处理 + if (!ignoreCheck && !Utils::enableClipCopy(getFilePath())) { + return; + } + if (m_bIsAltMod && !m_altModSelections.isEmpty()) { QString data; for (auto sel : m_altModSelections) { @@ -3434,8 +3616,17 @@ void TextEdit::copySelectedText() tryUnsetMark(); } -void TextEdit::cutSelectedText() +/** + * @brief 剪切选中的文本 + * @param ignoreCheck 是否忽略权限判断(外部已进行),默认false + */ +void TextEdit::cutSelectedText(bool ignoreCheck) { + // 添加权限判断是否允许拷贝,剪切;防止后续可能调用接口,冗余处理 + if (!ignoreCheck && !Utils::enableClipCopy(getFilePath())) { + return; + } + QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(textCursor().selection().toPlainText()); @@ -3457,7 +3648,6 @@ void TextEdit::setMark() { bool currentMark = m_cursorMark; bool markCursorChanged = false; - if (m_cursorMark) { if (textCursor().hasSelection()) { markCursorChanged = true; @@ -4166,7 +4356,7 @@ void TextEdit::getHideRowContent(int iLine) int curIndex = 0; //遍历最后右括弧文本块 设置块隐藏或显示,显示文本块不超过1000 while (beginBlock.isValid() - && (curIndex++ < s_MaxDisplayBlockCount)) { + && (curIndex++ < s_MaxDisplayBlockCount)) { m_foldCodeShow->appendText(beginBlock.text(), width()); beginBlock = beginBlock.next(); } @@ -4288,7 +4478,9 @@ int TextEdit::lineNumberAreaWidth() max /= 10; ++digits; } - int w = fontMetrics().horizontalAdvance(QLatin1Char('9')) * digits; + // 行号使用单独字体 + QFontMetrics fm(m_fontLineNumberArea); + int w = fm.horizontalAdvance(QLatin1Char('9')) * digits; return w > 15 ? w : 15; } @@ -4933,8 +5125,8 @@ void TextEdit::manualUpdateAllMark(const QList > &m bool isMultiLine = startBlock < endBlock; while (startBlock.isValid() - && endBlock.isValid() - && !(endBlock < startBlock)) { + && endBlock.isValid() + && !(endBlock < startBlock)) { QTextEdit::ExtraSelection selection; selection.format.setBackground(QColor(info.first.color)); selection.cursor = info.first.cursor; @@ -4972,11 +5164,11 @@ void TextEdit::manualUpdateAllMark(const QList > &m // 对修改后的颜色标记进行排序 std::sort(m_markOperations.begin(), m_markOperations.end(), - [](const QPair &a, const QPair &b){ + [](const QPair &a, const QPair &b) { return a.second < b.second; }); std::sort(m_wordMarkSelections.begin(), m_wordMarkSelections.end(), - [](const QPair &a, const QPair &b){ + [](const QPair &a, const QPair &b) { return a.second < b.second; }); @@ -4993,7 +5185,8 @@ void TextEdit::manualUpdateAllMark(const QList > &m * @param replaceText 替换的文本 * @return 查找到和颜色标记位置有交叉的文本位置索引区间 */ -static QPair findMatchRange(const QList &posList, int markStart, int markEnd, const QString &replaceText) { +static QPair findMatchRange(const QList &posList, int markStart, int markEnd, const QString &replaceText) +{ // 判断颜色标记 info 范围内是否包含替换文本索引信息 QPair foundPosRange {-1, -1}; if (posList.isEmpty()) { @@ -5047,8 +5240,7 @@ static void updateMarkReplaceRange(const QList &foundPosList, TextEdit::Mar // 处于颜色标记右侧,减去右侧替换文本的偏移量 info.start += (foundPosList.size() - 1) * adjustlen; info.end += (foundPosList.size() - 1) * adjustlen; - } - else { + } else { // 处于颜色标记左侧 info.start += foundPosList.size() * adjustlen; info.end += foundPosList.size() * adjustlen; @@ -5095,7 +5287,8 @@ static void updateMarkReplaceRange(const QList &foundPosList, TextEdit::Mar * @li MarkAll 全文颜色标记 * 1. 替换前后不进行特殊处理 */ -void TextEdit::calcMarkReplaceList(QList &replaceList, const QString &oldText, const QString &replaceText, const QString &withText, int offset) const +void TextEdit::calcMarkReplaceList(QList &replaceList, const QString &oldText, + const QString &replaceText, const QString &withText, int offset, Qt::CaseSensitivity caseFlag) const { // 当前替换项为空或相同,退出 if (replaceList.isEmpty() @@ -5104,7 +5297,7 @@ void TextEdit::calcMarkReplaceList(QList &replaceList } // 将传入的替换列表排序,按光标位置先后顺序进行排列 - std::sort(replaceList.begin(), replaceList.end(), [](const MarkReplaceInfo &a, const MarkReplaceInfo &b){ + std::sort(replaceList.begin(), replaceList.end(), [](const MarkReplaceInfo & a, const MarkReplaceInfo & b) { return a.start < b.start; }); @@ -5135,10 +5328,10 @@ void TextEdit::calcMarkReplaceList(QList &replaceList QList foundPosList; // 查找替换位置,遍历查找替换文本出现位置 - int findPos = oldText.indexOf(replaceText, findOffset); + int findPos = oldText.indexOf(replaceText, findOffset, caseFlag); // 需要取得左侧所有的变更相对偏移,从文本左侧开始循环遍历 while (-1 != findPos - && currentMarkIndex < replaceList.size()) { + && currentMarkIndex < replaceList.size()) { // 转换为相对全文的偏移 int realPos = findPos + offset; // 记录已查询的索引位置 @@ -5195,7 +5388,7 @@ void TextEdit::calcMarkReplaceList(QList &replaceList // 继续查找替换文本位置 findOffset = findPos + replaceText.size(); - findPos = oldText.indexOf(replaceText, findOffset); + findPos = oldText.indexOf(replaceText, findOffset, caseFlag); } // 继续处理剩余颜色标记偏移 @@ -6215,7 +6408,13 @@ void TextEdit::dropEvent(QDropEvent *event) { const QMimeData *data = event->mimeData(); - if (data->hasUrls() && data->urls().first().isLocalFile()) { + // 判断是否存在url信息,需要注意即使hasUrls()为true, urls()仍可能返回空,使用urls().first()可能越界 + QList dataUrls; + if (data->hasUrls()) { + dataUrls = data->urls(); + } + + if (!dataUrls.isEmpty() && dataUrls.first().isLocalFile()) { qobject_cast(this->window())->requestDropEvent(event); } else if (data->hasText() && !m_readOnlyMode) { //drag text in the same editor @@ -6263,7 +6462,7 @@ void TextEdit::dropEvent(QDropEvent *event) cursor.setPosition(dstpos); cursor.setPosition(dstpos + data->text().size(), QTextCursor::KeepAnchor); cursor.deleteChar(); - auto com = new InsertTextUndoCommand(cursor, data->text(), this); + auto com = new DragInsertTextUndoCommand(cursor, data->text(), this); m_pUndoStack->push(com); //operations in the source editor. @@ -6273,7 +6472,7 @@ void TextEdit::dropEvent(QDropEvent *event) auto cursor2 = another->textCursor(); cursor2.insertText(data->text()); cursor2.setPosition(cursor2.position() - data->text().size(), QTextCursor::KeepAnchor); - auto com2 = new DeleteBackCommond(cursor2, another); + auto com2 = new DeleteBackCommand(cursor2, another); another->m_pUndoStack->push(com2); } else if (!data->text().isEmpty()) { if (m_bReadOnlyPermission || m_readOnlyMode) { @@ -6286,7 +6485,7 @@ void TextEdit::dropEvent(QDropEvent *event) cursor.setPosition(dstpos); cursor.setPosition(dstpos + data->text().size(), QTextCursor::KeepAnchor); cursor.deleteChar(); - auto com = new InsertTextUndoCommand(cursor, data->text(), this); + auto com = new DragInsertTextUndoCommand(cursor, data->text(), this); m_pUndoStack->push(com); } } else { @@ -6301,57 +6500,87 @@ void TextEdit::inputMethodEvent(QInputMethodEvent *e) if (m_isSelectAll) QPlainTextEdit::selectAll(); - if (!m_readOnlyMode && !m_bReadOnlyPermission && !e->commitString().isEmpty()) { + if (m_readOnlyMode || m_bReadOnlyPermission) { + return; + } + + if (m_isPreeditBefore) { + // 每次 preedit 都是完整的字符串,所以撤销上次的 preedit + undo_(); + + // 将光标移回原位 + if (Overwrite == m_cursorMode) { + auto cursor = textCursor(); + cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::MoveAnchor, m_preeditLengthBefore); + setTextCursor(cursor); + } + } + bool isPreedit = !e->preeditString().isEmpty(); + if (isPreedit || !e->commitString().isEmpty()) { + const QString &text = isPreedit ? e->preeditString() : e->commitString(); + //列编辑添加撤销重做 if (m_bIsAltMod && !m_altModSelections.isEmpty()) { - insertColumnEditTextEx(e->commitString()); + insertColumnEditTextEx(text); } else { // 覆盖模式下输入法输入时,单独处理,模拟选中替换处理 if (Overwrite == m_cursorMode) { auto cursor = this->textCursor(); // 设置光标选中后续与当前输入法输入的文本相同长度 - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, e->commitString().size()); + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, text.size()); // 使用此光标信息插入将输入的文本替换选中的长度 - insertSelectTextEx(cursor, e->commitString()); + insertSelectTextEx(cursor, text); } else { - insertSelectTextEx(textCursor(), e->commitString()); + insertSelectTextEx(textCursor(), text); } } m_isSelectAll = false; } + + m_isPreeditBefore = isPreedit; + m_preeditLengthBefore = e->preeditString().length(); + } void TextEdit::mousePressEvent(QMouseEvent *e) { - if (m_bIsFindClose) { + if (m_bIsFindClose) + { m_bIsFindClose = false; removeKeywords(); } if (e->button() != Qt::RightButton) m_isSelectAll = false; - if (Qt::MouseEventSynthesizedByQt == e->source()) { + if (Qt::MouseEventSynthesizedByQt == e->source()) + { m_startY = e->y(); m_startX = e->x(); } - if (e->source() == Qt::MouseEventSynthesizedByQt) { + if (e->source() == Qt::MouseEventSynthesizedByQt) + { m_lastTouchBeginPos = e->pos(); - if (QScroller::hasScroller(this)) { + if (QScroller::hasScroller(this)) + { QScroller::scroller(this)->deleteLater(); } - if (m_updateEnableSelectionByMouseTimer) { + if (m_updateEnableSelectionByMouseTimer) + { m_updateEnableSelectionByMouseTimer->stop(); - } else { + } + else + { m_updateEnableSelectionByMouseTimer = new QTimer(this); m_updateEnableSelectionByMouseTimer->setSingleShot(true); static QObject *theme_settings = reinterpret_cast(qvariant_cast(qApp->property("_d_theme_settings_object"))); QVariant touchFlickBeginMoveDelay; - if (theme_settings) { + if (theme_settings) + { touchFlickBeginMoveDelay = theme_settings->property("touchFlickBeginMoveDelay"); } @@ -6362,34 +6591,41 @@ void TextEdit::mousePressEvent(QMouseEvent *e) m_updateEnableSelectionByMouseTimer->start(); } - //add for single refers to the sliding - if (e->type() == QEvent::MouseButtonPress && e->source() == Qt::MouseEventSynthesizedByQt) { + // add for single refers to the sliding + if (e->type() == QEvent::MouseButtonPress && e->source() == Qt::MouseEventSynthesizedByQt) + { m_lastMouseTimeX = e->timestamp(); m_lastMouseTimeY = e->timestamp(); m_lastMouseYpos = e->pos().y(); m_lastMouseXpos = e->pos().x(); - if (tweenY.activeY()) { + if (tweenY.activeY()) + { m_slideContinueY = true; tweenY.stopY(); } - if (tweenX.activeX()) { + if (tweenX.activeX()) + { m_slideContinueX = true; tweenX.stopX(); } } - if (e->modifiers() == Qt::AltModifier) { + if (e->modifiers() == Qt::AltModifier) + { m_bIsAltMod = true; - //鼠标点击位置为光标位置  获取光标行列位置 + // 鼠标点击位置为光标位置  获取光标行列位置 QMouseEvent *mouseEvent = static_cast(e); m_altStartTextCursor = this->cursorForPosition(mouseEvent->pos()); m_altStartTextCursor.clearSelection(); this->setTextCursor(m_altStartTextCursor); m_altModSelections.clear(); - } else { - if (e->button() != 2) { //右键,调用右键菜单时候不能清空 + } + else + { + if (e->button() != 2) + { // 右键,调用右键菜单时候不能清空 m_bIsAltMod = false; m_altModSelections.clear(); } @@ -6400,13 +6636,15 @@ void TextEdit::mousePressEvent(QMouseEvent *e) void TextEdit::mouseMoveEvent(QMouseEvent *e) { - if (Qt::MouseEventSynthesizedByQt == e->source()) { + if (Qt::MouseEventSynthesizedByQt == e->source()) + { m_endY = e->y(); m_endX = e->x(); } - //add for single refers to the sliding - if (e->type() == QEvent::MouseMove && e->source() == Qt::MouseEventSynthesizedByQt) { + // add for single refers to the sliding + if (e->type() == QEvent::MouseMove && e->source() == Qt::MouseEventSynthesizedByQt) + { const ulong diffTimeX = e->timestamp() - m_lastMouseTimeX; const ulong diffTimeY = e->timestamp() - m_lastMouseTimeY; const int diffYpos = e->pos().y() - m_lastMouseYpos; @@ -6416,7 +6654,8 @@ void TextEdit::mouseMoveEvent(QMouseEvent *e) m_lastMouseYpos = e->pos().y(); m_lastMouseXpos = e->pos().x(); - if (m_gestureAction == GA_slide) { + if (m_gestureAction == GA_slide) + { QFont font = this->font(); /*开根号时数值越大衰减比例越大*/ @@ -6437,11 +6676,12 @@ void TextEdit::mouseMoveEvent(QMouseEvent *e) m_stepSpeedX /= sqrt(font.pointSize() * 4.0); changeX = m_stepSpeedX * sqrt(abs(m_stepSpeedX)) * 100; - //return true; + // return true; } - if (m_gestureAction != GA_null) { - //return true; + if (m_gestureAction != GA_null) + { + // return true; } } @@ -6449,76 +6689,108 @@ void TextEdit::mouseMoveEvent(QMouseEvent *e) // so they need to be restored. QApplication::restoreOverrideCursor(); - if (viewport()->cursor().shape() != Qt::IBeamCursor) { + if (viewport()->cursor().shape() != Qt::IBeamCursor) + { viewport()->setCursor(Qt::IBeamCursor); } QPlainTextEdit::mouseMoveEvent(e); - - if (e->modifiers() == Qt::AltModifier && m_bIsAltMod) { + if (e->modifiers() == Qt::AltModifier && m_bIsAltMod) + { m_altModSelections.clear(); QMouseEvent *mouseEvent = static_cast(e); QPoint curPos = mouseEvent->pos(); m_altEndTextCursor = this->cursorForPosition(curPos); - - int column = m_altEndTextCursor.positionInBlock(); int row = m_altEndTextCursor.blockNumber(); - - int startColumn = m_altStartTextCursor.positionInBlock(); int startRow = m_altStartTextCursor.blockNumber(); - - int minColumn = startColumn < column ? startColumn : column; - int maxColumn = startColumn > column ? startColumn : column; int minRow = startRow < row ? startRow : row; int maxRow = startRow > row ? startRow : row; - QTextCharFormat format; QPalette palette; QColor highlightBackground = DGuiApplicationHelper::instance()->applicationPalette().color(QPalette::Highlight); format.setBackground(highlightBackground); format.setForeground(palette.highlightedText()); - - for (int iRow = minRow; iRow <= maxRow; iRow++) { - QTextBlock block = document()->findBlockByNumber(iRow); - QTextCursor cursor(block); - cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::MoveAnchor); - - QPoint blockTailPos = this->cursorRect(cursor).bottomRight(); - - //位置从0开始 - int length = block.text().length(); - - //鼠标x坐标大于当前块最后字符位置 遍历获取最大块长度 - if (curPos.x() >= blockTailPos.x() && length > maxColumn) { - maxColumn = length; - } + int judgeAncherPosX; + int judgeStartLength; + int startLineIdx; + { + QTextBlock block = document()->findBlockByNumber(startRow); + int startCurPos = m_altStartTextCursor.positionInBlock(); + QTextLine startLine = block.layout()->lineForTextPosition(startCurPos); + judgeAncherPosX = startLine.cursorToX(startCurPos); + judgeStartLength = startCurPos - startLine.textStart(); + startLineIdx = startLine.lineNumber(); + } + int judgeCursorPosX; + int judgeEndLength; + int endLineIdx; + { + QTextBlock block = document()->findBlockByNumber(row); + int endCurPos = m_altEndTextCursor.positionInBlock(); + QTextLine endLine = block.layout()->lineForTextPosition(endCurPos); + judgeCursorPosX = curPos.x(); + judgeEndLength = endCurPos - endLine.textStart(); + endLineIdx = endLine.lineNumber(); + } + bool isDown = false; + if (row > startRow) + { + isDown = true; } - - - for (int iRow = minRow; iRow <= maxRow; iRow++) { + else if (row == startRow && endLineIdx >= startLineIdx) + { + isDown = true; + } + for (int iRow = minRow; iRow <= maxRow; iRow++) + { QTextBlock block = document()->findBlockByNumber(iRow); - int length = block.text().size(); - - if (length < minColumn) continue; - - QTextEdit::ExtraSelection selection; - QTextCursor cursor = this->textCursor(); - cursor.clearSelection(); - setTextCursor(cursor); - cursor.setPosition(block.position() + minColumn, QTextCursor::MoveAnchor); - if (length < maxColumn) { - cursor.setPosition(block.position() + length, QTextCursor::KeepAnchor); - } else { - cursor.setPosition(block.position() + maxColumn, QTextCursor::KeepAnchor); + int lineAt = 0; + int lineCount = block.lineCount(); + // 对开始块和结束块的行数做判断 + if (iRow == minRow) + { + lineAt = isDown ? startLineIdx : endLineIdx; + } + if (iRow == maxRow) + { + lineCount = isDown ? endLineIdx + 1 : startLineIdx + 1; + } + for (; lineAt < lineCount; lineAt++) + { + // 引入行的判断 + QTextLine lineInBlock = block.layout()->lineAt(lineAt); + int lineLength = lineInBlock.textLength(); + if (lineLength < judgeStartLength && lineLength < judgeEndLength) + { + continue; + } + QTextCursor cursor = this->textCursor(); + cursor.clearSelection(); + setTextCursor(cursor); + int properColumn; + int blockPos = block.position(); + properColumn = lineInBlock.xToCursor(judgeAncherPosX); + cursor.setPosition(blockPos + properColumn, QTextCursor::MoveAnchor); + // 由于窗口大小小于块的最大长度的外部UI问题,这里要进行对鼠标pos进行若达到最大值无法对每行最后一个字符的覆盖的问题处理 + // 扩大了judgeCursorPosX的最大限度。 + int lineEndPosInBlock = lineInBlock.textStart() + lineInBlock.textLength(); + int lineEndPosToX = lineInBlock.cursorToX(lineEndPosInBlock); + if (lineInBlock.width() <= lineEndPosToX) + { + if (judgeCursorPosX > lineInBlock.cursorToX(lineEndPosInBlock - 1)) + { + judgeCursorPosX = lineEndPosToX; + } + } + properColumn = lineInBlock.xToCursor(judgeCursorPosX); + cursor.setPosition(blockPos + properColumn, QTextCursor::KeepAnchor); + QTextEdit::ExtraSelection selection; + selection.cursor = cursor; + selection.format = format; + m_altModSelections << selection; } - - selection.cursor = cursor; - selection.format = format; - m_altModSelections << selection; } - //清除撤销重做栈 - m_pUndoStack->clear(); renderAllSelections(); update(); } @@ -6546,27 +6818,27 @@ void TextEdit::mouseReleaseEvent(QMouseEvent *e) return; } - // 获取鼠标中键释放事件,进行中键黏贴处理 - // 此处判断从 QWidgetTextControlPrivate::mouseReleaseEvent() 摘录 - if (Qt::MidButton == e->button() - && !isReadOnly() - && QApplication::clipboard()->supportsSelection()) { - const QMimeData *md = QApplication::clipboard()->mimeData(QClipboard::Selection); - // 判断文本内容,文本编辑器为纯文本编辑,不涉及剪贴板富文本内容 - if (md && !md->text().isEmpty()) { - // 设置当前为中键黏贴状态,执行 QPlainTextEdit::mouseReleaseEvent(e) 时会触发文本变更信号。 - m_MidButtonPatse = true; + if (e->button() == Qt::MidButton) { + bool midButtonPaste = m_settings->settings->option("advance.editor.allow_midbutton_paste")->value().toBool(); + if (midButtonPaste) { + // 只读模式过滤鼠标中间黏贴 + if (m_readOnlyMode || m_bReadOnlyPermission) { + popupNotify(tr("Read-Only mode is on")); + return; + } + + slotPasteAction(); } + return; } - QPlainTextEdit::mouseReleaseEvent(e); + return QPlainTextEdit::mouseReleaseEvent(e); } void TextEdit::keyPressEvent(QKeyEvent *e) { Qt::KeyboardModifiers modifiers = e->modifiers(); QString key = Utils::getKeyshortcut(e); - //没有修改键 插入文件 //按下esc的时候,光标退出编辑区,切换至标题栏 if (modifiers == Qt::NoModifier && e->key() == Qt::Key_Escape) { @@ -6656,21 +6928,21 @@ void TextEdit::keyPressEvent(QKeyEvent *e) return; } else if (key == "Shift+/" && e->modifiers() == Qt::ControlModifier) { e->ignore(); - } else if(e->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) { - if(e->key() == Qt::Key_Return || e->key() == Qt::Key_D || e->key() == Qt::Key_K + } else if (e->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) { + if (e->key() == Qt::Key_Return || e->key() == Qt::Key_D || e->key() == Qt::Key_K || e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) { popupNotify(tr("Read-Only mode is on")); return; } else { - e->ignore(); + e->ignore(); } - }else if (e->modifiers() == Qt::ControlModifier) { - if(e->key() == Qt::Key_Return || e->key() == Qt::Key_K || e->key() == Qt::Key_X || + } else if (e->modifiers() == Qt::ControlModifier) { + if (e->key() == Qt::Key_Return || e->key() == Qt::Key_K || e->key() == Qt::Key_X || e->key() == Qt::Key_V || e->key() == Qt::Key_J || e->key() == Qt::Key_Z || e->key() == Qt::Key_Y) { popupNotify(tr("Read-Only mode is on")); return; } else { - e->ignore(); + e->ignore(); } } else if (e->key() == Qt::Key_Control || e->key() == Qt::Key_Shift) { e->ignore(); @@ -6810,7 +7082,7 @@ void TextEdit::keyPressEvent(QKeyEvent *e) QPlainTextEdit::selectAll(); if (m_bIsAltMod && !m_altModSelections.isEmpty()) { - DeleteBackAltCommond *commond = new DeleteBackAltCommond(m_altModSelections, this); + DeleteBackAltCommand *commond = new DeleteBackAltCommand(m_altModSelections, this); m_pUndoStack->push(commond); } else { //修改delete删除,在文档最末尾点击delete,引起标签栏*出现问题 @@ -6821,7 +7093,7 @@ void TextEdit::keyPressEvent(QKeyEvent *e) QString m_delText = cursor.selectedText(); if (m_delText.size() <= 0) return; - DeleteBackCommond *commond = new DeleteBackCommond(cursor, this); + DeleteBackCommand *commond = new DeleteBackCommand(cursor, this); m_pUndoStack->push(commond); } m_isSelectAll = false; @@ -7043,25 +7315,23 @@ void TextEdit::keyPressEvent(QKeyEvent *e) } else if (key == Utils::getKeyshortcutFromKeymap(m_settings, "editor", "mark")) { toggleMarkSelections(); return; - } else if (e->key() == Qt::Key_Insert && key != "Shift+Ins") { - if (e->modifiers() == Qt::NoModifier) { - setOverwriteMode(!overwriteMode()); - //update(); - if (!overwriteMode()) { - auto cursor = this->textCursor(); - cursor.clearSelection(); - cursor.movePosition(QTextCursor::Right); - this->setTextCursor(cursor); - - cursor = this->textCursor(); - cursor.movePosition(QTextCursor::Left); - this->setTextCursor(cursor); - } + } else if (e->key() == Qt::Key_Insert && key != "Shift+Ins" && e->modifiers() == Qt::NoModifier) { + setOverwriteMode(!overwriteMode()); + //update(); + if (!overwriteMode()) { + auto cursor = this->textCursor(); + cursor.clearSelection(); + cursor.movePosition(QTextCursor::Right); + this->setTextCursor(cursor); - m_cursorMode = overwriteMode() ? Overwrite : Insert; - emit cursorModeChanged(m_cursorMode); - e->accept(); + cursor = this->textCursor(); + cursor.movePosition(QTextCursor::Left); + this->setTextCursor(cursor); } + + m_cursorMode = overwriteMode() ? Overwrite : Insert; + emit cursorModeChanged(m_cursorMode); + e->accept(); } else { // Post event to window widget if key match window key list. for (auto option : m_settings->settings->group("shortcuts.window")->options()) { @@ -7128,30 +7398,22 @@ void TextEdit::paintEvent(QPaintEvent *e) } } } - QColor lineColor = palette().text().color(); if (m_bIsAltMod && !m_altModSelections.isEmpty()) { QTextCursor textCursor = this->textCursor(); int cursorWidth = this->cursorWidth(); - //int cursoColumn = textCursor.positionInBlock(); QPainter painter(viewport()); QPen pen; pen.setColor(lineColor); pen.setWidth(cursorWidth); painter.setPen(pen); - QList rowList; - for (int i = 0 ; i < m_altModSelections.size(); i++) { - //if(m_altModSelections[i].cursor.positionInBlock() == cursoColumn){ - int row = m_altModSelections[i].cursor.blockNumber(); - if (!rowList.contains(row)) { - rowList << row; - QRect textCursorRect = this->cursorRect(m_altModSelections[i].cursor); - painter.drawRect(textCursorRect); - } - // } + for (int i = 0; i < m_altModSelections.size(); i++) + { + QRect textCursorRect = this->cursorRect(m_altModSelections[i].cursor); + painter.drawRect(textCursorRect); } } } @@ -7164,6 +7426,17 @@ void TextEdit::resizeEvent(QResizeEvent *e) // 显示区域变化时同时更新视图 markAllKeywordInView(); + // 当前处于文档页面尾部时,缩放后保持焦点在文档页面尾部 + if (e->oldSize().width() < e->size().width() && verticalScrollBar()->maximum() == verticalScrollBar()->value()) { + QTimer::singleShot(0, [this]() { + // 宽度变大时文档布局大小变更信号未触发,手动通知 + auto docLayout = this->document()->documentLayout(); + Q_EMIT docLayout->documentSizeChanged(docLayout->documentSize()); + + verticalScrollBar()->setValue(verticalScrollBar()->maximum()); + }); + } + QPlainTextEdit::resizeEvent(e); } @@ -7670,8 +7943,7 @@ void TextEdit::removeComment() } } - if (!multiText.isEmpty()) - { + if (!multiText.isEmpty()) { // 同时删除多组注释文本 deleteMultiTextEx(multiText); } @@ -7806,7 +8078,7 @@ void TextEdit::onTextContentChanged(int from, int charsRemoved, int charsAdded) // 记录鼠标中键变更,滞后插入撤销栈,在push()时不执行redo() QTextCursor cursor = textCursor(); cursor.setPosition(from); - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, charsAdded); + cursor.setPosition(from + charsAdded, QTextCursor::KeepAnchor); // 取得已插入的文本信息 QString insertText = cursor.selectedText(); cursor.setPosition(from); diff --git a/src/editor/dtextedit.h b/src/editor/dtextedit.h index c30094bd..231ab9df 100644 --- a/src/editor/dtextedit.h +++ b/src/editor/dtextedit.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -15,6 +15,7 @@ //添加自定义撤销重做栈 #include "inserttextundocommand.h" #include "deletetextundocommand.h" +#include "../widgets/bottombar.h" #include #include @@ -87,8 +88,6 @@ class TextEdit : public DPlainTextEdit TextEdit(QWidget *parent = nullptr); ~TextEdit() override; - //在光标处添加删除内容 - //直接插入文本 void insertTextEx(QTextCursor, QString); //同时插入多个位置的文本 @@ -118,25 +117,18 @@ class TextEdit : public DPlainTextEdit void popRightMenu(QPoint pos = QPoint()); // void setWrapper(EditWrapper *); - EditWrapper *getWrapper(); - /** - * @brief getFilePath 获取打开文件路径 - * @return 打开文件路径 - */ + // 获取打开文件路径 inline QString getFilePath() { return m_sFilePath;} - // - inline void setFilePath(QString file) { m_sFilePath = file;} - // + // 设置文件路径 + inline void setFilePath(const QString &file) { m_sFilePath = file;} + // 取得左侧的导航控件,包含行号、书签、折叠控件等 inline LeftAreaTextEdit *getLeftAreaWidget() { return m_pLeftAreaWidget;} - /** - * @brief 是否撤销重做操作 - */ + + // 是否允许撤销重做操作 bool isUndoRedoOpt(); - /** - * @brief 判断文档是否被修改 - */ + // 判断文档是否被修改 bool getModified(); int getCurrentLine(); @@ -183,9 +175,7 @@ class TextEdit : public DPlainTextEdit //剪切选中行或当前行至剪贴板中 void cutlines(); - /** - * @brief joinLines 合并行 - */ + // joinLines 合并行 void joinLines(); void killLine(); @@ -204,24 +194,25 @@ class TextEdit : public DPlainTextEdit void setLineWrapMode(bool enable); void setFontFamily(QString fontName); - void setFontSize(int fontSize); + void setFontSize(qreal fontSize); void updateFont(); - void replaceAll(const QString &replaceText, const QString &withText); - void replaceNext(const QString &replaceText, const QString &withText); - void replaceRest(const QString &replaceText, const QString &withText); - void beforeReplace(const QString &strReplaceText); + void replaceAll(const QString &replaceText, const QString &withText, Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); + void replaceNext(const QString &replaceText, const QString &withText, Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); + void replaceRest(const QString &replaceText, const QString &withText, Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); + void beforeReplace(const QString &strReplaceText, Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); bool findKeywordForward(const QString &keyword); void removeKeywords(); - bool highlightKeyword(QString keyword, int position); - bool highlightKeywordInView(QString keyword); + bool highlightKeyword(const QString &keyword, int position, Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); + bool highlightKeywordInView(const QString &keyword, Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); void clearFindMatchSelections(); void updateCursorKeywordSelection(QString keyword, bool findNext); void updateHighlightLineSelection(); bool updateKeywordSelections(QString keyword, QTextCharFormat charFormat, QList &listSelection); - bool updateKeywordSelectionsInView(QString keyword, QTextCharFormat charFormat, QList *listSelection); + bool updateKeywordSelectionsInView(QString keyword, QTextCharFormat charFormat, QList *listSelection, + Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); bool searchKeywordSeletion(QString keyword, QTextCursor cursor, bool findNext); void renderAllSelections(); @@ -238,10 +229,7 @@ class TextEdit : public DPlainTextEdit // 手动更新所有的标记信息,用于撤销栈处理更新当前颜色标记操作 void manualUpdateAllMark(const QList > &markInfo); - /** - * @author shaoyu.guo ut000455 - * @brief updateMarkAllSelectColor 文档篇幅视图有变更时(翻页/滚动条变化/鼠标滚轮变化/键盘上下键),动态更新绘制可视范围内字符颜色 - */ + // 文档篇幅视图有变更时(翻页/滚动条变化/鼠标滚轮变化/键盘上下键),动态更新绘制可视范围内字符颜色 void updateMarkAllSelectColor(); void lineNumberAreaPaintEvent(QPaintEvent *event); @@ -251,8 +239,8 @@ class TextEdit : public DPlainTextEdit void setTheme(const QString &path); void removeHighlightWordUnderCursor(); void setSettings(Settings *settings); - void copySelectedText(); - void cutSelectedText(); + void copySelectedText(bool ignoreCheck = false); + void cutSelectedText(bool ignoreCheck = false); void pasteText(); void setMark(); void unsetMark(); @@ -521,9 +509,9 @@ public slots: void cursorPositionChanged(); //剪切槽函数 - void cut(); + void cut(bool ignoreCheck = false); //复制槽函数 - void copy(); + void copy(bool ignoreCheck = false); //粘贴槽函数 void paste(); //修改后,高亮显示 @@ -560,9 +548,17 @@ public slots: void redo_(); void undo_(); + void moveText(int from, int to, const QString& text, bool copy = false); - QTextCursor findCursor(const QString &substr, const QString &text, int from, bool backward = false, int cursorPos = 0); - QString selectedText(); + QTextCursor findCursor(const QString &substr, const QString &text, int from, bool backward = false, int cursorPos = 0, + Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive); + void onPressedLineNumber(const QPoint& point); + QString selectedText(bool checkCRLF = false); + void onEndlineFormatChanged(BottomBar::EndlineFormat from,BottomBar::EndlineFormat to); + + // 当前程序调色板更新时重绘部分组件 + void onAppPaletteChanged(); + protected: bool event(QEvent *evt) override; //触摸屏event事件 void dragEnterEvent(QDragEnterEvent *event) override; @@ -609,7 +605,8 @@ public slots: bool isAbleOperation(int iOperationType); // 计算颜色标记替换信息列表 void calcMarkReplaceList(QList &replaceList, const QString &oldText, - const QString &replaceText, const QString &withText, int offset = 0) const; + const QString &replaceText, const QString &withText, int offset = 0, + Qt::CaseSensitivity caseFlag = Qt::CaseInsensitive) const; // 查找行号line起始的折叠区域 bool findFoldBlock(int line, QTextBlock &beginBlock, QTextBlock &endBlock, QTextBlock &curBlock); @@ -739,7 +736,7 @@ private slots: int m_cursorWidthChangeDelay = 2000; bool m_bReadOnlyPermission = false; - int m_fontSize = 16; + qreal m_fontSize = 16; QString m_fontName; Comment::CommentDefinition m_commentDefinition; @@ -865,5 +862,9 @@ private slots: UpdateOperationType m_LeftAreaUpdateState; bool m_MidButtonPatse = false; // 鼠标中键黏贴处理 + bool m_isPreeditBefore = false; // 上一个输入法时间是否是 preedit + int m_preeditLengthBefore = 0; + + Qt::CaseSensitivity defaultCaseSensitive = Qt::CaseInsensitive; // 查找匹配时默认不区分 }; #endif diff --git a/src/editor/editwrapper.cpp b/src/editor/editwrapper.cpp index a1cd9581..fb5e1e9d 100644 --- a/src/editor/editwrapper.cpp +++ b/src/editor/editwrapper.cpp @@ -1,10 +1,11 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "../widgets/window.h" #include "../encodes/detectcode.h" #include "../common/fileloadthread.h" +#include "../widgets/pathsettintwgt.h" #include "editwrapper.h" #include "../common/utils.h" #include "leftareaoftextedit.h" @@ -85,6 +86,9 @@ EditWrapper::EditWrapper(Window *window, QWidget *parent) m_pWaringNotices(new WarningNotices(WarningNotices::ResidentType, this)) { + // 更新单独添加的高亮格式文件 + m_Repository.addCustomSearchPath(KF5_HIGHLIGHT_PATH); + m_bQuit = false; m_pWaringNotices->hide(); // Init layout and widgets. @@ -106,6 +110,7 @@ EditWrapper::EditWrapper(Window *window, QWidget *parent) connect(m_pTextEdit, &TextEdit::cursorModeChanged, this, &EditWrapper::handleCursorModeChanged); connect(m_pWaringNotices, &WarningNotices::reloadBtnClicked, this, &EditWrapper::reloadModifyFile); connect(m_pWaringNotices, &WarningNotices::saveAsBtnClicked, m_pWindow, &Window::saveAsFile); + // NOTE: 文本高亮会触发重新布局,与界面布局(拖拽、放大窗口)变更时的布局操作冲突,因此调整更新顺序,在布局后刷新高亮 connect(m_pTextEdit->verticalScrollBar(), &QScrollBar::valueChanged, this, [this](int) { OnUpdateHighlighter(); if ((m_pWindow->findBarIsVisiable() || m_pWindow->replaceBarIsVisiable()) && @@ -114,7 +119,7 @@ EditWrapper::EditWrapper(Window *window, QWidget *parent) } m_pTextEdit->markAllKeywordInView(); - }); + }, Qt::QueuedConnection); } EditWrapper::~EditWrapper() @@ -161,6 +166,11 @@ void EditWrapper::openFile(const QString &filepath, QString qstrTruePath, bool b // 设置预处理标识位 m_bHasPreProcess = false; + if (!bIsTemFile && !isDraftFile()) { + Settings::instance()->setSavePath(PathSettingWgt::LastOptBox, QFileInfo(qstrTruePath).absolutePath()); + Settings::instance()->setSavePath(PathSettingWgt::CurFileBox, QFileInfo(qstrTruePath).absolutePath()); + } + FileLoadThread *thread = new FileLoadThread(filepath); // begin to load the file. connect(thread, &FileLoadThread::sigPreProcess, this, &EditWrapper::handleFilePreProcess); @@ -184,7 +194,7 @@ bool EditWrapper::readFile(QByteArray encode) if (newEncode.isEmpty()) { // 接口修改,补充文件头内容,最多读取1MB文件头数据 newEncode = DetectCode::GetFileEncodingFormat( - m_pTextEdit->getFilePath(), fileContent.left(DATA_SIZE_1024 * DATA_SIZE_1024)); + m_pTextEdit->getFilePath(), fileContent.left(DATA_SIZE_1024 * DATA_SIZE_1024)); m_sFirstEncode = newEncode; } @@ -199,14 +209,38 @@ bool EditWrapper::readFile(QByteArray encode) return false; } -bool EditWrapper::saveAsFile(const QString &newFilePath, QByteArray encodeName) +/** + * @brief 将当前文件内容按编码格式 \a encodeName 保存到指定路径 \a newFilePath + * @param newFilePath 另存的文件路径 + * @param encodeName 文件保存时指定的文件格式 + * @return 是否成功另存文件 + */ +bool EditWrapper::saveAsFile(const QString &newFilePath, const QByteArray &encodeName) { + // WARNING: 对于超长文件,Qt在使用 QSaveFile 保存文件时,若当前环境不支持创建无名文件(UnnamedFile), + // 会在相同路径创建临时文件,路径为保存文件名 + 唯一后缀,此临时文件名可能超过255长度限制,导致保存失败。 + // 因此,过长的文件名屏蔽使用QSaveFile。QTemporaryFile 创建文件名的代码地址: + // link: https://github.com/qt/qtbase/blob/7191b8fe38788ac57e15e4124955c3cd8333d858/src/corelib/io/qtemporaryfile.cpp#L181 + const int limitFileNameLength = 245; + QFileInfo fileNameInfo(newFilePath); + bool disableSaveProtect = fileNameInfo.fileName().length() > limitFileNameLength; + // use QSaveFile for safely save files. QSaveFile saveFile(newFilePath); - saveFile.setDirectWriteFallback(true); - - if (!saveFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - return false; + if (!disableSaveProtect) { + saveFile.setDirectWriteFallback(true); + + if (!saveFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + qWarning() << Q_FUNC_INFO << "Open save file path error, " << saveFile.errorString(); + QWidget *curWidget = this->window()->getStackedWgt()->currentWidget(); + if (curWidget) { + DMessageManager::instance()->sendMessage(curWidget, QIcon(":/images/warning.svg"), + QString(tr("You do not have permission to save %1")).arg(saveFile.fileName())); + } + return false; + } + } else { + qWarning() << QString("SaveAs file name to long, disable QSaveFile. path: %1").arg(newFilePath); } QFile file(newFilePath); @@ -215,43 +249,70 @@ bool EditWrapper::saveAsFile(const QString &newFilePath, QByteArray encodeName) } //auto append new line char to end of file when file's format is Linux/MacOS - QByteArray fileContent = m_pTextEdit->toPlainText().toUtf8(); + QByteArray fileContent; + getPlainTextContent(fileContent); QByteArray Outdata; - DetectCode::ChangeFileEncodingFormat(fileContent, Outdata, QString("UTF-8"), encodeName); - file.write(Outdata); + bool convertSucc = DetectCode::ChangeFileEncodingFormat(fileContent, Outdata, QString("UTF-8"), encodeName); + + // 转换存在异常 + if (!convertSucc) { + qWarning() << QString("iconv Encode Transformat from '%1' to '%2' Fail! start QTextCodec Encode Transformat.") + .arg(QString("UTF-8")).arg(m_sCurEncode); + // 使用 QTextCodec 进行转换尝试 + QTextCodec *codec = QTextCodec::codecForName(encodeName); + if (codec) { + QByteArray encodedString = codec->fromUnicode(fileContent); + if (encodedString.isEmpty()) { + qWarning() << qPrintable("Both iconv and QTextCodec Encode Transformat Fail!"); + } else { + qInfo() << QString("QTextCodec Encode Transformat from '%1' to '%2' Success!") + .arg(QString("UTF-8")).arg(m_sCurEncode); + + Outdata = encodedString; + convertSucc = true; + } + + } else { + qWarning() << qPrintable("Unsupported QTextCodec Encode") << m_sCurEncode; + } + } + + if (!Outdata.isEmpty()) { + // 如果新数据为空,不进行文件写入,以降低文件内容损失 + file.write(Outdata); + } + // close and delete file. QFileDevice::FileError error = file.error(); file.close(); - // flush file. - if (!saveFile.flush()) { - return false; + if (!disableSaveProtect) { + // flush file. + if (!saveFile.flush()) { + return false; + } + // ensure that the file is written to disk + fsync(saveFile.handle()); } - // ensure that the file is written to disk - fsync(saveFile.handle()); QFileInfo fi(filePath()); m_tModifiedDateTime = fi.lastModified(); // did save work? // only finalize if stream status == OK - bool ok = (error == QFileDevice::NoError); - - return ok; + return convertSucc && (error == QFileDevice::NoError); } bool EditWrapper::saveAsFile() { DFileDialog dialog(this, tr("Save")); dialog.setAcceptMode(QFileDialog::AcceptSave); -dialog.addComboBox(QObject::tr("Encoding"), QStringList() << m_sFirstEncode); + dialog.addComboBox(QObject::tr("Encoding"), QStringList() << m_sFirstEncode); dialog.setDirectory(QDir::homePath()); dialog.setNameFilter("*.txt"); - //this->setUpdatesEnabled(false); int mode = dialog.exec(); - //this->setUpdatesEnabled(true); hideWarningNotices(); if (QDialog::Accepted == mode) { @@ -265,7 +326,7 @@ dialog.addComboBox(QObject::tr("Encoding"), QStringList() << m_sFirstEncode); return false; } - // 以新的编码保存内容到文件 + // 以新的编码保存内容到文件,无论何种格式,展示的文本编码为UTF-8 QByteArray inputData = m_pTextEdit->toPlainText().toUtf8(); QByteArray outData; DetectCode::ChangeFileEncodingFormat(inputData, outData, QString("UTF-8"), m_sFirstEncode); @@ -330,25 +391,30 @@ bool EditWrapper::reloadFileEncode(QByteArray encode) //保存 if (res == 1) { - // 保存文件前更新当前文件的编码格式 + // 保存文件前缓存当前文件的编码格式,文件将按之前的编码格式保存 QString tempEncode = m_sCurEncode; - m_sCurEncode = encode; //草稿文件 + bool reloadSucc = false; if (Utils::isDraftFile(m_pTextEdit->getFilePath())) { QString newFilePath; if (saveDraftFile(newFilePath)) { - return readFile(encode); + reloadSucc = readFile(encode); } } else { - if (saveFile()) { - return readFile(encode); + if (this->window()->saveAsFile()) { + reloadSucc = readFile(encode); } } - // 未成功保存,复位编码格式 - m_sCurEncode = tempEncode; - return false; + if (reloadSucc) { + // 保存成功,更新编码格式 + m_pBottomBar->setEncodeName(encode); + } else { + // 未成功保存,复位编码格式 + m_sCurEncode = tempEncode; + } + return reloadSucc; } return false; @@ -460,7 +526,7 @@ void EditWrapper::reloadModifyFile() return; } } else { - if (!saveAsFile()) { + if (!this->window()->saveAsFile()) { return; } } @@ -489,7 +555,13 @@ QString EditWrapper::getTextEncode() return m_sCurEncode; } -bool EditWrapper::saveFile() +/** + * @brief 保存当前文件数据,若设置了特定的编码格式 \a encode , 则按此编码格式存储, + * 否则使用当前显示的文本编码。 + * @param encode 文件编码 + * @return 是否成功保存文件数据 + */ +bool EditWrapper::saveFile(QByteArray encode) { QString qstrFilePath = m_pTextEdit->getTruePath(); QFile file(qstrFilePath); @@ -498,24 +570,35 @@ bool EditWrapper::saveFile() if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { QByteArray fileContent; getPlainTextContent(fileContent); + + if (!encode.isEmpty()) { + m_sCurEncode = encode; + // 更新底栏编码格式 + m_pBottomBar->setEncodeName(encode); + } + if (!fileContent.isEmpty()) { QByteArray Outdata; DetectCode::ChangeFileEncodingFormat(fileContent, Outdata, QString("UTF-8"), m_sCurEncode); // 如果 iconv 转换错误 - if (Outdata.size() == 0) { - qWarning() << QString("iconv Encode Transformat from '%1' to '%2' Fail!") - .arg(QString("UTF-8")).arg(m_sCurEncode) - << ", start QTextCodec Encode Transformat."; + if (Outdata.isEmpty()) { + qWarning() << qPrintable(QString("iconv Encode Transformat from '%1' to '%2' Fail! start QTextCodec Encode Transformat.") + .arg(QString("UTF-8")).arg(m_sCurEncode)); // 使用 QTextCodec 进行转换尝试 QTextCodec *codec = QTextCodec::codecForName(m_sCurEncode.toUtf8()); - QByteArray encodedString = codec->fromUnicode(fileContent); + if (codec) { + QByteArray encodedString = codec->fromUnicode(fileContent); + + if (encodedString.isEmpty()) { + qWarning() << qPrintable("Both iconv and QTextCodec Encode Transformat Fail!"); + } else { + qWarning() << qPrintable(QString("QTextCodec Encode Transformat from '%1' to '%2' Success!") + .arg(QString("UTF-8")).arg(m_sCurEncode)); + Outdata = encodedString; + } - if (encodedString.isEmpty()) { - qWarning() << "Both iconv and QTextCodec Encode Transformat Fail!"; } else { - qWarning() << QString("QTextCodec Encode Transformat from '%1' to '%2' Success!") - .arg(QString("UTF-8")).arg(m_sCurEncode); - Outdata = encodedString; + qWarning() << qPrintable("Unsupported QTextCodec format:") << m_sCurEncode; } } @@ -569,6 +652,10 @@ bool EditWrapper::saveFile() void EditWrapper::getPlainTextContent(QByteArray &plainTextContent) { QString strPlainText = m_pTextEdit->toPlainText(); + if (BottomBar::EndlineFormat::Windows == m_pBottomBar->getEndlineFormat()) { + strPlainText.replace("\n", "\r\n"); + } + qint64 iPlainTextAllLen = strPlainText.length(); qint64 iStep = 300 * DATA_SIZE_1024 * DATA_SIZE_1024; /* qt开发分析结论:大文本情况下toLocal8Bit()转换会引起应用闪退,此闪退问题qt方无法处理 */ @@ -701,10 +788,16 @@ bool EditWrapper::saveDraftFile(QString &newFilePath) { DFileDialog dialog(this, tr("Save")); dialog.setAcceptMode(QFileDialog::AcceptSave); - dialog.addComboBox(QObject::tr("Encoding"), QStringList() << m_sCurEncode); dialog.setDirectory(QDir::homePath()); dialog.setNameFilter("*.txt"); + // 允许选取保存的编码格式 + DFileDialog::DComboBoxOptions encodingOptions; + encodingOptions.editable = false; + encodingOptions.defaultValue = getTextEncode(); + encodingOptions.data = Utils::getSupportEncodingList(); + dialog.addComboBox(QObject::tr("Encoding"), encodingOptions); + if (m_pWindow) { m_pWindow = this->window(); QRegularExpression reg("[^*](.+)"); @@ -712,12 +805,11 @@ bool EditWrapper::saveDraftFile(QString &newFilePath) dialog.selectFile(match.captured(0) + ".txt"); } - //this->setUpdatesEnabled(false); int mode = dialog.exec(); // 0表示取消 1保存 - // this->setUpdatesEnabled(true); hideWarningNotices(); if (mode == 1) { + const QByteArray encode = dialog.getComboBoxValue(QObject::tr("Encoding")).toUtf8(); newFilePath = dialog.selectedFiles().value(0); if (newFilePath.isEmpty()) return false; @@ -731,7 +823,7 @@ bool EditWrapper::saveDraftFile(QString &newFilePath) // 以新的编码保存内容到文件 QByteArray inputData = m_pTextEdit->toPlainText().toUtf8(); QByteArray outData; - DetectCode::ChangeFileEncodingFormat(inputData, outData, QString("UTF-8"), m_sCurEncode); + DetectCode::ChangeFileEncodingFormat(inputData, outData, QString("UTF-8"), encode); qfile.write(outData); qfile.close(); @@ -787,9 +879,17 @@ void EditWrapper::checkForReload() void EditWrapper::showNotify(const QString &message) { if (m_pTextEdit->getReadOnlyPermission() || m_pTextEdit->getReadOnlyMode()) { +#ifdef DTKWIDGET_CLASS_DSizeMode + Utils::sendFloatMessageFixedFont(m_pTextEdit, QIcon(":/images/warning.svg"), message); +#else DMessageManager::instance()->sendMessage(m_pTextEdit, QIcon(":/images/warning.svg"), message); +#endif } else { +#ifdef DTKWIDGET_CLASS_DSizeMode + Utils::sendFloatMessageFixedFont(m_pTextEdit, QIcon(":/images/ok.svg"), message); +#else DMessageManager::instance()->sendMessage(m_pTextEdit, QIcon(":/images/ok.svg"), message); +#endif } } @@ -985,6 +1085,10 @@ void EditWrapper::UpdateBottomBarWordCnt(int cnt) m_pBottomBar->updateWordCount(cnt); } +/** + * @brief 界面显示内容变更时触发,将查询当前显示的内容 + * @param forceUpdate 是否强制重设高亮处理,部分高亮无需重复设置 + */ void EditWrapper::OnUpdateHighlighter() { if (m_pSyntaxHighlighter && !m_bQuit && !m_bHighlighterAll) { @@ -992,6 +1096,7 @@ void EditWrapper::OnUpdateHighlighter() QPoint startPoint = QPoint(0, 0); QTextBlock beginBlock = m_pTextEdit->cursorForPosition(startPoint).block(); QTextBlock endBlock; + QTextBlock foundBlock; if (pScrollBar->maximum() > 0) { QPoint endPoint = QPointF(0, 1.5 * m_pTextEdit->height()).toPoint(); @@ -1040,23 +1145,39 @@ void EditWrapper::OnUpdateHighlighter() prevBlock = prevBlock.previous(); } - // 无论是否查询到折叠区域,均更新起始文本块 - beginBlock = prevBlock; + // 仅在查询到折叠区域更新文本块 + if (foundBrace) { + foundBlock = prevBlock; + } } if (!beginBlock.isValid() || !endBlock.isValid()) { return; } - for (QTextBlock var = beginBlock; var != endBlock; var = var.next()) { + auto rehighlightBlock = [this](const QTextBlock &block) { m_pSyntaxHighlighter->setEnableHighlight(true); - m_pSyntaxHighlighter->rehighlightBlock(var); + m_pSyntaxHighlighter->rehighlightBlock(block); m_pSyntaxHighlighter->setEnableHighlight(false); + }; + + if (foundBlock.isValid() && foundBlock < beginBlock) { + for (QTextBlock var = foundBlock; var.isValid() && var != beginBlock; var = var.next()) + { + // Kate syntax highlighter 在高亮文本后会设置数据,通过此数据判断是否需要重复设置高亮 + if (var.userData()) { + continue; + } + + rehighlightBlock(var); + } } - m_pSyntaxHighlighter->setEnableHighlight(true); - m_pSyntaxHighlighter->rehighlightBlock(endBlock); - m_pSyntaxHighlighter->setEnableHighlight(false); + for (QTextBlock var = beginBlock; var != endBlock; var = var.next()) { + rehighlightBlock(var); + } + + rehighlightBlock(endBlock); } } @@ -1262,6 +1383,7 @@ void EditWrapper::loadContent(const QByteArray &strContent) int max = 40 * 1024 * 1024; QString data; + int inserted = 0; if (len > max) { // 当读取大文件时,采用事件队列方式处理 @@ -1301,11 +1423,17 @@ void EditWrapper::loadContent(const QByteArray &strContent) //秒开界面语法高亮 OnUpdateHighlighter(); QApplication::processEvents(); + inserted += InitContentPos; + double progress = (inserted * 1.0) / len * 100; + m_pBottomBar->setProgress(static_cast(progress)); if (!m_bQuit) { //data = strContent.mid(InitContentPos, len - InitContentPos); QByteArray text = strContent.mid(InitContentPos, len - InitContentPos); data = codec->toUnicode(text.constData(), text.size(), &state); cursor.insertText(data); + inserted += (len - InitContentPos); + progress = (inserted * 1.0) / len * 100; + m_pBottomBar->setProgress(static_cast(progress)); } } else { if (!m_bQuit) { @@ -1317,6 +1445,9 @@ void EditWrapper::loadContent(const QByteArray &strContent) m_pTextEdit->setTextCursor(firstLineCursor); //秒开界面语法高亮 OnUpdateHighlighter(); + inserted += len; + double progress = (inserted * 1.0) / len * 100; + m_pBottomBar->setProgress(static_cast(progress)); } } } @@ -1325,10 +1456,14 @@ void EditWrapper::loadContent(const QByteArray &strContent) } if (m_pBottomBar != nullptr) { m_pBottomBar->setChildEnabled(true); + auto format = BottomBar::getEndlineFormat(strContent); + m_pBottomBar->setEndlineMenuText(format); } m_pTextEdit->setReadOnly(false); m_pTextEdit->setLeftAreaUpdateState(TextEdit::FileOpenEnd); QApplication::restoreOverrideCursor(); + + } /** @@ -1347,7 +1482,7 @@ void EditWrapper::reinitOnFileLoad(const QByteArray &encode) m_pSyntaxHighlighter->setTheme(m_Repository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme)); } - if (m_pSyntaxHighlighter) m_pSyntaxHighlighter->setDefinition(m_Definition);; + if (m_pSyntaxHighlighter) m_pSyntaxHighlighter->setDefinition(m_Definition); m_pTextEdit->setSyntaxDefinition(m_Definition); m_pBottomBar->getHighlightMenu()->setCurrentTextOnly(m_Definition.translatedName()); } diff --git a/src/editor/editwrapper.h b/src/editor/editwrapper.h index fe80addf..588f3299 100644 --- a/src/editor/editwrapper.h +++ b/src/editor/editwrapper.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -52,17 +52,17 @@ class EditWrapper : public QWidget * @param bIsTemFile 修改状态 */ void openFile(const QString &filepath, QString qstrTruePath, bool bIsTemFile = false); - //以默认编码encode重写读取去文件 + // 以编码 encode 重新读取文件 bool readFile(QByteArray encode = ""); - //保存文件 - bool saveFile(); + // 按编码 encode 保存文件 + bool saveFile(QByteArray encode = ""); /** * @brief getPlainTextContent 获取文本框里的文本内容 * @param plainTextConteng 存放获取到的内容 */ void getPlainTextContent(QByteArray &plainTextContent); //重新加载文件编码 - bool saveAsFile(const QString &newFilePath, QByteArray encodeName); + bool saveAsFile(const QString &newFilePath, const QByteArray &encodeName); //保存草稿文件 bool saveDraftFile(QString &newFilePath); //另存为第一次打开文件编码文件 diff --git a/src/editor/endlineformatcommond.cpp b/src/editor/endlineformatcommond.cpp new file mode 100644 index 00000000..83f78618 --- /dev/null +++ b/src/editor/endlineformatcommond.cpp @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "endlineformatcommond.h" +EndlineFormartCommand::EndlineFormartCommand(TextEdit* edit,BottomBar* bar,BottomBar::EndlineFormat from,BottomBar::EndlineFormat to): + m_edit(edit), + m_bar(bar), + m_from(from), + m_to(to) +{ + +} +EndlineFormartCommand::~EndlineFormartCommand() +{ + +} + +void EndlineFormartCommand::undo() +{ + m_bar->setEndlineMenuText(m_from); +} +void EndlineFormartCommand::redo() +{ + auto cursor = m_edit->textCursor(); + auto pos = cursor.position(); + cursor.insertText(" "); + cursor.setPosition(pos); + cursor.deleteChar(); + m_bar->setEndlineMenuText(m_to); +} diff --git a/src/editor/endlineformatcommond.h b/src/editor/endlineformatcommond.h new file mode 100644 index 00000000..19550592 --- /dev/null +++ b/src/editor/endlineformatcommond.h @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef EndlineFormartCommand_H +#define EndlineFormartCommand_H +#include +#include "../widgets/bottombar.h" +#include "dtextedit.h" + + +class EndlineFormartCommand:public QUndoCommand +{ +public: + EndlineFormartCommand(TextEdit* edit,BottomBar* bar,BottomBar::EndlineFormat from,BottomBar::EndlineFormat to); + virtual ~EndlineFormartCommand(); + +protected: + virtual void undo(); + virtual void redo(); + +private: + BottomBar* m_bar=nullptr; + BottomBar::EndlineFormat m_from; + BottomBar::EndlineFormat m_to; + TextEdit* m_edit=nullptr; + +}; + + + +#endif // UndoList_H diff --git a/src/editor/indenttextcommond.cpp b/src/editor/indenttextcommond.cpp index 9dd591ae..eec4fe07 100644 --- a/src/editor/indenttextcommond.cpp +++ b/src/editor/indenttextcommond.cpp @@ -5,7 +5,7 @@ #include "indenttextcommond.h" #include "dtextedit.h" -IndentTextCommond::IndentTextCommond(TextEdit* edit,int startpos,int endpos,int startline,int endline): +IndentTextCommand::IndentTextCommand(TextEdit* edit,int startpos,int endpos,int startline,int endline): m_edit(edit), m_startpos(startpos), m_endpos(endpos), @@ -14,12 +14,12 @@ IndentTextCommond::IndentTextCommond(TextEdit* edit,int startpos,int endpos,int { m_hasselected = m_edit->textCursor().hasSelection(); } -IndentTextCommond::~IndentTextCommond() +IndentTextCommand::~IndentTextCommand() { } -void IndentTextCommond::redo() +void IndentTextCommand::redo() { auto cursor = m_edit->textCursor(); @@ -51,7 +51,7 @@ void IndentTextCommond::redo() -void IndentTextCommond::undo() +void IndentTextCommand::undo() { auto cursor = m_edit->textCursor(); diff --git a/src/editor/indenttextcommond.h b/src/editor/indenttextcommond.h index 5a3a6bb3..10730424 100644 --- a/src/editor/indenttextcommond.h +++ b/src/editor/indenttextcommond.h @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -#ifndef IndentTextCommond_H -#define IndentTextCommond_H +#ifndef IndentTextCommand_H +#define IndentTextCommand_H #include #include @@ -11,11 +11,11 @@ #include class TextEdit; //indent text in front of multiple lines -class IndentTextCommond:public QUndoCommand +class IndentTextCommand:public QUndoCommand { public: - IndentTextCommond(TextEdit* edit,int startpos,int endpos,int startline,int endline); - virtual ~IndentTextCommond(); + IndentTextCommand(TextEdit* edit,int startpos,int endpos,int startline,int endline); + virtual ~IndentTextCommand(); virtual void redo(); virtual void undo(); @@ -35,4 +35,4 @@ class IndentTextCommond:public QUndoCommand }; -#endif // IndentTextCommond_H +#endif // IndentTextCommand_H diff --git a/src/editor/insertblockbytextcommond.cpp b/src/editor/insertblockbytextcommond.cpp index 4a864586..f33971cc 100644 --- a/src/editor/insertblockbytextcommond.cpp +++ b/src/editor/insertblockbytextcommond.cpp @@ -10,7 +10,7 @@ #include "../widgets/window.h" #include "../widgets/bottombar.h" -InsertBlockByTextCommond::InsertBlockByTextCommond(const QString &text,TextEdit *edit,EditWrapper* wrapper): +InsertBlockByTextCommand::InsertBlockByTextCommand(const QString &text,TextEdit *edit,EditWrapper* wrapper): m_text(text), m_edit(edit), m_wrapper(wrapper) @@ -25,19 +25,19 @@ InsertBlockByTextCommond::InsertBlockByTextCommond(const QString &text,TextEdit } } -InsertBlockByTextCommond::~InsertBlockByTextCommond() +InsertBlockByTextCommand::~InsertBlockByTextCommand() { } -void InsertBlockByTextCommond::redo() +void InsertBlockByTextCommand::redo() { treat(true); insertByBlock(); treat(false); } -void InsertBlockByTextCommond::undo() +void InsertBlockByTextCommand::undo() { treat(true); @@ -54,7 +54,7 @@ void InsertBlockByTextCommond::undo() treat(false); } -void InsertBlockByTextCommond::treat(bool isStart) +void InsertBlockByTextCommand::treat(bool isStart) { if(m_wrapper!=nullptr){ @@ -74,7 +74,7 @@ void InsertBlockByTextCommond::treat(bool isStart) QObject::disconnect(m_edit, &QPlainTextEdit::cursorPositionChanged, m_edit, &TextEdit::cursorPositionChanged); } -void InsertBlockByTextCommond::insertByBlock() +void InsertBlockByTextCommand::insertByBlock() { auto cursor = m_edit->textCursor(); int block = 1 * 1024 * 1024 ; @@ -100,9 +100,3 @@ void InsertBlockByTextCommond::insertByBlock() } m_delPos = cursor.position(); } - - - - - - diff --git a/src/editor/insertblockbytextcommond.h b/src/editor/insertblockbytextcommond.h index 81a18ff4..ef130812 100644 --- a/src/editor/insertblockbytextcommond.h +++ b/src/editor/insertblockbytextcommond.h @@ -13,11 +13,11 @@ class TextEdit; class EditWrapper; //分块插入文本-撤销重做 -class InsertBlockByTextCommond:public QUndoCommand +class InsertBlockByTextCommand:public QUndoCommand { public: - InsertBlockByTextCommond(const QString& text,TextEdit* edit,EditWrapper* wrapper); - virtual ~InsertBlockByTextCommond(); + InsertBlockByTextCommand(const QString& text,TextEdit* edit,EditWrapper* wrapper); + virtual ~InsertBlockByTextCommand(); virtual void redo(); virtual void undo(); diff --git a/src/editor/inserttextundocommand.cpp b/src/editor/inserttextundocommand.cpp index 3579567a..b02864ff 100644 --- a/src/editor/inserttextundocommand.cpp +++ b/src/editor/inserttextundocommand.cpp @@ -1,37 +1,40 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "inserttextundocommand.h" -InsertTextUndoCommand::InsertTextUndoCommand(QTextCursor textcursor, QString text, QPlainTextEdit *edit, QUndoCommand *parent) +InsertTextUndoCommand::InsertTextUndoCommand(const QTextCursor &textcursor, const QString &text, QPlainTextEdit *edit, QUndoCommand *parent) : QUndoCommand(parent) , m_pEdit(edit) , m_textCursor(textcursor) , m_sInsertText(text) { - + m_sInsertText.replace("\r\n", "\n"); } -InsertTextUndoCommand::InsertTextUndoCommand(QList &selections, QString text, QPlainTextEdit *edit, QUndoCommand *parent) +InsertTextUndoCommand::InsertTextUndoCommand(QList &selections, + const QString &text, + QPlainTextEdit *edit, + QUndoCommand *parent) : QUndoCommand(parent) , m_pEdit(edit) , m_sInsertText(text) , m_ColumnEditSelections(selections) { - + m_sInsertText.replace("\r\n", "\n"); } - void InsertTextUndoCommand::undo() { if (m_ColumnEditSelections.isEmpty()) { + // 注意部分字符显示占位超过1 m_textCursor.setPosition(m_endPostion); - m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, m_endPostion - m_beginPostion); + m_textCursor.setPosition(m_beginPostion, QTextCursor::KeepAnchor); m_textCursor.deleteChar(); if (m_selectText != QString()) { m_textCursor.insertText(m_selectText); - m_textCursor.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor, m_selectText.length()); + m_textCursor.setPosition(m_textCursor.position() - m_selectText.length(), QTextCursor::KeepAnchor); } // 进行撤销/恢复时将光标移动到撤销位置 @@ -48,10 +51,8 @@ void InsertTextUndoCommand::undo() m_pEdit->setTextCursor(m_ColumnEditSelections.last().cursor); } } - } - void InsertTextUndoCommand::redo() { if (m_ColumnEditSelections.isEmpty()) { @@ -59,15 +60,9 @@ void InsertTextUndoCommand::redo() m_selectText = m_textCursor.selectedText(); m_textCursor.removeSelectedText(); } - #if 0 - else if(!m_selectText.isEmpty()) - { - m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, m_selectText.size()); - m_textCursor.removeSelectedText(); - } - #endif + m_textCursor.insertText(m_sInsertText); - m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, m_sInsertText.length()); + m_textCursor.setPosition(m_textCursor.position() - m_sInsertText.length(), QTextCursor::KeepAnchor); m_beginPostion = m_textCursor.selectionStart(); m_endPostion = m_textCursor.selectionEnd(); @@ -81,7 +76,8 @@ void InsertTextUndoCommand::redo() int cnt = m_ColumnEditSelections.size(); for (int i = 0; i < cnt; i++) { m_ColumnEditSelections[i].cursor.insertText(m_sInsertText); - m_ColumnEditSelections[i].cursor.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor, m_sInsertText.length()); + m_ColumnEditSelections[i].cursor.setPosition(m_ColumnEditSelections[i].cursor.position() - m_sInsertText.length() + 1, + QTextCursor::KeepAnchor); } if (m_pEdit && !m_ColumnEditSelections.isEmpty()) { @@ -92,18 +88,21 @@ void InsertTextUndoCommand::redo() } } - /** * @class MidButtonInsertTextUndoCommand * @brief 用于鼠标中键黏贴的插入撤销项,使用 QClipboard::Selection 类型插入选中的数据, * 需要注意中键插入不会覆盖被选中的文本。 */ -MidButtonInsertTextUndoCommand::MidButtonInsertTextUndoCommand(QTextCursor textcursor, QString text, QPlainTextEdit *edit, QUndoCommand *parent) +MidButtonInsertTextUndoCommand::MidButtonInsertTextUndoCommand(const QTextCursor &textcursor, + const QString &text, + QPlainTextEdit *edit, + QUndoCommand *parent) : QUndoCommand(parent) , m_pEdit(edit) , m_textCursor(textcursor) , m_sInsertText(text) { + m_sInsertText.replace("\r\n", "\n"); // 中键黏贴需要构造时计算一次光标位置 m_beginPostion = m_textCursor.position(); m_endPostion = m_textCursor.position() + m_sInsertText.length(); @@ -115,7 +114,7 @@ MidButtonInsertTextUndoCommand::MidButtonInsertTextUndoCommand(QTextCursor textc void MidButtonInsertTextUndoCommand::undo() { m_textCursor.setPosition(m_endPostion); - m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, m_endPostion - m_beginPostion); + m_textCursor.setPosition(m_beginPostion, QTextCursor::KeepAnchor); m_textCursor.deleteChar(); // 进行撤销/恢复时将光标移动到撤销位置 @@ -132,7 +131,7 @@ void MidButtonInsertTextUndoCommand::undo() void MidButtonInsertTextUndoCommand::redo() { m_textCursor.insertText(m_sInsertText); - m_textCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, m_sInsertText.length()); + m_textCursor.setPosition(m_textCursor.position() - m_sInsertText.length(), QTextCursor::KeepAnchor); m_beginPostion = m_textCursor.selectionStart(); m_endPostion = m_textCursor.selectionEnd(); @@ -143,3 +142,51 @@ void MidButtonInsertTextUndoCommand::redo() m_pEdit->setTextCursor(curCursor); } } + +/** + @brief 用于拖拽 `Drag` 插入的文本,仅插入不会覆盖数据。由于 `Drag` 操作时会先执行删除操作, + QTextCuesor可能变更,调整为使用固定偏移量。 + */ +DragInsertTextUndoCommand::DragInsertTextUndoCommand(const QTextCursor &textcursor, + const QString &text, + QPlainTextEdit *edit, + QUndoCommand *parent) + : QUndoCommand(parent) + , m_pEdit(edit) + , m_textCursor(textcursor) + , m_sInsertText(text) +{ + m_beginPostion = m_textCursor.selectionStart(); +} + +/** + @brief 复位插入操作 + */ +void DragInsertTextUndoCommand::undo() +{ + m_textCursor.setPosition(m_beginPostion); + m_textCursor.setPosition(m_beginPostion + m_sInsertText.size(), QTextCursor::KeepAnchor); + m_textCursor.deleteChar(); + + if (m_pEdit) { + m_pEdit->setTextCursor(m_textCursor); + } +} + +/** + @brief 重做插入操作,使用固定偏移量 + */ +void DragInsertTextUndoCommand::redo() +{ + if (m_beginPostion != m_textCursor.position()) { + m_textCursor.setPosition(m_beginPostion); + } + + m_textCursor.insertText(m_sInsertText); + + if (m_pEdit) { + QTextCursor curCursor = m_pEdit->textCursor(); + curCursor.setPosition(m_beginPostion + m_sInsertText.size()); + m_pEdit->setTextCursor(curCursor); + } +} diff --git a/src/editor/inserttextundocommand.h b/src/editor/inserttextundocommand.h index 5f91db9b..393dc95c 100644 --- a/src/editor/inserttextundocommand.h +++ b/src/editor/inserttextundocommand.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -14,16 +14,19 @@ class InsertTextUndoCommand : public QUndoCommand { public: - explicit InsertTextUndoCommand(QTextCursor textcursor, QString text, QPlainTextEdit *edit, QUndoCommand *parent = nullptr); - explicit InsertTextUndoCommand(QList &selections, QString text, QPlainTextEdit *edit, QUndoCommand *parent = nullptr); + explicit InsertTextUndoCommand(const QTextCursor &textcursor, const QString &text, QPlainTextEdit *edit, QUndoCommand *parent = nullptr); + explicit InsertTextUndoCommand(QList &selections, + const QString &text, + QPlainTextEdit *edit, + QUndoCommand *parent = nullptr); virtual void undo(); virtual void redo(); private: QPlainTextEdit *m_pEdit = nullptr; QTextCursor m_textCursor; - int m_beginPostion {0}; - int m_endPostion {0}; + int m_beginPostion{0}; + int m_endPostion{0}; QString m_sInsertText; QList m_ColumnEditSelections; QString m_selectText = QString(); @@ -35,17 +38,40 @@ class InsertTextUndoCommand : public QUndoCommand class MidButtonInsertTextUndoCommand : public QUndoCommand { public: - explicit MidButtonInsertTextUndoCommand(QTextCursor textcursor, QString text, QPlainTextEdit *edit, QUndoCommand *parent = nullptr); + explicit MidButtonInsertTextUndoCommand(const QTextCursor &textcursor, + const QString &text, + QPlainTextEdit *edit, + QUndoCommand *parent = nullptr); virtual void undo(); virtual void redo(); private: - QPlainTextEdit *m_pEdit = nullptr; // 关联的文本编辑控件 - QTextCursor m_textCursor; // 插入前的光标 - QString m_sInsertText; // 插入文本 - int m_beginPostion = 0; // 维护插入位置的标记 - int m_endPostion = 0; + QPlainTextEdit *m_pEdit = nullptr; // 关联的文本编辑控件 + QTextCursor m_textCursor; // 插入前的光标 + QString m_sInsertText; // 插入文本 + int m_beginPostion = 0; // 维护插入位置的标记 + int m_endPostion = 0; }; -#endif // INSERTTEXTUNDOCOMMAND_H +/** + @brief 拖拽插入文本处理 + */ +class DragInsertTextUndoCommand : public QUndoCommand +{ +public: + explicit DragInsertTextUndoCommand(const QTextCursor &textcursor, + const QString &text, + QPlainTextEdit *edit, + QUndoCommand *parent = nullptr); + virtual void undo() override; + virtual void redo() override; + +private: + QPlainTextEdit *m_pEdit = nullptr; + QTextCursor m_textCursor; + QString m_sInsertText; + int m_beginPostion{0}; +}; + +#endif // INSERTTEXTUNDOCOMMAND_H diff --git a/src/editor/leftareaoftextedit.cpp b/src/editor/leftareaoftextedit.cpp index 165deb3c..03c6ccd7 100644 --- a/src/editor/leftareaoftextedit.cpp +++ b/src/editor/leftareaoftextedit.cpp @@ -106,3 +106,9 @@ void LeftAreaTextEdit::paintEvent(QPaintEvent *event) } +TextEdit* LeftAreaTextEdit::getEdit() +{ + return m_pTextEdit; +} + + diff --git a/src/editor/leftareaoftextedit.h b/src/editor/leftareaoftextedit.h index 7dc613eb..d6e3cbf3 100644 --- a/src/editor/leftareaoftextedit.h +++ b/src/editor/leftareaoftextedit.h @@ -26,6 +26,7 @@ class LeftAreaTextEdit : public QWidget void updateBookMark(); void updateCodeFlod(); void updateAll(); + TextEdit* getEdit(); protected: void paintEvent(QPaintEvent *event); public: diff --git a/src/editor/linenumberarea.cpp b/src/editor/linenumberarea.cpp index 6007cd01..468a0966 100644 --- a/src/editor/linenumberarea.cpp +++ b/src/editor/linenumberarea.cpp @@ -6,6 +6,7 @@ #include "dtextedit.h" #include "leftareaoftextedit.h" #include +#include LineNumberArea::LineNumberArea(LeftAreaTextEdit *leftAreaWidget) { @@ -29,3 +30,17 @@ QSize LineNumberArea::sizeHint() const { return QSize(m_leftAreaWidget->lineNumberAreaWidth(), 0); } + + +void LineNumberArea::mousePressEvent(QMouseEvent *e) +{ +// m_pressPoint = e->pos(); +// m_leftAreaWidget->update(); + m_leftAreaWidget->getEdit()->onPressedLineNumber(e->pos()); + QWidget::mousePressEvent(e); +} + +QPoint LineNumberArea::getPressPoint() +{ + return m_pressPoint; +} diff --git a/src/editor/linenumberarea.h b/src/editor/linenumberarea.h index b7d76c68..aecf5d93 100644 --- a/src/editor/linenumberarea.h +++ b/src/editor/linenumberarea.h @@ -17,12 +17,16 @@ class LineNumberArea : public QWidget public: explicit LineNumberArea(LeftAreaTextEdit *leftAreaWidget); ~LineNumberArea() override; + QPoint getPressPoint(); +protected: void paintEvent(QPaintEvent *e) override; QSize sizeHint() const override; + void mousePressEvent(QMouseEvent *e) override; private: LeftAreaTextEdit *m_leftAreaWidget; + QPoint m_pressPoint; }; #endif diff --git a/src/editor/replaceallcommond.cpp b/src/editor/replaceallcommond.cpp index fa6dded1..4aa0d85a 100644 --- a/src/editor/replaceallcommond.cpp +++ b/src/editor/replaceallcommond.cpp @@ -6,7 +6,7 @@ -ReplaceAllCommond::ReplaceAllCommond(QString &oldText, QString &newText, QTextCursor cursor, QUndoCommand *parent) +ReplaceAllCommand::ReplaceAllCommand(QString &oldText, QString &newText, QTextCursor cursor, QUndoCommand *parent) : QUndoCommand(parent) , m_oldText(oldText) , m_newText(newText) @@ -15,12 +15,12 @@ ReplaceAllCommond::ReplaceAllCommond(QString &oldText, QString &newText, QTextCu } -ReplaceAllCommond::~ReplaceAllCommond() +ReplaceAllCommand::~ReplaceAllCommand() { } -void ReplaceAllCommond::redo() +void ReplaceAllCommand::redo() { m_cursor.setPosition(0); m_cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); @@ -29,7 +29,7 @@ void ReplaceAllCommond::redo() m_cursor.insertText(m_newText); } -void ReplaceAllCommond::undo() +void ReplaceAllCommand::undo() { m_cursor.setPosition(0); m_cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); @@ -37,4 +37,3 @@ void ReplaceAllCommond::undo() m_cursor.insertText(m_oldText); } - diff --git a/src/editor/replaceallcommond.h b/src/editor/replaceallcommond.h index cd4ff6bc..9b9c69ad 100644 --- a/src/editor/replaceallcommond.h +++ b/src/editor/replaceallcommond.h @@ -13,11 +13,11 @@ #include "dtextedit.h" // 全部替换撤销-重做 -class ReplaceAllCommond: public QUndoCommand +class ReplaceAllCommand: public QUndoCommand { public: - ReplaceAllCommond(QString &oldText, QString &newText, QTextCursor cursor, QUndoCommand *parent = nullptr); - virtual ~ReplaceAllCommond(); + ReplaceAllCommand(QString &oldText, QString &newText, QTextCursor cursor, QUndoCommand *parent = nullptr); + virtual ~ReplaceAllCommand(); virtual void redo(); virtual void undo(); diff --git a/src/editor/showflodcodewidget.cpp b/src/editor/showflodcodewidget.cpp index 99f235c8..8f0015a7 100644 --- a/src/editor/showflodcodewidget.cpp +++ b/src/editor/showflodcodewidget.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -36,6 +36,9 @@ ShowFlodCodeWidget::ShowFlodCodeWidget(DWidget *parent) pSubLayout->addWidget(m_pContentEdit); this->setLayout(pSubLayout); m_highlighter = new KSyntaxHighlighting::SyntaxHighlighter(m_pContentEdit->document()); + + // 更新单独添加的高亮格式文件 + m_repository.addCustomSearchPath(KF5_HIGHLIGHT_PATH); } ShowFlodCodeWidget::~ShowFlodCodeWidget() diff --git a/src/encodes/detectcode.cpp b/src/encodes/detectcode.cpp index 6827177e..fc691995 100644 --- a/src/encodes/detectcode.cpp +++ b/src/encodes/detectcode.cpp @@ -1,20 +1,117 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "detectcode.h" +#include "../common/config.h" + #include #include #include #include +#include + #include +#define DISABLE_TEXTCODEC + QMap DetectCode::sm_LangsMap; -DetectCode::DetectCode() -{ +// 最低的检测准确度判断,低于90%需要调整策略 +static const float gs_dMinConfidence = 0.9f; -} +// 手动添加 UTF BOM 信息 +static QMap gs_byteOrderMark = {{"UTF-16LE", QByteArray::fromHex("FFFE")}, + {"UTF-16BE", QByteArray::fromHex("FEFF")}, + {"UTF-32LE", QByteArray::fromHex("FFFE0000")}, + {"UTF-32BE", QByteArray::fromHex("0000FEFF")}}; + +/** + FIXME: 临时方案,后续修改iconv等编码转换处理 + # GB18030-2022 - UTF-8 编码转换处理 + 为适配 GB18030-2022 规范,{gs_UTF8MapGB18030Data} 为 GB18030-UTF8 PUA 区域映射表,对应 GB18030-2022 规范附录D 表D.1 + 替换2005和2022规范中转换存在差异的部分, 见 \l{https://en.wikipedia.org/wiki/GB_18030} + */ +static QHash gs_UTF8MapGB18030Data{ + {"\uE81E", 0x37903582}, {"\uE826", 0x38903582}, {"\uE82B", 0x39903582}, {"\uE82C", 0x30913582}, {"\uE832", 0x31913582}, + {"\uE843", 0x32913582}, {"\uE854", 0x33913582}, {"\uE864", 0x34913582}, {"\uE78D", 0x36823184}, {"\uE78F", 0x37823184}, + {"\uE78E", 0x38823184}, {"\uE790", 0x39823184}, {"\uE791", 0x30833184}, {"\uE792", 0x31833184}, {"\uE793", 0x32833184}, + {"\uE794", 0x33833184}, {"\uE795", 0x34833184}, {"\uE796", 0x35833184}, /*{"\uE816", 0x31903295}, {"\uE817", 0x33903295}, + {"\uE818", 0x30973295}, {"\uE831", 0x37B93695}, {"\uE83B", 0x35BA3096}, {"\uE855", 0x30B63596}*/}; + +/** + # GB18030-2022 规范附录D 表D.2处理 + GB18030 -> UTF8 编码转换时需要特殊处理,保留GB18030特殊编码的字符 + 在转换 0xFE51...0xFE91 编码时,GB18030 规范和 Unciode 4.1 规范转换后的编码不同,以 0xFE51 为例: + 1. 按 GB18030-2022 编码规范,0xFE51 转换为 \uE816 ,而非 \u20087,因此在转码前将 0xFE51 替换为转码标识 0xFFFFFF01 ; + 2. iconv 在转码遇到 0xFFFFFF01 时将报错退出,此时将 0xFFFFFF01 转换为 GB18030-2022 编码 \uE816 ; + 3. 由于根据 Unciode 4.1 规范,转换 UTF-8 到 GB18030 编码时,\uE816 不应存在,此时同样保存,手动还原编码为 0xFE51。 + */ +static QHash gs_ReplaceFromGB18030_2005Error{ + {QByteArray::fromHex("FE51"), QByteArray::fromHex("FFFFFF01")}, + {QByteArray::fromHex("FE52"), QByteArray::fromHex("FFFFFF02")}, + {QByteArray::fromHex("FE53"), QByteArray::fromHex("FFFFFF03")}, + {QByteArray::fromHex("FE6C"), QByteArray::fromHex("FFFFFF04")}, + {QByteArray::fromHex("FE76"), QByteArray::fromHex("FFFFFF05")}, + {QByteArray::fromHex("FE91"), QByteArray::fromHex("FFFFFF06")}}; +static QHash gs_ReplaceToUTF8_2005Error{{"\uE816", QByteArray::fromHex("FFFFFF01")}, + {"\uE817", QByteArray::fromHex("FFFFFF02")}, + {"\uE818", QByteArray::fromHex("FFFFFF03")}, + {"\uE831", QByteArray::fromHex("FFFFFF04")}, + {"\uE83B", QByteArray::fromHex("FFFFFF05")}, + {"\uE855", QByteArray::fromHex("FFFFFF06")}}; +static QHash gs_ReplaceUtf8ToGB18030_2005Error{{"\uE816", QByteArray::fromHex("FE51")}, + {"\uE817", QByteArray::fromHex("FE52")}, + {"\uE818", QByteArray::fromHex("FE53")}, + {"\uE831", QByteArray::fromHex("FE6C")}, + {"\uE83B", QByteArray::fromHex("FE76")}, + {"\uE855", QByteArray::fromHex("FE91")}}; + +/** + 同样,由于 0xFE51 和 0x95329031 在 Unciode 4.1 规范,均转换为 \u20087 ,但反向转换时,\u20087 转换为 0xFE51 。 + 导致数据互转时,源数据出现了变更,因此同样需要特殊处理,在 UTF-8 转换为 GB18030-2022 时,将 0xF0A08287(\u20087) 替换, + 并在实际转换过程中替换为 0x95329031 ,保证 GB18030-2022 编码转换准确 + */ +static QHash gs_ReplaceFromUtf8_2020Error{ + {QByteArray::fromHex("95329031"), QByteArray::fromHex("FFFF11")}, + {QByteArray::fromHex("95329033"), QByteArray::fromHex("FFFF12")}, + {QByteArray::fromHex("95329730"), QByteArray::fromHex("FFFF13")}, + {QByteArray::fromHex("9536B937"), QByteArray::fromHex("FFFF14")}, + {QByteArray::fromHex("9630BA35"), QByteArray::fromHex("FFFF15")}, + {QByteArray::fromHex("9635B630"), QByteArray::fromHex("FFFF16")}, +}; +// 0xF0A08287 为 \u20087 的 UTF-8 HEX 编码 +static QHash gs_ReplaceToGB18030_2020Error{ + {QByteArray::fromHex("F0A08287"), QByteArray::fromHex("FFFF11")}, + {QByteArray::fromHex("F0A08289"), QByteArray::fromHex("FFFF12")}, + {QByteArray::fromHex("F0A0838C"), QByteArray::fromHex("FFFF13")}, + {QByteArray::fromHex("F0A19797"), QByteArray::fromHex("FFFF14")}, + {QByteArray::fromHex("F0A2A68F"), QByteArray::fromHex("FFFF15")}, + {QByteArray::fromHex("F0A487BE"), QByteArray::fromHex("FFFF16")}, +}; +static QHash gs_ReplaceFromUtf8ToGB18030_2020Error{ + {QByteArray::fromHex("95329031"), "\u20087"}, + {QByteArray::fromHex("95329033"), "\u20089"}, + {QByteArray::fromHex("95329730"), "\u200CC"}, + {QByteArray::fromHex("9536B937"), "\u215D7"}, + {QByteArray::fromHex("9630BA35"), "\u2298F"}, + {QByteArray::fromHex("9635B630"), "\u241FE"}, +}; + +// 见QTextCodec::mibEnum() +enum MibEncoding { + UnknownMib = 0, + UTF_8 = 106, + GB18030 = 114, + UTF_16BE = 1013, + UTF_16LE = 1014, + UTF_16 = 1015, + UTF_32 = 1017, + UTF_32BE = 1018, + UTF_32LE = 1019, +}; + +DetectCode::DetectCode() {} /** * @brief 根据文件头内容 \a content 取得文件 \a filepath 字符编码格式 @@ -33,9 +130,6 @@ QByteArray DetectCode::GetFileEncodingFormat(QString filepath, QByteArray conten QByteArray detectRet; float chardetconfidence = 0.0f; - // 最低的检测准确度判断,低于90%需要调整策略 - static const float s_dMinConfidence = 0.9f; - /* chardet识别编码 */ QString str(content); // 匹配的是中文(仅在UTF-8编码下) @@ -50,9 +144,7 @@ QByteArray DetectCode::GetFileEncodingFormat(QString filepath, QByteArray conten // 大文本数据存在从文档中间截断的可能,导致unicode中文字符被截断,解析为乱码,处理部分情况 // 根据文本中断的情况,每次尝试解析编码后移除尾部字符,直到识别率达到90%以上 int tryCount = 5; - while (chardetconfidence < s_dMinConfidence - && newContent.size() > suffix.size() - && tryCount-- > 0) { + while (chardetconfidence < gs_dMinConfidence && newContent.size() > suffix.size() && tryCount-- > 0) { // 移除可能的乱码尾部字符 newContent.remove(newContent.size() - suffix.size(), 1); DetectCode::ChartDet_DetectingTextCoding(newContent, charDetectedResult, chardetconfidence); @@ -63,9 +155,7 @@ QByteArray DetectCode::GetFileEncodingFormat(QString filepath, QByteArray conten // 部分非unicode编码同为中文,例如 GB18030, BIG5 等中文编码,同样判断识别率,识别率较低手动干预多次检测 int tryCount = 5; QByteArray newContent = content; - while (chardetconfidence < s_dMinConfidence - && !newContent.isEmpty() - && tryCount-- > 0) { + while (chardetconfidence < gs_dMinConfidence && !newContent.isEmpty() && tryCount-- > 0) { newContent.chop(1); DetectCode::ChartDet_DetectingTextCoding(newContent, charDetectedResult, chardetconfidence); } @@ -73,20 +163,23 @@ QByteArray DetectCode::GetFileEncodingFormat(QString filepath, QByteArray conten ucharDetectdRet = charDetectedResult.toLatin1(); // uchardet识别编码 若识别率过低, 考虑是否非单字节编码格式。 - if (ucharDetectdRet.contains("unknown") - || ucharDetectdRet.contains("ASCII") - || ucharDetectdRet.contains("???") - || ucharDetectdRet.isEmpty() - || chardetconfidence < s_dMinConfidence) { + if (ucharDetectdRet.contains("unknown") || ucharDetectdRet.contains("ASCII") || ucharDetectdRet.contains("???") || + ucharDetectdRet.isEmpty() || chardetconfidence < gs_dMinConfidence) { ucharDetectdRet = DetectCode::UchardetCode(filepath); } - /* icu识别编码 */ - icuDetectTextEncoding(filepath, icuDetectRetList); - detectRet = selectCoding(ucharDetectdRet, icuDetectRetList); + if (ucharDetectdRet.contains("ASCII")) { + // 使用配置的默认文件编码,默认为UTF-8 + detectRet = Config::instance()->defaultEncoding(); + } else { + // icu识别编码 + icuDetectTextEncoding(filepath, icuDetectRetList); + detectRet = selectCoding(ucharDetectdRet, icuDetectRetList, chardetconfidence); - if (detectRet.contains("ASCII") || detectRet.isEmpty()) { - detectRet = "UTF-8"; + if (detectRet.contains("ASCII") || detectRet.isEmpty()) { + // 使用配置的默认文件编码,默认为UTF-8 + detectRet = Config::instance()->defaultEncoding(); + } } return detectRet.toUpper(); @@ -121,18 +214,26 @@ QByteArray DetectCode::UchardetCode(QString filepath) uchardet_data_end(handle); charset = uchardet_get_charset(handle); - uchardet_delete(handle); } - delete [] buff; + uchardet_delete(handle); + delete[] buff; buff = nullptr; - if (charset == "MAC-CENTRALEUROPE") charset = "MACCENTRALEUROPE"; - if (charset == "MAC-CYRILLIC") charset = "MACCYRILLIC"; - if (charset.contains("WINDOWS-")) charset = charset.replace("WINDOWS-", "CP"); + if (charset == "MAC-CENTRALEUROPE") + charset = "MACCENTRALEUROPE"; + if (charset == "MAC-CYRILLIC") + charset = "MACCYRILLIC"; + if (charset.contains("WINDOWS-")) + charset = charset.replace("WINDOWS-", "CP"); return charset; } +/** + * @author guoshao + * @brief icuDetectTextEncoding() icu库编码识别 + * @param filePath:文件路径,listDetectRet:编码识别结果存在的变量 + **/ void DetectCode::icuDetectTextEncoding(const QString &filePath, QByteArrayList &listDetectRet) { FILE *file; @@ -142,34 +243,43 @@ void DetectCode::icuDetectTextEncoding(const QString &filePath, QByteArrayList & return; } - int len = 0; - int iBuffSize = 4096; + size_t iBuffSize = 4096; char *detected = nullptr; char *buffer = new char[iBuffSize]; memset(buffer, 0, iBuffSize); int readed = 0; while (!feof(file)) { - int32_t len = fread(buffer, 1, iBuffSize, file); + size_t len = fread(buffer, 1, iBuffSize, file); readed += len; if (readed > 1 * 1024 * 1024) { break; } - if (!detectTextEncoding(buffer, len, &detected, listDetectRet)) { + + if (detectTextEncoding(buffer, len, &detected, listDetectRet)) { break; } } - delete [] buffer; + delete[] buffer; buffer = nullptr; fclose(file); } +/** + * @author guoshao + * @brief detectTextEncoding() icu库编码识别内层函数 + * @param data:要识别的内容,len:要识别的内容的长度,detected:编码识别结果存在的变量, + * listDetectRet:编码识别结果存在的list + * @return true:识别成功,false:识别失败 + **/ bool DetectCode::detectTextEncoding(const char *data, size_t len, char **detected, QByteArrayList &listDetectRet) { + Q_UNUSED(detected); + UCharsetDetector *csd; const UCharsetMatch **csm; - int32_t match, matchCount = 0; + int32_t matchCount = 0; UErrorCode status = U_ZERO_ERROR; csd = ucsdet_open(&status); @@ -183,38 +293,37 @@ bool DetectCode::detectTextEncoding(const char *data, size_t len, char **detecte } csm = ucsdet_detectAll(csd, &matchCount, &status); - //csm = ucsdet_detectAll_63(csd, &matchCount, &status); if (status != U_ZERO_ERROR) { return false; } - for (match = 0; match < matchCount; match++) { - const char *name = ucsdet_getName(csm[match], &status); - int32_t confidence = ucsdet_getConfidence(csm[match], &status); + int readMax = 0; + // 提高GB18030识别率时,拓展允许读取的编码列表 + if (Config::instance()->enableImproveGB18030()) { + readMax = qMin(6, matchCount); + } else { + readMax = qMin(3, matchCount); } - if (matchCount >= 3) { - for (int i = 0; i < 3; i++) { - auto str = ucsdet_getName(csm[i], &status); - if (status != U_ZERO_ERROR) { - return false; - } - listDetectRet << QByteArray(str); + for (int i = 0; i < readMax; i++) { + auto str = ucsdet_getName(csm[i], &status); + if (status != U_ZERO_ERROR) { + return false; } - - - } else if (matchCount > 0) { - auto str = ucsdet_getName(csm[0], &status); listDetectRet << QByteArray(str); } - ucsdet_close(csd); - return true; } -QByteArray DetectCode::selectCoding(QByteArray ucharDetectdRet, QByteArrayList icuDetectRetList) +/** + * @author guoshao + * @brief selectCoding() 筛选识别出来的编码 + * @param ucharDetectdRet:chardet/uchardet识别的编码结果,icuDetectRetList:编码识别结果存在的list + * @return 筛选编码的结果 + **/ +QByteArray DetectCode::selectCoding(QByteArray ucharDetectdRet, QByteArrayList icuDetectRetList, float confidence) { // 列表不允许为空 if (icuDetectRetList.isEmpty()) { @@ -222,11 +331,19 @@ QByteArray DetectCode::selectCoding(QByteArray ucharDetectdRet, QByteArrayList i } if (!ucharDetectdRet.isEmpty()) { - if (ucharDetectdRet.contains(icuDetectRetList[0])) { - return ucharDetectdRet; + // 获取是否允许提高GB18030编码的策略 + if (Config::instance()->enableImproveGB18030()) { + // 中文环境优先匹配GB18030编码 + if (QLocale::Chinese == QLocale::system().language()) { + if (confidence < gs_dMinConfidence && icuDetectRetList.contains("GB18030")) { + return QByteArray("GB18030"); + } + } } - if (!ucharDetectdRet.contains(icuDetectRetList[0])) { + if (ucharDetectdRet.contains(icuDetectRetList[0])) { + return ucharDetectdRet; + } else { if (icuDetectRetList.contains("GB18030")) { return QByteArray("GB18030"); } else { @@ -327,16 +444,18 @@ QByteArray DetectCode::EncaDetectCode(QString filepath) } #endif +/** + * @brief ChartDet_DetectingTextCoding libchardet1编码识别库识别编码 + */ int DetectCode::ChartDet_DetectingTextCoding(const char *str, QString &encoding, float &confidence) { DetectObj *obj = detect_obj_init(); if (obj == nullptr) { - //qInfo() << "Memory Allocation failed\n"; + // qInfo() << "Memory Allocation failed\n"; return CHARDET_MEM_ALLOCATED_FAIL; } - /* 另一种编码识别逻辑,暂且保留*/ /*size_t buffer_size = 1024; char *buff = new char[buffer_size]; @@ -362,7 +481,6 @@ int DetectCode::ChartDet_DetectingTextCoding(const char *str, QString &encoding, delete [] buff; buff = nullptr;*/ - #ifndef CHARDET_BINARY_SAFE // before 1.0.5. This API is deprecated on 1.0.5 switch (detect(str, &obj)) @@ -371,17 +489,17 @@ int DetectCode::ChartDet_DetectingTextCoding(const char *str, QString &encoding, switch (detect_r(str, strlen(str), &obj)) #endif { - case CHARDET_OUT_OF_MEMORY : - qInfo() << "On handle processing, occured out of memory\n"; - detect_obj_free(&obj); - return CHARDET_OUT_OF_MEMORY; - case CHARDET_NULL_OBJECT : - qInfo() << "2st argument of chardet() is must memory allocation with detect_obj_init API\n"; - return CHARDET_NULL_OBJECT; + case CHARDET_OUT_OF_MEMORY: + qInfo() << "On handle processing, occured out of memory\n"; + detect_obj_free(&obj); + return CHARDET_OUT_OF_MEMORY; + case CHARDET_NULL_OBJECT: + qInfo() << "2st argument of chardet() is must memory allocation with detect_obj_init API\n"; + return CHARDET_NULL_OBJECT; } #ifndef CHARDET_BOM_CHECK - //qInfo() << "encoding:" << obj->encoding << "; confidence: " << obj->confidence; + // qInfo() << "encoding:" << obj->encoding << "; confidence: " << obj->confidence; #else // from 1.0.6 support return whether exists BOM qInfo() << "encoding:" << obj->encoding << "; confidence: " << obj->confidence << "; bom: " << obj->bom; @@ -394,15 +512,220 @@ int DetectCode::ChartDet_DetectingTextCoding(const char *str, QString &encoding, return CHARDET_SUCCESS; } -bool DetectCode::ChangeFileEncodingFormat(QByteArray &inputStr, QByteArray &outStr, QString fromCode, QString toCode) +/** + * @return 根据 UTF-8 字符编码,返回传入的字符串 \a buf 头部字符可能占用的字节数量 + * @note 不同编码UTF-8字节划分示例,除首个字节为0外 + * 如果一个字节的第一位是0,则这个字节单独就是一个字符;如果第一位是1,则连续有多少个1,就表示当前字符占用多少个字节。 + * 0000 0000-0000 007F | 0xxxxxxx + * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + * + * @link https://zh.wikipedia.org/wiki/UTF-8 + */ +int utf8MultiByteCount(char *buf, size_t size) +{ + // UTF 字符类型,单字符,中间字符,双字节,三字节,四字节 + enum UtfCharType { + Single, + Mid, + DoubleBytes, + ThreeBytes, + FourBytes, + }; + + // 取得 UTF-8 字节序数值 + auto LeftBitFunc = [](char data) -> int { + // 返回前导1的个数 + int res = 0; + while (data & 0x80) { + res++; + data <<= 1; + } + return res; + }; + + int count = 0; + while (size > 0 && count < FourBytes) { + int leftBits = LeftBitFunc(*buf); + switch (leftBits) { + case Mid: + count++; + break; + case DoubleBytes: + case ThreeBytes: + case FourBytes: + return leftBits; + default: + // 超过4字节或单字节,均返回1 + return 1; + } + + buf++; + size--; + } + + return count; +} + +/** + @brief 检测 GB18030 转换 UTF-8 时PUA区域异常处理 + + @note GB18030 PUA区域编码转换各版本异同 + iconv当前使用2022标志,遇到PUA区域将报错(2022不再支持),此处兼容2005设计, + GB18030 - UTF-8 互转时,将PUA区域字符按2005标准转换 + | GB18030 原始数据(HEX) | GB18030-2005 to UTF8 | GB18030-2022 toUtf8 | + |------------------------|-----------------------|-----------------------| + | 0x37903582 | \uE81E | \u9FB4 | + | 0x38903582 | \uE826 | \u9FB5 | + | 0x39903582 | \uE82B | \u9FB6 | + | 0x30913582 | \uE82C | \u9FB7 | + | 0x31913582 | \uE832 | \u9FB8 | + | 0x32913582 | \uE843 | \u9FB9 | + | 0x33913582 | \uE854 | \u9FBA | + | 0x34913582 | \uE864 | \u9FBB | + | 0x36823184 | \uE78D | \uFE10 | + | 0x37823184 | \uE78F | \uFE11 | + | 0x38823184 | \uE78E | \uFE12 | + | 0x39823184 | \uE790 | \uFE13 | + | 0x30833184 | \uE791 | \uFE14 | + | 0x31833184 | \uE792 | \uFE15 | + | 0x32833184 | \uE793 | \uFE16 | + | 0x33833184 | \uE794 | \uFE17 | + | 0x34833184 | \uE795 | \uFE18 | + | 0x35833184 | \uE796 | \uFE19 | + + 以下为特殊字符,2005和2022转换后编码,映射Unicode编码 + | GB18030 原始数据(HEX) | GB18030 to UTF8 | Unicode 4.1映射 | + |------------------------|----------------------|------------------------| + | 0x31903295 | U+E816 | \u20087 | + | 0x33903295 | U+E817 | \u20089 | + | 0x30973295 | U+E818 | \u200CC | + | 0x37B93695 | U+E831 | \u215D7 | + | 0x35BA3096 | U+E83B | \u2298F | + | 0x30B63596 | U+E855 | \u241FE | + */ +bool checkGB18030ToUtf8Error(char *buf, size_t size, size_t &replaceLen, QByteArray &appendChar) +{ + // 对于GB18030-2005编码规范PUA区域的字符,iconv报错,替换为对应的字符序。 + static const int sc_minGB18030PUACharLen = 4; + if (size < sc_minGB18030PUACharLen) { + replaceLen = 1; + appendChar = "?"; + return false; + } + + quint32 puaChar = *reinterpret_cast(buf); + appendChar = gs_UTF8MapGB18030Data.key(puaChar); + if (appendChar.isEmpty()) { + // FFFFFF0X -> \uE816...\uE855 + appendChar = gs_ReplaceToUTF8_2005Error.key(QByteArray(buf, sc_minGB18030PUACharLen)); + } + + if (appendChar.isEmpty()) { + replaceLen = 1; + appendChar = "?"; + return false; + } else { + replaceLen = sc_minGB18030PUACharLen; + return true; + } +} + +/** + @brief 检测 UTF-8 转换 GB18030 时PUA区域异常处理 + */ +bool checkUTF8ToGB18030Error(char *buf, size_t size, size_t &replaceLen, QByteArray &appendChar) +{ + // 待转换的PUA字符均为3 + static const int sc_minUTFPUACharLen = 3; + if (size < sc_minUTFPUACharLen) { + replaceLen = 1; + appendChar = "?"; + return false; + } + + QByteArray puaChar(buf, sc_minUTFPUACharLen); + quint32 gb18030char = gs_UTF8MapGB18030Data.value(puaChar, 0); + if (!gb18030char) { + // \uE816 -> 0xFE51 + appendChar = gs_ReplaceUtf8ToGB18030_2005Error.value(puaChar); + if (appendChar.isEmpty()) { + // 0xFFFF11 -> 0x95329031 + appendChar = gs_ReplaceFromUtf8_2020Error.key(puaChar); + } + + if (!appendChar.isEmpty()) { + replaceLen = sc_minUTFPUACharLen; + return true; + } + + replaceLen = 1; + appendChar = "?"; + return false; + } else { + replaceLen = sc_minUTFPUACharLen; + appendChar = QByteArray(reinterpret_cast(&gb18030char), sizeof(gb18030char)); + return true; + } +} + +/** + * @brief 将输入的字符序列 \a inputStr 从编码 \a fromCode 转换为编码 \a toCode, 并返回转换后的字符序列。 + * @return 字符编码转换是否成功 + */ +bool DetectCode::ChangeFileEncodingFormat(QByteArray &inputStr, + QByteArray &outStr, + const QString &fromCode, + const QString &toCode) { if (fromCode == toCode) { outStr = inputStr; return true; } + if (inputStr.isEmpty()) { + outStr.clear(); + return true; + } + +#ifndef DISABLE_TEXTCODEC + // 使用QTextCodec对部分编码进行处理 + static QStringList codecList{"GB18030"}; + if (codecList.contains(fromCode) || codecList.contains(toCode)) { + return convertEncodingTextCodec(inputStr, outStr, fromCode, toCode); + } +#endif + iconv_t handle = iconv_open(toCode.toLocal8Bit().data(), fromCode.toLocal8Bit().data()); if (handle != reinterpret_cast(-1)) { + MibEncoding fromMib = UnknownMib; + QTextCodec *fromCodec = QTextCodec::codecForName(fromCode.toUtf8()); + if (fromCodec) { + fromMib = static_cast(fromCodec->mibEnum()); + } + // 不使用上层修改的Iconv处理时,不检测转换的编码格式,跳过GB18030转换特殊处理 + MibEncoding toMib = UnknownMib; + + const bool enablePatchedIconv = Config::instance()->enablePatchedIconv(); + if (enablePatchedIconv) { + QTextCodec *toCodec = QTextCodec::codecForName(toCode.toUtf8()); + if (toCodec) { + toMib = static_cast(toCodec->mibEnum()); + } + + // 替换需手动修改 UTF-8 和 GB180303 编码转换的部分 + if (GB18030 == fromMib && UTF_8 == toMib) { + for (auto itr = gs_ReplaceFromGB18030_2005Error.begin(); itr != gs_ReplaceFromGB18030_2005Error.end(); ++itr) { + inputStr.replace(itr.key(), itr.value()); + } + } else if (UTF_8 == fromMib && GB18030 == toMib) { + for (auto itr = gs_ReplaceToGB18030_2020Error.begin(); itr != gs_ReplaceToGB18030_2020Error.end(); ++itr) { + inputStr.replace(itr.key(), itr.value()); + } + } + } + char *inbuf = inputStr.data(); size_t inbytesleft = static_cast(inputStr.size()); size_t outbytesleft = 4 * inbytesleft; @@ -411,36 +734,137 @@ bool DetectCode::ChangeFileEncodingFormat(QByteArray &inputStr, QByteArray &outS size_t maxBufferSize = outbytesleft; memset(outbuf, 0, outbytesleft); - size_t ret = iconv(handle, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (static_cast(-1) == ret) { - // 记录错误信息 - int errorNum = errno; - qWarning() << Q_FUNC_INFO << "iconv() convert text encoding error, errocode:" << errorNum; + + int errorNum = 0; + try { + size_t ret = 0; + do { + ret = iconv(handle, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (static_cast(-1) == ret) { + // 记录错误信息 + errorNum = errno; + + // 遇到错误的输入,错误码 EILSEQ (84),跳过当前位置并添加'?' + if (EILSEQ == errorNum) { + // 缓冲区不足跳出 + if (outbytesleft == 0) { + break; + } + + size_t replaceLen = 1; + // 跳过错误字符,设置错误字符为'?' + QByteArray appendChar = "?"; + + switch (fromMib) { + case UTF_8: { + // 特殊处理,若为UTF-8 到 GB18030的转换,优先排查异常数据 + if (GB18030 == toMib) { + if (checkUTF8ToGB18030Error(inbuf, inbytesleft, replaceLen, appendChar)) { + break; + } + } + + // 源编码为 UTF-8 时,可计算需跳过的字符数 + replaceLen = static_cast(utf8MultiByteCount(inbuf, inbytesleft)); + } break; + case GB18030: + // 特殊处理,若为GB18030 到 UTF-8 的转换,优先排查异常数据 + if (UTF_8 == toMib) { + if (checkGB18030ToUtf8Error(inbuf, inbytesleft, replaceLen, appendChar)) { + break; + } + } + break; + default: + break; + } + + // 替换错误字符为对应字符 + size_t appendSize = static_cast(appendChar.size()); + if (outbytesleft < appendSize) { + break; + } + + outbytesleft -= appendSize; + ::memcpy(outbuf, appendChar.data(), appendSize); + outbuf += appendSize; + + if (inbytesleft <= replaceLen) { + // 移动至末尾 + inbuf += inbytesleft; + inbytesleft = 0; + break; + } + + inbuf += replaceLen; + inbytesleft -= replaceLen; + } else { + break; + } + } + } while (static_cast(-1) == ret); + + } catch (const std::exception &e) { + qWarning() << qPrintable("iconv convert encoding catching exception") << qPrintable(e.what()); } + if (errorNum) { + qWarning() << qPrintable("iconv() convert text encoding error, errocode:") << errorNum; + } iconv_close(handle); // 手动添加 UTF BOM 信息 - static QMap byteOrderMark = { - {"UTF-16LE", QByteArray::fromHex("FFFE")}, - {"UTF-16BE", QByteArray::fromHex("FEFF")}, - {"UTF-32LE", QByteArray::fromHex("FFFE0000")}, - {"UTF-32BE", QByteArray::fromHex("0000FEFF")} - }; - outStr.append(byteOrderMark.value(toCode)); + outStr.append(gs_byteOrderMark.value(toCode)); // 计算 iconv() 实际转换的字节数 size_t realConvertSize = maxBufferSize - outbytesleft; outStr += QByteArray(bufferHeader, static_cast(realConvertSize)); - delete [] bufferHeader; + delete[] bufferHeader; bufferHeader = nullptr; return true; } else { - qWarning() << Q_FUNC_INFO << "Text encoding convert error, iconv_open() failed."; - return false; + qWarning() << qPrintable("Text encoding convert error, iconv_open() failed."); + // 尝试使用QTextCodec加载 + return convertEncodingTextCodec(inputStr, outStr, fromCode, toCode); } } +/** + * @brief 使用QTextCodec将输入的字符序列 \a inputStr 从编码 \a fromCode 转换为编码 \a toCode, 并返回转换后的字符序列。 + * @return 字符编码转换是否成功 + */ +bool DetectCode::convertEncodingTextCodec(QByteArray &inputStr, + QByteArray &outStr, + const QString &fromCode, + const QString &toCode) +{ + QString convertData; + if (fromCode != "UTF-8") { + QTextCodec *fromCodec = QTextCodec::codecForName(fromCode.toUtf8()); + if (!fromCodec) { + return false; + } + + convertData = fromCodec->toUnicode(inputStr); + } else { + convertData = QString::fromUtf8(inputStr); + } + + if (toCode != "UTF-8") { + QTextCodec *toCodec = QTextCodec::codecForName(toCode.toUtf8()); + if (!toCodec) { + return false; + } + + outStr = toCodec->fromUnicode(convertData); + } else { + outStr = convertData.toUtf8(); + } + + // 手动添加 UTF BOM 信息 + outStr.append(gs_byteOrderMark.value(toCode)); + return true; +} diff --git a/src/encodes/detectcode.h b/src/encodes/detectcode.h index d5ff9592..2a4d4cca 100644 --- a/src/encodes/detectcode.h +++ b/src/encodes/detectcode.h @@ -1,11 +1,13 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef DETECTCODE_H #define DETECTCODE_H + #include #include + #include #include #include @@ -17,66 +19,54 @@ #include /* -* -* 文本编码识别引用第三库识别 chardet1 uchardet -* chardet识别不了使用uchardet -* 编码转换库使用iconv -* -* author:梁卫东 2020年10月15日16:56:11 -* -*/ + * + * 文本编码识别引用第三库识别 chardet1 uchardet + * chardet识别不了使用uchardet + * 编码转换库使用iconv + * + * author:梁卫东 2020年10月15日16:56:11 + * + */ class QByteArray; class QString; - class DetectCode { public: DetectCode(); - //enca 识别文本编码 - #if 0 /* 因为开源协议存在法律冲突,停止使用libenca0编码识别库 */ +// enca 识别文本编码 +#if 0 /* 因为开源协议存在法律冲突,停止使用libenca0编码识别库 */ static QByteArray EncaDetectCode (QString filepath); - #endif +#endif - /** - * @brief ChartDet_DetectingTextCoding libchardet1编码识别库识别编码 - */ + // libchardet1编码识别库识别编码 static int ChartDet_DetectingTextCoding(const char *str, QString &encoding, float &confidence); - - //uchardet 识别文编编码 + // uchardet 识别文编编码 static QByteArray UchardetCode(QString filepath); - /** - * @author guoshao - * @brief icuDetectTextEncoding() icu库编码识别 - * @param filePath:文件路径,listDetectRet:编码识别结果存在的变量 - * @return - **/ + // icu库编码识别 static void icuDetectTextEncoding(const QString &filePath, QByteArrayList &listDetectRet); - /** - * @author guoshao - * @brief detectTextEncoding() icu库编码识别内层函数 - * @param data:要识别的内容,len:要识别的内容的长度,detected:编码识别结果存在的变量, - * listDetectRet:编码识别结果存在的list - * @return true:识别成功,false:识别失败 - **/ - static bool detectTextEncoding(const char *data, size_t len, char **detected, QByteArrayList &listDetectRet); - /** - * @author guoshao - * @brief selectCoding() 筛选识别出来的编码 - * @param ucharDetectdRet:chardet/uchardet识别的编码结果,icuDetectRetList:编码识别结果存在的list - * @return 筛选编码的结果 - **/ - static QByteArray selectCoding(QByteArray ucharDetectdRet, QByteArrayList icuDetectRetList); - //获取文件编码方式 + // icu库编码识别内层函数 + static bool detectTextEncoding(const char *data, size_t len, char **detected, QByteArrayList &listDetectRet); + // 筛选识别出来的编码 + static QByteArray selectCoding(QByteArray ucharDetectdRet, QByteArrayList icuDetectRetList, float confidence); + // 获取文件编码方式 static QByteArray GetFileEncodingFormat(QString filepath, QByteArray content = QByteArray("")); + // 转换文本编码格式 + static bool ChangeFileEncodingFormat(QByteArray &inputStr, + QByteArray &outStr, + const QString &fromCode, + const QString &toCode = QString("UTF-8")); + + static bool convertEncodingTextCodec(QByteArray &inputStr, + QByteArray &outStr, + const QString &fromCode, + const QString &toCode = QString("UTF-8")); - static bool ChangeFileEncodingFormat(QByteArray& inputStr,QByteArray& outStr,QString fromCode,QString toCode=QString("UTF-8")); private: - static QMap sm_LangsMap; + static QMap sm_LangsMap; }; - -#endif // DETECTCODE_H +#endif // DETECTCODE_H diff --git a/src/environments.h b/src/environments.h deleted file mode 100644 index ee0d0bdc..00000000 --- a/src/environments.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ENVIRONMENTS_H_ -#define __ENVIRONMENTS_H_ - -#define VERSION "1.2.2" - -#endif // __ENVIRONMENTS_H_ diff --git a/src/main.cpp b/src/main.cpp index 745dc746..12fc0a9b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -9,44 +9,47 @@ #include "editorapplication.h" #include "performancemonitor.h" #include "eventlogutils.h" +#include "common/utils.h" #include #include #include #include +#include +#include #include #include #include #include -#include #include #include +#include + #include -#include DWIDGET_USE_NAMESPACE int main(int argc, char *argv[]) { - using namespace Dtk::Core; - + DCORE_USE_NAMESPACE PerformanceMonitor::initializeAppStart(); if (!QString(qgetenv("XDG_CURRENT_DESKTOP")).toLower().startsWith("deepin")) { - setenv("XDG_CURRENT_DESKTOP", "Deepin", 1); } qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell"); QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - //QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + // QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); EditorApplication app(argc, argv); - Dtk::Core::DLogManager::registerConsoleAppender(); - Dtk::Core::DLogManager::registerFileAppender(); - //save theme + // save theme DApplicationSettings savetheme; + // 需在App构造后初始化日志设置 + DLogManager::registerConsoleAppender(); + DLogManager::registerFileAppender(); + // Parser input arguments. QCommandLineParser parser; const QCommandLineOption newWindowOption("w", "Open file in new window"); @@ -54,35 +57,60 @@ int main(int argc, char *argv[]) parser.addOption(newWindowOption); parser.process(app); + qInfo() << qPrintable(QString("App start, pid: %1, version: %2").arg(app.applicationPid()).arg(app.applicationVersion())); + QStringList urls; QStringList arguments = parser.positionalArguments(); for (const QString &path : arguments) { UrlInfo info(path); urls << info.url.toLocalFile(); + + QFileInfo fileInfo(path); + qInfo() << qPrintable(QString("Open file, isFile: %1, suffix: %2, size: %3, permssion: %4").arg(fileInfo.isFile()) + .arg(fileInfo.suffix()).arg(fileInfo.size()).arg(fileInfo.permissions())); } - qInfo() << Q_FUNC_INFO << "Open file urls" << urls; bool hasWindowFlag = parser.isSet(newWindowOption); QDBusConnection dbus = QDBusConnection::sessionBus(); // Start editor process if not found any editor use DBus. if (dbus.registerService("com.deepin.Editor")) { +#ifdef DTKWIDGET_CLASS_DSizeMode + // 不同模式下的基础字体像素大小不同,系统级别为 T6 的字体大小, 默认是 14px ;在紧凑模式下 T6 为 12px + QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, [](){ + const int genericPixelSize = 14; + const int genericPixelSizeCompact = 12; + DFontSizeManager::instance()->setFontGenericPixelSize( + DGuiApplicationHelper::isCompactMode() ? genericPixelSizeCompact : genericPixelSize); + }); +#endif + StartManager *startManager = StartManager::instance(); //埋点记录启动数据 QJsonObject objStartEvent{ {"tid", Eventlogutils::StartUp}, - {"vsersion", VERSION}, + {"version", VERSION}, {"mode", 1}, }; Eventlogutils::GetInstance()->writeLogs(objStartEvent); - if (hasWindowFlag) { - startManager->openFilesInWindow(urls); + bool save_tab_before_close = + Settings::instance()->settings->option("advance.startup.save_tab_before_close")->value().toBool(); + if (!save_tab_before_close && urls.isEmpty()) { + auto window = startManager->createWindow(true); + window->addBlankTab(); } else { - startManager->openFilesInTab(urls); + if (hasWindowFlag) { + startManager->openFilesInWindow(urls); + } else { + startManager->openFilesInTab(urls); + } } + // 解析ZPD定制需求提供的库libzpdcallback.so + Utils::loadCustomDLL(); + dbus.registerObject("/com/deepin/Editor", startManager, QDBusConnection::ExportScriptableSlots); PerformanceMonitor::initializAppFinish(); @@ -90,10 +118,8 @@ int main(int argc, char *argv[]) } // Just send dbus message to exist editor process. else { - QDBusInterface notification("com.deepin.Editor", - "/com/deepin/Editor", - "com.deepin.Editor", - QDBusConnection::sessionBus()); + QDBusInterface notification( + "com.deepin.Editor", "/com/deepin/Editor", "com.deepin.Editor", QDBusConnection::sessionBus()); QList args; args << urls; diff --git a/src/resources/settings.json b/src/resources/settings.json index cf3f02fc..d84ccfd4 100644 --- a/src/resources/settings.json +++ b/src/resources/settings.json @@ -185,6 +185,18 @@ "type": "keySequenceEdit", "default": "Ctrl+F" }, + { + "key": "findNext", + "name": "Find Next", + "type": "keySequenceEdit", + "default": "F3" + }, + { + "key": "findPrev", + "name": "Find Previous", + "type": "keySequenceEdit", + "default": "Shift+F3" + }, { "key": "replace", "name": "Replace", @@ -637,6 +649,18 @@ "reset": false, "default": "F1" }, + { + "key": "findNext", + "hide" : true, + "reset" : false, + "default": "F3" + }, + { + "key": "findPrev", + "hide" : true, + "reset" : false, + "default": "Shift+F3" + }, { "key": "find", "hide" : true, @@ -1119,6 +1143,18 @@ "reset" : false, "default": "F1" }, + { + "key": "findNext", + "hide" : true, + "reset" : false, + "default": "F3" + }, + { + "key": "findPrev", + "hide" : true, + "reset" : false, + "default": "Shift+F3" + }, { "key": "find", "hide" : true, @@ -1601,6 +1637,18 @@ "reset" : false, "default": "F1" }, + { + "key": "findNext", + "hide" : true, + "reset" : false, + "default": "F3" + }, + { + "key": "findPrev", + "hide" : true, + "reset" : false, + "default": "Shift+F3" + }, { "key": "find", "hide" : true, @@ -1994,6 +2042,19 @@ "key": "advance", "name": "Advanced", "groups": [ + { + "key": "startup", + "name": "Startup", + "options": [ + { + "key": "save_tab_before_close", + "name": "Reopen last closed tabs", + "text": "Reopen last closed tabs", + "type": "checkbox", + "default": true + } + ] + }, { "key": "window", "name": "Window", @@ -2030,6 +2091,13 @@ "min": 1, "max": 24 }, + { + "key": "allow_midbutton_paste", + "name": "Paste by pressing a middle mouse button", + "text": "Paste by pressing a middle mouse button", + "type": "checkbox", + "default": true + }, { "key": "file_dialog_dir", "hide": true, @@ -2067,7 +2135,32 @@ "default": "" } ] + }, + { + "key": "open_save_setting", + "name": "Open/Save Settings", + "options": [ + { + "key": "savingpathwgt", + "type": "savingpathwgt", + "default":"0" + }, + { + "key": "open_save_curfile_path", + "hide": true + }, + { + "key": "open_save_lastopt_path", + "hide": true + }, + { + "key": "open_save_custom_path", + "hide": true + } + ] + } + ] } ] diff --git a/src/startmanager.cpp b/src/startmanager.cpp index 3802c735..66786a9f 100644 --- a/src/startmanager.cpp +++ b/src/startmanager.cpp @@ -561,6 +561,7 @@ void StartManager::createWindowFromWrapper(const QString &tabName, const QString pWindow->currentWrapper()->updateModifyStatus(isModifyed); pWindow->currentWrapper()->OnUpdateHighlighter(); pWindow->setFocus(); + pWindow->setFontSizeWithConfig(pWindow->currentWrapper()); }); group->addAnimation(geometry); diff --git a/src/thememodule/themelistmodel.cpp b/src/thememodule/themelistmodel.cpp index 26032ed4..5a03e95f 100644 --- a/src/thememodule/themelistmodel.cpp +++ b/src/thememodule/themelistmodel.cpp @@ -66,7 +66,7 @@ QVariant ThemeListModel::data(const QModelIndex &index, int role) const void ThemeListModel::initThemes() { - QFileInfoList infoList = QDir("/usr/share/deepin-editor/themes").entryInfoList(QDir::Files | QDir::NoDotAndDotDot); + QFileInfoList infoList = QDir(QString("%1share/deepin-editor/themes").arg(LINGLONG_PREFIX)).entryInfoList(QDir::Files | QDir::NoDotAndDotDot); for (QFileInfo info : infoList) { QVariantMap jsonMap = Utils::getThemeMapFromPath(info.filePath()); diff --git a/src/widgets/bottombar.cpp b/src/widgets/bottombar.cpp index 3c824d93..82c277fa 100644 --- a/src/widgets/bottombar.cpp +++ b/src/widgets/bottombar.cpp @@ -1,17 +1,22 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later -#include "bottombar.h" -#include "../common/utils.h" -#include "../editor/editwrapper.h" -#include "../widgets/window.h" - #include #include #include #include #include +#include "bottombar.h" +#include "bottombar.h" +#include "../common/utils.h" +#include "../editor/editwrapper.h" +#include "../widgets/window.h" +#include "../editor/replaceallcommond.h" + +// 不同布局模式(紧凑) +const int s_BottomBarHeight = 32; +const int s_BottomBarHeightCompact = 26; BottomBar::BottomBar(QWidget *parent) : QWidget(parent), @@ -23,25 +28,47 @@ BottomBar::BottomBar(QWidget *parent) m_pHighlightMenu(DDropdownMenu::createHighLightMenu()), m_rowStr(tr("Row")), m_columnStr(tr("Column")), - m_chrCountStr(tr("Characters %1")) + m_chrCountStr(tr("Characters %1")), + m_scaleLabel(new DLabel), + m_progressLabel(new DLabel), + m_progressBar(new DProgressBar) { QFont font; - font.setFamily("SourceHanSansSC-Normal"); m_pPositionLabel->setFont(font); m_pCharCountLabel->setFont(font); m_pCursorStatus->setFont(font); + m_scaleLabel->setFont(font); + m_progressLabel->setFont(font); + m_progressLabel->setText(tr("Loading:")); + m_progressBar->setRange(0,100); + m_progressBar->setTextVisible(false); + m_progressBar->setMinimumWidth(80); + QHBoxLayout* progressLayout = new QHBoxLayout; + progressLayout->addWidget(m_progressLabel); + progressLayout->addWidget(m_progressBar); + // progressLayout->addStretch(); DFontSizeManager::instance()->bind(m_pPositionLabel, DFontSizeManager::T9); DFontSizeManager::instance()->bind(m_pCharCountLabel, DFontSizeManager::T9); DFontSizeManager::instance()->bind(m_pCursorStatus, DFontSizeManager::T9); + DFontSizeManager::instance()->bind(m_scaleLabel, DFontSizeManager::T9); + DFontSizeManager::instance()->bind(m_progressLabel, DFontSizeManager::T9); + + initFormatMenu(); QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(29, 1, 10, 0); + layout->setAlignment(Qt::AlignVCenter); + layout->addLayout(progressLayout); + // layout->addStretch(); layout->addWidget(m_pPositionLabel); layout->addStretch(); layout->addSpacerItem(new QSpacerItem(110,20,QSizePolicy::Expanding,QSizePolicy::Fixed)); layout->addWidget(m_pCharCountLabel); + m_progressBar->hide(); + m_progressLabel->hide(); + m_pCursorStatus->setText(qApp->translate("EditWrapper", "INSERT")); m_pPositionLabel->setText(QString("%1 %2 %3 %4").arg(m_rowStr, "1",m_columnStr, "1")); @@ -53,29 +80,33 @@ BottomBar::BottomBar(QWidget *parent) DVerticalLine *pVerticalLine2 = new DVerticalLine(); pVerticalLine1->setFixedSize(1, 15); pVerticalLine2->setFixedSize(1, 15); + DVerticalLine *pVerticalLine3 = new DVerticalLine(); + pVerticalLine3->setFixedSize(1, 15); + layout->addStretch(); + layout->addWidget(m_scaleLabel); layout->addStretch(); layout->addWidget(m_pCursorStatus); layout->addSpacing(10); layout->addWidget(pVerticalLine1); layout->addWidget(m_pEncodeMenu); layout->addWidget(pVerticalLine2); + layout->addWidget(m_formatMenu); + layout->addWidget(pVerticalLine3); layout->addWidget(m_pHighlightMenu); - setFixedHeight(32); //切换编码 connect(m_pEncodeMenu, &DDropdownMenu::currentActionChanged, this,[this](QAction* pAct){ - // 保持界面统一,先更新底栏展示结果 + // 保持界面统一 QString previousText = m_pEncodeMenu->getCurrentText(); - m_pEncodeMenu->setCurrentTextOnly(pAct->text()); // 处于文件加载状态或转换失败则恢复默认编码格式 if (m_pWrapper->getFileLoading() || !m_pWrapper->reloadFileEncode(pAct->text().toLocal8Bit())) { m_pEncodeMenu->setCurrentTextOnly(previousText); + } else { + // 存储完成后更新底栏显示文本,重载时可能需要保存旧文本 + m_pEncodeMenu->setCurrentTextOnly(pAct->text()); } - - //先屏蔽,双字节空字符先按照显示字符编码号处理 - //m_pWrapper->clearDoubleCharaterEncode(); }); //切换文件类型 @@ -89,6 +120,14 @@ BottomBar::BottomBar(QWidget *parent) //编码按钮/文本类型按钮失去焦点后,设置光标回到文本框里 connect(m_pEncodeMenu, &DDropdownMenu::sigSetTextEditFocus, this, &BottomBar::slotSetTextEditFocus); connect(m_pHighlightMenu, &DDropdownMenu::sigSetTextEditFocus, this, &BottomBar::slotSetTextEditFocus); + connect(m_formatMenu,&DDropdownMenu::sigSetTextEditFocus, this, &BottomBar::slotSetTextEditFocus); + +#ifdef DTKWIDGET_CLASS_DSizeMode + updateSizeMode(); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &BottomBar::updateSizeMode); +#else + setFixedHeight(s_BottomBarHeight); +#endif } BottomBar::~BottomBar() @@ -141,15 +180,19 @@ void BottomBar::setPalette(const QPalette &palette) paEncodeMenu.setColor(DPalette::WindowText, colorFont); paHighlightMenu.setColor(DPalette::WindowText, colorFont); + m_pPositionLabel->setPalette(paPositionLabel); m_pCharCountLabel->setPalette(paCharCountLabel); m_pCursorStatus->setPalette(paCursorStatus); m_pEncodeMenu->getButton()->setPalette(paEncodeMenu); m_pHighlightMenu->getButton()->setPalette(paHighlightMenu); + m_scaleLabel->setPalette(paPositionLabel); + m_formatMenu->getButton()->setPalette(paEncodeMenu); QString theme = (palette.color(QPalette::Background).lightness() < 128) ? "dark" : "light"; m_pEncodeMenu->setTheme(theme); m_pHighlightMenu->setTheme(theme); + m_formatMenu->setTheme(theme); QWidget::setPalette(palette); } @@ -166,15 +209,57 @@ void BottomBar::setChildEnabled(bool enabled) m_pHighlightMenu->setEnabled(enabled); m_pEncodeMenu->setRequestMenu(enabled); m_pHighlightMenu->setRequestMenu(enabled); + m_formatMenu->setEnabled(enabled); } void BottomBar::setChildrenFocus(bool ok,QWidget* preOrderWidget) { m_pEncodeMenu->setChildrenFocus(ok); m_pHighlightMenu->setChildrenFocus(ok); + m_formatMenu->setChildrenFocus(ok); if(ok) { if(preOrderWidget) setTabOrder(preOrderWidget,m_pEncodeMenu->getButton()); - setTabOrder(m_pEncodeMenu->getButton(),m_pHighlightMenu->getButton()); + + setTabOrder(m_pEncodeMenu->getButton(),m_formatMenu->getButton()); + setTabOrder(m_formatMenu->getButton(),m_pHighlightMenu->getButton()); + } +} + +void BottomBar::setScaleLabelText(qreal fontSize) +{ + int maxFont = 50; + int minFont = 8; + int midFont = 12; + QString text; + if (qFuzzyCompare(fontSize, midFont)) { + text = "100%"; + } + else if(fontSize > midFont){ + float delta = (500-100)*1.0/(maxFont - midFont); + int target = 100 + qRound(delta * (fontSize-midFont)); + text = QString("%1%").arg(target); + } + else { + float delta = (100-10)*1.0/(midFont - minFont); + int target = 100 + qRound(delta * (fontSize-midFont)); + target = std::max(10,target); + text = QString("%1%").arg(target); + } + + m_scaleLabel->setText(text); +} + +void BottomBar::setProgress(int progress) +{ + if(progress<0){ + return; + } + m_progressBar->show(); + m_progressLabel->show(); + m_progressBar->setValue(progress); + if(progress >= 100){ + m_progressBar->hide(); + m_progressLabel->hide(); } } @@ -243,3 +328,100 @@ void BottomBar::slotSetTextEditFocus() Window *pWindow = static_cast(m_pWrapper->window()); emit pWindow->pressEsc(); } + +BottomBar::EndlineFormat BottomBar::getEndlineFormat(const QByteArray& text) +{ + for(int i=0;isetExclusive(true); + m_formatMenu->setMenuActionGroup(actionGroup); + + m_unixAction = menu->addAction("Unix"); + m_windowsAction = menu->addAction("Windows"); + m_unixAction->setProperty(FormatActionType,EndlineFormat::Unix); + m_windowsAction->setProperty(FormatActionType,EndlineFormat::Windows); + actionGroup->addAction(m_unixAction); + actionGroup->addAction(m_windowsAction); + connect(actionGroup, &QActionGroup::triggered, this,&BottomBar::onFormatMenuTrigged); + + m_formatMenu->setMenu(menu); + m_formatMenu->setCurrentTextOnly("Unix"); +} + +//行尾格式action槽函数 +void BottomBar::onFormatMenuTrigged(QAction* action) +{ + if(!action){ + return; + } + int type = action->property(FormatActionType).toInt(); + if(m_endlineFormat == type){ + return; + } + + m_pWrapper->textEditor()->onEndlineFormatChanged(m_endlineFormat,(EndlineFormat)type); + m_endlineFormat = (EndlineFormat)type; + +} + +/** + @brief 根据界面布局模式 `DGuiApplicationHelper::isCompactMode()` 切换当前界面布局参数。 + 需要注意,界面参数同设计图参数并非完全一致,而是按照实际的显示像素值进行比对。 + */ +void BottomBar::updateSizeMode() +{ +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + setFixedHeight(s_BottomBarHeightCompact); + } else { + setFixedHeight(s_BottomBarHeight); + } +#endif +} + +//设置行尾menu text +void BottomBar::setEndlineMenuText(EndlineFormat format) +{ + if(format == EndlineFormat::Unix || format == EndlineFormat::Unknow){ + m_formatMenu->setCurrentTextOnly("Unix"); + m_endlineFormat = EndlineFormat::Unix; + + } + else { + m_formatMenu->setCurrentTextOnly("Windows"); + m_endlineFormat = EndlineFormat::Windows; + } +} + +/** + @return 返回默认的底部栏高度,此高度在紧凑模式下有不同值 + */ +int BottomBar::defaultHeight() +{ +#ifdef DTKWIDGET_CLASS_DSizeMode + return DGuiApplicationHelper::isCompactMode() ? s_BottomBarHeightCompact : s_BottomBarHeight; +#else + return s_BottomBarHeight; +#endif +} diff --git a/src/widgets/bottombar.h b/src/widgets/bottombar.h index 63382a24..889b2833 100644 --- a/src/widgets/bottombar.h +++ b/src/widgets/bottombar.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -12,12 +12,22 @@ #include #include #include +#include + +#define FormatActionType "format-action-type" class EditWrapper; class BottomBar : public QWidget { Q_OBJECT +public: + enum EndlineFormat{ + Unknow = -1, + Unix, + Windows + }; + public: explicit BottomBar(QWidget *parent = nullptr); ~BottomBar(); @@ -31,13 +41,24 @@ class BottomBar : public QWidget void setChildEnabled(bool enabled); //设置所有焦点 梁卫东 2020-09-14 10:55:22 void setChildrenFocus(bool ok,QWidget* preOrderWidget = nullptr); + void setScaleLabelText(qreal fontSize); + void setProgress(int progress); DDropdownMenu* getEncodeMenu(); DDropdownMenu* getHighlightMenu(); + static EndlineFormat getEndlineFormat(const QByteArray& text); + EndlineFormat getEndlineFormat(); + void setEndlineMenuText(EndlineFormat format); + static int defaultHeight(); protected: void paintEvent(QPaintEvent *); +private: + void initFormatMenu(); + Q_SLOT void onFormatMenuTrigged(QAction* action); + Q_SLOT void updateSizeMode(); + private: EditWrapper *m_pWrapper {nullptr}; DLabel *m_pPositionLabel {nullptr}; @@ -49,6 +70,14 @@ class BottomBar : public QWidget QString m_columnStr {QString()}; QString m_chrCountStr {QString()}; bool m_bIsFindOrReplace {false}; + DLabel* m_scaleLabel = nullptr; + DLabel* m_progressLabel = nullptr; + DProgressBar* m_progressBar = nullptr; + DDropdownMenu *m_formatMenu = nullptr; + EndlineFormat m_endlineFormat = EndlineFormat::Unix; + QAction* m_unixAction = nullptr; + QAction* m_windowsAction = nullptr; + public slots: //编码按钮/文本类型按钮失去焦点后,设置光标回到文本框里 diff --git a/src/widgets/ddropdownmenu.cpp b/src/widgets/ddropdownmenu.cpp index c254785d..843eb00f 100644 --- a/src/widgets/ddropdownmenu.cpp +++ b/src/widgets/ddropdownmenu.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -18,13 +18,18 @@ using namespace Dtk::Core; -QVector> DDropdownMenu::sm_groupEncodeVec; +// 不同布局模式(紧凑) +const int s_DDropdownMenuHeight = 28; +const int s_DDropdownMenuHeightCompact = 20; DDropdownMenu::DDropdownMenu(QWidget *parent) : QFrame(parent) , m_pToolButton(new DToolButton(this)) , m_menu(new DMenu) { + // 更新单独添加的高亮格式文件 + m_Repository.addCustomSearchPath(KF5_HIGHLIGHT_PATH); + //设置toobutton属性 m_pToolButton->setFocusPolicy(Qt::StrongFocus); m_pToolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); @@ -35,8 +40,8 @@ DDropdownMenu::DDropdownMenu(QWidget *parent) //设置图标 QString theme = (DGuiApplicationHelper::instance()->applicationPalette().color(QPalette::Background).lightness() < 128) ? "dark" : "light"; QString arrowSvgPath = QString(":/images/dropdown_arrow_%1.svg").arg(theme); - //装换图片 - int scaled =qApp->devicePixelRatio() == 1.25 ? 2 : 1; + // 根据当前显示缩放转换图片 + qreal scaled = this->devicePixelRatioF(); QSvgRenderer svg_render(arrowSvgPath); QPixmap pixmap(QSize(8,5)*scaled); pixmap.fill(Qt::transparent); @@ -47,9 +52,8 @@ DDropdownMenu::DDropdownMenu(QWidget *parent) m_pToolButton->setIcon(createIcon()); //设置字体 - int fontsize =DFontSizeManager::instance()->fontPixelSize(DFontSizeManager::T9); + int fontsize = DFontSizeManager::instance()->fontPixelSize(DFontSizeManager::T9); m_font.setPixelSize(fontsize); - m_font.setFamily("SourceHanSansSC-Normal"); //添加布局 QHBoxLayout *layout = new QHBoxLayout(); @@ -62,6 +66,15 @@ DDropdownMenu::DDropdownMenu(QWidget *parent) //设置字体自适应大小 //设置界面大小根据内容大小自适应 梁卫东 2020.7.7 connect(qApp,&DApplication::fontChanged,this,&DDropdownMenu::OnFontChangedSlot); + +#ifdef DTKWIDGET_CLASS_DSizeMode + m_pToolButton->setFixedHeight(DGuiApplicationHelper::isCompactMode() ? s_DDropdownMenuHeightCompact : s_DDropdownMenuHeight); + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [this](){ + m_pToolButton->setFixedHeight(DGuiApplicationHelper::isCompactMode() ? s_DDropdownMenuHeightCompact : s_DDropdownMenuHeight); + }); +#else + m_pToolButton->setFixedHeight(s_DDropdownMenuHeight); +#endif } DDropdownMenu::~DDropdownMenu() @@ -93,28 +106,55 @@ void DDropdownMenu::setCurrentAction(QAction *pAct) void DDropdownMenu::setCurrentTextOnly(const QString &name) { - QList menuList = m_menu->actions(); - - for (int i = 0; i < menuList.size(); i++) { - if(menuList[i]->menu()){ - QList acts = menuList[i]->menu()->actions(); - if(acts.size() == 0) continue; - for (int j = 0; j < acts.size(); j++) { - if(acts[j]->text() != name){ - acts[j]->setCheckable(false); - acts[j]->setChecked(false); - } - else{ - acts[j]->setCheckable(true); - acts[j]->setChecked(true); - } - } - } + // QList menuList = m_menu->actions(); + +// for (int i = 0; i < menuList.size(); i++) { +// if(menuList[i]->menu()){ +// QList acts = menuList[i]->menu()->actions(); +// if(acts.size() == 0) continue; +// for (int j = 0; j < acts.size(); j++) { +// if(acts[j]->text() != name){ +// acts[j]->setCheckable(false); +// acts[j]->setChecked(false); +// } +// else{ +// acts[j]->setCheckable(true); +// acts[j]->setChecked(true); +// } +// } +// } +// } + for(auto ac:m_menu->actions()){ + setCheckedExclusive(ac,name); } setText(name); } + +void DDropdownMenu::setCheckedExclusive(QAction* action,const QString& name) +{ + if(nullptr == action){ + return; + } + + if(action->menu()){ + for(auto ac:action->menu()->actions()){ + setCheckedExclusive(ac,name); + } + } + else { + if(action->text() != name){ + action->setCheckable(false); + action->setChecked(false); + } + else{ + action->setCheckable(true); + action->setChecked(true); + } + } +} + void DDropdownMenu::slotRequestMenu(bool request) { if (request) { @@ -173,8 +213,8 @@ void DDropdownMenu::deleteMenuActionGroup() void DDropdownMenu::setTheme(const QString &theme) { QString arrowSvgPath = QString(":/images/dropdown_arrow_%1.svg").arg(theme); - //装换图片 - int scaled =qApp->devicePixelRatio() == 1.25 ? 2 : 1; + // 根据当前显示缩放转换图片 + qreal scaled = this->devicePixelRatioF(); QSvgRenderer svg_render(arrowSvgPath); QPixmap pixmap(QSize(8,5)*scaled); @@ -216,45 +256,13 @@ DDropdownMenu *DDropdownMenu::createEncodeMenu() { DDropdownMenu *m_pEncodeMenu = new DDropdownMenu(); DMenu* m_pMenu = new DMenu(); - if(sm_groupEncodeVec.isEmpty()){ - QFile file(":/encodes/encodes.ini"); - QString data; - if(file.open(QIODevice::ReadOnly)) - { - data = QString::fromUtf8(file.readAll()); - file.close(); - } - - QTextStream readStream(&data,QIODevice::ReadOnly); - while (!readStream.atEnd()) { - QString group = readStream.readLine(); - QString key = group.mid(1,group.length()-2); - QString encodes = readStream.readLine(); - QString value = encodes.mid(8,encodes.length()-2); - sm_groupEncodeVec.append(QPair(key,value.split(","))); - - QStringList list = value.split(","); - QMenu* groupMenu = new QMenu(QObject::tr(key.toLocal8Bit().data())); - foreach(QString var,list) - { - QAction *act= groupMenu->addAction(QObject::tr(var.toLocal8Bit().data())); - if(act->text() == "UTF-8") { - m_pEncodeMenu->m_pActUtf8 = act; - act->setChecked(true); - }else { - act->setCheckable(false); - } - - } - - m_pMenu->addMenu(groupMenu); - } - }else { - int cnt = sm_groupEncodeVec.size(); - for (int i = 0;i < cnt;i++) { - QMenu* groupMenu = new QMenu(QObject::tr(sm_groupEncodeVec[i].first.toLocal8Bit().data())); - foreach(QString var,sm_groupEncodeVec[i].second) + auto groupEncodeVec = Utils::getSupportEncoding(); + if (!groupEncodeVec.isEmpty()) { + int cnt = groupEncodeVec.size(); + for (int i = 0; i < cnt;i++) { + QMenu* groupMenu = new QMenu(QObject::tr(groupEncodeVec[i].first.toLocal8Bit().data())); + foreach(QString var, groupEncodeVec[i].second) { QAction *act= groupMenu->addAction(QObject::tr(var.toLocal8Bit().data())); if(act->text() == "UTF-8") { @@ -367,15 +375,19 @@ QIcon DDropdownMenu::createIcon() arrowPixmap = m_arrowPixmap; } - //根据字体大小设置icon大小 - //height 30 width QFontMetrics fm(font()) fm.width(text)+40; - int fontWidth = QFontMetrics(m_font).width(m_text)+20; - int fontHeight = QFontMetrics(m_font).height(); + // 根据字体大小设置icon大小,按计算的字体高度,而非从字体文件中读取的高度(部分字体中英文高度不同) + QFontMetrics metrics(m_font); + int fontWidth = metrics.width(m_text) + 20; + int fontHeight = metrics.size(Qt::TextSingleLine, m_text).height(); int iconW = 8; int iconH = 5; - int totalWidth = fontWidth + iconW + 20; - int totalHeigth = 28; + int totalWidth = fontWidth + iconW + 10; +#ifdef DTKWIDGET_CLASS_DSizeMode + int totalHeigth = DGuiApplicationHelper::isCompactMode() ? s_DDropdownMenuHeightCompact : s_DDropdownMenuHeight; +#else + int totalHeigth = s_DDropdownMenuHeight; +#endif m_pToolButton->setFixedSize(totalWidth,totalHeigth); m_pToolButton->setIconSize(QSize(totalWidth,totalHeigth)); diff --git a/src/widgets/ddropdownmenu.h b/src/widgets/ddropdownmenu.h index b3edf0c5..e516ebbd 100644 --- a/src/widgets/ddropdownmenu.h +++ b/src/widgets/ddropdownmenu.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -43,6 +43,7 @@ public slots: void setCurrentAction(QAction*); void setCurrentTextOnly(const QString& name); void slotRequestMenu(bool request); + void setCheckedExclusive(QAction* action,const QString& name); public: //创建编码菜单 @@ -80,8 +81,6 @@ private slots: bool m_bPressed =false; bool isRequest = false; KSyntaxHighlighting::Repository m_Repository; -private: - static QVector> sm_groupEncodeVec; }; #endif diff --git a/src/widgets/pathsettintwgt.cpp b/src/widgets/pathsettintwgt.cpp new file mode 100644 index 00000000..7f9f999e --- /dev/null +++ b/src/widgets/pathsettintwgt.cpp @@ -0,0 +1,172 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "pathsettintwgt.h" +#include "../common/settings.h" + +#include +#include + +#include +#include +#include +#include + +// 不同布局模式参数 +const int s_PSWSuggestBtnSize = 36; +const int s_PSWSuggestIconSize = 24; +const int s_PSWSuggestBtnSizeCompact = 24; +const int s_PSWSuggestIconSizeCompact = 16; + +PathSettingWgt::PathSettingWgt(QWidget* parent):DWidget(parent) +{ + init(); + onSaveIdChanged(Settings::instance()->getSavePathId()); +} + +PathSettingWgt::~PathSettingWgt() +{ + +} + +void PathSettingWgt::onSaveIdChanged(int id) +{ + switch (id) { + case CurFileBox:{ + m_curFileBox->setChecked(true); + m_customBtn->setEnabled(false); + break; + } + case LastOptBox:{ + m_lastOptBox->setChecked(true); + m_customBtn->setEnabled(false); + break; + } + case CustomBox:{ + m_customBox->setChecked(true); + m_customBtn->setEnabled(true); + setEditText(Settings::instance()->getSavePath(CustomBox)); + break; + } + default: + break; + } +} + +void PathSettingWgt::init() +{ + QVBoxLayout* layout = new QVBoxLayout(this); + m_group = new QButtonGroup(this); + layout->setContentsMargins(0,0,0,0); + m_curFileBox = new DCheckBox(this); + m_lastOptBox = new DCheckBox(this); + m_customBox = new DCheckBox(this); + m_customEdit = new DLineEdit(this); + m_customBtn = new DSuggestButton(this); + // 获取DTK提供的选取按钮,保持和 DFileChooserEdit 相同的设置 + m_customBtn->setFixedSize(36, 36); + m_customBtn->setIconSize(QSize(24, 24)); + m_customBtn->setIcon(DStyleHelper(style()).standardIcon(DStyle::SP_SelectElement, nullptr)); + + m_group->addButton(m_lastOptBox,LastOptBox); + m_group->addButton(m_curFileBox,CurFileBox); + m_group->addButton(m_customBox,CustomBox); + + m_lastOptBox->setText(tr("Remember the last used path")); + m_curFileBox->setText(tr("Same path as the current file")); + m_customBox->setText(tr("Customize the default path")); + m_customBtn->setEnabled(false); + m_customEdit->setDisabled(true); + m_customEdit->setClearButtonEnabled(false); + + QHBoxLayout* hlayout = new QHBoxLayout; + hlayout->addWidget(m_customBox); + hlayout->addWidget(m_customEdit); + hlayout->addWidget(m_customBtn); + + layout->addWidget(m_lastOptBox); + layout->addWidget(m_curFileBox); + layout->addLayout(hlayout); + + connections(); + +#ifdef DTKWIDGET_CLASS_DSizeMode + updateSizeMode(); + QObject::connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &PathSettingWgt::updateSizeMode); +#endif +} + +void PathSettingWgt::connections() +{ + connect(m_group,static_cast(&QButtonGroup::buttonClicked),this,&PathSettingWgt::onBoxClicked); + connect(m_customBtn, &QPushButton::clicked, this, &PathSettingWgt::onBtnClicked); +} + +void PathSettingWgt::setEditText(const QString& text) +{ + QFontMetrics metrics(m_customEdit->font()); + Qt::TextElideMode em = Qt::TextElideMode::ElideMiddle; + m_customEdit->setText(metrics.elidedText(text, em, 175)); +} + +void PathSettingWgt::onBoxClicked(int id) +{ + switch (id) { + case CurFileBox:{ + Settings::instance()->setSavePathId(CurFileBox); + m_customBtn->setEnabled(false); + break; + } + case LastOptBox:{ + Settings::instance()->setSavePathId(LastOptBox); + m_customBtn->setEnabled(false); + break; + } + case CustomBox:{ + Settings::instance()->setSavePathId(CustomBox); + setEditText(Settings::instance()->getSavePath(CustomBox)); + m_customBtn->setEnabled(true); + break; + } + default: + break; + } +} + +void PathSettingWgt::onBtnClicked() +{ + QFileDialog dialog(this); + dialog.setFileMode(QFileDialog::DirectoryOnly); + dialog.setAcceptMode(QFileDialog::AcceptOpen); + QString path = Settings::instance()->getSavePath(PathSettingWgt::CustomBox); + if(!QDir(path).exists() || path.isEmpty()){ + path = QDir::homePath() + "/Documents"; + } + dialog.setDirectory(path); + const int mode = dialog.exec(); + if (mode != QDialog::Accepted) { + return; + } + + path = dialog.selectedFiles().at(0); + setEditText(path); + Settings::instance()->setSavePath(PathSettingWgt::CustomBox,path); +} + +/** + @brief 根据界面布局模式 `DGuiApplicationHelper::isCompactMode()` 切换当前界面布局参数。 + 需要注意,界面参数同设计图参数并非完全一致,而是按照实际的显示像素值进行比对。 + */ +void PathSettingWgt::updateSizeMode() +{ +#ifdef DTKWIDGET_CLASS_DSizeMode + if (DGuiApplicationHelper::isCompactMode()) { + m_customBtn->setFixedSize(s_PSWSuggestBtnSizeCompact, s_PSWSuggestBtnSizeCompact); + m_customBtn->setIconSize(QSize(s_PSWSuggestIconSizeCompact, s_PSWSuggestIconSizeCompact)); + } else { + m_customBtn->setFixedSize(s_PSWSuggestBtnSize, s_PSWSuggestBtnSize); + m_customBtn->setIconSize(QSize(s_PSWSuggestIconSize, s_PSWSuggestIconSize)); + } +#endif +} diff --git a/src/widgets/pathsettintwgt.h b/src/widgets/pathsettintwgt.h new file mode 100644 index 00000000..638340ca --- /dev/null +++ b/src/widgets/pathsettintwgt.h @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef PATHSETTINTWGT_H +#define PATHSETTINTWGT_H + +#include +#include +#include +#include + +#include + +DWIDGET_USE_NAMESPACE +class PathSettingWgt : public DWidget +{ + Q_OBJECT +public: + enum CheckBoxType{ + LastOptBox, + CurFileBox, + CustomBox + }; + +public: + PathSettingWgt(QWidget* parent = nullptr); + virtual ~PathSettingWgt(); + +public Q_SLOTS: + void onSaveIdChanged(int id); + void setEditText(const QString& text); + +private: + void init(); + void connections(); + +Q_SIGNALS: + void savingPathChanged(CheckBoxType id,const QString& path); + +private Q_SLOTS: + void onBoxClicked(int); + void onBtnClicked(); + void updateSizeMode(); + +private: + DCheckBox* m_curFileBox = nullptr; + DCheckBox* m_lastOptBox = nullptr; + DCheckBox* m_customBox = nullptr; + DLineEdit* m_customEdit = nullptr; + DSuggestButton* m_customBtn = nullptr; + QButtonGroup* m_group = nullptr; +}; + +#endif diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index f0fb0995..c5babbc4 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -1,9 +1,9 @@ -// SPDX-FileCopyrightText: - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "window.h" - +#include "pathsettintwgt.h" #include #include #include @@ -42,6 +42,7 @@ #define PRINT_FLAG 2 #define PRINT_ACTION 8 +#define PRINT_FORMAT_MARGIN 10 #define FLOATTIP_MARGIN 95 /** @@ -111,8 +112,8 @@ void Window::printPage(int index, QPainter *painter, const QTextDocument *doc, * @param body 范围大小 * @param pageCountBox 绘制页码的范围 */ -void Window::printPageWithMultiDoc(int index, QPainter *painter, const QVector &printInfo, - const QRectF &body, const QRectF &pageCountBox) +void Window::printPageWithMultiDoc( + int index, QPainter *painter, const QVector &printInfo, const QRectF &body, const QRectF &pageCountBox) { painter->save(); @@ -131,11 +132,61 @@ void Window::printPageWithMultiDoc(int index, QPainter *painter, const QVectordocumentLayout(); - QAbstractTextDocumentLayout::PaintContext ctx; - ctx.clip = docView; - ctx.palette.setColor(QPalette::Text, Qt::black); - // 绘制文档 - layout->draw(painter, ctx); + + // 大文本的高亮单独处理 + if (info.highlighter) { + // 提前两页拷贝数据,用于处理高亮计算时连续处理 + qreal offsetHeight = qMax(0, (qMin(2, docIndex - 1) * body.height())); + QPointF point = docView.topLeft() - QPointF(0, offsetHeight); + int pos = layout->hitTest(point, Qt::FuzzyHit); + QTextCursor cursor(info.doc); + cursor.setPosition(pos); + // 选取后续内容 + int endPos = layout->hitTest(docView.bottomLeft(), Qt::FuzzyHit); + endPos = qMin(endPos + 1000, info.doc->characterCount() - 1); + cursor.setPosition(endPos, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + + // 创建临时文档 + QTextDocument *tmpDoc = createNewDocument(info.doc); + QTextCursor insertCursor(tmpDoc); + insertCursor.beginEditBlock(); + insertCursor.insertFragment(QTextDocumentFragment(cursor)); + insertCursor.endEditBlock(); + + auto margin = info.doc->rootFrame()->frameFormat().margin(); + auto fmt = tmpDoc->rootFrame()->frameFormat(); + fmt.setMargin(margin); + tmpDoc->rootFrame()->setFrameFormat(fmt); + + tmpDoc->setPageSize(body.size()); + // 重新高亮文本 + auto newHighlighter = new CSyntaxHighlighter(tmpDoc); + newHighlighter->setDefinition(info.highlighter->definition()); + newHighlighter->setTheme(info.highlighter->theme()); + rehighlightPrintDoc(tmpDoc, newHighlighter); + + // 确保布局完成 + tmpDoc->pageCount(); + + // 调整显示位置 + painter->resetTransform(); + painter->translate(body.left(), body.top() - offsetHeight); + QAbstractTextDocumentLayout::PaintContext ctx; + ctx.clip = QRectF(0, offsetHeight, body.width(), body.height()); + ctx.palette.setColor(QPalette::Text, Qt::black); + tmpDoc->documentLayout()->setPaintDevice(painter->device()); + tmpDoc->documentLayout()->draw(painter, ctx); + + delete newHighlighter; + delete tmpDoc; + } else { + QAbstractTextDocumentLayout::PaintContext ctx; + ctx.clip = docView; + ctx.palette.setColor(QPalette::Text, Qt::black); + // 绘制文档 + layout->draw(painter, ctx); + } break; } @@ -145,7 +196,6 @@ void Window::printPageWithMultiDoc(int index, QPainter *painter, const QVectorrestore(); } - Window::Window(DMainWindow *parent) : DMainWindow(parent), m_centralWidget(new QWidget), @@ -296,6 +346,10 @@ Window::Window(DMainWindow *parent) //setChildrenFocus(false); Utils::clearChildrenFocus(m_tabbar);//使用此函数把tabbar的组件焦点去掉(左右箭头不能focus) +#ifdef DTKWIDGET_CLASS_DSizeMode + // 适配紧凑模式更新,注意 Qt::QueuedConnection 需要在其他子组件更新后触发 + connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &Window::updateSizeMode, Qt::QueuedConnection); +#endif } Window::~Window() @@ -364,7 +418,7 @@ void Window::updateModifyStatus(const QString &path, bool isModified) QString tabName; QString filePath = m_tabbar->truePathAt(tabIndex); - if (filePath.isNull() || filePath.length() <= 0 || filePath.contains("/.local/share/deepin/deepin-editor/blank-files")) { + if (filePath.isNull() || filePath.length() <= 0 || Utils::isDraftFile(filePath)) { tabName = m_tabbar->textAt(tabIndex); if (isModified) { if (!tabName.contains('*')) { @@ -491,6 +545,11 @@ void Window::initTitlebar() connect(m_tabbar, &Tabbar::closeTabs, this, &Window::handleTabsClosed, Qt::QueuedConnection); connect(m_tabbar, &Tabbar::requestHistorySaved, this, [ = ](const QString & filePath) { + // 单个Tab页关闭文件时记录文件信息 + if (StartManager::instance()->checkPath(filePath)) { + Utils::recordCloseFile(filePath); + } + if (QFileInfo(filePath).dir().absolutePath() == m_blankFileDir) { return; } @@ -625,15 +684,25 @@ void Window::addTab(const QString &filepath, bool activeTab) void Window::addTabWithWrapper(EditWrapper *wrapper, const QString &filepath, const QString &qstrTruePath, const QString &tabName, int index) { if (index == -1) { - index = m_tabbar->currentIndex() + 1; + index = m_tabbar->count(); } //这里会重复连接信号和槽,先全部取消 QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.systemBus().disconnect("com.deepin.daemon.Gesture", - "/com/deepin/daemon/Gesture", "com.deepin.daemon.Gesture", - "Event", - wrapper->textEditor(), SLOT(fingerZoom(QString, QString, int))); + switch (Utils::getSystemVersion()) { + case Utils::V23: + dbus.systemBus().disconnect("org.deepin.dde.Gesture1", + "/org/deepin/dde/Gesture1", "org.deepin.dde.Gesture1", + "Event", + wrapper->textEditor(), SLOT(fingerZoom(QString, QString, int))); + break; + default: + dbus.systemBus().disconnect("com.deepin.daemon.Gesture", + "/com/deepin/daemon/Gesture", "com.deepin.daemon.Gesture", + "Event", + wrapper->textEditor(), SLOT(fingerZoom(QString, QString, int))); + break; + } wrapper->textEditor()->disconnect(); connect(wrapper->textEditor(), &TextEdit::cursorModeChanged, wrapper, &EditWrapper::handleCursorModeChanged); connect(wrapper->textEditor(), &TextEdit::clickFindAction, this, &Window::popupFindBar, Qt::QueuedConnection); @@ -643,10 +712,20 @@ void Window::addTabWithWrapper(EditWrapper *wrapper, const QString &filepath, co connect(wrapper->textEditor(), &TextEdit::popupNotify, this, &Window::showNotify, Qt::QueuedConnection); connect(wrapper->textEditor(), &TextEdit::signal_setTitleFocus, this, &Window::slot_setTitleFocus, Qt::QueuedConnection); - dbus.systemBus().connect("com.deepin.daemon.Gesture", - "/com/deepin/daemon/Gesture", "com.deepin.daemon.Gesture", - "Event", - wrapper->textEditor(), SLOT(fingerZoom(QString, QString, int))); + switch (Utils::getSystemVersion()) { + case Utils::V23: + dbus.systemBus().connect("org.deepin.dde.Gesture1", + "/org/deepin/dde/Gesture1", "org.deepin.dde.Gesture1", + "Event", + wrapper->textEditor(), SLOT(fingerZoom(QString, QString, int))); + break; + default: + dbus.systemBus().connect("com.deepin.daemon.Gesture", + "/com/deepin/daemon/Gesture", "com.deepin.daemon.Gesture", + "Event", + wrapper->textEditor(), SLOT(fingerZoom(QString, QString, int))); + break; + } connect(wrapper->textEditor(), &QPlainTextEdit::cursorPositionChanged, wrapper->textEditor(), &TextEdit::cursorPositionChanged); connect(wrapper->textEditor(), &QPlainTextEdit::textChanged, wrapper->textEditor(), [ = ]() { @@ -968,6 +1047,24 @@ void Window::openFile() } dialog.setDirectory(historyDirStr); + QDir historyDir(historyDirStr); + + if (historyDir.exists()) { + dialog.setDirectory(historyDir); + } else { + qDebug() << "historyDir or default path not existed:" << historyDir; + } + + QString path = m_settings->getSavePath(m_settings->getSavePathId()); + // 使用当前文件路径时,打开当前文件的目录,新建文档为系统-文档目录 + if (PathSettingWgt::CurFileBox == m_settings->getSavePathId()) { + path = getCurrentOpenFilePath(); + } + if (path.isEmpty() || !QDir(path).exists() || !QFileInfo(path).isWritable() || !QDir(path).isReadable()) { + path = QDir::homePath() + "/Documents"; + } + dialog.setDirectory(path); + const int mode = dialog.exec(); PerformanceMonitor::openFileStart(); @@ -1037,10 +1134,6 @@ bool Window::saveFile() } else { temPath = filePath; } - - //updateSaveAsFileName(temPath, filePath); - //wrapperEdit->updatePath(temPath,filePath); - bool success = wrapperEdit->saveFile(); if (success) { @@ -1086,9 +1179,19 @@ QString Window::saveAsFileToDisk() DFileDialog dialog(this, tr("Save File")); dialog.setAcceptMode(QFileDialog::AcceptSave); - dialog.addComboBox(QObject::tr("Encoding"), QStringList() << wrapper->getTextEncode()); dialog.setDirectory(QDir::homePath()); - QString path = m_settings->settings->option("advance.editor.file_dialog_dir")->value().toString(); + // 允许选取保存的编码格式 + DFileDialog::DComboBoxOptions encodingOptions; + encodingOptions.editable = false; + encodingOptions.defaultValue = wrapper->getTextEncode(); + encodingOptions.data = Utils::getSupportEncodingList(); + dialog.addComboBox(QObject::tr("Encoding"), encodingOptions); + + QString path = m_settings->getSavePath(m_settings->getSavePathId()); + // 使用当前文件路径时,打开当前文件的目录,新建文档为系统-文档目录 + if (PathSettingWgt::CurFileBox == m_settings->getSavePathId()) { + path = getCurrentOpenFilePath(); + } if (path.isEmpty() || !QDir(path).exists() || !QFileInfo(path).isWritable() || !QDir(path).isReadable()) { path = QDir::homePath() + "/Documents"; } @@ -1103,21 +1206,37 @@ QString Window::saveAsFileToDisk() dialog.selectFile(fileInfo.fileName()); } - //wrapper->setUpdatesEnabled(false); int mode = dialog.exec(); - //wrapper->setUpdatesEnabled(true); - if (mode == QDialog::Accepted) { const QByteArray encode = dialog.getComboBoxValue(QObject::tr("Encoding")).toUtf8(); - const QString endOfLine = dialog.getComboBoxValue(QObject::tr("Line Endings")); const QString newFilePath = dialog.selectedFiles().value(0); - m_settings->settings->option("advance.editor.file_dialog_dir")->setValue(dialog.directoryUrl().toLocalFile()); + Settings::instance()->setSavePath(PathSettingWgt::LastOptBox, QFileInfo(newFilePath).absolutePath()); + Settings::instance()->setSavePath(PathSettingWgt::CurFileBox, QFileInfo(newFilePath).absolutePath()); wrapper->updatePath(wrapper->filePath(), newFilePath); - if (!wrapper->saveFile()) { + + bool needChangeEncode = (encode != wrapper->getTextEncode().toUtf8()); + bool saveSucc = false; + if (QFileInfo(wrapper->filePath()).absoluteFilePath() + == QFileInfo(newFilePath).absoluteFilePath()) { + // 相同路径,直接保存文件 + saveSucc = wrapper->saveFile(encode); + } else { + saveSucc = wrapper->saveAsFile(newFilePath, encode); + } + + if (!saveSucc) { /* 如果保存未成功,无需记录更新新文件路径 */ wrapper->updatePath(wrapper->filePath(), QString()); return QString(); + } else { + // 更新文件编码 + wrapper->bottomBar()->setEncodeName(encode); + + // 若编码变更,保存完成后,重新加载文件 + if (needChangeEncode) { + wrapper->readFile(encode); + } } if (wrapper->filePath().contains(m_backupDir) || wrapper->filePath().contains(m_blankFileDir)) { @@ -1251,15 +1370,66 @@ void Window::changeSettingDialogComboxFontNumber(int fontNumber) m_settings->settings->option("base.font.size")->setValue(fontNumber); } +/** + * @brief 根据传入的字体大小计算字体的比例,字体大小范围在 8 ~ 500,比例范围在 10% ~ 500%, + * 默认字体大小为12。因此在 8~12 和 12~50 两组范围字体的缩放间隔不同。 + * @param fontSize 字体大小 + * @return 字体缩放比例,范围 10 ~ 500 + */ +qreal Window::calcFontScale(qreal fontSize) +{ + if (qFuzzyCompare(fontSize, m_settings->m_iDefaultFontSize)) { + return 100.0; + } else if (fontSize > m_settings->m_iDefaultFontSize) { + static const qreal delta = (500 - 100) * 1.0 / (m_settings->m_iMaxFontSize - m_settings->m_iDefaultFontSize); + qreal fontScale = 100 + delta * (fontSize - m_settings->m_iDefaultFontSize); + return qMin(fontScale, 500.0); + } else { + static const qreal delta = (100 - 10) * 1.0 / (m_settings->m_iDefaultFontSize - m_settings->m_iMinFontSize); + qreal fontScale = 100 + delta * (fontSize - m_settings->m_iDefaultFontSize); + return qMax(fontScale, 10.0); + } +} + +/** + * @brief 根据字体缩放比例返回字体大小 + * @param fontScale 字体缩放比例 + * @return 字体大小,范围 8~50 + */ +qreal Window::calcFontSizeFromScale(qreal fontScale) +{ + if (qFuzzyCompare(fontScale, 100.0)) { + return m_settings->m_iDefaultFontSize; + } else if (fontScale > 100.0) { + static const qreal delta = (m_settings->m_iMaxFontSize - m_settings->m_iDefaultFontSize) * 1.0 / (500 - 100); + qreal fontSize = m_settings->m_iDefaultFontSize + delta * ((fontScale) - 100); + return qMin(fontSize, m_settings->m_iMaxFontSize); + } else { + static const qreal delta = (m_settings->m_iDefaultFontSize - m_settings->m_iMinFontSize) * 1.0 / (100 - 10) ; + qreal fontSize = m_settings->m_iMinFontSize + delta * (fontScale - 10); + return qMax(fontSize, m_settings->m_iMinFontSize); + } +} + void Window::decrementFontSize() { - int size = std::max(m_fontSize - 1, m_settings->m_iMinFontSize); + qreal fontScale = calcFontScale(m_fontSize); + // 减少10% + fontScale -= 10; + m_fontSize = calcFontSizeFromScale(fontScale); + + qreal size = qMax(m_fontSize, m_settings->m_iMinFontSize); m_settings->settings->option("base.font.size")->setValue(size); } void Window::incrementFontSize() { - int size = std::min(m_fontSize + 1, m_settings->m_iMaxFontSize); + qreal fontScale = calcFontScale(m_fontSize); + // 增加10% + fontScale += 10; + m_fontSize = calcFontSizeFromScale(fontScale); + + qreal size = qMin(m_fontSize, m_settings->m_iMaxFontSize); m_settings->settings->option("base.font.size")->setValue(size); } @@ -1270,8 +1440,9 @@ void Window::resetFontSize() void Window::setFontSizeWithConfig(EditWrapper *wrapper) { - int size = m_settings->settings->option("base.font.size")->value().toInt(); + qreal size = m_settings->settings->option("base.font.size")->value().toReal(); wrapper->textEditor()->setFontSize(size); + wrapper->bottomBar()->setScaleLabelText(size); m_fontSize = size; } @@ -1312,12 +1483,17 @@ void Window::popupFindBar() m_findBar->show(); m_findBar->move(QPoint(4, height() - m_findBar->height() - 4)); - QString text = wrapper->textEditor()->textCursor().selectedText(); + //QString text = wrapper->textEditor()->textCursor().selectedText(); + QString text = wrapper->textEditor()->selectedText(); int row = wrapper->textEditor()->getCurrentLine(); int column = wrapper->textEditor()->getCurrentColumn(); int scrollOffset = wrapper->textEditor()->getScrollOffset(); m_findBar->activeInput(text, tabPath, row, column, scrollOffset); + // highlight keyword when findbar show + wrapper->textEditor()->highlightKeywordInView(text); + // set keywords + m_keywordForSearchAll = m_keywordForSearch = text; QTimer::singleShot(10, this, [ = ] { m_findBar->focus(); }); } @@ -1435,6 +1611,9 @@ void Window::popupSettingsDialog() DSettingsDialog *dialog = new DSettingsDialog(this); dialog->widgetFactory()->registerWidget("fontcombobox", Settings::createFontComBoBoxHandle); dialog->widgetFactory()->registerWidget("keySequenceEdit", Settings::createKeySequenceEditHandle); + dialog->widgetFactory()->registerWidget("savingpathwgt", Settings::createSavingPathWgt); + dialog->resize(680, 300); + dialog->setMinimumSize(680, 300); m_settings->setSettingDialog(dialog); dialog->updateSettings(m_settings->settings); @@ -1486,13 +1665,36 @@ void Window::setWindowTitleInfo() } } +/** + * @brief 取得当前文件打开文档目录,新建文档为"系统-文档"目录(~/Documents) + * @return 当前文件打开文档目录 + */ +QString Window::getCurrentOpenFilePath() +{ + QString path; + EditWrapper *wrapper = currentWrapper(); + if (wrapper) { + QString curFilePath = wrapper->textEditor() ? wrapper->textEditor()->getTruePath() + : wrapper->filePath(); + // 临时文件或备份文件,均返回"文档"目录 + if (Utils::isDraftFile(curFilePath) || Utils::isBackupFile(curFilePath)) { + path = QDir::homePath() + "/Documents"; + } else { + path = QFileInfo(curFilePath).absolutePath(); + } + } + + return path; +} + /** * @brief 克隆文本数据,不同于 QTextDocument::clone(), 主要用于大文本的拷贝,拷贝过程通过 * QApplication::processEvents() 执行其它事件 * @param editWrapper 文本编辑处理,提供文本编辑器和高亮信息 * @return 是否克隆数据成功 * - * @note Qt自带的布局算法在超长文本时存在计算越界的问题,计算后的 + * @note Qt自带的布局算法在超长文本时存在计算越界的问题,计算长度将返回溢出值,导致显示异常, + 调整为拆分的文档结构 */ bool Window::cloneLargeDocument(EditWrapper *editWrapper) { @@ -1552,8 +1754,8 @@ bool Window::cloneLargeDocument(EditWrapper *editWrapper) if (currentCopyCharCount >= s_StepCopyCharCount) { // 判断是否超过单个文档允许的最大范围 - if ((copyDoc->characterCount() + currentCopyCharCount) > s_MaxDocCharCount - || (copyDoc->blockCount() + currentSelectBlock) > s_MaxDocBlockCount) { + if ((copyDoc->characterCount() + currentCopyCharCount) > s_MaxDocCharCount || + (copyDoc->blockCount() + currentSelectBlock) > s_MaxDocBlockCount) { // 创建新的打印文档 m_printDocList.append(createPrintInfo()); copyDoc = m_printDocList.last().doc; @@ -1598,34 +1800,64 @@ bool Window::cloneLargeDocument(EditWrapper *editWrapper) return true; } -\ -#if 0 //Qt原生打印预览调用 -void Window::popupPrintDialog() +/** + @brief 使用 \a highlighter 重新高亮传入的文本 \a doc ,此函数用于大文本打印时对临时文本的处理 + */ +void Window::rehighlightPrintDoc(QTextDocument *doc, CSyntaxHighlighter *highlighter) { - QPrinter printer(QPrinter::HighResolution); - QPrintPreviewDialog preview(this); + if (!doc || !highlighter) { + return; + } - TextEdit *wrapper = currentWrapper()->textEditor(); - const QString &filePath = wrapper->filepath; - const QString &fileDir = QFileInfo(filePath).dir().absolutePath(); + QColor background = m_printWrapper->textEditor()->palette().color(QPalette::Base); + bool backgroundIsDark = background.value() < 128; - if (fileDir == m_blankFileDir) { - printer.setOutputFileName(QString("%1/%2.pdf").arg(QDir::homePath(), m_tabbar->currentName())); - printer.setDocName(QString("%1/%2.pdf").arg(QDir::homePath(), m_tabbar->currentName())); + highlighter->setEnableHighlight(true); + if (backgroundIsDark) { + for (QTextBlock block = doc->firstBlock(); block.isValid(); block = block.next()) { + highlighter->rehighlightBlock(block); + + QVector formatList = block.layout()->formats(); + // adjust syntax highlighting colors for better contrast + for (int i = formatList.count() - 1; i >= 0; --i) { + QTextCharFormat &format = formatList[i].format; + if (format.background().color() == background) { + QBrush brush = format.foreground(); + QColor color = brush.color(); + int h, s, v, a; + color.getHsv(&h, &s, &v, &a); + color.setHsv(h, s, qMin(128, v), a); + brush.setColor(color); + format.setForeground(brush); + } + format.setBackground(Qt::white); + } + + block.layout()->setFormats(formatList); + } } else { - printer.setOutputFileName(QString("%1/%2.pdf").arg(fileDir, QFileInfo(filePath).baseName())); - printer.setDocName(QString("%1/%2.pdf").arg(fileDir, QFileInfo(filePath).baseName())); + highlighter->rehighlight(); } + highlighter->setEnableHighlight(false); +} - printer.setOutputFormat(QPrinter::PdfFormat); - - connect(&preview, &QPrintPreviewDialog::paintRequested, this, [ = ](QPrinter * printer) { - currentWrapper()->textEditor()->print(printer); - }); +/** + @brief 接收布局模式变更信号 DGuiApplicationHelper::sizeModeChanged() ,更新界面布局 + Window 接收布局模式变更,调整 findBar 和 replaceBar 的坐标位置。 + @note 需要在 findBar / replaceBar / bottomBar 更新后触发更新 + */ +void Window::updateSizeMode() +{ + if (m_findBar && m_findBar->isVisible()) { + currentWrapper()->bottomBar()->updateSize(m_findBar->height() + 8, true); + m_findBar->move(QPoint(4, height() - m_findBar->height() - 4)); + } - preview.exec(); + if (m_replaceBar && m_replaceBar->isVisible()) { + currentWrapper()->bottomBar()->updateSize(m_replaceBar->height() + 8, true); + m_replaceBar->move(QPoint(4, height() - m_replaceBar->height() - 4)); + } } -#endif void Window::popupPrintDialog() { @@ -1640,6 +1872,8 @@ void Window::popupPrintDialog() const QString &filePath = currentWrapper()->textEditor()->getFilePath(); const QString &fileDir = QFileInfo(filePath).dir().absolutePath(); + qInfo() << qPrintable("Start print doc"); + //适配打印接口2.0,dtk版本大于或等于5.4.10才放开最新的2.0打印预览接口 #if (DTK_VERSION_MAJOR > 5 \ || (DTK_VERSION_MAJOR == 5 && DTK_VERSION_MINOR > 4) \ @@ -1673,6 +1907,7 @@ void Window::popupPrintDialog() // 大文件处理 if (m_bLargePrint) { + qInfo() << qPrintable("Clone large print document"); // 克隆大文本数据 if (!cloneLargeDocument(currentWrapper())) { return; @@ -1793,6 +2028,18 @@ void Window::displayShortcuts() QRect rect = window()->geometry(); QPoint pos(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2); + // 获取当前焦点位置(光标所在屏幕中心) + QScreen *screen = nullptr; + if (DGuiApplicationHelper::isTabletEnvironment()) { + // bug 88079 避免屏幕旋转弹出位置错误 + screen = qApp->primaryScreen(); + } else { + screen = QGuiApplication::screenAt(QCursor::pos()); + } + + if (screen) { + pos = screen->geometry().center(); + } //窗体快捷键 QStringList windowKeymaps; @@ -1970,7 +2217,7 @@ void Window::doPrint(DPrinter *printer, const QVector &pageRange) layout->setPaintDevice(p.device()); int dpiy = p.device()->logicalDpiY(); - int margin = (int)((2 / 2.54) * dpiy); // 2 cm margins + int margin = static_cast((2 / 2.54) * dpiy); // 2 cm margins auto fmt = m_printDoc->rootFrame()->frameFormat(); fmt.setMargin(margin); @@ -2039,7 +2286,7 @@ void Window::doPrintWithLargeDoc(DPrinter *printer, const QVector &pageRang return; } - qWarning() << "calc print large doc!"; + qInfo() << qPrintable("Calc print large doc!"); // 执行处理时屏蔽其它输入 DPrintPreviewWidget *prieviewWidget = m_pPreview->findChild(); @@ -2079,10 +2326,7 @@ void Window::doPrintWithLargeDoc(DPrinter *printer, const QVector &pageRang body.width() - 2 * margin, fontMetrics.height()); - // 进行文本高亮和布局 - QColor background = m_printWrapper->textEditor()->palette().color(QPalette::Base); - bool backgroundIsDark = background.value() < 128; - + // Note:大文本打印的高亮处理被延迟到实际打印时计算 m_multiDocPageCount = 0; for (auto &info : m_printDocList) { QTextDocument *printDoc = info.doc; @@ -2097,37 +2341,7 @@ void Window::doPrintWithLargeDoc(DPrinter *printer, const QVector &pageRang // 设置打印大小 printDoc->setPageSize(body.size()); - if (info.highlighter) { - info.highlighter->setEnableHighlight(true); - } - for (QTextBlock block = printDoc->firstBlock(); block.isValid(); block = block.next()) { - // 调整为开始布局前高亮(纯文本无需高亮) - if (info.highlighter) { - info.highlighter->rehighlightBlock(block); - - // 调整颜色对比度 - if (backgroundIsDark) { - QVector formatList = block.layout()->formats(); - // adjust syntax highlighting colors for better contrast - for (int i = formatList.count() - 1; i >= 0; --i) { - QTextCharFormat &format = formatList[i].format; - if (format.background().color() == background) { - QBrush brush = format.foreground(); - QColor color = brush.color(); - int h, s, v, a; - color.getHsv(&h, &s, &v, &a); - color.setHsv(h, s, qMin(128, v), a); - brush.setColor(color); - format.setForeground(brush); - } - format.setBackground(Qt::white); - } - - block.layout()->setFormats(formatList); - } - } - // 通过对单个文本块进行布局,拆分布局总时间,防止布局时间过长 lay->blockBoundingRect(block); // 处理其它事件 @@ -2146,10 +2360,6 @@ void Window::doPrintWithLargeDoc(DPrinter *printer, const QVector &pageRang } } - if (info.highlighter) { - info.highlighter->setEnableHighlight(false); - } - // 更新文件总打印页数 m_multiDocPageCount += printDoc->pageCount(); } @@ -2176,6 +2386,8 @@ void Window::doPrintWithLargeDoc(DPrinter *printer, const QVector &pageRang printer->newPage(); } } + + qInfo() << qPrintable("Calc print large doc finised!"); } #endif @@ -2193,7 +2405,7 @@ void Window::asynPrint(QPainter &p, DPrinter *printer, const QVector &pageR QRectF pageRect(printer->pageRect()); int dpiy = p.device()->logicalDpiY(); - int margin = (int)((2 / 2.54) * dpiy); // 2 cm margins + int margin = static_cast((2 / 2.54) * dpiy); // 2 cm margins QRectF body = QRectF(0, 0, pageRect.width(), pageRect.height()); QTextDocument *curDoc = m_bLargePrint ? m_printDocList.first().doc : m_printDoc; @@ -2343,7 +2555,15 @@ bool Window::closeAllFiles() return true; } -void Window::addTemFileTab(QString qstrPath, QString qstrName, QString qstrTruePath, QString lastModifiedTime, bool bIsTemFile) +/** + * @brief addTemFileTab 恢复备份文件标签页 + * @param qstrPath 打开文件路径 + * @param qstrName 真实文件名 + * @param qstrTruePath 真实文件路径 + * @param qstrTruePath 最后一次修改时间 + * @param bIsTemFile 是否修改 + */ +void Window::addTemFileTab(const QString &qstrPath, const QString &qstrName, const QString &qstrTruePath, const QString &lastModifiedTime, bool bIsTemFile) { if (qstrPath.isEmpty() || !Utils::fileExists(qstrPath)) { return; @@ -2386,8 +2606,6 @@ QMap Window::getWrappers() void Window::setChildrenFocus(bool ok) { - QMap::Iterator it = m_wrappers.begin(); - if (ok) { DIconButton *addButton = m_tabbar->findChild("AddButton"); DIconButton *optionBtn = titlebar()->findChild("DTitlebarDWindowOptionButton"); @@ -2537,7 +2755,7 @@ void Window::handleCurrentChanged(const int &index) if (currentWrapper() != nullptr) { currentWrapper()->bottomBar()->show(); - currentWrapper()->bottomBar()->updateSize(32, false); + currentWrapper()->bottomBar()->updateSize(BottomBar::defaultHeight(), false); } } @@ -2607,7 +2825,7 @@ void Window::slotFindbarClose() wrapper->bottomBar()->show(); } - wrapper->bottomBar()->updateSize(32, false); + wrapper->bottomBar()->updateSize(BottomBar::defaultHeight(), false); currentWrapper()->textEditor()->setFocus(); currentWrapper()->textEditor()->tellFindBarClose(); } @@ -2620,7 +2838,7 @@ void Window::slotReplacebarClose() wrapper->bottomBar()->show(); } - wrapper->bottomBar()->updateSize(32, false); + wrapper->bottomBar()->updateSize(BottomBar::defaultHeight(), false); currentWrapper()->textEditor()->setFocus(); currentWrapper()->textEditor()->tellFindBarClose(); } @@ -2631,8 +2849,9 @@ void Window::handleReplaceAll(const QString &replaceText, const QString &withTex wrapper->textEditor()->replaceAll(replaceText, withText); } -void Window::handleReplaceNext(QString file, const QString &replaceText, const QString &withText) +void Window::handleReplaceNext(const QString &file, const QString &replaceText, const QString &withText) { + Q_UNUSED(file); m_keywordForSearch = replaceText; m_keywordForSearchAll = replaceText; EditWrapper *wrapper = currentWrapper(); @@ -2933,10 +3152,11 @@ void Window::slotSigAdjustFont(QString fontName) } } -void Window::slotSigAdjustFontSize(int fontSize) +void Window::slotSigAdjustFontSize(qreal fontSize) { for (EditWrapper *wrapper : m_wrappers.values()) { wrapper->textEditor()->setFontSize(fontSize); + wrapper->bottomBar()->setScaleLabelText(fontSize); wrapper->OnUpdateHighlighter(); } @@ -3106,7 +3326,21 @@ void Window::closeEvent(QCloseEvent *e) return; } } else { - backupFile(); + bool save_tab_before_close = m_settings->settings->option("advance.startup.save_tab_before_close")->value().toBool(); + if (!save_tab_before_close) { + if (!closeAllFiles()) { + e->ignore(); + return; + } + } else { + // 单个窗口时,没有记录单独关闭窗口,需要记录窗口信息。 + for (auto itr = m_wrappers.begin(); itr != m_wrappers.end(); ++itr) { + QString filePath = itr.value()->textEditor()->getFilePath(); + Utils::recordCloseFile(filePath); + } + + backupFile(); + } } // WARNING: 调用 QProcess::startDetached() 前同步配置,防止多线程对 qgetenv() 中的 environmentMutex 加锁 @@ -3224,6 +3458,10 @@ void Window::keyPressEvent(QKeyEvent *e) } } else if (key == Utils::getKeyshortcutFromKeymap(m_settings, "window", "find")) { popupFindBar(); + } else if (key == Utils::getKeyshortcutFromKeymap(m_settings, "window", "findNext")) { + handleFindNextSearchKeyword(m_keywordForSearch); + } else if (key == Utils::getKeyshortcutFromKeymap(m_settings, "window", "findPrev")) { + handleFindPrevSearchKeyword(m_keywordForSearch); } else if (key == Utils::getKeyshortcutFromKeymap(m_settings, "window", "replace")) { popupReplaceBar(); } else if (key == Utils::getKeyshortcutFromKeymap(m_settings, "window", "jumptoline")) { diff --git a/src/widgets/window.h b/src/widgets/window.h index 725a08b6..67cf028a 100644 --- a/src/widgets/window.h +++ b/src/widgets/window.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -120,26 +120,12 @@ class Window : public DMainWindow // 翻页预览打印,无需重新布局 void asynPrint(QPainter &p, DPrinter *printer, const QVector &pageRange); - /** - * @brief backupFile 备份文件 - */ + // 备份文件 void backupFile(); - - /** - * @brief closeAllFiles 关闭当前窗口所有文件 - * @return - */ + // 关闭当前窗口所有文件 bool closeAllFiles(); - - /** - * @brief addTemFileTab 恢复备份文件标签页 - * @param qstrPath 打开文件路径 - * @param qstrName 真实文件名 - * @param qstrTruePath 真实文件路径 - * @param qstrTruePath 最后一次修改时间 - * @param bIsTemFile 是否修改 - */ - void addTemFileTab(QString qstrPath, QString qstrName, QString qstrTruePath, QString lastModifiedTime, bool bIsTemFile = false); + // 恢复备份文件标签页 + void addTemFileTab(const QString &qstrPath, const QString &qstrName, const QString &qstrTruePath, const QString &lastModifiedTime, bool bIsTemFile = false); QMap getWrappers(); @@ -156,8 +142,8 @@ class Window : public DMainWindow static void printPage(int index, QPainter *painter, const QTextDocument *doc, const QRectF &body, const QRectF &pageCountBox); -signals: - void themeChanged(const QString themeName); +Q_SIGNALS: + void themeChanged(const QString &themeName); void requestDragEnterEvent(QDragEnterEvent *); void requestDropEvent(QDropEvent *); void newWindow(); @@ -167,7 +153,7 @@ class Window : public DMainWindow // 标签页出现变更信号,文件添加或删除时触发 void tabChanged(); -public slots: +public Q_SLOTS: void addBlankTab(); void addBlankTab(const QString &blankFile); void handleTabCloseRequested(int index); @@ -192,7 +178,7 @@ public slots: void slotReplacebarClose(); void handleReplaceAll(const QString &replaceText, const QString &withText); - void handleReplaceNext(QString file, const QString &replaceText, const QString &withText); + void handleReplaceNext(const QString &file, const QString &replaceText, const QString &withText); void handleReplaceRest(const QString &replaceText, const QString &withText); void handleReplaceSkip(QString file, QString keyword); @@ -217,7 +203,7 @@ public slots: void slotClearDoubleCharaterEncode(); void slotSigThemeChanged(const QString &path); void slotSigAdjustFont(QString fontName); - void slotSigAdjustFontSize(int fontSize); + void slotSigAdjustFontSize(qreal fontSize); void slotSigAdjustTabSpaceNumber(int number); void slotSigAdjustWordWrap(bool enable); void slotSigSetLineNumberShow(bool bIsShow); @@ -238,12 +224,23 @@ public slots: void checkTabbarForReload(); void clearPrintTextDocument(); void setWindowTitleInfo(); + // 取得当前文档打开路径(新建文档为"系统-文档"目录) + QString getCurrentOpenFilePath(); + // 计算字体大小的缩放比例 + qreal calcFontScale(qreal fontSize); + // 从字体缩放比例推算字体大小 + qreal calcFontSizeFromScale(qreal fontScale); // 克隆文本数据 bool cloneLargeDocument(EditWrapper *editWrapper); // 打印多文本数据 void printPageWithMultiDoc(int index, QPainter *painter, const QVector &printInfo, const QRectF &body, const QRectF &pageCountBox); + // 重新更新文本 + void rehighlightPrintDoc(QTextDocument *doc, CSyntaxHighlighter *highlighter); + + // 接收布局模式变更信号,更新界面布局 + Q_SLOT void updateSizeMode(); protected: void resizeEvent(QResizeEvent *event) override; @@ -284,7 +281,7 @@ public slots: QString m_blankFileDir; QString m_backupDir; QString m_autoBackupDir; - int m_fontSize = 0; + qreal m_fontSize = 0; QString m_titlebarStyleSheet; @@ -307,6 +304,8 @@ public slots: bool m_bLargePrint = false; // 是否为大文件打印 bool m_bPrintProcessing = false; // 文件打印计算中 EditWrapper *m_printWrapper = nullptr; // 当前处理的编辑对象(关闭标签页时需要退出打印) + QTextDocument *printCopyDoc = nullptr; // 用于大文本打印时的拷贝文档 + CSyntaxHighlighter *printCopyHighlighter = nullptr; // 用于大文本打印时的高亮文档 QVector m_printDocList; // 打印文档列表,用于超大文档打印 int m_multiDocPageCount = 0; // 用于超大文档打印时单独记录多文档的打印页数 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e29c970a..6145bee9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -59,11 +59,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline") #Include all app own subdirectorys -file(GLOB_RECURSE INTRODUCTION_SRC_TEST ${CMAKE_CURRENT_LIST_DIR}/../src/*.cpp) +file(GLOB_RECURSE INTRODUCTION_SRC_TEST ${CMAKE_CURRENT_LIST_DIR}/../src/*.cpp ${CMAKE_CURRENT_LIST_DIR}/../src/basepub/*.c) #file(GLOB_RECURSE INTRODUCTION_SRC_TEST ${CMAKE_CURRENT_LIST_DIR}/../src/*.) #file(GLOB_RECURSE INTRODUCTION_SRC_TEST1 ${CMAKE_CURRENT_LIST_DIR}/src/*.) file(GLOB_RECURSE INTRODUCTION_SRC_TEST1 ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp *.theme) #file(GLOB_RECURSE INTRODUCTION_SRC_TEST1 ${CMAKE_CURRENT_LIST_DIR}/src/*.theme) +file(GLOB_RECURSE INTRODUCTION_SRC_TEST2 ${CMAKE_CURRENT_LIST_DIR}/../src/*.h) list(REMOVE_ITEM INTRODUCTION_SRC_TEST "${CMAKE_CURRENT_LIST_DIR}/../src/main.cpp") list(REMOVE_ITEM INTRODUCTION_SRC_TEST "${CMAKE_CURRENT_LIST_DIR}/../src/dedit/main.cpp") @@ -72,6 +73,7 @@ list(REMOVE_ITEM INTRODUCTION_SRC_TEST "${CMAKE_CURRENT_LIST_DIR}/../src/common/ # 生成测试可执行程序 add_executable(${PROJECT_NAME_TEST} + ${INTRODUCTION_SRC_TEST2} ${INTRODUCTION_SRC_TEST} ${INTRODUCTION_SRC_TEST1} ${APP_QRC} @@ -105,6 +107,7 @@ target_link_libraries(${PROJECT_NAME_TEST} ICU::uc -lpthread -lm + dl uchardet chardet ) diff --git a/tests/src/common/ut_utils.cpp b/tests/src/common/ut_utils.cpp index 98e56fe4..bcc72c4a 100644 --- a/tests/src/common/ut_utils.cpp +++ b/tests/src/common/ut_utils.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,6 +11,10 @@ #include "../../src/startmanager.h" #include "../../src/editor/dtextedit.h" #include "../../src/common/utils.h" +extern "C" { +#include "../../src/basepub/load_libs.h" +} + #include "stub.h" #include #include @@ -529,4 +533,51 @@ TEST(UT_Utils_checkRegionIntersect, checkRegionIntersect) ASSERT_EQ(type, Utils::EIntersectInner); } +QByteArray supportEncoding_readAll_stub() +{ + return QByteArray(); +} + +TEST(UT_Utils_getSupportEncoding, getSupportEncoding) +{ + auto encoding = Utils::getSupportEncoding(); + ASSERT_FALSE(encoding.isEmpty()); +} + +TEST(UT_Utils_getSupportEncoding, getSupportEncodingWithError) +{ + Stub stub1; + typedef QVector > VecType; + stub1.set(ADDR(VecType, isEmpty), supportEncoding_readAll_stub); + Stub stub2; + stub2.set(ADDR(QIODevice, readAll), supportEncoding_readAll_stub); + + auto encoding = Utils::getSupportEncoding(); + ASSERT_TRUE(encoding.isEmpty()); +} +TEST(UT_Utils_getSupportEncodingList, getSupportEncodingList) +{ + QStringList encodingList = Utils::getSupportEncodingList(); + ASSERT_FALSE(encodingList.isEmpty()); + ASSERT_TRUE(encodingList.contains("UTF-8")); +} + +void uos_document_clip_copy_false(const char *path, int *intercept) +{ + Q_UNUSED(path) + if (intercept) { + *intercept = 1; + } +} + +TEST(UT_Utils_zpdLib, enableClipCopy_notLoad_True) +{ + EXPECT_TRUE(Utils::enableClipCopy("")); + EXPECT_TRUE(Utils::enableClipCopy(QString::null)); + + getLoadZPDLibsInstance()->m_document_clip_copy = &uos_document_clip_copy_false; + EXPECT_FALSE(Utils::enableClipCopy("")); + + getLoadZPDLibsInstance()->m_document_clip_copy = nullptr; +} diff --git a/tests/src/editor/ut_deletebackcommond.cpp b/tests/src/editor/ut_deletebackcommond.cpp index f2931aba..d1ff2c70 100644 --- a/tests/src/editor/ut_deletebackcommond.cpp +++ b/tests/src/editor/ut_deletebackcommond.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022-2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -12,11 +12,11 @@ UT_Deletebackcommond::UT_Deletebackcommond() } -TEST(UT_Deletebackcommond_DeleteBackCommond, UT_Deletebackcommond_DeleteBackCommond) +TEST(UT_Deletebackcommond_DeleteBackCommand, UT_Deletebackcommond_DeleteBackCommand) { QTextCursor cursor; QPlainTextEdit *pEdit = new QPlainTextEdit; - DeleteBackCommond *pCom = new DeleteBackCommond(cursor, pEdit); + DeleteBackCommand *pCom = new DeleteBackCommand(cursor, pEdit); ASSERT_TRUE(pCom->m_insertPos != 0); delete pCom; @@ -33,7 +33,7 @@ TEST(UT_Deletebackcommond_redo, UT_Deletebackcommond_redo) QTextCursor cursor = pWindow->currentWrapper()->textEditor()->textCursor(); pWindow->currentWrapper()->textEditor()->insertPlainText(QString("12345")); cursor.setPosition(10, QTextCursor::MoveMode::KeepAnchor); - DeleteBackCommond *pCom = new DeleteBackCommond(cursor, pWindow->currentWrapper()->textEditor()); + DeleteBackCommand *pCom = new DeleteBackCommand(cursor, pWindow->currentWrapper()->textEditor()); pCom->m_delText = text; pCom->redo(); @@ -52,27 +52,24 @@ TEST(UT_Deletebackcommond_undo, UT_Deletebackcommond_undo) pWindow->addBlankTab(QString()); QTextCursor cursor = pWindow->currentWrapper()->textEditor()->textCursor(); pWindow->currentWrapper()->textEditor()->insertPlainText(QString("12345")); - cursor.setPosition(10, QTextCursor::MoveMode::KeepAnchor); - DeleteBackCommond *pCom = new DeleteBackCommond(cursor, pWindow->currentWrapper()->textEditor()); + cursor.setPosition(5, QTextCursor::MoveMode::KeepAnchor); + DeleteBackCommand *pCom = new DeleteBackCommand(cursor, pWindow->currentWrapper()->textEditor()); pCom->m_delText = text; pCom->undo(); - ASSERT_NE(cursor.position(), pWindow->currentWrapper()->textEditor()->textCursor().position()); + EXPECT_EQ(cursor.position(), pWindow->currentWrapper()->textEditor()->textCursor().position()); delete pCom; pCom = nullptr; - delete pWindow; - pWindow = nullptr; + pWindow->deleteLater(); } - - UT_Deletebackaltcommond::UT_Deletebackaltcommond() { } -TEST(UT_Deletebackaltcommond_DeleteBackAltCommond, UT_Deletebackaltcommond_DeleteBackAltCommond) +TEST(UT_Deletebackaltcommond_DeleteBackAltCommand, UT_Deletebackaltcommond_DeleteBackAltCommand) { QString text = "test"; QList list; @@ -85,7 +82,7 @@ TEST(UT_Deletebackaltcommond_DeleteBackAltCommond, UT_Deletebackaltcommond_Delet list.push_back(sel); QPlainTextEdit* edit = new QPlainTextEdit; - DeleteBackAltCommond* com = new DeleteBackAltCommond(list, edit); + DeleteBackAltCommand* com = new DeleteBackAltCommand(list, edit); delete com; com = nullptr; @@ -108,7 +105,7 @@ TEST(UT_Deletebackaltcommond_redo, UT_Deletebackaltcommond_redo) sel.cursor = cursor; list.push_back(sel); list.push_back(sel); - DeleteBackAltCommond * commond = new DeleteBackAltCommond(list,edit); + DeleteBackAltCommand * commond = new DeleteBackAltCommand(list,edit); commond->m_deletions = {{"123",1,1,1,cursor}}; commond->redo(); @@ -135,7 +132,7 @@ TEST(UT_Deletebackaltcommond_undo, UT_Deletebackaltcommond_undo) list.push_back(sel); list.push_back(sel); - DeleteBackAltCommond* com = new DeleteBackAltCommond(list,edit); + DeleteBackAltCommand* com = new DeleteBackAltCommand(list,edit); com->m_deletions = {{"123",1,1,1,cursor}}; com->undo(); diff --git a/tests/src/editor/ut_editwrapper.cpp b/tests/src/editor/ut_editwrapper.cpp index 3993c448..99169bf1 100644 --- a/tests/src/editor/ut_editwrapper.cpp +++ b/tests/src/editor/ut_editwrapper.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -25,7 +25,7 @@ bool rettruestub() return true; } -QStringList stringList = {"123","456"}; +QStringList stringList = {"/tmp/ut_123.txt","/tmp/ut_456.txt"}; QStringList retstringliststub() { return stringList; @@ -131,7 +131,6 @@ void hideWarningNotices_stub() //bool saveFile_001(); TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_001) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); pWindow->currentWrapper()->textEditor()->insertTextEx(pWindow->currentWrapper()->textEditor()->textCursor(), @@ -145,10 +144,9 @@ TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_001) stub.set(pWindow->currentWrapper()->saveFile(), saveFile_001_stub()); bRet = pWindow->currentWrapper()->saveFile(); } - ASSERT_TRUE(bRet == true); + EXPECT_TRUE(bRet == true); pWindow->deleteLater(); - */ } bool saveFile_002_stub() @@ -159,7 +157,6 @@ bool saveFile_002_stub() //bool saveFile_002(); TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_002) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); bool bRet = pWindow->currentWrapper()->saveFile(); @@ -170,17 +167,14 @@ TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_002) stub.set(pWindow->currentWrapper()->saveFile(), saveFile_002_stub()); bRet = pWindow->currentWrapper()->saveFile(); } - ASSERT_TRUE(bRet == true); + EXPECT_TRUE(bRet == true); - delete pWindow; - pWindow = nullptr; - */ + pWindow->deleteLater(); } //bool saveFile_003(); TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_003) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); pWindow->currentWrapper()->textEditor()->m_sFilePath = QString(""); @@ -188,16 +182,13 @@ TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_003) Stub stubNotices; stubNotices.set(ADDR(EditWrapper, hideWarningNotices), hideWarningNotices_stub); bool bRet = pWindow->currentWrapper()->saveFile(); - ASSERT_TRUE(bRet == false); + EXPECT_TRUE(bRet == false); - delete pWindow; - pWindow = nullptr; - */ + pWindow->deleteLater(); } TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_004) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); pWindow->currentWrapper()->textEditor()->m_sFilePath = QString(""); @@ -214,15 +205,13 @@ TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_004) s2.set(ADDR(QByteArray,isEmpty),rettruestub); bool bRet = pWindow->currentWrapper()->saveFile(); + EXPECT_TRUE(bRet); - delete pWindow; - pWindow = nullptr; - */ + pWindow->deleteLater(); } TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_005) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); pWindow->currentWrapper()->textEditor()->m_sFilePath = QString(""); @@ -243,12 +232,52 @@ TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_005) intvalue=0; bool bRet = pWindow->currentWrapper()->saveFile(); + EXPECT_TRUE(bRet); - delete pWindow; - pWindow = nullptr; - */ + pWindow->deleteLater(); } + +TEST(UT_Editwrapper_saveFile, UT_Editwrapper_saveFile_with_encode) +{ + Window *pWindow = new Window; + pWindow->addBlankTab(QString()); + QString tmpFilePath("/tmp/UT_Editwrapper_saveFile.txt"); + pWindow->currentWrapper()->textEditor()->m_sFilePath = tmpFilePath; + pWindow->currentWrapper()->textEditor()->m_qstrTruePath = tmpFilePath; + + QByteArray encoding("GB18030"); + QByteArray utfData("\u4e2d\u6587\u6d4b\u8bd5\u4e00\u4e8c\u4e09\u56db\u0031\u0032\u0033\u0034\u0035\u0036\u0037" + "\u0038\u0039\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068"); + pWindow->currentWrapper()->textEditor()->setPlainText(QString::fromUtf8(utfData)); + + Stub stubNotices; + stubNotices.set(ADDR(EditWrapper, hideWarningNotices), hideWarningNotices_stub); + intvalue = 1; + typedef int (*Fptr)(QFileDialog *); + Fptr fptr = (Fptr)(&QFileDialog::exec); + Stub s1; + s1.set(fptr,retintstub); + + intvalue = 1; + bool bRet = pWindow->currentWrapper()->saveFile(encoding); + EXPECT_TRUE(bRet); + + QFile tmpFile(tmpFilePath); + EXPECT_TRUE(tmpFile.exists()); + QByteArray saveData; + if (tmpFile.open(QFile::ReadOnly | QFile::Text)) { + saveData = tmpFile.readAll(); + tmpFile.close(); + } + + QTextCodec *codec = QTextCodec::codecForName(encoding); + EXPECT_EQ(codec->fromUnicode(utfData), saveData); + + pWindow->deleteLater(); +} + + //bool saveAsFile_001(const QString &newFilePath, QByteArray encodeName); TEST(UT_Editwrapper_saveAsFile_001, UT_Editwrapper_saveAsFile_001) { @@ -257,7 +286,7 @@ TEST(UT_Editwrapper_saveAsFile_001, UT_Editwrapper_saveAsFile_001) pWindow->currentWrapper()->textEditor()->insertTextEx(pWindow->currentWrapper()->textEditor()->textCursor(), QString("12345")); bool bRet = pWindow->currentWrapper()->saveAsFile(QString(), QByteArray("UTF-8")); - ASSERT_TRUE(bRet == false); + EXPECT_FALSE(bRet); pWindow->deleteLater(); } @@ -270,31 +299,24 @@ bool saveAsFile_002_stub() //bool saveAsFile_001(const QString &newFilePath, QByteArray encodeName); TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveAsFile_002) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); pWindow->currentWrapper()->textEditor()->insertTextEx(pWindow->currentWrapper()->textEditor()->textCursor(), QString("12345")); QString newFilePaht(pWindow->currentWrapper()->textEditor()->getTruePath()); bool bRet = pWindow->currentWrapper()->saveAsFile(newFilePaht, QByteArray("UTF-8")); - if (bRet == false) { - Stub stub; - stub.set(pWindow->currentWrapper()->saveAsFile(), saveAsFile_002_stub()); - } - ASSERT_TRUE(bRet == true); + EXPECT_TRUE(bRet); pWindow->deleteLater(); - */ } TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveAsFile_003) { - /* Window *pWindow = new Window(); pWindow->addBlankTab(QString()); pWindow->currentWrapper()->textEditor()->insertTextEx(pWindow->currentWrapper()->textEditor()->textCursor(), QString("12345")); - + intvalue = 1; typedef int (*Fptr)(QFileDialog *); Fptr fptr = (Fptr)(&QFileDialog::exec); Stub s1; @@ -302,7 +324,6 @@ TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveAsFile_003) Stub s2; s2.set(ADDR(QString,isEmpty),retfalsestub); - Stub s3; s3.set(ADDR(QFileDialog,selectedFiles),retstringliststub); @@ -313,9 +334,69 @@ TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveAsFile_003) bool bRet = pWindow->currentWrapper()->saveAsFile(); - EXPECT_NE(bRet,true); + EXPECT_TRUE(bRet); + pWindow->deleteLater(); +} + +// bool saveAsFile(const QString &newFilePath, const QByteArray &encodeName); +TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveFile_with_change_encoding) +{ + Window *pWindow = new Window; + QString saveAsPath("/tmp/ut_saveAsFile.txt"); + QByteArray encoding("GB18030"); + // Utf8 Text: 中文测试一二三四123456789abcdefgh + QByteArray utfData("\u4e2d\u6587\u6d4b\u8bd5\u4e00\u4e8c\u4e09\u56db\u0031\u0032\u0033\u0034\u0035\u0036\u0037" + "\u0038\u0039\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068"); + pWindow->addBlankTab(QString()); + pWindow->currentWrapper()->textEditor()->setPlainText(QString::fromUtf8(utfData)); + + // 默认文本编码为 UTF-8, 转换为 GB18030 + bool ret = pWindow->currentWrapper()->saveAsFile(saveAsPath, encoding); + EXPECT_TRUE(ret); + + QFile saveAsFile(saveAsPath); + EXPECT_TRUE(saveAsFile.open(QFile::ReadOnly | QFile::Text)); + QByteArray saveData = saveAsFile.readAll(); + saveAsFile.close(); + saveAsFile.remove(); + + QTextCodec *codec = QTextCodec::codecForName(encoding); + EXPECT_EQ(codec->fromUnicode(utfData), saveData); + + pWindow->deleteLater(); +} + +// bool saveAsFile(const QString &newFilePath, const QByteArray &encodeName); +TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveFile_with_error_encoding) +{ + Window *pWindow = new Window; + QString saveAsPath("/tmp/ut_saveAsFile.txt"); + QByteArray errEncoding("ERROR-ENCODING"); + // Utf8 Text: 中文测试一二三四123456789abcdefgh + QByteArray utfData("\u4e2d\u6587\u6d4b\u8bd5\u4e00\u4e8c\u4e09\u56db\u0031\u0032\u0033\u0034\u0035\u0036\u0037" + "\u0038\u0039\u0061\u0062\u0063\u0064\u0065\u0066\u0067\u0068"); + pWindow->addBlankTab(QString()); + pWindow->currentWrapper()->textEditor()->setPlainText(QString::fromUtf8(utfData)); + + // 默认文本编码为 UTF-8, 转换为 GB18030 + bool ret = pWindow->currentWrapper()->saveAsFile(saveAsPath, errEncoding); + EXPECT_FALSE(ret); + + pWindow->deleteLater(); +} + +// bool saveAsFile(const QString &newFilePath, const QByteArray &encodeName); +TEST(UT_Editwrapper_saveAsFile, UT_Editwrapper_saveFile_with_empty_data) +{ + Window *pWindow = new Window; + QString saveAsPath("/tmp/ut_saveAsFile.txt"); + pWindow->addBlankTab(QString()); + + // 默认文本编码为 UTF-8, 转换为 GB18030 + bool ret = pWindow->currentWrapper()->saveAsFile(saveAsPath, "UTF-8"); + EXPECT_TRUE(ret); + pWindow->deleteLater(); - */ } //void updatePath(const QString &file); @@ -688,6 +769,8 @@ TEST(UT_Editwrapper_handleFileLoadFinished, UT_Editwrapper_handleFileLoadFinishe setPrintEnabled_stub.set(ADDR(Window, setPrintEnabled), handleFileLoadFinished_001_setPrintEnabled_stub); Stub setTextFinished_stub; setTextFinished_stub.set(ADDR(TextEdit, setTextFinished), handleFileLoadFinished_001_setTextFinished_stub); + Stub loadContent_stub; + loadContent_stub.set(ADDR(EditWrapper, loadContent), rettruestub); pWindow->currentWrapper()->handleFileLoadFinished(encode, retFileContent, false); ASSERT_TRUE(pWindow->currentWrapper()->m_pBottomBar->m_pEncodeMenu != nullptr); @@ -801,7 +884,8 @@ TEST(UT_Editwrapper_handleFileLoadFinished, UT_Editwrapper_handleFileLoadFinishe Stub setTextFinished_stub; setTextFinished_stub.set(ADDR(TextEdit, setTextFinished), handleFileLoadFinished_001_setTextFinished_stub); pWindow->currentWrapper()->handleFileLoadFinished(encode, retFileContent, true); - EXPECT_TRUE(pWindow->currentWrapper()->textEditor()->getReadOnlyPermission()); + EXPECT_FALSE(pWindow->currentWrapper()->textEditor()->getReadOnlyPermission()); + EXPECT_TRUE(pWindow->currentWrapper()->textEditor()->getReadOnlyMode()); pWindow->deleteLater(); } diff --git a/tests/src/editor/ut_insertblockbytextcommond.cpp b/tests/src/editor/ut_insertblockbytextcommond.cpp index 58cd5cfe..6175243c 100644 --- a/tests/src/editor/ut_insertblockbytextcommond.cpp +++ b/tests/src/editor/ut_insertblockbytextcommond.cpp @@ -26,7 +26,7 @@ test_insertblockbytextcommond::test_insertblockbytextcommond() } -TEST_F(test_insertblockbytextcommond, InsertBlockByTextCommond) +TEST_F(test_insertblockbytextcommond, InsertBlockByTextCommand) { Window *pWindow = new Window(); pWindow->addBlankTab(QString()); @@ -36,10 +36,10 @@ TEST_F(test_insertblockbytextcommond, InsertBlockByTextCommond) QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); textCursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor); pWindow->currentWrapper()->textEditor()->setTextCursor(textCursor); - InsertBlockByTextCommond *pInsertBlockByTextCommond = new InsertBlockByTextCommond(QString("Hei man"), + InsertBlockByTextCommand *pInsertBlockByTextCommand = new InsertBlockByTextCommand(QString("Hei man"), pWindow->currentWrapper()->textEditor(), pWindow->currentWrapper()); - QString strRet(pInsertBlockByTextCommond->m_selected); + QString strRet(pInsertBlockByTextCommand->m_selected); ASSERT_TRUE(!strRet.compare(QString("Holle world."))); pWindow->deleteLater(); @@ -56,7 +56,7 @@ TEST_F(test_insertblockbytextcommond, redo) cursor.movePosition(QTextCursor::Start,QTextCursor::KeepAnchor); TextEdit* edit = new TextEdit; edit->setTextCursor(cursor); - InsertBlockByTextCommond* com = new InsertBlockByTextCommond(text,edit,nullptr); + InsertBlockByTextCommand* com = new InsertBlockByTextCommand(text,edit,nullptr); com->redo(); ASSERT_TRUE(!edit->textCursor().hasSelection()); @@ -78,7 +78,7 @@ TEST_F(test_insertblockbytextcommond, undo) cursor.movePosition(QTextCursor::Start,QTextCursor::KeepAnchor); TextEdit* edit = new TextEdit; edit->setTextCursor(cursor); - InsertBlockByTextCommond* com = new InsertBlockByTextCommond(text,edit,nullptr); + InsertBlockByTextCommand* com = new InsertBlockByTextCommand(text,edit,nullptr); com->undo(); ASSERT_TRUE(!edit->textCursor().hasSelection()); @@ -103,7 +103,7 @@ TEST_F(test_insertblockbytextcommond, treat) // TextEdit* edit = new TextEdit(window); // edit->m_wrapper = wrapper; // edit->setTextCursor(cursor); -// InsertBlockByTextCommond* com = new InsertBlockByTextCommond(text,edit,wrapper); +// InsertBlockByTextCommand* com = new InsertBlockByTextCommand(text,edit,wrapper); // Stub s1; // s1.set(ADDR(Window,setPrintEnabled),retintstub); @@ -130,7 +130,7 @@ TEST_F(test_insertblockbytextcommond, insertByBlock) cursor.movePosition(QTextCursor::Start,QTextCursor::KeepAnchor); TextEdit* edit = new TextEdit; edit->setTextCursor(cursor); - InsertBlockByTextCommond* com = new InsertBlockByTextCommond(text,edit,nullptr); + InsertBlockByTextCommand* com = new InsertBlockByTextCommand(text,edit,nullptr); com->insertByBlock(); ASSERT_TRUE(!edit->textCursor().hasSelection()); @@ -139,4 +139,3 @@ TEST_F(test_insertblockbytextcommond, insertByBlock) com=nullptr; edit->deleteLater(); } - diff --git a/tests/src/editor/ut_replaceallcommond.cpp b/tests/src/editor/ut_replaceallcommond.cpp index 79204ac6..e38b533d 100644 --- a/tests/src/editor/ut_replaceallcommond.cpp +++ b/tests/src/editor/ut_replaceallcommond.cpp @@ -10,11 +10,11 @@ test_replaceallcommond::test_replaceallcommond() } -TEST_F(test_replaceallcommond, ReplaceAllCommond) +TEST_F(test_replaceallcommond, ReplaceAllCommand) { QString text = "test"; QTextCursor cursor; - ReplaceAllCommond* com = new ReplaceAllCommond(text,text,cursor); + ReplaceAllCommand* com = new ReplaceAllCommand(text,text,cursor); ASSERT_TRUE(!text.compare(com->m_newText)); delete com; @@ -25,7 +25,7 @@ TEST_F(test_replaceallcommond, redo) { QString text = "test"; QTextCursor cursor; - ReplaceAllCommond* com = new ReplaceAllCommond(text,text,cursor); + ReplaceAllCommand* com = new ReplaceAllCommand(text,text,cursor); com->redo(); ASSERT_TRUE(com->m_cursor.position() != 0); @@ -37,7 +37,7 @@ TEST_F(test_replaceallcommond, undo) { QString text = "test"; QTextCursor cursor; - ReplaceAllCommond* com = new ReplaceAllCommond(text,text,cursor); + ReplaceAllCommand* com = new ReplaceAllCommand(text,text,cursor); com->undo(); ASSERT_TRUE(com->m_cursor.position() != 0); @@ -46,4 +46,3 @@ TEST_F(test_replaceallcommond, undo) } - diff --git a/tests/src/editor/ut_textedit.cpp b/tests/src/editor/ut_textedit.cpp index 8211b191..d329641b 100644 --- a/tests/src/editor/ut_textedit.cpp +++ b/tests/src/editor/ut_textedit.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -1801,6 +1801,7 @@ TEST(UT_test_textedit_replaceAll, UT_test_textedit_replaceAll_002) QString strRetAfter(pWindow->currentWrapper()->textEditor()->toPlainText()); ASSERT_TRUE(!strRetAfter.compare(strRetBefore)); + pWindow->deleteLater(); } @@ -1819,6 +1820,35 @@ TEST(UT_test_textedit_replaceAll, UT_test_textedit_replaceAll_003) QString strRetAfter(pWindow->currentWrapper()->textEditor()->toPlainText()); ASSERT_TRUE(!strRetAfter.compare(QString("Holle Holle\nHolle Holle"))); + + pWindow->currentWrapper()->textEditor()->replaceAll(QString("holle"), QString("World")); + strRetAfter = QString(pWindow->currentWrapper()->textEditor()->toPlainText()); + ASSERT_TRUE(!strRetAfter.compare(QString("World World\nWorld World"))); + + pWindow->deleteLater(); +} + +//replaceAll check case sensitive +TEST(UT_test_textedit_replaceAll, UT_test_textedit_replaceAll_CaseSensitive) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + QString strMsg("Hello world\nHello world"); + QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + pWindow->currentWrapper()->textEditor()->insertTextEx(textCursor, strMsg); + + auto *textEdit = pWindow->currentWrapper()->textEditor(); + + // NotChange + textEdit->replaceAll(QString("hello"), QString("world"), Qt::CaseSensitive); + ASSERT_TRUE(!textEdit->toPlainText().compare(strMsg)); + + textEdit->replaceAll(QString("hello"), QString("World"), Qt::CaseInsensitive); + ASSERT_TRUE(!textEdit->toPlainText().compare(QString("World world\nWorld world"))); + + textEdit->replaceAll(QString("world"), QString("World"), Qt::CaseInsensitive); + ASSERT_TRUE(!textEdit->toPlainText().compare(QString("World World\nWorld World"))); + pWindow->deleteLater(); } @@ -1909,6 +1939,38 @@ TEST(UT_test_textedit_replaceNext, UT_test_textedit_replaceNext_004) pWindow->deleteLater(); } +//replaceNext check sensitive +TEST(UT_test_textedit_replaceNext, UT_test_textedit_replaceNext_CaseSensitive) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + QString strMsg("Hello world\nHello world"); + auto *textEdit = pWindow->currentWrapper()->textEditor(); + QTextCursor textCursor = textEdit->textCursor(); + textEdit->insertTextEx(textCursor, strMsg); + + textCursor = textEdit->textCursor(); + textCursor.movePosition(QTextCursor::Start); + textCursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); + textEdit->setTextCursor(textCursor); + textEdit->m_findHighlightSelection.cursor = textCursor; + + QString strReplaceText("hello"); + QString strWithText("World"); + QString strRetBefore(textEdit->textCursor().block().text()); + + textEdit->replaceNext(strReplaceText, strWithText, Qt::CaseSensitive); + QString strRetAfter(textEdit->textCursor().block().text()); + ASSERT_TRUE(!strRetAfter.compare(strRetBefore)); + + textEdit->setTextCursor(textCursor); + textEdit->m_findHighlightSelection.cursor = textCursor; + textEdit->replaceNext(strReplaceText, strWithText, Qt::CaseInsensitive); + ASSERT_TRUE(!textEdit->toPlainText().compare("World world\nHello world")); + + pWindow->deleteLater(); +} + //replaceRest 001 TEST(UT_test_textedit_replaceRest, UT_test_textedit_replaceRest_001) { @@ -1970,6 +2032,33 @@ TEST(UT_test_textedit_replaceRest, UT_test_textedit_replaceRest_003) pWindow->deleteLater(); } +//replaceRest check case sensitive +TEST(UT_test_textedit_replaceRest, UT_test_textedit_replaceRest_CaseSensitive) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + QString strMsg("Hello world\nHello world Hello world"); + QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + pWindow->currentWrapper()->textEditor()->insertTextEx(textCursor, strMsg); + + textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + textCursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor); + pWindow->currentWrapper()->textEditor()->setTextCursor(textCursor); + QString strReplaceText("World"); + QString strWithText("Hello"); + QString strRetBefore(pWindow->currentWrapper()->textEditor()->textCursor().block().text()); + pWindow->currentWrapper()->textEditor()->replaceRest(strReplaceText, strWithText, Qt::CaseSensitive); + QString strRetAfter(pWindow->currentWrapper()->textEditor()->textCursor().block().text()); + ASSERT_TRUE(!strRetAfter.compare(strRetBefore)); + + pWindow->currentWrapper()->textEditor()->replaceRest(strReplaceText, strWithText, Qt::CaseInsensitive); + strRetAfter = QString(pWindow->currentWrapper()->textEditor()->textCursor().block().text()); + ASSERT_TRUE(!strRetAfter.compare("Hello Hello Hello Hello")); + + pWindow->deleteLater(); +} + + //beforeReplace TEST(UT_test_textedit_beforeReplace, UT_test_textedit_beforeReplace_001) { @@ -2050,6 +2139,27 @@ TEST(UT_test_textedit_highlightKeyword, UT_test_textedit_highlightKeyword_001) pWindow->deleteLater(); } +//highlightKeyword case sensitive +TEST(UT_test_textedit_highlightKeyword, UT_test_textedit_highlightKeyword_CaseSensitive) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + QString strMsg("Hello world\nHello world"); + QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + pWindow->currentWrapper()->textEditor()->insertTextEx(textCursor, strMsg); + + bool bRet = pWindow->currentWrapper()->textEditor()->highlightKeyword(QString("World"), 0); + ASSERT_TRUE(bRet); + + bRet = pWindow->currentWrapper()->textEditor()->highlightKeyword(QString("hello"), 0); + ASSERT_TRUE(bRet); + + bRet = pWindow->currentWrapper()->textEditor()->highlightKeyword(QString("World"), 0, Qt::CaseSensitive); + ASSERT_FALSE(bRet); + + pWindow->deleteLater(); +} + //highlightKeywordInView TEST(UT_test_textedit_highlightKeywordInView, UT_test_textedit_highlightKeywordInView_001) { @@ -2130,8 +2240,12 @@ TEST(UT_test_textedit_updateKeywordSelections, UT_test_textedit_updateKeywordSel QList listExtraSelection; listExtraSelection.append(extraSelection); bool bRet = pWindow->currentWrapper()->textEditor()->updateKeywordSelections(QString("smile"), charFormat, listExtraSelection); + ASSERT_TRUE(bRet == false); + pWindow->currentWrapper()->textEditor()->defaultCaseSensitive = Qt::CaseSensitive; + bRet = pWindow->currentWrapper()->textEditor()->updateKeywordSelections(QString("World"), charFormat, listExtraSelection); ASSERT_TRUE(bRet == false); + pWindow->deleteLater(); } @@ -2151,8 +2265,11 @@ TEST(UT_test_textedit_updateKeywordSelections, UT_test_textedit_updateKeywordSel QList listExtraSelection; listExtraSelection.append(extraSelection); bool bRet = pWindow->currentWrapper()->textEditor()->updateKeywordSelections(QString("world"), charFormat, listExtraSelection); + ASSERT_TRUE(bRet == true); + bRet = pWindow->currentWrapper()->textEditor()->updateKeywordSelections(QString("World"), charFormat, listExtraSelection); ASSERT_TRUE(bRet == true); + pWindow->deleteLater(); } @@ -2786,6 +2903,33 @@ TEST(UT_test_textedit_cutSelectedText, UT_test_textedit_cutSelectedText_001) pWindow->deleteLater(); } +TEST(UT_test_textedit_cutSelectedText, cutSelectedText_withMultiByteText_passed) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + // 多字节字符编码 CJK + // 𢝐𢝑𢝒𢝓𢝔𢝕𢝖𢝗𢝘𢝙\n𢝚𢝛𢝜𢝝𢝞𢝟𢝠𢝡𢝢𢝣 + QString strMsg("\360\242\235\220\360\242\235\221\360\242\235\222\360\242\235\223\360\242\235\224" + "\360\242\235\225\360\242\235\226\360\242\235\227\360\242\235\230\360\242\235\231\n" + "\360\242\235\232\360\242\235\233\360\242\235\234\360\242\235\235\360\242\235\236" + "\360\242\235\237\360\242\235\240\360\242\235\241\360\242\235\242\360\242\235\243"); + QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + pWindow->currentWrapper()->textEditor()->insertTextEx(textCursor, strMsg); + + textCursor.setPosition(0); + textCursor.setPosition(6, QTextCursor::KeepAnchor); + pWindow->currentWrapper()->textEditor()->setTextCursor(textCursor); + QClipboard *pClipboard = QApplication::clipboard(); + pClipboard->clear(); + pWindow->currentWrapper()->textEditor()->cutSelectedText(); + + QString strRet1(pClipboard->text()); + QString strRet2(pWindow->currentWrapper()->textEditor()->toPlainText()); + EXPECT_EQ(strRet1, strMsg.left(6)); + EXPECT_EQ(strRet2, strMsg.mid(6)); + pWindow->deleteLater(); +} + //void pasteText() 001 TEST(UT_test_textedit_pasteText, UT_test_textedit_pasteText_001) { @@ -3659,7 +3803,10 @@ TEST(UT_test_textedit_lineNumberAreaWidth, UT_test_textedit_lineNumberAreaWidth_ int iRet = pWindow->currentWrapper()->textEditor()->lineNumberAreaWidth(); - ASSERT_TRUE(iRet == 20); + QFontMetrics fm(pWindow->currentWrapper()->textEditor()->m_fontLineNumberArea); + int calcWitdh = fm.horizontalAdvance(QLatin1Char('9')) * 2; + + EXPECT_EQ(iRet, calcWitdh); pWindow->deleteLater(); } @@ -5201,6 +5348,7 @@ TEST_F(test_textedit, setCursorKeywordSeletoin) startManager->deleteLater(); p->deleteLater(); } + // void cursorPositionChanged(); TEST_F(test_textedit, cursorPositionChanged) { @@ -5222,6 +5370,65 @@ TEST_F(test_textedit, cursorPositionChanged) startManager->deleteLater(); p->deleteLater(); } + +// void cut(); +TEST_F(test_textedit, cut_normal_passed) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + QString strMsg("hello world\n" + "hello world"); + QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + pWindow->currentWrapper()->textEditor()->insertTextEx(textCursor, strMsg); + + textCursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor); + pWindow->currentWrapper()->textEditor()->setTextCursor(textCursor); + QClipboard *pClipboard = QApplication::clipboard(); + pClipboard->clear(); + pWindow->currentWrapper()->textEditor()->cut(); + + QString strRet1(pClipboard->text()); + QString strRet2(pWindow->currentWrapper()->textEditor()->toPlainText()); + EXPECT_EQ(strRet1, QString("hello world")); + EXPECT_EQ(strRet2, QString("hello world\n")); + pWindow->currentWrapper()->textEditor()->undo_(); + QString strRet3(pWindow->currentWrapper()->textEditor()->toPlainText()); + EXPECT_EQ(strRet3, strMsg); + + pWindow->deleteLater(); +} + +TEST_F(test_textedit, cut_withMultiByteText_passed) +{ + Window *pWindow = new Window(); + pWindow->addBlankTab(QString()); + // 多字节字符编码 CJK + // 𢝐𢝑𢝒𢝓𢝔𢝕𢝖𢝗𢝘𢝙\n𢝚𢝛𢝜𢝝𢝞𢝟𢝠𢝡𢝢𢝣 + QString strMsg("\360\242\235\220\360\242\235\221\360\242\235\222\360\242\235\223\360\242\235\224" + "\360\242\235\225\360\242\235\226\360\242\235\227\360\242\235\230\360\242\235\231\n" + "\360\242\235\232\360\242\235\233\360\242\235\234\360\242\235\235\360\242\235\236" + "\360\242\235\237\360\242\235\240\360\242\235\241\360\242\235\242\360\242\235\243"); + QTextCursor textCursor = pWindow->currentWrapper()->textEditor()->textCursor(); + pWindow->currentWrapper()->textEditor()->insertTextEx(textCursor, strMsg); + + textCursor.setPosition(0); + textCursor.setPosition(6, QTextCursor::KeepAnchor); + pWindow->currentWrapper()->textEditor()->setTextCursor(textCursor); + QClipboard *pClipboard = QApplication::clipboard(); + pClipboard->clear(); + pWindow->currentWrapper()->textEditor()->cut(); + + QString strRet1(pClipboard->text()); + QString strRet2(pWindow->currentWrapper()->textEditor()->toPlainText()); + EXPECT_EQ(strRet1, strMsg.leftRef(6)); + EXPECT_EQ(strRet2, strMsg.midRef(6)); + pWindow->currentWrapper()->textEditor()->undo_(); + QString strRet3(pWindow->currentWrapper()->textEditor()->toPlainText()); + EXPECT_EQ(strRet3, strMsg); + + pWindow->deleteLater(); +} + // void updateHighlightBrackets(const QChar &openChar, const QChar &closeChar); TEST_F(test_textedit, updateHighlightBrackets) { @@ -9460,6 +9667,49 @@ TEST(UT_Textedit_selectText, SelectText_MultiBlock_Pass) wra->deleteLater(); } +TEST(UT_Textedit_selectText, SelectText_MultiBlock_MultiByte_Pass) +{ + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + // 此字符串为特殊多字节编码 CJK + // "𢝐𢝑𢝒𢝓𢝔𢝕𢝖𢝗𢝘𢝙\n𢝚𢝛𢝜𢝝𢝞𢝟𢝠𢝡𢝢𢝣\n𢝤𢝥𢝦𢝧𢝨𢝩𢝪𢝫𢝬𢝭\n" + QString multiByteText("\360\242\235\220\360\242\235\221\360\242\235\222\360\242\235\223\360\242\235\224" + "\360\242\235\225\360\242\235\226\360\242\235\227\360\242\235\230\360\242\235\231\n" + "\360\242\235\232\360\242\235\233\360\242\235\234\360\242\235\235\360\242\235\236" + "\360\242\235\237\360\242\235\240\360\242\235\241\360\242\235\242\360\242\235\243\n" + "\360\242\235\244\360\242\235\245\360\242\235\246\360\242\235\247\360\242\235\250" + "\360\242\235\251\360\242\235\252\360\242\235\253\360\242\235\254\360\242\235\255\n"); + edit->setPlainText(multiByteText); + // 选中 "𢝘𢝙\n𢝚𢝛" + QString str1 = QString("\360\242\235\230\360\242\235\231\n\360\242\235\232\360\242\235\233"); + QTextCursor cursor = edit->textCursor(); + cursor.setPosition(16); + cursor.setPosition(16 + str1.length(), QTextCursor::KeepAnchor); + edit->setTextCursor(cursor); + EXPECT_EQ(cursor.selectedText().replace("\u2029", "\n"), edit->selectedText()); + EXPECT_EQ(str1, edit->selectedText()); + + // 选中 "𢝘𢝙\n𢝚𢝛𢝜𢝝𢝞𢝟𢝠𢝡𢝢𢝣\n𢝤𢝥" + QString str2 = multiByteText.mid(16, 30); + cursor.setPosition(16); + cursor.setPosition(16 + str2.length(), QTextCursor::KeepAnchor); + edit->setTextCursor(cursor); + EXPECT_EQ(cursor.selectedText().replace("\u2029", "\n"), edit->selectedText()); + EXPECT_EQ(str2, edit->selectedText()); + + // 选中 "𢝘𢝙\n𢝚𢝛𢝜𢝝𢝞𢝟𢝠𢝡𢝢𢝣\n𢝤𢝥𢝦𢝧𢝨𢝩𢝪𢝫𢝬𢝭\n" + QString str3 = multiByteText.mid(16); + cursor.setPosition(16); + cursor.setPosition(16 + str3.length(), QTextCursor::KeepAnchor); + edit->setTextCursor(cursor); + EXPECT_EQ(cursor.selectedText().replace("\u2029", "\n"), edit->selectedText()); + EXPECT_EQ(str3, edit->selectedText()); + edit->deleteLater(); + wra->deleteLater(); +} + TEST(UT_Textedit_MidButtonInsertText, onTextContentChanged_MidButtonInsertText_Pass) { TextEdit* edit = new TextEdit; @@ -9488,3 +9738,217 @@ TEST(UT_Textedit_MidButtonInsertText, onTextContentChanged_MidButtonInsertText_P edit->deleteLater(); wra->deleteLater(); } + +DPalette stubApplicationPalette() +{ + DPalette pa; + pa.setColor(DPalette::Highlight, QColor(Qt::red)); + return pa; +} + +TEST(UT_Textedit_onAppPaletteChanged, OnAppPaletteChanged_ChangeBackground_Pass) +{ + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + Stub s; + s.set(ADDR(DGuiApplicationHelper, applicationPalette), stubApplicationPalette); + + QTextEdit::ExtraSelection selection; + selection.format.setBackground(QBrush(Qt::white)); + edit->m_altModSelections.append(selection); + edit->m_bIsAltMod = true; + edit->onAppPaletteChanged(); + + ASSERT_FALSE(edit->m_altModSelections.isEmpty()); + QBrush background = edit->m_altModSelections.first().format.background(); + EXPECT_EQ(QColor(Qt::red), background.color()); + + edit->deleteLater(); + wra->deleteLater(); +} + +TEST(UT_Textedit_MoveText, moveText_Move_Pass) +{ + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + QString sourceText("123456789\n"); + edit->setPlainText(sourceText); + + edit->moveText(0, 10, "12"); + EXPECT_EQ(edit->toPlainText(), QString("3456789\n12")); + edit->undo_(); + EXPECT_EQ(edit->toPlainText(), sourceText); + edit->redo_(); + EXPECT_EQ(edit->toPlainText(), QString("3456789\n12")); + + edit->deleteLater(); + wra->deleteLater(); +} + +TEST(UT_Textedit_MoveText, moveText_Copy_Pass) +{ + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + QString sourceText("123456789\n"); + edit->setPlainText(sourceText); + + edit->moveText(0, 10, "12", true); + EXPECT_EQ(edit->toPlainText(), QString("123456789\n12")); + edit->undo_(); + EXPECT_EQ(edit->toPlainText(), sourceText); + edit->redo_(); + EXPECT_EQ(edit->toPlainText(), QString("123456789\n12")); + + edit->deleteLater(); + wra->deleteLater(); +} + +TEST(UT_Textedit_MoveText, moveText_Multi_Pass) +{ + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + edit->insertTextEx(edit->textCursor(), "1\n"); + edit->insertTextEx(edit->textCursor(), "2\n"); + EXPECT_EQ(edit->toPlainText(), QString("1\n2\n")); + + edit->moveText(2, 1, "2"); + EXPECT_EQ(edit->toPlainText(), QString("12\n\n")); + edit->moveText(0, 4, "12"); + EXPECT_EQ(edit->toPlainText(), QString("\n\n12")); + edit->moveText(2, 0, "12", true); + EXPECT_EQ(edit->toPlainText(), QString("12\n\n12")); + + while(edit->m_pUndoStack->canUndo()) { + edit->undo_(); + } + EXPECT_TRUE(edit->toPlainText().isEmpty()); + while(edit->m_pUndoStack->canRedo()) { + edit->redo_(); + } + EXPECT_EQ(edit->toPlainText(), QString("12\n\n12")); + + edit->deleteLater(); + wra->deleteLater(); +} + +TEST(UT_Textedit_onPressedLineNumber, onPressedLineNumber_BoundaryCheck_Pass) +{ + // 边界检查 + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + edit->onPressedLineNumber(QPoint(0, 0)); + EXPECT_EQ(edit->textCursor().position(), 0); + + edit->onPressedLineNumber(QPoint(0, 100)); + EXPECT_EQ(edit->textCursor().position(), 0); + + edit->insertTextEx(edit->textCursor(), "123\n222\n333"); + auto cursor = edit->textCursor(); + cursor.setPosition(0); + edit->setTextCursor(cursor); + edit->onPressedLineNumber(QPoint(-1, -1)); + EXPECT_EQ(edit->textCursor().position(), 0); + EXPECT_TRUE(edit->textCursor().selectedText().isEmpty()); + + edit->onPressedLineNumber(QPoint(INT_MAX, INT_MAX)); + EXPECT_EQ(edit->textCursor().position(), 0); + EXPECT_TRUE(edit->textCursor().selectedText().isEmpty()); + + edit->deleteLater(); + wra->deleteLater(); +} + +TEST(UT_Textedit_onPressedLineNumber, onPressedLineNumber_MultiBlock_Pass) +{ + // 多行不同位置选取 + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + edit->insertTextEx(edit->textCursor(), "123\n222\n333"); + QTextCursor cursor = edit->textCursor(); + + QTextBlock selectBlock = edit->document()->firstBlock(); + cursor.setPosition(selectBlock.position(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + QRect rect = edit->cursorRect(cursor); + edit->onPressedLineNumber(QPoint(rect.left(), rect.center().y())); + EXPECT_EQ(edit->textCursor().selectedText().replace("\u2029", "\n"), QString("123\n")); + + selectBlock = edit->document()->lastBlock(); + cursor.setPosition(selectBlock.position(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + rect = edit->cursorRect(cursor); + edit->onPressedLineNumber(QPoint(rect.left(), rect.center().y())); + EXPECT_EQ(edit->textCursor().selectedText().replace("\u2029", "\n"), QString("333")); + + edit->deleteLater(); + wra->deleteLater(); +} + +TEST(UT_Textedit_onPressedLineNumber, onPressedLineNumber_OutOfBlock_Pass) +{ + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + edit->insertTextEx(edit->textCursor(), "123\n222\n333"); + QTextCursor cursor = edit->textCursor(); + + QTextBlock selectBlock = edit->document()->lastBlock(); + cursor.setPosition(selectBlock.position(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + QRect rect = edit->cursorRect(cursor); + // 超过文档范围选取将锁定尾行 + edit->onPressedLineNumber(QPoint(rect.left(), rect.center().y() + rect.height())); + EXPECT_EQ(edit->textCursor().selectedText().replace("\u2029", "\n"), QString("333")); + + edit->deleteLater(); + wra->deleteLater(); +} + +QString stub_getSystemLan() +{ + return "bo_CN"; +} + +TEST(UT_Textedit_onPressedLineNumber, onPressedLineNumber_LanBo_CN_Pass) +{ + // bo_CN 语言环境调整偏移量,光标向下偏移2 + Stub stub; + stub.set(ADDR(Utils, getSystemLan), stub_getSystemLan); + + TextEdit* edit = new TextEdit; + EditWrapper* wra = new EditWrapper; + edit->m_wrapper = wra; + + edit->insertTextEx(edit->textCursor(), "123\n222\n333"); + QTextCursor cursor = edit->textCursor(); + + QTextBlock selectBlock = edit->document()->firstBlock(); + cursor.setPosition(selectBlock.position(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + QRect rect = edit->cursorRect(cursor); + edit->onPressedLineNumber(QPoint(rect.left(), rect.bottom() + 2)); + EXPECT_EQ(edit->textCursor().selectedText().replace("\u2029", "\n"), QString("123\n")); + + selectBlock = selectBlock.next(); + cursor.setPosition(selectBlock.position(), QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + rect = edit->cursorRect(cursor); + edit->onPressedLineNumber(QPoint(rect.left(), rect.bottom() + 2)); + EXPECT_EQ(edit->textCursor().selectedText().replace("\u2029", "\n"), QString("222\n")); + + edit->deleteLater(); + wra->deleteLater(); +} diff --git a/tests/src/encodes/ut_detectcode.cpp b/tests/src/encodes/ut_detectcode.cpp index 854f0d1e..94035ae8 100644 --- a/tests/src/encodes/ut_detectcode.cpp +++ b/tests/src/encodes/ut_detectcode.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -12,10 +12,9 @@ namespace detectcodestub { QString stringvalue="1"; -int intvalue=1; -int retintstub() +QByteArray retintstub() { - return intvalue; + return QByteArray(); } QByteArray retByteArray = QByteArray(); diff --git a/tests/src/widgets/ut_ddropdownmenu.cpp b/tests/src/widgets/ut_ddropdownmenu.cpp index b0a4cd9e..0d9d0d7c 100644 --- a/tests/src/widgets/ut_ddropdownmenu.cpp +++ b/tests/src/widgets/ut_ddropdownmenu.cpp @@ -1,8 +1,9 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "ut_ddropdownmenu.h" +#include "../stub.h" #include #include @@ -134,29 +135,29 @@ TEST_F(test_ddropdownmenu, getButton) } +bool createEncodeMenu_isEmpty_stub() +{ + return true; +} + // 测试函数 DDropdownMenu::createEncodeMenu TEST_F(test_ddropdownmenu, createEncodeMenu) { - - // 场景1: sm_groupEncodeVec为空 - DDropdownMenu::sm_groupEncodeVec.clear(); - DDropdownMenu *dropMenu = new DDropdownMenu(); - dropMenu->createEncodeMenu(); - EXPECT_GT(DDropdownMenu::sm_groupEncodeVec.size(), 0); - EXPECT_NE(dropMenu,nullptr); + // 场景2: sm_groupEncodeVec为空 + Stub stub; + typedef QVector > VecType; + stub.set(ADDR(VecType, isEmpty), createEncodeMenu_isEmpty_stub); + DDropdownMenu *dropMenu = DDropdownMenu::createEncodeMenu(); + ASSERT_NE(dropMenu, nullptr); + EXPECT_TRUE(dropMenu->m_menu->actions().isEmpty()); dropMenu->deleteLater(); - - // 场景1: sm_groupEncodeVec不为空 - DDropdownMenu::sm_groupEncodeVec.clear(); - dropMenu = new DDropdownMenu(); - dropMenu->createEncodeMenu(); - dropMenu->createEncodeMenu(); - EXPECT_NE(dropMenu,nullptr); + stub.reset(ADDR(VecType, isEmpty)); + dropMenu = DDropdownMenu::createEncodeMenu(); + ASSERT_NE(dropMenu, nullptr); + EXPECT_FALSE(dropMenu->m_menu->actions().isEmpty()); dropMenu->deleteLater(); - - } // 测试函数 DDropdownMenu::createHighLightMenu diff --git a/tests/src/widgets/ut_window.cpp b/tests/src/widgets/ut_window.cpp index 1af94a53..233ed1f3 100644 --- a/tests/src/widgets/ut_window.cpp +++ b/tests/src/widgets/ut_window.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -56,6 +56,14 @@ bool EditWrapper_saveFile_stub() return editwrapper_saveFile; } +bool editwrapper_saveAsFile = false; +bool EditWrapper_saveAsFile_stub(const QString &newFilePath, const QByteArray &encodeName) +{ + Q_UNUSED(newFilePath); + Q_UNUSED(encodeName); + return editwrapper_saveAsFile; +} + EditWrapper* window_currentWrapper = nullptr; EditWrapper* Window_currentWrapper_stub() { @@ -534,7 +542,7 @@ TEST(UT_Window_saveAsFileToDisk, UT_Window_saveAsFileToDisk_002) exec_ret=1; editwrapper_saveFile = true; isDraft=false; - + editwrapper_saveAsFile = true; Stub s0;s0.set(ADDR(Window,currentWrapper),Window_currentWrapper_stub); typedef int (*Fptr)(QFileDialog *); @@ -543,16 +551,15 @@ TEST(UT_Window_saveAsFileToDisk, UT_Window_saveAsFileToDisk_002) Stub s2;s2.set(ADDR(EditWrapper,saveFile),EditWrapper_saveFile_stub); Stub s3;s3.set(ADDR(Window,updateSaveAsFileName),Window_updateSabeAsFileNameTemp_stub); Stub s4;s4.set(ADDR(EditWrapper,isDraftFile),EditWrapper_isDraftFile_stub); - + Stub s5;s5.set((bool(EditWrapper::*)(const QString &, const QByteArray&))ADDR(EditWrapper, saveAsFile), EditWrapper_saveAsFile_stub); EXPECT_NE(window1->saveAsFileToDisk(),"1"); EXPECT_NE(window1,nullptr); window1->deleteLater(); window_currentWrapper->deleteLater(); - - } + //saveBlankFileToDisk TEST(UT_Window_saveBlankFileToDisk, UT_Window_saveBlankFileToDisk) { @@ -563,8 +570,8 @@ TEST(UT_Window_saveBlankFileToDisk, UT_Window_saveBlankFileToDisk) window1->deleteLater(); - } + //saveAsOtherTabFile TEST(UT_Window_saveAsOtherTabFile, UT_Window_saveAsOtherTabFile_001) { @@ -1234,7 +1241,10 @@ TEST(UT_Window_decrementFontSize, UT_Window_decrementFontSize) Window *window = new Window(); EditWrapper * a = new EditWrapper(); window->m_settings =Settings::instance(); + window->m_fontSize = 12; + qreal oldFontSize = window->m_fontSize; window->decrementFontSize(); + EXPECT_GT(oldFontSize, window->m_fontSize); EXPECT_NE(window,nullptr); window->deleteLater(); @@ -1248,8 +1258,9 @@ TEST(UT_Window_incrementFontSize, UT_Window_incrementFontSize) Window *window = new Window(); EditWrapper * a = new EditWrapper(); window->m_settings =Settings::instance(); + qreal oldFontSize = window->m_fontSize; window->incrementFontSize(); - + EXPECT_LT(oldFontSize, window->m_fontSize); EXPECT_NE(window,nullptr); window->deleteLater(); @@ -2166,25 +2177,25 @@ TEST(UT_Window_slot_setTitleFocus, UT_Window_slot_setTitleFocus_002) w->deleteLater(); } -TEST(UT_Window_keyPressEvent, UT_Window_keyPressEvent_007) +TEST(UT_Window_rehighlightPrintDoc, rehighlightPrintDoc_HighlightCpp_pass) { -// QStringList aa; -// Window *window = new Window(); -// window->m_settings = Settings::instance(); + Window* w = new Window; + w->addBlankTab(); + w->m_printWrapper = w->currentWrapper(); + QTextDocument *doc = new QTextDocument; + doc->setPlainText("#include ;\n" + "int main(int argc, char *argv[]) { }"); -// utils_getkeyshortcut = Utils::getKeyshortcutFromKeymap(window->m_settings, "window", "togglefullscreen"); -// editwrapper_texteditor = new TextEdit; + CSyntaxHighlighter *highlighter = new CSyntaxHighlighter(doc); + KSyntaxHighlighting::Repository repository; + highlighter->setDefinition(repository.definitionForName("C++")); + highlighter->setTheme(repository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme)); -// Stub s1;s1.set(ADDR(Utils,getKeyshortcut),Utils_getKeyshortcut_stub); -// Stub s2;s2.set(ADDR(EditWrapper,textEditor),EditWrapper_textEditor_stub); -// Stub s3;s3.set(ADDR(Utils,getKeyshortcutFromKeymap),Utils_getKeyshortcutFromKeymap_stub); - -// window->keyPressEvent(eve); + w->rehighlightPrintDoc(doc, highlighter); + EXPECT_FALSE(doc->firstBlock().textFormats().isEmpty()); -// EXPECT_NE(window,nullptr); -// window->deleteLater(); -// window->m_settings->deleteLater(); -// editwrapper_texteditor->deleteLater(); + doc->deleteLater(); + w->deleteLater(); } diff --git a/translations/deepin-editor.ts b/translations/deepin-editor.ts index eefcec53..cef05630 100644 --- a/translations/deepin-editor.ts +++ b/translations/deepin-editor.ts @@ -1,4 +1,6 @@ - + + + BottomBar @@ -16,13 +18,18 @@ Characters %1 Characters %1 + + + Loading: + Loading: + DDropdownMenu - + + - None None @@ -30,69 +37,70 @@ EditWrapper - - - - + + + + Save Save - + Do you want to save this file? Do you want to save this file? - - + + Cancel Cancel - + Encoding changed. Do you want to save the file now? Encoding changed. Do you want to save the file now? - + Discard Discard - + + You do not have permission to save %1 You do not have permission to save %1 - + File removed on the disk. Save it now? File removed on the disk. Save it now? - + File has changed on disk. Reload? File has changed on disk. Reload? - - + + INSERT INSERT - + OVERWRITE OVERWRITE - + R/O R/O - + The file cannot be read, which may be too large or has been damaged! - The file cannot be read, which may be too large or has been damaged! + @@ -116,7 +124,7 @@ JumpLineBar - + Go to Line: Go to Line: @@ -134,6 +142,24 @@ Text Editor + + PathSettingWgt + + + Remember the last used path + Remember the last used path + + + + Same path as the current file + Same path as the current file + + + + Customize the default path + Customize the default path + + QObject @@ -142,12 +168,13 @@ Text Editor - - - - - - + + + + + + + Encoding Encoding @@ -184,8 +211,8 @@ - - + + Window Window @@ -271,438 +298,467 @@ + Find Next + Find Next + + + + Find Previous + Find Previous + + + Replace Replace - + Go to line Go to line - + Save cursor position Save cursor position - + Reset cursor position Reset cursor position - + Exit Exit - + Display shortcuts Display shortcuts - + Print Print - + Editor Editor - + Increase indent Increase indent - + Decrease indent Decrease indent - + Forward character Forward character - + Backward character Backward character - + Forward word Forward word - + Backward word Backward word - + Next line Next line - + Previous line Previous line - + New line New line - + New line above New line above - + New line below New line below - + Duplicate line Duplicate line - + Delete to end of line Delete to end of line - + Delete current line Delete current line - + Swap line up Swap line up - + Swap line down Swap line down - + Scroll up one line Scroll up one line - + Scroll down one line Scroll down one line - + Page up Page up - + Page down Page down - + Move to end of line Move to end of line - + Move to start of line Move to start of line - + Move to end of text Move to end of text - + Move to start of text Move to start of text - + Move to line indentation Move to line indentation - + Upper case Upper case - + Lower case Lower case - + Capitalize Capitalize - + Delete backward word Delete backward word - + Delete forward word Delete forward word - + Forward over a pair Forward over a pair - + Backward over a pair Backward over a pair - + Select all Select all - + Copy Copy - + Cut Cut - + Paste Paste - + Transpose character Transpose character - + Mark Mark - + Unmark Unmark - + Copy line Copy line - + Cut line Cut line - + Merge lines Merge lines - + Read-Only mode Read-Only mode - + Add comment Add comment - + Remove comment Remove comment - + Undo Undo - + Redo Redo - + Add/Remove bookmark Add/Remove bookmark - + Move to previous bookmark Move to previous bookmark - + Move to next bookmark Move to next bookmark - + Advanced Advanced - + Window size Window size - + Tab width Tab width - + + Paste by pressing a middle mouse button + Paste by pressing a middle mouse button + + + + Startup + Startup + + + + Reopen last closed tabs + Reopen last closed tabs + + + + Open/Save Settings + Open/Save Settings + + + Word wrap Word wrap - + Code folding flag Code folding flag - + Show line numbers Show line numbers - + Show bookmarks icon Show bookmarks icon - + Show whitespaces and tabs Show whitespaces and tabs - + Highlight current line Highlight current line - + Color mark Color mark - + Unicode Unicode - + WesternEuropean WesternEuropean - + CentralEuropean CentralEuropean - + Baltic Baltic - + Cyrillic Cyrillic - + Arabic Arabic - + Celtic Celtic - + SouthEasternEuropean SouthEasternEuropean - + Greek Greek - + Hebrew Hebrew - + ChineseSimplified ChineseSimplified - + ChineseTraditional ChineseTraditional - + Japanese Japanese - + Korean Korean - + Thai Thai - + Turkish Turkish - + Vietnamese Vietnamese - + File not saved File not saved - - - + + Line Endings Line Endings @@ -744,66 +800,67 @@ S: - + The first line of the short usage message. - + Settings - + Standard Standard - + Customize Customize - + Normal Normal - + Maximum Maximum - + Fullscreen Fullscreen - + This shortcut conflicts with system shortcut %1 This shortcut conflicts with system shortcut %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - - + + + The shortcut %1 is invalid, please set another one. The shortcut %1 is invalid, please set another one. - + Cancel Cancel - + Replace Replace - + OK OK @@ -852,259 +909,260 @@ TextEdit - + Undo Undo - + Redo Redo - + Cut Cut - + Copy Copy - + Paste Paste - + Delete Delete - + Select All Select All - - + + Find Find - - + + Replace Replace - + Go to Line Go to Line - + Turn on Read-Only mode Turn on Read-Only mode - + Turn off Read-Only mode Turn off Read-Only mode - + Fullscreen Fullscreen - + Exit fullscreen Exit fullscreen - + Display in file manager Display in file manager - - + + Add Comment Add Comment - + Text to Speech Text to Speech - + Stop reading Stop reading - + Speech to Text Speech to Text - + Translate Translate - + Column Mode Column Mode - + Add bookmark Add bookmark - + Remove Bookmark Remove Bookmark - + Previous bookmark Previous bookmark - + Next bookmark Next bookmark - + Remove All Bookmarks Remove All Bookmarks - + Fold All Fold All - + Fold Current Level Fold Current Level - + Unfold All Unfold All - + Unfold Current Level Unfold Current Level - + Color Mark Color Mark - + Clear All Marks Clear All Marks - + Clear Last Mark Clear Last Mark - + Mark Mark - + Mark All Mark All - + Remove Comment Remove Comment - + Copy failed: not enough memory Copy failed: not enough memory - + Press ALT and click lines to edit in column mode Press ALT and click lines to edit in column mode - + Change Case Change Case - + Upper Case Upper Case - + Lower Case Lower Case - + Capitalize Capitalize - + None None - + Selected line(s) copied Selected line(s) copied - + Current line copied Current line copied - + Selected line(s) clipped Selected line(s) clipped - + Current line clipped Current line clipped - + Paste failed: not enough memory Paste failed: not enough memory - + Read-Only mode is off Read-Only mode is off - - - - - + + + + + + Read-Only mode is on Read-Only mode is on @@ -1121,131 +1179,131 @@ Window - + Save as Save as - + New window New window - + New tab New tab - + Open file Open file - - + + Save Save - + Print Print - + Switch theme Switch theme - - + + Settings Settings - - + + Read-Only Read-Only - + You do not have permission to open %1 You do not have permission to open %1 - - + + Invalid file: %1 Invalid file: %1 - - + + Do you want to save this file? Do you want to save this file? - + You do not have permission to save %1 You do not have permission to save %1 - + Saved successfully Saved successfully - - - + + + Save File Save File - + Encoding Encoding - + Read-Only mode is on Read-Only mode is on - + Current location remembered Current location remembered - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Editor - + Untitled %1 Untitled %1 - + Cancel Cancel - + Discard Discard - \ No newline at end of file + diff --git a/translations/deepin-editor_ar.ts b/translations/deepin-editor_ar.ts index 6d12b052..15e75f25 100644 --- a/translations/deepin-editor_ar.ts +++ b/translations/deepin-editor_ar.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row صف - + Column عمود - + Characters %1 الحروف 1% + + + Loading: + + DDropdownMenu - - - + + + None - لا شيء + لا شيء EditWrapper - - File has changed on disk. Reload? - الملف الذي في القرص قد عُدِّل. أعيد التحميل؟ - - - - File removed on the disk. Save it now? - الملف الذي في القرص قد حُذِف. أحفظه الآن؟ + + + + + Save + حفظ - + Do you want to save this file? - هل تريد حفظ هذا الملف؟ + هل تريد حفظ هذا الملف؟ - - Discard - إلغاء + + + Cancel + إلغاء - + Encoding changed. Do you want to save the file now? - + تم تغيير الترميز. هل تريد حفظ الملف الآن؟ - + + Discard + إلغاء + + + + You do not have permission to save %1 - لا تملك الإذن لحفظ 1% + لا تملك الإذن لحفظ 1% + + + + File removed on the disk. Save it now? + الملف الذي في القرص قد حُذِف. أحفظه الآن؟ + + + + File has changed on disk. Reload? + الملف الذي في القرص قد عُدِّل. أعيد التحميل؟ - - + + INSERT إدخال - + OVERWRITE إعادة الكتابة - + R/O قراءة - - - Cancel - إلغاء - - - - - - - Save - حفظ + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find بحث - - Next - التالي - - - + Previous السابق + + + Next + التالي + JumpLineBar - + Go to Line: انتقل إلى السطر: @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. محرر النصوص هو أداة قوية لعرض وتحرير الملفات النصية. - + Text Editor محرر نصي - QObject + PathSettingWgt - - File not saved - لم يتم حفظ الملف + + Remember the last used path + - + + Same path as the current file + + + + + Customize the default path + + + + + QObject + + Text Editor محرر النصوص - + + + + + + + + Encoding + الترميز + + + Basic بسيط - + Font Style نوع الخط - + Font الخط - + Font Size حجم الخط - - - Keymap - خارطة المفاتيح - - - + Shortcuts الاختصارات - - Forward character - حرف للأمام - - - - Backward character - حرف للخلف - - - - Transpose character - تغيير مكان الحرف - - - - Tab width - عرض الشريط - - - - Word wrap - + + + Keymap + خارطة المفاتيح - - - + + + Window النافذة - + New tab لسان جديد - + New window نافذة جديدة - + Save حفظ - + Save as حفظ باسم - + Next tab اللسان التالي - + Previous tab اللسان السابق - + Close tab أغلاق اللسان - + Close other tabs أغلاق الألسنة الأخرى - + Restore tab استعادة الألسنة - + Open file فتح الملف - + Increment font size زد حجم الخط - + Decrement font size أنقص حجم الخط - + Reset font size إعادة تعيين حجم الخط - - Toggle fullscreen - تبديل ملء الشاشة - - - + Help المساعدة - + + Toggle fullscreen + تبديل ملء الشاشة + + + Find بحث - + + Find Next + + + + + Find Previous + + + + Replace استبدال - + Go to line انتقال إلى السطر - + Save cursor position حفظ موضع المؤشر - + Reset cursor position إعادة تعيين موضع المؤشر - + Exit خروج - + Display shortcuts عرض الاختصارات - + Print طباعة - + Editor المحرر - + Increase indent زيادة المسافة البادئة - + Decrease indent نقصان المسافة البادئة - + + Forward character + حرف للأمام + + + + Backward character + حرف للخلف + + + Forward word كلمة إلى الأمام - + Backward word كلمة إلى الخلف - + Next line السطر التالي - + Previous line السطر السابق - + New line سطر جديد - + New line above سطر جديد أعلى - + New line below سطر جديد أسفل - + Duplicate line مضاعفة السطر - + Delete to end of line حذف إلى نهاية السطر - + Delete current line حذف السطر الحالي - + Swap line up بادل سطرًا للأعلى - + Swap line down بادل سطرًا للأسفل - + Scroll up one line انتقل لأعلى سطرًا واحدًا - + Scroll down one line انتقل لأسفل سطرًا واحدًا - + Page up صفحة لأعلى - + Page down صفحة لأسفل - + Move to end of line انتقل الى نهاية السطر - + Move to start of line انتقل الى بداية السطر - + Move to end of text انتقل إلى نهاية النص - + Move to start of text انتقل إلى أول النص - + Move to line indentation تحريك إلى سطر جديد - + Upper case حرف كبير - + Lower case حرف صغير - + Capitalize تحويل الحروف إلى حروف كبيرة - + Delete backward word حذف الكلمة الخلفية - + Delete forward word حذف الكلمة الأمامية - + Forward over a pair تحويل إلى الأمام لأكثر من زوج - + Backward over a pair تحويل إلى الخلف لأكثر من زوج - + Select all اختر الكل - + Copy نسخ - + Cut قص - + Paste لصق - + + Transpose character + تغيير مكان الحرف + + + Mark وضع علامة - + Unmark إزالة علامة - + Copy line نسخ السطر - + Cut line قص السطر - + Merge lines دمج السطور - + Read-Only mode وضع القراءة فقط - + Add comment - + - + Remove comment - + - + Undo تراجع - + Redo أعد - + Add/Remove bookmark - + - + Move to previous bookmark - + - + Move to next bookmark - + - + Advanced متقدم - + Window size حجم النافذة - + + Tab width + عرض الشريط + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + + Word wrap + + + + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + + Color mark + + + + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - + - - Color mark - - - - - - - - - - Encoding - الترميز + + File not saved + لم يتم حفظ الملف - - - + + Line Endings - نهايات السطور + نهايات السطور ReplaceBar - + Find بحث - + Replace With استبدال بـ - + Replace استبدال - + Skip تخطي - + Replace Rest استبدال الباقي - + Replace All استبدال الكل + + S: + + + + The first line of the short usage message. + + + Settings - + Standard قياسي - + Customize معدل - + Normal عادي - + Maximum أقصى - + Fullscreen ملء الشاشة - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel إلغاء - + Replace استبدال - + OK - + StartManager - + Untitled %1 - بلا عنوان %1 + بلا عنوان %1 Tabbar - + Close tab أغلق اللسان - + + Close other tabs + أغلق الألسنة الأخرى + + + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - - - - - Close other tabs - أغلق الألسنة الأخرى + TextEdit - + Undo تراجع - + Redo أعد - + Cut قص - + Copy نسخ - + Paste لصق - + Delete حذف - + Select All اختر الكل - - + + Find بحث - - + + Replace استبدال - + Go to Line انتقال إلى سطر - + Turn on Read-Only mode تشغيل وضع القراءة فقط - + Turn off Read-Only mode ايقاف وضع القراءة فقط - + Fullscreen ملء الشاشة - + Exit fullscreen الخروج من وضع ملء للشاشة - + Display in file manager عرض في مدير الملفات - - + + Add Comment - - - - - Column Mode - - - - - Remove Comment - - - - - Copy failed: not enough memory - - - - - Press ALT and click lines to edit in column mode - + - + Text to Speech النص إلى الكلام - + Stop reading - توقف عن القراءة + - + Speech to Text الكلام إلى النص - + Translate تَرجم - + + Column Mode + + + + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - - Mark All - + + Clear All Marks + - + + Clear Last Mark + + + + Mark وضع علامة - - Clear All Marks - + + Mark All + - - Clear Last Mark - + + Remove Comment + - + + Copy failed: not enough memory + + + + + Press ALT and click lines to edit in column mode + + + + Change Case غيِّر الخانة - + Upper Case احرف الكبيرة - + Lower Case أحرف صغيرة - + Capitalize تحويل الحروف إلى حروف كبيرة - + None لا شيء - + Selected line(s) copied تم نسخ الخط (الخطوط) المحدد - + Current line copied تم نسخ السطر الحالي - + Selected line(s) clipped تم قص الخط (الخطوط) المحدد - + Current line clipped تم قص الخط المحدد - + Paste failed: not enough memory - + - + Read-Only mode is off وضع القراءة فقط متوقف - - - + + + + + + Read-Only mode is on وضع القراءة فقط قيد التشغيل @@ -1098,7 +1168,7 @@ WarningNotices - + Reload أعد التحميل @@ -1106,131 +1176,132 @@ Window - + + + Save as + حفظ باسم + + + New window نافذة جديدة - + New tab لسان جديد - + Open file فتح الملف - - - Save as - حفظ باسم + + + Save + حفظ - + Print طباعة - + Switch theme غيِّر السمة - - + + + Settings + إعدادات + + + + Read-Only للقراءة فقط - - Saved successfully - حُفِظ بنجاح + + You do not have permission to open %1 + لا تملك الإذن لفتح 1% - - Read-Only mode is on - وضع القراءة فقط قيد التشغيل + + + Invalid file: %1 + ملف غير مدعوم: 1% - - Ctrl+'=' - + + + Do you want to save this file? + هل تريد حفظ هذا الملف؟ - - Ctrl+'-' - + + You do not have permission to save %1 + لا تملك الإذن لحفظ 1% - - Discard - إلغاء + + Saved successfully + حُفِظ بنجاح - - - Settings - إعدادات + + + + Save File + حفظ الملف - - You do not have permission to open %1 - لا تملك الإذن لفتح 1% + + Encoding + الترميز - - Invalid file: %1 - ملف غير مدعوم: 1% + + Read-Only mode is on + وضع القراءة فقط قيد التشغيل - - - - Save File - حفظ الملف + + Current location remembered + تم تذكر المكان الحالي - - - Do you want to save this file? - هل تريد حفظ هذا الملف؟ + + Ctrl+'=' + - - Encoding - الترميز + + Ctrl+'-' + - + Editor المحرر - - You do not have permission to save %1 - لا تملك الإذن لحفظ 1% - - - + Untitled %1 بلا عنوان %1 - - Current location remembered - تم تذكر المكان الحالي - - - + Cancel إلغاء - - - Save - حفظ + + Discard + إلغاء - + \ No newline at end of file diff --git a/translations/deepin-editor_az.ts b/translations/deepin-editor_az.ts index 02919205..d734ce56 100644 --- a/translations/deepin-editor_az.ts +++ b/translations/deepin-editor_az.ts @@ -16,13 +16,18 @@ Characters %1 %1 simvol + + + Loading: + Yüklənir: + DDropdownMenu - + + - None Heç biri @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Saxlamaq - + Do you want to save this file? Bu faylı saxlamaq istəyirsiniz? - - + + Cancel İmtina - + Encoding changed. Do you want to save the file now? Kodlaşma dəyişdirildi. Faylı indi saxlamaq istəyirsiniz? - + Discard Rədd etmək - + + You do not have permission to save %1 %1 saxlamaq üçün imtiyazınız yoxdur - + File removed on the disk. Save it now? Diskdəki fayl silindi. O, indi saxlanılsın? - + File has changed on disk. Reload? Diskdəki fayl dəyişdirildi. Yenidən yüklənsin? - - + + INSERT DAXİL_ETMƏK - + OVERWRITE ÜZƏRİNƏ_YAZMAQ - + R/O Y/O - + The file cannot be read, which may be too large or has been damaged! - + Fayl oxuna bilməz, ola bilsin ki, o, çox böyükdür və ya zədələnib! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Sətirə keçin: @@ -134,6 +140,24 @@ Mətn Redaktoru + + PathSettingWgt + + + Remember the last used path + Sonuncu istifadə olunmuş yolu yadda saxlamaq + + + + Same path as the current file + Cari fayl ilə eyni yol + + + + Customize the default path + Satandart yolu dəyişdir + + QObject @@ -142,12 +166,13 @@ Mətn Redaktoru - - - - - - + + + + + + + Encoding Kodlaşma @@ -184,8 +209,8 @@ - - + + Window Pəncərə @@ -271,438 +296,467 @@ + Find Next + Sonrakını tapın + + + + Find Previous + Əvvəlkini tapın + + + Replace Əvəzləmək - + Go to line Sətirə keçmək - + Save cursor position Kursorun yerini saxlamaq - + Reset cursor position Kursorun yerini sıfırlamaq - + Exit Çıxış - + Display shortcuts Qısayolları göstərmək - + Print Çap - + Editor Redaktor - + Increase indent Abzası böyütmək - + Decrease indent Abzası daraltmaq - + Forward character Bir sonrakı somvol - + Backward character Bir əvvəlki simvol - + Forward word Başlanğıc söz - + Backward word Bir əvvəlki söz - + Next line Sonrakı sətir - + Previous line Əvvəlki sətir - + New line Yeni sətir - + New line above Yeni sətir yuxarı - + New line below Yeni sətir aşağı - + Duplicate line Sətirin təkrarı - + Delete to end of line Sətirin sonundək silmək - + Delete current line Cari sətiri silmək - + Swap line up Sətiri yuxarı dəyişmək - + Swap line down Sətiri aşağı dəyişmək - + Scroll up one line Bir sətir yuxarı sürüşdürmək - + Scroll down one line Bir sətir aşağı sürüşdürmək - + Page up Bir səhifə yuxarı - + Page down Bir səhifə aşağı - + Move to end of line Sətirin sonuna köçürmək - + Move to start of line Sətirin başlanğıcına köçürmək - + Move to end of text Mətnin sonuna köçürmək - + Move to start of text Mətnin əvvəlinə köçürmək - + Move to line indentation Sətirin abzasına keçmək - + Upper case Böyük hərf - + Lower case Kiçik hərf - + Capitalize Baş hərflərlə - + Delete backward word Bir əvvəlki sözü silmək - + Delete forward word Bir sonrakı sözü silmək - + Forward over a pair Sonrakı cüt - + Backward over a pair Əvvəlki cüt - + Select all Hamısını seçmək - + Copy Kopyalamaq - + Cut Kəsmək - + Paste Yerləşdirmək - + Transpose character Simvolun yerini dəyişmək - + Mark İşarələmək - + Unmark İşarəni qaldırmaq - + Copy line Sətiri kopyalamaq - + Cut line Sətiri kəsmək - + Merge lines Sətirləri birləşdirmək - + Read-Only mode Yalnız-oxu rejimi - + Add comment Şərh əlavə edin - + Remove comment Şərhi silmək - + Undo Qaytarmaq - + Redo Hazır - + Add/Remove bookmark Əlfəcin əlavə edin/silin - + Move to previous bookmark Əvvəlki əlfəcinlərə köçürmək - + Move to next bookmark Sonrakı əlfəcinə köçürmək - + Advanced Əlavə - + Window size Pəncərə ölçüsü - + Tab width Vərəqin eni - + + Paste by pressing a middle mouse button + Siçanın orta düyməsinə vurmaqla yerləşdirmək + + + + Startup + Başladılma + + + + Reopen last closed tabs + Sonuncu açılmış vərəqləri yenidən aç + + + + Open/Save Settings + Aç/bağla ayarları + + + Word wrap Sözü sətirə keçirmək - + Code folding flag Kod yığma bayrağı - + Show line numbers Sətir nömrəsini göstərmək - + Show bookmarks icon Əlfəcinlərin nişanlarını göstərmək - + Show whitespaces and tabs Ara boşluqlarını və vərəqləri göstərmək - + Highlight current line Cari sətiri vurğulamaq - + Color mark Rəng markeri - + Unicode Unicode - + WesternEuropean Qərbi_Avropa - + CentralEuropean Mərkəzi_Avropa - + Baltic Baltik - + Cyrillic Kiril - + Arabic Ərəb - + Celtic Kelt - + SouthEasternEuropean Cənub-Şərqi_Avropa - + Greek Yunan - + Hebrew İvrit - + ChineseSimplified Çin_Sadələşdirilmiş - + ChineseTraditional Çin_Ənənəvi - + Japanese Yapon - + Korean Koreya - + Thai Tay - + Turkish Türk - + Vietnamese Vyetnam - + File not saved Fayl saxlanılmadı - - - + + Line Endings Sətrin sonu @@ -752,58 +806,59 @@ Settings - + Standard Standard - + Customize Özəlləşdirmək - + Normal Normal - + Maximum Ən çox - + Fullscreen Tam ekran - + This shortcut conflicts with system shortcut %1 Bu qısayol %1 sistem qısayolu ilə ziddiyyətlidir - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Bu qısayol %1 ilə ziddiyyətlidir, bu qısayolu dərhal qüvvəyə mindirmək üçün Əvəzləmək düyməsinə vurun - - + + + The shortcut %1 is invalid, please set another one. %1 qısayolu işləmir, başqa birini təyin edin. - + Cancel İmtina - + Replace Əvəzləmək - + OK OLDU @@ -852,259 +907,260 @@ TextEdit - + Undo Qaytarmaq - + Redo Hazır - + Cut Kəsmək - + Copy Kopyalamaq - + Paste Yerləşdirmək - + Delete Silmək - + Select All Hamısını seçmək - - + + Find Tapmaq - - + + Replace Əvəzləmək - + Go to Line Sətirə keçin - + Turn on Read-Only mode Yalnız-oxu, rejimini açmaq - + Turn off Read-Only mode Yalnız-oxu, rejimini söndürmək - + Fullscreen Tam ekran - + Exit fullscreen Tam ekrandan çıxış - + Display in file manager Fayl bələdçisində göstərmək - - + + Add Comment Şərh əlavə edin - + Text to Speech Mətndən_Nitqə - + Stop reading Oxunuşu saxlamaq - + Speech to Text Nitqdən_Mətnə - + Translate Tərcümə - + Column Mode Sütun rejimi - + Add bookmark Əlfəcin əlavə etmək - + Remove Bookmark Əlfəcini silmək - + Previous bookmark Əvvəlki əlfəcin - + Next bookmark Sonrakı əlfəcin - + Remove All Bookmarks Bütün əlfəcinləri silmək - + Fold All Hamısını bükmək - + Fold Current Level Cari səviyyəni bükmək - + Unfold All Hamısını açmaq - + Unfold Current Level Cari səviyyəni açmaq - + Color Mark Rəng markeri - + Clear All Marks Bütün işarələri qaldırmaq - + Clear Last Mark Sonuncu işarəni qaldırmaq - + Mark İşarələmək - + Mark All Hamısını işarələmək - + Remove Comment Şərhi silmək - + Copy failed: not enough memory Kopyalanmadı: kifayət qədər yaddaş yoxdur - + Press ALT and click lines to edit in column mode Sütun rejimində düzəliş etmək üçün ALT düyməsini basın və sətirə vurun - + Change Case Böyük-kiçik hərfi dəyişdirmək - + Upper Case Böyük hərf - + Lower Case Kiçik hərf - + Capitalize Baş hərflərlə - + None Heç biri - + Selected line(s) copied Seçilmiş sətir(lər) kopyalandı - + Current line copied Cari sətir kopyalandı - + Selected line(s) clipped Seçilmiş sətir(lər) kəsildi - + Current line clipped Cari sətir kəsildi - + Paste failed: not enough memory Yerləşdirilmədi: kifayət qədər yaddaş yoxdur - + Read-Only mode is off Yalnız-oxu, rejimi söndürülüb - - - - - + + + + + + Read-Only mode is on Yalnız-ozu, rejimi aktivdir @@ -1121,129 +1177,129 @@ Window - + Save as Belə saxlayın - + New window Yeni pəncərə - + New tab Yeni vərəq - + Open file Faylı açın - - + + Save Saxlamaq - + Print Çap - + Switch theme Mövzunu dəyişmək - - + + Settings Ayarlar - - + + Read-Only Yalnız-oxumaq - + You do not have permission to open %1 %1 açmaq üçün imtiyazınız yoxdur - - + + Invalid file: %1 Səhv fayl: %1 - - + + Do you want to save this file? Bu faylı saxlamaq istəyirsiniz? - + You do not have permission to save %1 %1 saxlamaq üçün imtiyazınız yoxdur - + Saved successfully Uğurla saxlanıldı - - - + + + Save File Faylı saxlayın - + Encoding Kodlaşma - + Read-Only mode is on Yalnız-ozu, rejimi aktivdir - + Current location remembered Cari yer yadda saxlanıldı - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Redaktor - + Untitled %1 Başlıqsız %1 - + Cancel İmtina - + Discard Rədd etmək diff --git a/translations/deepin-editor_bg.ts b/translations/deepin-editor_bg.ts index f0f97dee..2d2a4035 100644 --- a/translations/deepin-editor_bg.ts +++ b/translations/deepin-editor_bg.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row Ред - + Column Колона - + Characters %1 Знак %1 + + + Loading: + + DDropdownMenu - - - + + + None - Нищо + Нищо EditWrapper - - File has changed on disk. Reload? - Файлът е променен на диска. Презареждане? - - - - File removed on the disk. Save it now? - Файлът е премахнат на диска. Запазвате ли го? + + + + + Save + Запазване - + Do you want to save this file? - Искате ли да запазите този файл? + Искате ли да запазите този файл? - - Discard - Отказ + + + Cancel + Отказ - + Encoding changed. Do you want to save the file now? - + - + + Discard + Отказ + + + + You do not have permission to save %1 - Нямате разрешение да запазите %1 + Нямате разрешение да запазите %1 + + + + File removed on the disk. Save it now? + Файлът е премахнат на диска. Запазвате ли го? - - + + File has changed on disk. Reload? + Файлът е променен на диска. Презареждане? + + + + INSERT ВМЪКВАНЕ - + OVERWRITE ПРЕЗАПИСВАНЕ - + R/O R/O - - - Cancel - Отказ - - - - - - - Save - Запазване + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find Търсене - - Next - Следващ - - - + Previous Предишен + + + Next + Следващ + JumpLineBar - + Go to Line: Отиди на ред: @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. - + - + Text Editor - + - QObject + PathSettingWgt - - File not saved - + + Remember the last used path + + + + + Same path as the current file + - + + Customize the default path + + + + + QObject + + Text Editor - + - + + + + + + + + Encoding + Кодиране + + + Basic Основен - + Font Style Стил на шрифт - + Font Щрифт - + Font Size Размер на шрифт - - - Keymap - Клавиатурната подредба - - - + Shortcuts Преки пътища - - Forward character - Следваш знак - - - - Backward character - Предишен знак - - - - Transpose character - Транспониращ символ - - - - Add comment - - - - - Remove comment - - - - - Add/Remove bookmark - - - - - Move to previous bookmark - - - - - Move to next bookmark - - - - - Tab width - ширина на раздела + + + Keymap + Клавиатурната подредба - - - + + + Window Прозорец - + New tab Нов раздел - + New window Нов прозорец - + Save Запазване - + Save as Запази като - + Next tab Следващ раздел - + Previous tab Предишен раздел - + Close tab Затваряне на раздел - + Close other tabs Затвори другите раздели - + Restore tab Възстанови раздел - + Open file Отваряне на файл - - Reset font size - Възстановяване на размера на шрифта + + Increment font size + Увеличаване на размера на шрифта - - Toggle fullscreen - Превключи на цял екран + + Decrement font size + Намаляване на размера на шрифта - - Help - + + Reset font size + Възстановяване на размера на шрифта - - Increment font size - + + Help + - - Decrement font size - + + Toggle fullscreen + Превключи на цял екран - + Find Търсене - + + Find Next + + + + + Find Previous + + + + Replace Замяна - + Go to line Отиди на ред - + Save cursor position Запази положението на курсора - + Reset cursor position Възстанови положението на курсора - + Exit Изход - + Display shortcuts Покажи преките пътища - + Print Принтиране - + Editor Редактор - + Increase indent Увеличи отстъпа - + Decrease indent Намали отстъпа - + + Forward character + Следваш знак + + + + Backward character + Предишен знак + + + Forward word Следваща дума - + Backward word Предишна дума - + Next line Следваща линия - + Previous line Предна линия - + New line Нов ред - + New line above Нов ред отгоре - + New line below Нов ред отдолу - + Duplicate line Дублирай ред - + Delete to end of line Изтрий до края на реда - + Delete current line Изтрий текущият ред - + Swap line up Прехвърли реда нагоре - + Swap line down Прехвърли реда надолу - + Scroll up one line Превъртане нагоре с един ред - + Scroll down one line Превъртане надолу с един ред - + Page up Страница нагоре - + Page down Страница надолу - + Move to end of line Преместване до края на реда - + Move to start of line Преместване до началото на реда - + Move to end of text Преместване до края на текста - + Move to start of text Преместване до началото на текста - + Move to line indentation Преместване до отстъпа на реда - + Upper case Големи букви - + Lower case Малки букви - + Capitalize С големи букви - + Delete backward word Изтрий предишна дума - + Delete forward word Изтрий следваща дума - + Forward over a pair Напред през два - + Backward over a pair Назад през два - + Select all Избор на всичко - + Copy Копиране - + Cut Премести - + Paste Прилагане - + + Transpose character + Транспониращ символ + + + Mark Маркиране - + Unmark Размаркиране - + Copy line Копиране на ред - + Cut line Преместване на линия - + Merge lines Сливане на ред - + Read-Only mode Режим "Само за четене" - + + Add comment + + + + + Remove comment + + + + + Undo + Поправи + + + + Redo + Повторение + + + + Add/Remove bookmark + + + + + Move to previous bookmark + + + + + Move to next bookmark + + + + + Advanced + За напреднали + + + + Window size + Размер на прозорец + + + + Tab width + ширина на раздела + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap - + - + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + Color mark - + - + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - + - - Undo - Поправи - - - - Redo - Повторение - - - - Advanced - За напреднали - - - - Window size - Размер на прозорец - - - - - - - - - Encoding - Кодиране + + File not saved + - - - + + Line Endings - Крайни линии + Крайни линии ReplaceBar - + Find Търсене - + Replace With - + - + Replace Рамени - + Skip Пропусни - + Replace Rest Замени останалото - + Replace All Замени всички: + + S: + + + + The first line of the short usage message. + + + Settings - + Standard Стандартно - + Customize Потребителско - + Normal Нормално - + Maximum Максимум - + Fullscreen На цял екран - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel - Отказ + Отказ - + Replace - + Рамени - + OK - + StartManager - + Untitled %1 - + Tabbar - + Close tab Затваряне на раздел - + Close other tabs Затвори другите раздели - + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - + TextEdit - + Undo Поправи - + Redo Повторение - + Cut Премести - + Copy Копиране - + Paste Прилагане - + Delete Изтриване - + Select All Избор на всичко - - + + Find Търсене - - + + Replace Рамени - + Go to Line Отиди на ред - + Turn on Read-Only mode Включване режим "Само за четене" - + Turn off Read-Only mode Изключване режим "Само за четене" - + Fullscreen На цял екран - + Exit fullscreen Изход от цял екран - + Display in file manager Отвори във файловия диспечер - - + + Add Comment - + - + Text to Speech - + - + Stop reading - + - + Speech to Text - + - + Translate - + - + Column Mode - + - + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - + Clear All Marks - + - + Clear Last Mark - + - + Mark - Маркиране + Маркиране - + Mark All - + - + Remove Comment - + - + Copy failed: not enough memory - + - + Press ALT and click lines to edit in column mode - + - + Change Case Смяна на големината - + Upper Case Големи букви - + Lower Case Малки букви - + Capitalize С големи букви - + None Нищо - + Selected line(s) copied - + - + Current line copied - + - + Selected line(s) clipped - + - + Current line clipped - + - + Paste failed: not enough memory - + - + Read-Only mode is off Режим "Само за четене" е изключен - - - + + + + + + Read-Only mode is on Режим "Само за четене" е включен @@ -1098,7 +1168,7 @@ WarningNotices - + Reload Презареди @@ -1106,131 +1176,132 @@ Window - + + + Save as + Запази като + + + New window Нов прозорец - + New tab Нов раздел - + Open file Отваряне на файл - - - Save as - Запази като + + + Save + Запазване - + Print Принтиране - + Switch theme Смени тема - - + + + Settings + Настройки + + + + Read-Only Само за четене - - Saved successfully - Успешно запазено + + You do not have permission to open %1 + Нямате разрешение да отворите %1 - - Read-Only mode is on - Режим "Само за четене" е включен + + + Invalid file: %1 + Невалиден файл: %1 - - Ctrl+'=' - + + + Do you want to save this file? + Искате ли да запазите този файл? - - Ctrl+'-' - + + You do not have permission to save %1 + Нямате разрешение да запазите %1 - - Discard - Отказ + + Saved successfully + Успешно запазено - - - Settings - Настройки + + + + Save File + Запази файла - - You do not have permission to open %1 - Нямате разрешение да отворите %1 + + Encoding + Кодиране - - Invalid file: %1 - Невалиден файл: %1 + + Read-Only mode is on + Режим "Само за четене" е включен - - - - Save File - Запази файла + + Current location remembered + - - - Do you want to save this file? - Искате ли да запазите този файл? + + Ctrl+'=' + - - Encoding - Кодиране + + Ctrl+'-' + - + Editor Редактор - - You do not have permission to save %1 - Нямате разрешение да запазите %1 - - - + Untitled %1 - + - - Current location remembered - - - - + Cancel Отказ - - - Save - Запазване + + Discard + Отказ - + \ No newline at end of file diff --git a/translations/deepin-editor_bo.ts b/translations/deepin-editor_bo.ts index c7421bcd..21bd6961 100644 --- a/translations/deepin-editor_bo.ts +++ b/translations/deepin-editor_bo.ts @@ -16,13 +16,18 @@ Characters %1 ཡིག་འབྲུ། %1 + + + Loading: + ཡིག་ཆ་སྣོན་འཇུག་བྱེད་བཞིན་པ། + DDropdownMenu - + + - None མེད། @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save ཉར་ཚགས། - + Do you want to save this file? ཁྱེད་ཀྱིས་ཡིག་ཆ་འདི་ཉར་ཚགས་བྱེད་དམ། - - + + Cancel འདོར་བ། - + Encoding changed. Do you want to save the file now? ཡིག་ཆའི་ཨང་སྒྲིག་བཟོ་བཅོས་བྱས་ཟིན་པས། སྔོན་ལ་ཉར་ཚགས་བྱེད་དམ། - + Discard མི་ཉར། - + + You do not have permission to save %1 ཁྱེད་ལ་%1ཉར་བའི་དབང་ཚད་མེད། - + File removed on the disk. Save it now? སྡུད་སྡེར་ནང་གི་ཐོག་མའི་ཡིག་ཆ་འབུད་ཟིན་པས། དེ་ཉར་རམ། - + File has changed on disk. Reload? སྡུད་སྡེར་ནང་གི་ཐོག་མའི་ཡིག་ཆ་བཟོ་བཅོས་བྱས་ཟིན་པས། བསྐྱར་འཇུག་བྱེད་དམ། - - + + INSERT ནང་འཇུག - + OVERWRITE འགེབས་པ། - + R/O ཀློག་ཙམ། - + The file cannot be read, which may be too large or has been damaged! - + ཡིག་ཆ་འདི་ཉིད་ཀློག་ཐབས་བྲལ། ཡིག་ཆ་ཆེ་དྲགས་པ་དང་ཡང་ན་འཕྲོ་བརླག་ཕྱིན་ཡོད་སྲིད། @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: འཕྲེད་སྟར་དུ་མཆོང་བ། @@ -134,6 +140,24 @@ ཡིག་ཆ་རྩོམ་སྒྲིག་ཆས། + + PathSettingWgt + + + Remember the last used path + མཐའ་མའི་བཀོལ་སྤྱོད་ལམ་བུ་ངེས་དགོས། + + + + Same path as the current file + མིག་སྔའི་ཡིག་ཆ་དང་གཅིག་མཐུན་བྱེད་པ། + + + + Customize the default path + རང་སྒྲུབ་བཀོལ་སྤྱོད་ལམ་བུ། + + QObject @@ -142,12 +166,13 @@ ཡིག་ཆ་རྩོམ་སྒྲུག་ཆས། - - - - - - + + + + + + + Encoding ཨང་སྒྲིག @@ -184,8 +209,8 @@ - - + + Window སྒེའུ་ཁུང་། @@ -271,438 +296,467 @@ + Find Next + རྗེས་མ་འཚོལ་བ། + + + + Find Previous + གོང་མ་འཚོལ་བ། + + + Replace བརྗེ་བ། - + Go to line འཕྲེད་སྟར་དུ་མཆོང་བ། - + Save cursor position འོད་རྟགས་གནས་ཡུལ་ཉར་བ། - + Reset cursor position ཉར་བའི་འོད་རྟགས་གནས་ཡུལ་དུ་མཆོང་བ། - + Exit ཕྱིར་འབུད། - + Display shortcuts མྱུར་མཐེབ་འཆར་བ། - + Print པར་འདེབས། - + Editor རྩོམ་སྒྲིག - + Increase indent སྐུམ་ཚད་ཆེར་གཏོང་། - + Decrease indent སྐུམ་ཚད་ཆུང་གཏོང་། - + Forward character གཡས་སུ་ཡིག་རྟགས་གཅིག་སྤོ་བ། - + Backward character གཡོན་ལ་ཡིག་རྟགས་གཅིག་སྤོ་བ། - + Forward word གཡས་སུ་ཚིག་གཅིག་སྤོ་བ། - + Backward word གཡོན་དུ་ཚིག་གཅིག་སྤོ་བ། - + Next line སྟར་པ་རྗེས་མ། - + Previous line སྟར་པ་གོང་མ། - + New line སྟར་པ་བརྗེ་བ། - + New line above གོང་ལ་སྟར་པ་གཅིག་འཇུག་པ། - + New line below འོག་ཏུ་སྟར་པ་གཅིག་འཇུག་པ། - + Duplicate line འདྲ་བཤུ་བྱས་རྗེས་མིག་སྔའི་སྟར་པར་སྦྱར་བ། - + Delete to end of line སྟར་པའི་མཇུག་བར་སུབ་པ། - + Delete current line མིག་སྔའི་སྟར་པ་སུབ་པ། - + Swap line up གོང་དུ་སྟར་པ་གཅིག་སྤོ་བ། - + Swap line down འོག་ཏུ་སྟར་པ་གཅིག་སྤོ་བ། - + Scroll up one line སྟེང་དུ་སྟར་པ་གཅིག་འགྲིལ་བ། - + Scroll down one line འོག་ཏུ་སྟར་པ་གཅིག་འགྲིལ་བ། - + Page up སྟེང་དུ་ཤོག་ལྷེ་གཅིག་འགྲིལ་བ། - + Page down འོག་ཏུ་ཤོག་ལྷེ་གཅིག་འགྲིལ་བ། - + Move to end of line སྟར་པའི་མཇུག་ཏུ་སྤོ་བ། - + Move to start of line སྟར་པའི་མགོ་ལ་སྤོ་བ། - + Move to end of text ཡིག་ཆའི་མཇུག་ཏུ་སྤོ་བ། - + Move to start of text ཡིག་ཆའི་མགོ་ལ་སྤོ་བ། - + Move to line indentation སྟར་པ་སྐུམ་སར་སྤོ་བ། - + Upper case ཆེ་བྲིས་ལ་བརྗེ་བ། - + Lower case ཆུང་བྲིས་ལ་བརྗེ་བ། - + Capitalize མགོ་ཡིག་ཆེ་བྲིས། - + Delete backward word གཡོན་དུ་ཚིག་གཅིག་སུབ་པ། - + Delete forward word གཡས་སུ་ཚིག་གཅིག་སུབ་པ། - + Forward over a pair གཡས་སུ་སྙོམ་སྒྲིག་བྱེད་པ། - + Backward over a pair གཡོན་དུ་སྙོམ་སྒྲིག་བྱེད་པ། - + Select all ཡོངས་འདེམས། - + Copy པར་སློག - + Cut དྲས་གཏུབ། - + Paste སྦྱར་བ། - + Transpose character ཡིག་རྟགས་བརྗེ་བ། - + Mark རྟགས་སྒྲིག་བཀོད། - + Unmark རྟགས་འདོར་བ། - + Copy line སྟར་པ་འདྲ་བཟོ། - + Cut line སྟར་པ་དྲས་པ། - + Merge lines སྟར་པ་སྒྲིལ་བ། - + Read-Only mode ཀློག་ཙམ་དཔེ་དབྱིབས་ལ་བརྗེ་བ། - + Add comment མཆན་སྣོན་པ། - + Remove comment མཆན་འདོར་བ། - + Undo མི་བྱེད། - + Redo བསྐྱར་བྱེད། - + Add/Remove bookmark ཤོག་འཛར་སྣོན་པ།/འདོར་བ། - + Move to previous bookmark ཤོག་འཛར་གོང་དུ་སྤོ་བ། - + Move to next bookmark ཤོག་འཛར་རྗེས་མར་སྤོ་བ། - + Advanced མཐོ་རིམ་སྒྲིག་བཀོད། - + Window size སྒེའུ་ཁུང་རྣམ་པ། - + Tab width Tabཡིག་རྟགས་ཞེང་ཚད། - + + Paste by pressing a middle mouse button + ཙི་གུས་སྦྱར་ཆོག + + + + Startup + འགོ་སློང་། + + + + Reopen last closed tabs + སྒོ་མ་བརྒྱབ་གོང་གི་ཤོག་ངོས་ཉར་བ། + + + + Open/Save Settings + སྒྲིག་འགོད་ཕྱེ་བ་དང་ཉར་བ། + + + Word wrap རང་འགུལ་ངང་འཕྲེད་སྟར་བརྗེ་བ། - + Code folding flag ཚབ་རྟགས་ལྟེབ་པའི་མཚོན་རྟགས་གསལ་བ། - + Show line numbers སྟར་ཨང་གསལ་བ། - + Show bookmarks icon ཤོག་འཛར་གྱི་རྟགས་གསལ་བ། - + Show whitespaces and tabs སྟོང་ཆའི་ཡིག་རྟགས།/རེའུ་མིག་བཟོ་རྟགས་གསལ་བ། - + Highlight current line མིག་སྔའི་མཐོ་ཚད་གསལ་བ། - + Color mark ཚོས་གཞིའི་རྟགས། - + Unicode Unicode - + WesternEuropean ཡོ་རོབ་ནུབ་མའི་སྐད་ཁོངས། - + CentralEuropean ཡོ་རོབ་བར་མའི་སྐད་ཁོངས། - + Baltic པོ་ལོའུ་ཏི་ཧའེ་ཡི་སྐད་ཡིག - + Cyrillic ཞི་ལེར་གྱི་ཡི་གེ། - + Arabic ཨ་རབ་ཀྱི་སྐད། - + Celtic ཁའེ་ཐེའི་སྐད། - + SouthEasternEuropean ཡོ་རོབ་ཤར་ལྷོའི་སྐད་ཁོངས། - + Greek གྷི་རིག་གི་སྐད། - + Hebrew ཞི་པོ་ལའེ་ཡི་སྐད། - + ChineseSimplified ཟོར་ཡང་རྒྱ་ཡིག - + ChineseTraditional ཟོར་ལྕིའི་རྒྱ་ཡིག - + Japanese ཉི་ཧོང་སྐད། - + Korean ཁོ་རེ་ཡའི་སྐད། - + Thai ཐེ་ལན་གྱི་སྐད། - + Turkish ཐུར་ཁེའི་སྐད། - + Vietnamese ཝེ་ཐེ་ནམ་གྱི་སྐད། - + File not saved ཡིག་ཆ་ཉར་ཚགས་བྱས་མེད། - - - + + Line Endings སྟར་བརྗེ་རྟགས། @@ -752,58 +806,59 @@ Settings - + Standard ཚད་ལྡན། - + Customize རང་སྒྲུབ། - + Normal རྒྱུན་གཏན་སྒེའུ་ཁུང་། - + Maximum ཆེ་སྒྱུར། - + Fullscreen ཡོལ་གང་། - + This shortcut conflicts with system shortcut %1 མྱུར་མཐེབ་འདི་དང་མ་ལག་གི་མྱུར་མཐེབ་%1འགལ་ཟླ་ཡོད། - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately མྱུར་མཐེབ་འདི་དང་%1འགལ་ཟླ་ཡོད་པས། བརྗེ་པོ་མནན་ནས་མྱུར་མཐེབ་འདི་ལམ་སེང་སྤྱོད་གོ་ཆོད། - - + + + The shortcut %1 is invalid, please set another one. %1ནི་ནུས་མེད་མྱུར་མཐེབ་ཡིན་པས། ཡང་བསྐྱར་སྒྲིག་བཀོད་གནང་རྒྱུ། - + Cancel འདོར་བ། - + Replace བརྗེ་བ། - + OK གཏན་འཁེལ། @@ -852,259 +907,260 @@ TextEdit - + Undo མི་བྱེད། - + Redo བསྐྱར་བྱེད། - + Cut དྲས་གཏུབ། - + Copy པར་སློག - + Paste སྦྱར་བ། - + Delete སུབ་པ། - + Select All ཡོངས་འདེམས། - - + + Find འཚོལ་བ། - - + + Replace བརྗེ་བ། - + Go to Line འཕྲེད་སྟར་དུ་མཆོང་བ། - + Turn on Read-Only mode ཀློག་ཙམ་དཔེ་དབྱིབས་ཁ་ཕྱེ། - + Turn off Read-Only mode ཀློག་ཙམ་དཔེ་དབྱིབས་ཁ་རྒྱག - + Fullscreen ཡོལ་གང་། - + Exit fullscreen ཡོལ་གང་ནས་ཕྱིར་འབུད་པ། - + Display in file manager ཡིག་ཆ་དོ་དམ་ཆས་ཁྲོད་དུ་མངོན་པ། - - + + Add Comment མཆན་སྣོན་པ། - + Text to Speech ཀློག་འདོན་བྱ་རྒྱུ། - + Stop reading ཀློག་མཚམས་འཇོག་པ། - + Speech to Text སྐད་སྒྲའི་དཔོད་བྲིས། - + Translate ཡིག་སྒྱུར། - + Column Mode གཞུང་སྟར་རྩོམ་སྒྲིག་རྣམ་པ། - + Add bookmark ཤོག་འཛར་སྣོན་པ། - + Remove Bookmark ཤོག་འཛར་འདོར་བ། - + Previous bookmark ཤོག་འཛར་གོང་མ། - + Next bookmark ཤོག་འཛར་རྗེས་མ། - + Remove All Bookmarks ཤོག་འཛར་ཚང་མ་འདོར་བ། - + Fold All བང་རིམ་ཚང་མ་ལྟེབ་པ། - + Fold Current Level མིག་སྔའི་བང་རིམ་ལྟེབ་པ། - + Unfold All བང་རིམ་ཚང་མ་བཀྲམ་པ། - + Unfold Current Level མིག་སྔའི་བང་རིམ་བཀྲམ་པ། - + Color Mark ཚོས་གཞིའི་རྟགས། - + Clear All Marks རྟགས་ཚང་མ་གཙང་སེལ། - + Clear Last Mark གོང་གི་རྟགས་གཙང་སེལ། - + Mark རྟགས་སྒྲིག་བཀོད། - + Mark All རྟགས་ཚང་མ། - + Remove Comment མཆན་འདོར་བ། - + Copy failed: not enough memory གཤོང་ཚད་མ་འདང་བས་པར་སློག་བྱེད་ཐབས་བྲལ། - + Press ALT and click lines to edit in column mode ALT+ཙི་གུའི་འདེམས་པ་སྤྱད་ནས་གཞུང་སྟར་རྩོམ་སྒྲིག་རྣམ་པ་བརྗེ་རྒྱུ། - + Change Case ཆེ་བྲིས་ཆུང་བྲིས་བརྗེ་བ། - + Upper Case ཆེ་བྲིས། - + Lower Case ཆུང་བྲིས། - + Capitalize མགོ་ཡིག་ཆེ་བྲིས། - + None མེད། - + Selected line(s) copied བདམས་ཟིན་པའི་སྟར་པ(རུ་སྟར)འདི་དྲས་སྦྱར་པང་དུ་པར་སློག་བྱས་ཟིན། - + Current line copied མིག་སྔའི་སྟར་པ་འདི་དྲས་སྦྱར་པང་དུ་པར་སློག་བྱས་ཟིན། - + Selected line(s) clipped བདམས་ཟིན་པའི་སྟར་པ(རུ་སྟར)འདི་དྲས་སྦྱར་པང་དུ་དྲས་གཏུབ་བྱས་ཟིན། - + Current line clipped མིག་སྔའི་སྟར་པ་འདི་དྲས་སྦྱར་པང་དུ་དྲས་གཏུབ་བྱས་ཟིན། - + Paste failed: not enough memory ཤོང་ཚད་མི་འདང་བས་སྦྱར་མ་ཐུབ། - + Read-Only mode is off ཀློག་ཙམ་དཔེ་དབྱིབས་ཁ་བརྒྱབ་ཟིན། - - - - - + + + + + + Read-Only mode is on ཀློག་ཙམ་དཔེ་དབྱིབས་ཁ་ཕྱེ་ཟིན། @@ -1121,129 +1177,129 @@ Window - + Save as གཞན་ཉར། - + New window སྒེའུ་ཁུང་གསར་པ། - + New tab ཁ་བྱང་ངོས་གསར། - + Open file ཡིག་ཆ་ཁ་ཕྱེ། - - + + Save ཉར་ཚགས། - + Print པར་འདེབས། - + Switch theme བརྗོད་བྱ་གཙོ་བོ་བརྗེ་བ། - - + + Settings སྒྲིག་བཀོད། - - + + Read-Only ཀློག་ཙམ། - + You do not have permission to open %1 ཁྱེད་ལ་%1ཁ་ཕྱེ་བའི་དབང་ཚད་མེད། - - + + Invalid file: %1 ཕན་མེད་ཡིག་ཆ། %1 - - + + Do you want to save this file? ཁྱེད་ཀྱིས་ཡིག་ཆ་འདི་ཉར་ཚགས་བྱེད་དམ། - + You do not have permission to save %1 ཁྱེད་ལ་%1ཉར་བའི་དབང་ཚད་མེད། - + Saved successfully ཡིག་ཆ་ཉར་ཟིན། - - - + + + Save File ཉར་བ། - + Encoding ཨང་སྒྲིག - + Read-Only mode is on ཀློག་ཙམ་དཔེ་དབྱིབས་ཁ་ཕྱེ་ཟིན། - + Current location remembered མིག་སྔའི་གནས་ས་ངེས་ཟིན། - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor རྩོམ་སྒྲིག - + Untitled %1 མིང་མེད་པའི་ཡིག་ཚགས་%1 - + Cancel འདོར་བ། - + Discard མི་ཉར། diff --git a/translations/deepin-editor_ca.ts b/translations/deepin-editor_ca.ts index d5d0507a..2952a30a 100644 --- a/translations/deepin-editor_ca.ts +++ b/translations/deepin-editor_ca.ts @@ -16,13 +16,18 @@ Characters %1 Caràcters %1 + + + Loading: + Es carrega: + DDropdownMenu - + + - None Cap @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Desa - + Do you want to save this file? Voleu desar aquest fitxer? - - + + Cancel Cancel·la - + Encoding changed. Do you want to save the file now? Ha canviat la codificació. Voleu desar el fitxer ara? - + Discard Descarta - + + You do not have permission to save %1 No teniu permís per desar %1 - + File removed on the disk. Save it now? El fitxer s'ha eliminat del disc. El voleu desar ara? - + File has changed on disk. Reload? El fitxer ha canviat al disc. El torno a carregar? - - + + INSERT INSEREIX - + OVERWRITE SOBREESCRIU - + R/O N/L - + The file cannot be read, which may be too large or has been damaged! - + El fitxer no es pot llegir. Pot ser massa gros o estar malmès! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Ves a la línia: @@ -134,6 +140,24 @@ Editor de text + + PathSettingWgt + + + Remember the last used path + Recorda el darrer camí usat. + + + + Same path as the current file + El mateix camí del fitxer actual + + + + Customize the default path + Personalització del camí predeterminat + + QObject @@ -142,12 +166,13 @@ Editor de text - - - - - - + + + + + + + Encoding Codificació @@ -184,8 +209,8 @@ - - + + Window Finestra @@ -271,438 +296,467 @@ + Find Next + Troba el següent + + + + Find Previous + Troba l'anterior + + + Replace Reemplaça - + Go to line Ves a la línia - + Save cursor position Desa la posició del cursor - + Reset cursor position Restableix la posició del cursor - + Exit Surt - + Display shortcuts Mostra les dreceres - + Print Imprimeix - + Editor Editor - + Increase indent Augmenta el sagnat - + Decrease indent Redueix el sagant - + Forward character Caràcter següent - + Backward character Caràcter anterior - + Forward word Paraula següent - + Backward word Paraula anterior - + Next line Línia següent - + Previous line Línia anterior - + New line Línia nova - + New line above Línia nova superior - + New line below Línia nova inferior - + Duplicate line Duplica la línia - + Delete to end of line Suprimeix fins al final de la línia - + Delete current line Suprimeix la línia actual - + Swap line up Intercanvia amb la línia superior - + Swap line down Intercanvia amb la línia inferior - + Scroll up one line Ves una línia amunt - + Scroll down one line Ves una línia avall - + Page up Pàgina amunt - + Page down Pàgina avall - + Move to end of line Mou al final de la línia - + Move to start of line Mou a l'inici de la línia - + Move to end of text Mou al final del text - + Move to start of text Mou a l'inici del text - + Move to line indentation Mou al sagnat de la línia - + Upper case Majúscules - + Lower case Minúscules - + Capitalize Posa en majúscules - + Delete backward word Suprimeix la paraula anterior - + Delete forward word Suprimeix la paraula següent - + Forward over a pair Endavant dues - + Backward over a pair Endarrere dues - + Select all Selecciona-ho tot - + Copy Copia - + Cut Retalla - + Paste Enganyxa - + Transpose character Transposa el caràcter - + Mark Marca - + Unmark Desmarca - + Copy line Copia la línia - + Cut line Retalla la línia - + Merge lines Fusiona les línies - + Read-Only mode Mode només de lectura - + Add comment Afegeix-hi un comentari - + Remove comment Elimina el comentari - + Undo Desfés - + Redo Refés - + Add/Remove bookmark Afegeix / elimina un marcador - + Move to previous bookmark Ves al marcador anterior - + Move to next bookmark Ves al marcador següent - + Advanced Avançat - + Window size Mida de la finestra - + Tab width Amplada de la pestanya - + + Paste by pressing a middle mouse button + Enganxa prement el botó del mig del ratolí. + + + + Startup + Inici + + + + Reopen last closed tabs + Torna a obrir les darreres pestanyes tancades. + + + + Open/Save Settings + Configuració d'obertura / desament + + + Word wrap Ajust de paraules - + Code folding flag Bandera de plec de codi - + Show line numbers Mostra els números de línia - + Show bookmarks icon Mostra la icona dels marcadors - + Show whitespaces and tabs Mostra els espais en blanc i les tabulacions - + Highlight current line Ressalta la línia actual - + Color mark Marca de color - + Unicode Unicode - + WesternEuropean Europeu occidental - + CentralEuropean Centreeuropeu - + Baltic Bàltic - + Cyrillic Cirílic - + Arabic Àrab - + Celtic Celta - + SouthEasternEuropean Sud-est europeu - + Greek Grec - + Hebrew Hebreu - + ChineseSimplified Xinès simplificat - + ChineseTraditional Xinès tradicional - + Japanese Japonès - + Korean Coreà - + Thai Tailandès - + Turkish Turc - + Vietnamese Vietnamita - + File not saved Fitxer no desat - - - + + Line Endings Finals de línia @@ -752,58 +806,59 @@ Settings - + Standard Estàndard - + Customize Personalitza - + Normal Normal - + Maximum Màxim - + Fullscreen Pantalla completa - + This shortcut conflicts with system shortcut %1 Aquesta drecera entra en conflicte amb la drecera del sistema %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Aquesta tecla de drecera té conflicte amb %1. Cliqueu a Reemplaça perquè aquesta drecera tingui efecte immediatament. - - + + + The shortcut %1 is invalid, please set another one. La drecera %1 no és vàlida. Establiu-ne una altra. - + Cancel Cancel·la - + Replace Reemplaça - + OK D'acord @@ -852,259 +907,260 @@ TextEdit - + Undo Desfés - + Redo Refés - + Cut Retalla - + Copy Copia - + Paste Enganxa - + Delete Suprimeix - + Select All Selecciona-ho tot - - + + Find Troba - - + + Replace Reemplaça - + Go to Line Ves a la línia - + Turn on Read-Only mode Activa el mode només de lectura - + Turn off Read-Only mode Desactiva el mode només de lectura - + Fullscreen Pantalla completa - + Exit fullscreen Surt de la pantalla completa - + Display in file manager Mostra-ho al gestor de fitxers - - + + Add Comment Afegeix-hi un comentari - + Text to Speech Text a veu - + Stop reading Atura la lectura - + Speech to Text Veu a text - + Translate Tradueix - + Column Mode Mode de columna - + Add bookmark Afegeix-hi un marcador - + Remove Bookmark Elimina el marcador - + Previous bookmark Marcador anterior - + Next bookmark Marcador següent - + Remove All Bookmarks Elimina tots els marcadors - + Fold All Plega-ho tot - + Fold Current Level Plega el nivell actual - + Unfold All Desplega-ho tot - + Unfold Current Level Desplega el nivell actual - + Color Mark Marca de color - + Clear All Marks Neteja totes les marques - + Clear Last Mark Neteja la darrera marca - + Mark Marca - + Mark All Marca-ho tot - + Remove Comment Elimina el comentari - + Copy failed: not enough memory La còpia ha fallat: no hi ha prou memòria. - + Press ALT and click lines to edit in column mode Premeu ALT i feu clic a les línies per editar-lo en mode columna - + Change Case Canvia'n la caixa - + Upper Case Majúscules - + Lower Case Minúscules - + Capitalize Posa en majúscules - + None Cap - + Selected line(s) copied S'han copiat les línies seleccionades. - + Current line copied S'ha copiat la línia actual. - + Selected line(s) clipped S'han retallat les línies seleccionades. - + Current line clipped S'ha retallat la línia actual. - + Paste failed: not enough memory Ha fallat l'acció d'enganxar: no hi ha prou memòria. - + Read-Only mode is off Mode de lectura desactivat - - - - - + + + + + + Read-Only mode is on Mode de lectura activat @@ -1121,129 +1177,129 @@ Window - + Save as Desa com a - + New window Finestra nova - + New tab Pestanya nova - + Open file Obre un fitxer - - + + Save Desa - + Print Imprimeix - + Switch theme Canvia el tema - - + + Settings Paràmetres - - + + Read-Only Només de lectura - + You do not have permission to open %1 No teniu permís per obrir %1 - - + + Invalid file: %1 Fitxer no vàlid: %1 - - + + Do you want to save this file? Voleu desar aquest fitxer? - + You do not have permission to save %1 No teniu permís per desar %1 - + Saved successfully S'ha desat correctament - - - + + + Save File Desa el fitxer - + Encoding Codificació - + Read-Only mode is on Mode de lectura activat - + Current location remembered Es recorda la ubicació actual. - + Ctrl+'=' Ctrl + = - + Ctrl+'-' Ctrl + - - + Editor Editor - + Untitled %1 Sense títol: %1 - + Cancel Cancel·la - + Discard Descarta diff --git a/translations/deepin-editor_cs.ts b/translations/deepin-editor_cs.ts index b0ca4717..3b61cf99 100644 --- a/translations/deepin-editor_cs.ts +++ b/translations/deepin-editor_cs.ts @@ -16,13 +16,18 @@ Characters %1 Znaků %1 + + + Loading: + Nahrává se: + DDropdownMenu - + + - None Žádné @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Uložit - + Do you want to save this file? Chcete tento soubor uložit? - - + + Cancel Zrušit - + Encoding changed. Do you want to save the file now? Kódování změněno. Chcete tento soubor uložit nyní? - + Discard Zahodit - + + You do not have permission to save %1 Nemáte oprávnění pro uložení %1 - + File removed on the disk. Save it now? Soubor byl mezitím na disku odstraněn. Uložit ho nyní? - + File has changed on disk. Reload? Soubor byl mezitím na disku změněn. Načíst znovu? - - + + INSERT VLOŽIT - + OVERWRITE PŘEPSAT - + R/O Pouze pro čtení - + The file cannot be read, which may be too large or has been damaged! - + Soubor nelze přečíst, může být příliš velký nebo poškozený! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Jít na řádek: @@ -134,6 +140,24 @@ Textový editor + + PathSettingWgt + + + Remember the last used path + Pamatovat si poslední použitou cestu + + + + Same path as the current file + Stejná cesta jako k nynějšímu souboru + + + + Customize the default path + Přizpůsobit výchozí cestu + + QObject @@ -142,12 +166,13 @@ Textový editor - - - - - - + + + + + + + Encoding Kódování znaků @@ -184,8 +209,8 @@ - - + + Window Okno @@ -271,438 +296,467 @@ + Find Next + Vyhledat text + + + + Find Previous + Vyhledat předchozí + + + Replace Nahradit - + Go to line Jít na řádek - + Save cursor position Uložit pozici kurzoru - + Reset cursor position Vrátit polohu kurzoru na výchozí - + Exit Ukončit - + Display shortcuts Zobrazit klávesové zkratky - + Print Tisk - + Editor Editor - + Increase indent Zvětšit odsazení - + Decrease indent Zmenšit odsazení - + Forward character O znak dopředu - + Backward character O znak dozadu - + Forward word O slovo dopředu - + Backward word O slovo dozadu - + Next line Další řádek - + Previous line Předchozí řádek - + New line Nový řádek - + New line above Nový řádek nad - + New line below Nový řádek pod - + Duplicate line Zduplikovat řádek - + Delete to end of line Smazat po konec řádku - + Delete current line Smazat stávající řádek - + Swap line up Prohodit řádek s tím nad ním - + Swap line down Prohodit řádek s tím pod ním - + Scroll up one line Posunout se o řádek nahoru - + Scroll down one line Posunout se o řádek dolů - + Page up O stránku nahoru - + Page down O stránku dolů - + Move to end of line Přesunout na konec řádku - + Move to start of line Přesunout na začátek řádku - + Move to end of text Přesunout na konec textu - + Move to start of text Přesunout na začátek textu - + Move to line indentation Přesunout na odsazení řádku - + Upper case Velká písmena - + Lower case Malá písmena - + Capitalize Vše velkými písmeny - + Delete backward word Smazat slovo za kurzorem - + Delete forward word Smazat slovo před kurzorem - + Forward over a pair Dopředu přes dvojici - + Backward over a pair Dozadu přes dvojici - + Select all Vybrat vše - + Copy Kopírovat - + Cut Vyjmout - + Paste Vložit - + Transpose character Přemístit znak - + Mark Označit - + Unmark Odznačit - + Copy line Kopírovat řádek - + Cut line Vyjmout řádek - + Merge lines Sloučit řádky - + Read-Only mode Režim pouze pro čtení - + Add comment Přidat komentář - + Remove comment Odebrat komentář - + Undo Zpět - + Redo Znovu - + Add/Remove bookmark Přidat/Odebrat záložku - + Move to previous bookmark Přesunout na předchozí záložku - + Move to next bookmark Přesunout na další záložku - + Advanced Pokročilé - + Window size Velikost okna - + Tab width Šířka zarážky (tabulátor) - + + Paste by pressing a middle mouse button + Vložit stisknutím prostředního tlačítka myši + + + + Startup + Spuštění + + + + Reopen last closed tabs + Znovu otevřít naposledy zavřené karty + + + + Open/Save Settings + Nastavení pro otevírání/ukládání + + + Word wrap Zalamování slov - + Code folding flag Příznak sbalení kódu - + Show line numbers Zobrazovat čísla řádek - + Show bookmarks icon Zobrazovat ikony záložek - + Show whitespaces and tabs Zobrazovat prázdné znaky a tabulátory - + Highlight current line Zvýraznit stávající řádek - + Color mark Barevná značka - + Unicode Unicode - + WesternEuropean Západoevropské - + CentralEuropean Středoevropské - + Baltic Baltské - + Cyrillic Cyrilice - + Arabic Arabské - + Celtic Keltské - + SouthEasternEuropean Jihovýchodoevropské - + Greek Řecké - + Hebrew Hebrejské - + ChineseSimplified Zjednodušená čínština - + ChineseTraditional Tradiční čínština - + Japanese Japonské - + Korean Korejské - + Thai Thajské - + Turkish Turecké - + Vietnamese Vietnamské - + File not saved Soubor neuložen - - - + + Line Endings Konce řádků @@ -752,58 +806,59 @@ Settings - + Standard Standardní - + Customize Přizpůsobit - + Normal Normální - + Maximum Největší - + Fullscreen Na celou obrazovku - + This shortcut conflicts with system shortcut %1 Tato zkratka je v konfliktu se systémovou %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Tato zkratka koliduje s %1 – klepněte na Nahradit, pokud chcete, aby začala platit pro tuto akci - - + + + The shortcut %1 is invalid, please set another one. Zkratka %1 není platná – prosím nastavte jinou. - + Cancel Zrušit - + Replace Nahradit - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Zpět - + Redo Znovu - + Cut Vyjmout - + Copy Zkopírovat - + Paste Vložit - + Delete Smazat - + Select All Vybrat vše - - + + Find Najít - - + + Replace Nahradit - + Go to Line Jít na řádek - + Turn on Read-Only mode Zapnout režim pouze pro čtení - + Turn off Read-Only mode Vypnout režim pouze pro čtení - + Fullscreen Na celou obrazovku - + Exit fullscreen Opustit zobrazení na celou obrazovku - + Display in file manager Zobrazit ve správci souborů - - + + Add Comment Přidat komentář - + Text to Speech Text na řeč - + Stop reading Zastavit předčítání - + Speech to Text Řeč na text - + Translate Přeložit - + Column Mode Sloupcový režim - + Add bookmark Přidat záložku - + Remove Bookmark Odebrat záložku - + Previous bookmark Předchozí záložka - + Next bookmark Další záložka - + Remove All Bookmarks Odebrat veškeré záložky - + Fold All Sbalit vše - + Fold Current Level Sbalit stávající úroveň - + Unfold All Rozbalit vše - + Unfold Current Level Rozbalit stávající úroveň - + Color Mark Barevná značka - + Clear All Marks Vymazat všechny značky - + Clear Last Mark Vymazat poslední značku - + Mark Označit - + Mark All Označit vše - + Remove Comment Odebrat komentář - + Copy failed: not enough memory Kopírování se nezdařilo: nedostatek paměti - + Press ALT and click lines to edit in column mode Pro upravování ve sloupcovém režimu stiskněte ALT a klepejte na řádky - + Change Case Změnit velikost písmen - + Upper Case Velká písmena - + Lower Case Malá písmena - + Capitalize Vše velkými písmeny - + None Žádné - + Selected line(s) copied Vybraný řádek (řádky) zkopírován - + Current line copied Stávající řádek zkopírován - + Selected line(s) clipped Vybraný řádek (řádky) zkrácen - + Current line clipped Stávající řádek zkrácen - + Paste failed: not enough memory Vložení se nezdařilo: nedostatek paměti - + Read-Only mode is off Režim pouze pro čtení je vypnut - - - - - + + + + + + Read-Only mode is on Režim pouze pro čtení je zapnut @@ -1121,129 +1177,129 @@ Window - + Save as Uložit jako - + New window Nové okno - + New tab Nová karta - + Open file Otevřít soubor - - + + Save Uložit - + Print Tisk - + Switch theme Přepnout vzhled - - + + Settings Nastavení - - + + Read-Only Pouze pro čtení - + You do not have permission to open %1 Nemáte oprávnění pro otevření %1 - - + + Invalid file: %1 Neplatný soubor: %1 - - + + Do you want to save this file? Chcete tento soubor uložit? - + You do not have permission to save %1 Nemáte oprávnění pro uložení %1 - + Saved successfully Úspěšně uloženo - - - + + + Save File Uložit soubor - + Encoding Kódování znaků - + Read-Only mode is on Režim pouze pro čtení je zapnut - + Current location remembered Stávající pozice zapamatována - + Ctrl+'=' Ctrl + = - + Ctrl+'-' Ctlr + - - + Editor Editor - + Untitled %1 Bez názvu %1 - + Cancel Zrušit - + Discard Zahodit diff --git a/translations/deepin-editor_da.ts b/translations/deepin-editor_da.ts index 27972d54..bc17bfa1 100644 --- a/translations/deepin-editor_da.ts +++ b/translations/deepin-editor_da.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row Række - + Column Kolonne - + Characters %1 Tegn %1 + + + Loading: + + DDropdownMenu - - - + + + None - Ingen + Ingen EditWrapper - - File has changed on disk. Reload? - Filen er blevet ændret på disken. Genindlæs? - - - - File removed on the disk. Save it now? - Filen er fjernet fra disken. Gem den nu? + + + + + Save + Gem - + Do you want to save this file? - Vil du gemme filen? + Vil du gemme filen? - - Discard - Forkast + + + Cancel + Annuller - + Encoding changed. Do you want to save the file now? - + Kodning ændret. Vil du gemme filen nu? - + + Discard + Forkast + + + + You do not have permission to save %1 - Du har ikke tilladelse til at gemme %1 + Du har ikke tilladelse til at gemme %1 + + + + File removed on the disk. Save it now? + Filen er fjernet fra disken. Gem den nu? + + + + File has changed on disk. Reload? + Filen er blevet ændret på disken. Genindlæs? - - + + INSERT INDSÆT - + OVERWRITE OVERSKRIV - + R/O SB - - - Cancel - Annuller - - - - - - - Save - Gem + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find Find - - Next - Næste - - - + Previous Forrige + + + Next + Næste + JumpLineBar - + Go to Line: Gå til linje: @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. Teksteditor er et kraftfuldt værktøj til at vise og redigere tekstfiler. - + Text Editor Teksteditor - QObject + PathSettingWgt - - File not saved - Filen er ikke gemt + + Remember the last used path + - + + Same path as the current file + + + + + Customize the default path + + + + + QObject + + Text Editor Teksteditor - + + + + + + + + Encoding + Kodning + + + Basic Grundlæggende - + Font Style Skriftstil - + Font Skrifttype - + Font Size Skriftstørrelse - - - Keymap - Tegnkort - - - + Shortcuts Genveje - - Forward character - Et tegn fremad - - - - Backward character - Et tegn tilbage - - - - Transpose character - Omvendte tegn - - - - Tab width - Tabulatorbredde - - - - Word wrap - + + + Keymap + Tegnkort - - - + + + Window Vindue - + New tab Nyt faneblad - + New window Nyt vindue - + Save Gem - + Save as Gem som - + Next tab Næste faneblad - + Previous tab Forrige faneblad - + Close tab Luk faneblad - + Close other tabs Luk andre faneblade - + Restore tab Gendan faneblad - + Open file Åbn fil - + Increment font size Større skriftstørrelse - + Decrement font size Mindre skriftstørrelse - + Reset font size Nulstil skriftstørrelse - - Toggle fullscreen - Fuldskærm til/fra - - - + Help Hjælp - + + Toggle fullscreen + Fuldskærm til/fra + + + Find Find - + + Find Next + + + + + Find Previous + + + + Replace Erstat - + Go to line Gå til linje - + Save cursor position Gem markørplacering - + Reset cursor position Nulstil markørplacering - + Exit Afslut - + Display shortcuts Vis genveje - + Print Udskriv - + Editor Editor - + Increase indent Større indrykning - + Decrease indent Mindre indrykning - + + Forward character + Et tegn fremad + + + + Backward character + Et tegn tilbage + + + Forward word Et ord fremad - + Backward word Et ord tilbage - + Next line Næste linje - + Previous line Forrige linje - + New line Ny linje - + New line above Ny linje nedenfor - + New line below Ny linje ovenfor - + Duplicate line Dupliker linje - + Delete to end of line Slet til slutningen af linjen - + Delete current line Slet nuværende linje - + Swap line up Ombyt linje op - + Swap line down Ombyt linje ned - + Scroll up one line Rul en linje op - + Scroll down one line Rul en linje ned - + Page up Side op - + Page down Side ned - + Move to end of line Flyt til slutningen af linjen - + Move to start of line Flyt til begyndelsen af linjen - + Move to end of text Flyt til slutningen af teksten - + Move to start of text Flyt til begyndelsen af teksten - + Move to line indentation Flyt til linjeindrykning - + Upper case Store bogstaver - + Lower case Små bogstaver - + Capitalize Stort begyndelsesbogstav - + Delete backward word Slet et ord tilbage - + Delete forward word Slet et ord fremad - + Forward over a pair Fremad over et par - + Backward over a pair Tilbage over et par - + Select all Markér alt - + Copy Kopiér - + Cut Klip - + Paste Indsæt - + + Transpose character + Omvendte tegn + + + Mark Sæt mærke - + Unmark Fjern mærke - + Copy line Kopiér linje - + Cut line Klip linje - + Merge lines Sammenlæg linjer - + Read-Only mode Skrivebeskyttet tilstand - + Add comment - + - + Remove comment - + - + Undo Fortryd - + Redo Omgør - + Add/Remove bookmark - + - + Move to previous bookmark - + - + Move to next bookmark - + - + Advanced Avanceret - + Window size Vinduesstørrelse - + + Tab width + Tabulatorbredde + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + + Word wrap + + + + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + + Color mark + + + + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - + - - Color mark - - - - - - - - - - Encoding - Kodning + + File not saved + Filen er ikke gemt - - - + + Line Endings - Linjeskift + Linjeskift ReplaceBar - + Find Find - + Replace With Erstat med - + Replace Erstat - + Skip Spring over - + Replace Rest Erstat resten - + Replace All Erstat alle + + S: + + + + The first line of the short usage message. + + + Settings - + Standard Standard - + Customize Tilpas - + Normal Normal - + Maximum Maksimum - + Fullscreen Fuldskærm - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel Annuller - + Replace Erstat - + OK - + StartManager - + Untitled %1 - Unavngivet %1 + Unavngivet %1 Tabbar - + Close tab Luk faneblad - + + Close other tabs + Luk andre faneblade + + + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - - - - - Close other tabs - Luk andre faneblade + TextEdit - + Undo Fortryd - + Redo Omgør - + Cut Klip - + Copy Kopiér - + Paste Indsæt - + Delete Slet - + Select All Markér alt - - + + Find Find - - + + Replace Erstat - + Go to Line Gå til linje - + Turn on Read-Only mode Aktivér skrivebeskyttet tilstand - + Turn off Read-Only mode Deaktivér skrivebeskyttet tilstand - + Fullscreen Fuldskærm - + Exit fullscreen Afslut fuldskærm - + Display in file manager Vis i filhåndtering - - + + Add Comment - - - - - Column Mode - - - - - Remove Comment - - - - - Copy failed: not enough memory - - - - - Press ALT and click lines to edit in column mode - + - + Text to Speech Tekst til tale - + Stop reading - Stop læsning + - + Speech to Text Tale til tekst - + Translate Oversæt - + + Column Mode + + + + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - - Mark All - + + Clear All Marks + - + + Clear Last Mark + + + + Mark Sæt mærke - - Clear All Marks - + + Mark All + - - Clear Last Mark - + + Remove Comment + - + + Copy failed: not enough memory + + + + + Press ALT and click lines to edit in column mode + + + + Change Case Skift store/små bogstaver - + Upper Case Store bogstaver - + Lower Case Små bogstaver - + Capitalize Stort begyndelsesbogstav - + None Ingen - + Selected line(s) copied Valgte linje(r) kopieret - + Current line copied Nuværende linje kopieret - + Selected line(s) clipped Valgte linje(r) beskåret - + Current line clipped Nuværende linje beskåret - + Paste failed: not enough memory - + - + Read-Only mode is off Skrivebeskyttet tilstand er deaktiveret - - - + + + + + + Read-Only mode is on Skrivebeskyttet tilstand er aktiveret @@ -1098,7 +1168,7 @@ WarningNotices - + Reload Genindlæs @@ -1106,131 +1176,132 @@ Window - + + + Save as + Gem som + + + New window Nyt vindue - + New tab Nyt faneblad - + Open file Åbn fil - - - Save as - Gem som + + + Save + Gem - + Print Udskriv - + Switch theme Skift tema - - + + + Settings + Indstillinger + + + + Read-Only Skrivebeskyttet - - Saved successfully - Gemt + + You do not have permission to open %1 + Du har ikke tilladelse til at åbne %1 - - Read-Only mode is on - Skrivebeskyttet tilstand er aktiveret + + + Invalid file: %1 + Ugyldig fil: %1 - - Ctrl+'=' - + + + Do you want to save this file? + Vil du gemme filen? - - Ctrl+'-' - + + You do not have permission to save %1 + Du har ikke tilladelse til at gemme %1 - - Discard - Forkast + + Saved successfully + Gemt - - - Settings - Indstillinger + + + + Save File + Gem fil - - You do not have permission to open %1 - Du har ikke tilladelse til at åbne %1 + + Encoding + Kodning - - Invalid file: %1 - Ugyldig fil: %1 + + Read-Only mode is on + Skrivebeskyttet tilstand er aktiveret - - - - Save File - Gem fil + + Current location remembered + Nuværende placering husket - - - Do you want to save this file? - Vil du gemme filen? + + Ctrl+'=' + - - Encoding - Kodning + + Ctrl+'-' + - + Editor Editor - - You do not have permission to save %1 - Du har ikke tilladelse til at gemme %1 - - - + Untitled %1 Unavngivet %1 - - Current location remembered - Nuværende placering husket - - - + Cancel Annuller - - - Save - Gem + + Discard + Forkast - + \ No newline at end of file diff --git a/translations/deepin-editor_de.ts b/translations/deepin-editor_de.ts index 1da99d1a..0302045e 100644 --- a/translations/deepin-editor_de.ts +++ b/translations/deepin-editor_de.ts @@ -16,13 +16,18 @@ Characters %1 Zeichen %1 + + + Loading: + Wird geladen: + DDropdownMenu - + + - None Keines @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Speichern - + Do you want to save this file? Möchten Sie diese Datei speichern? - - + + Cancel Abbrechen - + Encoding changed. Do you want to save the file now? Kodierung geändert. Wollen Sie die Datei jetzt speichern? - + Discard Verwerfen - + + You do not have permission to save %1 Berechtigung zum Speichern von %1 fehlt - + File removed on the disk. Save it now? Die Datei wurde von der Festplatte entfernt. Soll die Datei jetzt gespeichert werden. - + File has changed on disk. Reload? Die Datei wurde verändert.. Soll die Datei neu geladen werden? - - + + INSERT EINFÜGEN - + OVERWRITE ÜBERSCHREIBEN - + R/O R/O - + The file cannot be read, which may be too large or has been damaged! - + Die Datei kann nicht gelesen werden, da sie möglicherweise zu groß oder beschädigt ist! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Gehe zu Zeile: @@ -134,6 +140,24 @@ Texteditor + + PathSettingWgt + + + Remember the last used path + Zuletzt verwendeten Pfad merken + + + + Same path as the current file + Gleicher Pfad wie bei der aktuellen Datei + + + + Customize the default path + Anpassen des Standardpfads + + QObject @@ -142,12 +166,13 @@ Texteditor - - - - - - + + + + + + + Encoding Kodierung @@ -184,8 +209,8 @@ - - + + Window Fenster @@ -271,438 +296,467 @@ + Find Next + Weitersuchen + + + + Find Previous + + + + Replace Ersetzen - + Go to line Gehe zu Zeile - + Save cursor position Position des Schreibmarkers speichern - + Reset cursor position Position des Schreibmarkers zurücksetzen - + Exit Beenden - + Display shortcuts Tastaturkürzel anzeigen - + Print Drucken - + Editor Editor - + Increase indent Einrückung vergrößern - + Decrease indent Einrückung verringern - + Forward character Ein Zeichen vorwärts - + Backward character Ein Zeichen rückwärts - + Forward word Ein Wort vorwärts - + Backward word Ein Wort rückwärts - + Next line Nächste Zeile - + Previous line Vorherige Zeile - + New line Neue Zeile - + New line above Neue Zeile davor - + New line below Neue Zeile danach - + Duplicate line Zeile duplizieren - + Delete to end of line Ende der Zeile löschen - + Delete current line Aktuelle Zeile entfernen - + Swap line up Zeile nach oben verschieben - + Swap line down Zeile nach unten verschieben - + Scroll up one line Eine Zeile hoch - + Scroll down one line Eine Zeile runter - + Page up Eine Seite nach oben - + Page down Eine Seite nach unten - + Move to end of line Zum Ende der Zeile bewegen - + Move to start of line Zum Anfang der Zeile bewegen - + Move to end of text Zum Ende des Texts bewegen - + Move to start of text Zum Anfang des Texts bewegen - + Move to line indentation Zur Zeileneinrückung bewegen - + Upper case Großbuchstaben - + Lower case Kleinbuchstaben - + Capitalize Großschreibung - + Delete backward word Ein Wort rückwärts entfernen - + Delete forward word Ein Wort vorwärts entfernen - + Forward over a pair Vorwärts über ein Paar - + Backward over a pair Rückwärts über ein Paar - + Select all Alles markieren - + Copy Kopieren - + Cut Ausschneiden - + Paste Einfügen - + Transpose character Zeichen transponieren - + Mark Markieren - + Unmark Markierung aufheben - + Copy line Zeile kopieren - + Cut line Zeile ausschneiden - + Merge lines Zeilen zusammenfügen - + Read-Only mode Nur-Lese-Modus - + Add comment Kommentar hinzufügen - + Remove comment Kommentar entfernen - + Undo Rückgängig - + Redo Wiederherstellen - + Add/Remove bookmark Lesezeichen hinzufügen/entfernen - + Move to previous bookmark Zum vorherigen Lesezeichen wechseln - + Move to next bookmark Zum nächsten Lesezeichen wechseln - + Advanced Erweitert - + Window size Fenstergröße - + Tab width Tabulatorbreite - + + Paste by pressing a middle mouse button + Einfügen durch Drücken der mittleren Maustaste + + + + Startup + + + + + Reopen last closed tabs + Zuletzt geschlossene Tabs wieder öffnen + + + + Open/Save Settings + Einstellungen zum Öffnen/Speichern + + + Word wrap Zeilenumbruch - + Code folding flag Code-Einklapp-Schalter - + Show line numbers Zeilennummern anzeigen - + Show bookmarks icon Lesezeichensymbol anzeigen - + Show whitespaces and tabs Leerzeichen und Tabulatoren anzeigen - + Highlight current line Aktuelle Zeile markieren - + Color mark Farbmarkierung - + Unicode Unicode - + WesternEuropean Westeuropäisch - + CentralEuropean Mitteleuropäisch - + Baltic Baltisch - + Cyrillic Kyrillisch - + Arabic Arabisch - + Celtic Keltisch - + SouthEasternEuropean Südosteuropäisch - + Greek Griechisch - + Hebrew Hebräisch - + ChineseSimplified ChinesischVereinfacht - + ChineseTraditional ChinesischTraditionell - + Japanese Japanisch - + Korean Koreanisch - + Thai Thailändisch - + Turkish Türkisch - + Vietnamese Vietnamesisch - + File not saved Datei nicht gespeichert - - - + + Line Endings Zeilenenden @@ -752,58 +806,59 @@ Settings - + Standard Standard - + Customize Anpassen - + Normal Normal - + Maximum Maximum - + Fullscreen Vollbild - + This shortcut conflicts with system shortcut %1 Dieses Tastaturkürzel steht im Konflikt mit dem Systemkürzel %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Dieses Tastaturkürzel steht im Konflikt mit %1, klicke auf Ersetzen, um dieses Kürzel sofort wirksam zu machen - - + + + The shortcut %1 is invalid, please set another one. Das Tastaturkürzel %1 ist ungültig, bitte stelle ein anderes ein. - + Cancel Abbrechen - + Replace Ersetzen - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Rückgängig - + Redo Wiederherstellen - + Cut Ausschneiden - + Copy Kopieren - + Paste Einfügen - + Delete Löschen - + Select All Alles auswählen - - + + Find Suchen - - + + Replace Ersetzen - + Go to Line Gehe zu Zeile - + Turn on Read-Only mode Nur-Lese-Modus aktivieren - + Turn off Read-Only mode Nur-Lese-Modus deaktivieren - + Fullscreen Vollbild - + Exit fullscreen Vollbild beenden - + Display in file manager Im Dateimanager anzeigen - - + + Add Comment Kommentar hinzufügen - + Text to Speech Text zu Sprache - + Stop reading Lesen beenden - + Speech to Text Sprache zu Text - + Translate Übersetzen - + Column Mode Spaltenmodus - + Add bookmark Lesezeichen hinzufügen - + Remove Bookmark Lesezeichen entfernen - + Previous bookmark Vorheriges Lesezeichen - + Next bookmark Nächstes Lesezeichen - + Remove All Bookmarks Alle Lesezeichen entfernen - + Fold All Alles einfalten - + Fold Current Level Aktuelle Ebene einfalten - + Unfold All Alles ausfalten - + Unfold Current Level Aktuelle Ebene ausfalten - + Color Mark Farbmarkierung - + Clear All Marks Alle Markierungen löschen - + Clear Last Mark Letzte Markierung löschen - + Mark Markieren - + Mark All Alles markieren - + Remove Comment Kommentar entfernen - + Copy failed: not enough memory Kopieren fehlgeschlagen: nicht genügend Speicher - + Press ALT and click lines to edit in column mode Drücke ALT und klicke auf Zeilen, um im Spaltenmodus zu bearbeiten - + Change Case Groß-/Kleinschreibung ändern - + Upper Case Großbuchstaben - + Lower Case Kleinbuchstaben - + Capitalize Großschreibung - + None Keines - + Selected line(s) copied Ausgewählte Zeile(n) kopiert - + Current line copied Aktuelle Zeile kopiert - + Selected line(s) clipped Ausgewählte Zeile(n) abgeschnitten - + Current line clipped Aktuelle Zeile abgeschnitten - + Paste failed: not enough memory Einfügen fehlgeschlagen: nicht genügend Speicher - + Read-Only mode is off Nur-Lese-Modus ist ausgeschaltet - - - - - + + + + + + Read-Only mode is on Nur-Lese-Modus ist eingeschaltet @@ -1121,129 +1177,129 @@ Window - + Save as Speichern unter - + New window Neues Fenster - + New tab Neuer Tab - + Open file Datei öffnen - - + + Save Speichern - + Print Drucken - + Switch theme Theme wechseln - - + + Settings Einstellungen - - + + Read-Only Nur Lesen - + You do not have permission to open %1 Berechtigung zum Öffnen von %1 fehlt - - + + Invalid file: %1 Ungültige Datei: %1 - - + + Do you want to save this file? Möchten Sie diese Datei speichern? - + You do not have permission to save %1 Berechtigung zum Speichern von %1 fehlt - + Saved successfully Erfolgreich gespeichert - - - + + + Save File Datei speichern - + Encoding Kodierung - + Read-Only mode is on Nur-Lese-Modus ist aktiviert - + Current location remembered Aktueller Standort gespeichert - + Ctrl+'=' Strg+'=' - + Ctrl+'-' Strg+'-' - + Editor Editor - + Untitled %1 Unbenannt %1 - + Cancel Abbrechen - + Discard Verwerfen diff --git a/translations/deepin-editor_es.ts b/translations/deepin-editor_es.ts index 373413dc..e1f5afc9 100644 --- a/translations/deepin-editor_es.ts +++ b/translations/deepin-editor_es.ts @@ -16,13 +16,18 @@ Characters %1 Caracteres %1 + + + Loading: + Cargando: + DDropdownMenu - + + - None Ninguno @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Guardar - + Do you want to save this file? ¿Desea guardar este archivo? - - + + Cancel Cancelar - + Encoding changed. Do you want to save the file now? La codificación ha cambiado. ¿Desea guardar el archivo ahora? - + Discard Descartar - + + You do not have permission to save %1 No tienes permisos para guardar %1 - + File removed on the disk. Save it now? Archivo eliminado en el disco. ¿Desea guardarlo? - + File has changed on disk. Reload? El archivo ha cambiado en el disco. ¿Recargar? - - + + INSERT INSERTAR - + OVERWRITE SOBRESCRIBIR - + R/O R/O - + The file cannot be read, which may be too large or has been damaged! - + ¡No se puede leer el archivo, puede ser demasiado grande o estar dañado! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Ir a la línea @@ -134,6 +140,24 @@ Editor de texto + + PathSettingWgt + + + Remember the last used path + Recordar la última ruta usada + + + + Same path as the current file + Misma ruta que el archivo actual + + + + Customize the default path + Personalizar la ruta predeterminada + + QObject @@ -142,12 +166,13 @@ Editor de texto - - - - - - + + + + + + + Encoding Codificación @@ -184,8 +209,8 @@ - - + + Window Ventana @@ -271,438 +296,467 @@ + Find Next + + + + + Find Previous + + + + Replace Reemplazar - + Go to line Ir a la línea - + Save cursor position Guardar la posición del cursor - + Reset cursor position Restablecer posición del cursor - + Exit Salir - + Display shortcuts Mostrar atajos - + Print Imprimir - + Editor Editor - + Increase indent Aumentar sangría - + Decrease indent Disminuir sangría - + Forward character Próximo carácter - + Backward character Carácter anterior - + Forward word Próxima palabra - + Backward word Palabra anterior - + Next line Siguiente línea - + Previous line Línea anterior - + New line Nueva línea - + New line above Nueva línea encima - + New line below Nueva línea debajo - + Duplicate line Duplicar línea - + Delete to end of line Borrar hasta el final de la línea - + Delete current line Borrar la línea actual - + Swap line up Subir línea - + Swap line down Bajar línea - + Scroll up one line Desplazar una línea arriba - + Scroll down one line Desplazar una línea abajo - + Page up Página arriba - + Page down Página abajo - + Move to end of line Mover al final de la línea - + Move to start of line Mover al inicio de la línea - + Move to end of text Mover al final del texto - + Move to start of text Mover al inicio del texto - + Move to line indentation Mover a sangría de línea - + Upper case Mayúsculas - + Lower case Minúsculas - + Capitalize Capitalizar - + Delete backward word Borrar palabra anterior - + Delete forward word Borrar siguiente palabra - + Forward over a pair Adelantar sobre un par - + Backward over a pair Retroceder sobre un par - + Select all Seleccionar todo - + Copy Copiar - + Cut Cortar - + Paste Pegar - + Transpose character Transponer carácter - + Mark Resaltar - + Unmark No resaltar - + Copy line Copiar línea - + Cut line Cortar línea - + Merge lines Fusionar líneas - + Read-Only mode Modo solo lectura - + Add comment Añadir comentario - + Remove comment Borrar comentario - + Undo Deshacer - + Redo Rehacer - + Add/Remove bookmark Añadir/quitar marcador - + Move to previous bookmark Mover al marcador anterior - + Move to next bookmark Mover al siguiente marcador - + Advanced Avanzado - + Window size Tamaño de ventana - + Tab width Ancho de la pestaña - + + Paste by pressing a middle mouse button + Pegar presionando el botón medio del raton + + + + Startup + Iniciar + + + + Reopen last closed tabs + Reabrir las últimas pestañas cerradas + + + + Open/Save Settings + Abrir/guardar configuración + + + Word wrap Ajuste de línea - + Code folding flag Marcador para contraer el código - + Show line numbers Mostrar número de línea - + Show bookmarks icon Mostrar iconos de marcadores - + Show whitespaces and tabs Mostrar espacios en blanco y tabulaciones - + Highlight current line Resaltar línea actual - + Color mark Resaltador - + Unicode Unicode - + WesternEuropean Europeo Occidental - + CentralEuropean Centro Europeo - + Baltic Báltico - + Cyrillic Cirílico - + Arabic Árabe - + Celtic Céltico - + SouthEasternEuropean Europeo del Sudeste - + Greek Griego - + Hebrew Hebreo - + ChineseSimplified Chino Simplificado - + ChineseTraditional Chino Tradicional - + Japanese Japonés - + Korean Coreano - + Thai Tailandés - + Turkish Turco - + Vietnamese Vietnamita - + File not saved No se guardó el archivo - - - + + Line Endings Finales de línea @@ -752,58 +806,59 @@ Settings - + Standard Estándar - + Customize Personalizar - + Normal Normal - + Maximum Maximizada - + Fullscreen Pantalla completa - + This shortcut conflicts with system shortcut %1 Este atajo entra en conflicto con el atajo del sistema %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Este atajo entra en conflicto con %1, haga clic en Reemplazar para que este atajo sea efectivo inmediatamente - - + + + The shortcut %1 is invalid, please set another one. El atajo %1 es inválido, por favor ponga otro. - + Cancel Cancelar - + Replace Reemplazar - + OK Aceptar @@ -852,259 +907,260 @@ TextEdit - + Undo Deshacer - + Redo Rehacer - + Cut Cortar - + Copy Copiar - + Paste Pegar - + Delete Borrar - + Select All Seleccionar todo - - + + Find Buscar - - + + Replace Reemplazar - + Go to Line Ir a la línea - + Turn on Read-Only mode Activar modo solo lectura - + Turn off Read-Only mode Desactivar modo solo lectura - + Fullscreen Pantalla completa - + Exit fullscreen Salir de la pantalla completa - + Display in file manager Mostrar en el administrador de archivos - - + + Add Comment Añadir comentario - + Text to Speech Texto a voz - + Stop reading Detener lectura - + Speech to Text Voz a texto - + Translate Traducir - + Column Mode Modo de columna - + Add bookmark Añadir marcador - + Remove Bookmark Quitar marcador - + Previous bookmark Marcador anterior - + Next bookmark Marcador siguiente - + Remove All Bookmarks Quitar todos los marcadores - + Fold All Ocultar todo - + Fold Current Level Ocultar el nivel actual - + Unfold All Mostrar todo - + Unfold Current Level Mostrar el nivel actual - + Color Mark Resaltador - + Clear All Marks Borrar todo lo resaltado - + Clear Last Mark Borrar último resalte - + Mark Resaltar - + Mark All Resaltar todo - + Remove Comment Borrar comentario - + Copy failed: not enough memory Copia fallida: no hay suficiente memoria - + Press ALT and click lines to edit in column mode Presiona ALT y haz clic en las líneas para editar en el modo de columna - + Change Case Formato de texto - + Upper Case Mayúsculas - + Lower Case Minúsculas - + Capitalize Capitalizar - + None Ninguno - + Selected line(s) copied Líneas seleccionadas copiadas - + Current line copied Línea actual copiada - + Selected line(s) clipped Líneas seleccionadas cortadas - + Current line clipped Línea actual cortada - + Paste failed: not enough memory Fallo al pegar: no hay suficiente memoria - + Read-Only mode is off Modo solo lectura desactivado - - - - - + + + + + + Read-Only mode is on Modo solo lectura activado @@ -1121,129 +1177,129 @@ Window - + Save as Guardar como - + New window Nueva ventana - + New tab Nueva pestaña - + Open file Abrir archivo - - + + Save Guardar - + Print Imprimir - + Switch theme Cambiar el tema - - + + Settings Ajustes - - + + Read-Only Sólo lectura - + You do not have permission to open %1 No tienes permisos para abrir %1 - - + + Invalid file: %1 Archivo inválido: %1 - - + + Do you want to save this file? ¿Desea guardar este archivo? - + You do not have permission to save %1 No tienes permisos para guardar %1 - + Saved successfully Guardado exitosamente - - - + + + Save File Guardar el archivo - + Encoding Codificación - + Read-Only mode is on Modo solo lectura activado - + Current location remembered Guardar ubicación actual - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Editor - + Untitled %1 Sin título %1 - + Cancel Cancelar - + Discard Descartar diff --git a/translations/deepin-editor_fa.ts b/translations/deepin-editor_fa.ts index 7b654df3..bf58da18 100644 --- a/translations/deepin-editor_fa.ts +++ b/translations/deepin-editor_fa.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row سطر - + Column ستون - + Characters %1 کاراکتر %1 + + + Loading: + + DDropdownMenu - - - + + + None - هیچ یک + هیچ یک EditWrapper - - File has changed on disk. Reload? - فایل روی دیسک تغییر کرده است. بارگیری مجدد شود؟ - - - - File removed on the disk. Save it now? - فایل بر روی دیسک حذف شد. اکنون آن را ذخیره می کنید؟ + + + + + Save + - + Do you want to save this file? - آیا می خواهید این فایل را ذخیره کنید؟ + آیا می خواهید این فایل را ذخیره کنید؟ - - Discard - دور انداختن + + + Cancel + لغو - + Encoding changed. Do you want to save the file now? - + - + + Discard + دور انداختن + + + + You do not have permission to save %1 - شما اجازه ذخیره %1 را ندارید + شما اجازه ذخیره %1 را ندارید + + + + File removed on the disk. Save it now? + فایل بر روی دیسک حذف شد. اکنون آن را ذخیره می کنید؟ - - + + File has changed on disk. Reload? + فایل روی دیسک تغییر کرده است. بارگیری مجدد شود؟ + + + + INSERT الحاق - + OVERWRITE بازنویسی - + R/O R/O - - - Cancel - لغو - - - - - - - Save - ذخیره + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find یافتن - - Next - بعدی - - - + Previous قبلی + + + Next + بعدی + JumpLineBar - + Go to Line: برو به خط: @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. - + - + Text Editor - + - QObject + PathSettingWgt - - File not saved - + + Remember the last used path + + + + + Same path as the current file + - + + Customize the default path + + + + + QObject + + Text Editor - + - + + + + + + + + Encoding + رمزگذاری + + + Basic ابتدایی - + Font Style سبک فونت - + Font فونت - + Font Size اندازه فونت - - - Keymap - نقشه کلید - - - + Shortcuts میانبرها - - Forward character - کاراکتر جلو - - - - Backward character - کاراکتر عقب - - - - Transpose character - انتقال کاراکتر - - - - Add comment - - - - - Remove comment - - - - - Add/Remove bookmark - - - - - Move to previous bookmark - - - - - Move to next bookmark - - - - - Tab width - عرض زبانه + + + Keymap + نقشه کلید - - - + + + Window پنجره - + New tab زبانه جدید - + New window پنجره جدید - + Save ذخیره - + Save as ذخیره به عنوان - + Next tab زبانه بعدی - + Previous tab زبانه قبلی - + Close tab بستن زبانه - + Close other tabs بستن بقیه زبانه ها - + Restore tab بازیابی زبانه - + Open file باز کردن فایل - - Reset font size - تنظیم مجدد اندازه فونت + + Increment font size + - - Toggle fullscreen - ضامن تمام صفحه + + Decrement font size + - - Help - + + Reset font size + تنظیم مجدد اندازه فونت - - Increment font size - + + Help + - - Decrement font size - + + Toggle fullscreen + ضامن تمام صفحه - + Find یافتن - + + Find Next + + + + + Find Previous + + + + Replace جایگزین - + Go to line برو به خط - + Save cursor position ذخیره موقعیت مکان نما - + Reset cursor position تنظیم مجدد موقعیت مکان نما - + Exit خروج - + Display shortcuts نمایش میانبرها - + Print چاپ - + Editor ویرایشگر - + Increase indent افزایش تورفتگی - + Decrease indent کاهش تورفتگی - + + Forward character + کاراکتر جلو + + + + Backward character + کاراکتر عقب + + + Forward word کلمه جلو - + Backward word کلمه عقب - + Next line خط بعدی - + Previous line خط قبلی - + New line - خط جدید + خط جدید - + New line above خط جدید بالا - + New line below خط جدید پایین - + Duplicate line تکثیر خط - + Delete to end of line حذف تا انتهای خط - + Delete current line حذف خط فعلی - + Swap line up تعویض خط بالا - + Swap line down تعویض خط پایین - + Scroll up one line پیمایش به یک خط بالا - + Scroll down one line پیمایش به یک خط پایین - + Page up Page up - + Page down Page down - + Move to end of line حرکت به انتهای خط - + Move to start of line حرکت به ابتدای خط - + Move to end of text انتقال به انتهای متن - + Move to start of text انتقال به ابتدای متن - + Move to line indentation انتقال به تورفتگی متن - + Upper case حالت بزرگ - + Lower case حالت کوچک - + Capitalize درشت نوشتن - + Delete backward word حذف کلمه عقب - + Delete forward word حذف کلمه جلو - + Forward over a pair جلو یک جفت - + Backward over a pair عقب یک جفت - + Select all انتخاب همه - + Copy کپی - + Cut بریدن - + Paste چسباندن - + + Transpose character + انتقال کاراکتر + + + Mark علامت - + Unmark بدون علامت - + Copy line کپی خط - + Cut line برش خط - + Merge lines ادغام خطوط - + Read-Only mode حالت فقط خواندن - + + Add comment + + + + + Remove comment + + + + + Undo + واچیدن + + + + Redo + مجدد + + + + Add/Remove bookmark + + + + + Move to previous bookmark + + + + + Move to next bookmark + + + + + Advanced + پیشرفته + + + + Window size + اندازه پنجره + + + + Tab width + عرض زبانه + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap - + - + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + Color mark - + - + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - + - - Undo - واچیدن - - - - Redo - مجدد - - - - Advanced - پیشرفته - - - - Window size - اندازه پنجره - - - - - - - - - Encoding - رمزگذاری + + File not saved + - - - + + Line Endings - خط پایان + خط پایان ReplaceBar - + Find - یافتن + - + Replace With - + - + Replace جایگزین - + Skip پرش - + Replace Rest جایگزینی بقیه - + Replace All جایگزینی همه + + S: + + + + The first line of the short usage message. + + + Settings - + Standard استاندارد - + Customize شخصی سازی - + Normal طبیعی - + Maximum بیشترین - + Fullscreen تمام صفحه - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel - لغو + لغو - + Replace - جایگزین + جایگزین - + OK - + StartManager - + Untitled %1 - + Tabbar - + Close tab بستن زبانه - + Close other tabs بستن بقیه زبانه ها - + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - + TextEdit - + Undo واچیدن - + Redo مجدد - + Cut بریدن - + Copy کپی - + Paste چسباندن - + Delete حذف - + Select All انتخاب همه - - + + Find یافتن - - + + Replace جایگزین - + Go to Line برو به خط - + Turn on Read-Only mode روشن کردن حالت فقط خواندن - + Turn off Read-Only mode خاموش کردن حالت فقط خواندن - + Fullscreen تمام صفحه - + Exit fullscreen خروج از تمام صفحه - + Display in file manager نمایش در مدیریت کننده فایل - - + + Add Comment - + - + Text to Speech - + - + Stop reading - + - + Speech to Text - + - + Translate - + - + Column Mode - + - + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - + Clear All Marks - + - + Clear Last Mark - + - + Mark - علامت + علامت - + Mark All - + - + Remove Comment - + - + Copy failed: not enough memory - + - + Press ALT and click lines to edit in column mode - + - + Change Case تغییر حالت - + Upper Case حالت بزرگ - + Lower Case حالت کوچک - + Capitalize درشت نوشتن - + None هیچ یک - + Selected line(s) copied - + - + Current line copied - + - + Selected line(s) clipped - + - + Current line clipped - + - + Paste failed: not enough memory - + - + Read-Only mode is off حالت فقط خواندن خاموش است - - - + + + + + + Read-Only mode is on حالت فقط خواندن روشن است @@ -1098,139 +1168,140 @@ WarningNotices - + Reload - + Window - + + + Save as + ذخیره به عنوان + + + New window پنجره جدید - + New tab زبانه جدید - + Open file باز کردن فایل - - - Save as - ذخیره به عنوان + + + Save + ذخیره - + Print چاپ - + Switch theme تغییر تم - - + + + Settings + تنظیمات + + + + Read-Only فقط خواندنی - - Saved successfully - با موفقیت ذخیره شد + + You do not have permission to open %1 + شما اجازه باز کردن %1 را ندارید - - Read-Only mode is on - حالت فقط خواندن روشن است + + + Invalid file: %1 + فایل نامعتبر: %1 - - Ctrl+'=' - + + + Do you want to save this file? + آیا می خواهید این فایل را ذخیره کنید؟ - - Ctrl+'-' - + + You do not have permission to save %1 + شما اجازه ذخیره %1 را ندارید - - Discard - دور انداختن + + Saved successfully + با موفقیت ذخیره شد - - - Settings - تنظیمات + + + + Save File + ذخیره فایل - - You do not have permission to open %1 - شما اجازه باز کردن %1 را ندارید + + Encoding + رمزگذاری - - Invalid file: %1 - فایل نامعتبر: %1 + + Read-Only mode is on + حالت فقط خواندن روشن است - - - - Save File - ذخیره فایل + + Current location remembered + - - - Do you want to save this file? - آیا می خواهید این فایل را ذخیره کنید؟ + + Ctrl+'=' + - - Encoding - رمزگذاری + + Ctrl+'-' + - + Editor ویرایشگر - - You do not have permission to save %1 - شما اجازه ذخیره %1 را ندارید - - - + Untitled %1 - + - - Current location remembered - - - - + Cancel لغو - - - Save - ذخیره + + Discard + دور انداختن - + \ No newline at end of file diff --git a/translations/deepin-editor_fi.ts b/translations/deepin-editor_fi.ts index d577353c..fb7d32fc 100644 --- a/translations/deepin-editor_fi.ts +++ b/translations/deepin-editor_fi.ts @@ -16,13 +16,18 @@ Characters %1 Merkit %1 + + + Loading: + Lataaminen: + DDropdownMenu - + + - None Tyhjä @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Tallenna - + Do you want to save this file? Haluatko tallentaa tämän tiedoston? - - + + Cancel Peru - + Encoding changed. Do you want to save the file now? Koodaus muutettu. Haluatko tallentaa tiedoston nyt? - + Discard Hylkää - + + You do not have permission to save %1 Sinulla ei ole lupaa tallentaa %1 - + File removed on the disk. Save it now? Tiedosto on poistettu. Tallenna se nyt? - + File has changed on disk. Reload? Tiedosto on muuttunut. Päivitä? - - + + INSERT Lisää - + OVERWRITE Ylikirjoita - + R/O R/O - + The file cannot be read, which may be too large or has been damaged! - + Tiedostoa ei voi lukea, se voi olla liian suuri tai vahingoittunut! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Siirry riville: @@ -134,6 +140,24 @@ Tekstieditori + + PathSettingWgt + + + Remember the last used path + Muista viimeksi käytetty polku + + + + Same path as the current file + Sama polku kuin nykyisessä tiedostossa + + + + Customize the default path + Mukauta oletuspolkua + + QObject @@ -142,12 +166,13 @@ Tekstieditori - - - - - - + + + + + + + Encoding Koodaus @@ -184,8 +209,8 @@ - - + + Window Ikkuna @@ -271,438 +296,467 @@ + Find Next + Etsi seuraava + + + + Find Previous + Etsi edellinen + + + Replace Korvaa - + Go to line Siirry riville - + Save cursor position Tallenna kohdistimen sijainti - + Reset cursor position Nollaa kohdistimen sijainti - + Exit Poistu - + Display shortcuts Näytä pikavalinnat - + Print Tulosta - + Editor Editori - + Increase indent Suurenna sisennys - + Decrease indent Pienennä sisennys - + Forward character Merkki eteen - + Backward character Merkki taakse - + Forward word Sanan eteen - + Backward word Sanan taakse - + Next line Seuraava rivi - + Previous line Edellinen rivi - + New line Uusi rivi - + New line above Uusi rivi eteen - + New line below Uusi rivi taakse - + Duplicate line Monista rivi - + Delete to end of line Poista rivin loppuun - + Delete current line Poista nykyinen rivi - + Swap line up Vaihda rivi ylös - + Swap line down Vaihda rivi alas - + Scroll up one line Vieritä rivi ylöspäin - + Scroll down one line Vieritä rivi alaspäin - + Page up Sivu ylös - + Page down Sivu alas - + Move to end of line Siirry rivin loppuun - + Move to start of line Siirry rivin alkuun - + Move to end of text Siirry tekstin loppuun - + Move to start of text Siirry tekstin alkuun - + Move to line indentation Lisää sisennys - + Upper case Isot kirjaimet - + Lower case Pienet kirjaimet - + Capitalize Suuret kirjaimet - + Delete backward word Poista taaksepäin - + Delete forward word Poista eteenpäin - + Forward over a pair Etenevä - + Backward over a pair Takautuva - + Select all Valitse kaikki - + Copy Kopioi - + Cut Leikkaa - + Paste Liitä - + Transpose character Siirrä merkki - + Mark Merkki - + Unmark Poista merkintä - + Copy line Kopioi rivi - + Cut line Leikkaa rivi - + Merge lines Yhdistä rivit - + Read-Only mode Vain lukutila - + Add comment Lisää kommentti - + Remove comment Poista kommentti - + Undo Kumoa - + Redo Uudelleen - + Add/Remove bookmark Lisää/poista kirjanmerkki - + Move to previous bookmark Siirry edelliseen kirjanmerkkiin - + Move to next bookmark Siirry seuraavaan kirjanmerkkiin - + Advanced Edistynyt - + Window size Ikkunan koko - + Tab width Välilehden leveys - + + Paste by pressing a middle mouse button + Liitä painamalla hiiren keskimmäistä painiketta + + + + Startup + Käynnistys + + + + Reopen last closed tabs + Avaa suljetut välilehdet uudelleen + + + + Open/Save Settings + Avaa/Tallenna asetukset + + + Word wrap Rivitys - + Code folding flag Koodin taiton merkit - + Show line numbers Näytä rivinumerot - + Show bookmarks icon Näytä kirjanmerkit kuvake - + Show whitespaces and tabs Näytä välilyönnit ja tabulaattorit - + Highlight current line Korosta nykyinen rivi - + Color mark Värimerkki - + Unicode Unicode - + WesternEuropean Länsi-Eurooppa - + CentralEuropean Keski-Eurooppa - + Baltic Baltia - + Cyrillic Kyrillinen - + Arabic Arabia - + Celtic Kelttiläinen - + SouthEasternEuropean Kaakkois-Eurooppa - + Greek Kreikka - + Hebrew Hebrea - + ChineseSimplified Kiina-yksinkertaistettu - + ChineseTraditional Kiina-perinteinen - + Japanese Japani - + Korean Korea - + Thai Thai - + Turkish Turkki - + Vietnamese Vietnami - + File not saved Tiedostoa ei tallennettu - - - + + Line Endings Rivin loppu @@ -752,58 +806,59 @@ Settings - + Standard Standardi - + Customize Muokkaa - + Normal Normaali - + Maximum Maksimi - + Fullscreen Koko näyttö - + This shortcut conflicts with system shortcut %1 Tämä pikanäppäin on ristiriidassa järjestelmän %1 kanssa - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Tämä on ristiriidassa %1 kanssa, valitse Korvaa, jotta tämä pikanäppäin tulee voimaan välittömästi - - + + + The shortcut %1 is invalid, please set another one. Pikanäppäin %1 on virheellinen, aseta toinen. - + Cancel Peru - + Replace Korvaa - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Kumoa - + Redo Uudelleen - + Cut Leikkaa - + Copy Kopioi - + Paste Liitä - + Delete Poista - + Select All Valitse kaikki - - + + Find Etsi - - + + Replace Korvaa - + Go to Line Siirry riville - + Turn on Read-Only mode Vain lukutila - + Turn off Read-Only mode Poista vain lukutila - + Fullscreen Koko näyttö - + Exit fullscreen Poistu koko näytöstä - + Display in file manager Näytä tiedostojenhallinnassa - - + + Add Comment Lisää kommentti - + Text to Speech Teksti puheeksi - + Stop reading Lopeta lukeminen - + Speech to Text Puhe tekstiksi - + Translate Kääntäjä - + Column Mode Saraketila - + Add bookmark Lisää kirjanmerkki - + Remove Bookmark Poista kirjanmerkki - + Previous bookmark Edellinen kirjanmerkki - + Next bookmark Seuraava kirjanmerkki - + Remove All Bookmarks Poista kaikki kirjanmerkkit - + Fold All Taita kaikki - + Fold Current Level Taita nykyinen taso - + Unfold All Avaa kaikki - + Unfold Current Level Avaa nykyinen taso - + Color Mark Värimerkki - + Clear All Marks Poista kaikki merkit - + Clear Last Mark Poista viimeinen merkki - + Mark Merkki - + Mark All Merkitse kaikki - + Remove Comment Poista kommentti - + Copy failed: not enough memory Kopiointi epäonnistui: muisti ei riitä - + Press ALT and click lines to edit in column mode Paina ALT-näppäintä ja napsauta riviä, jos haluat muokata sitä saraketilassa - + Change Case Vaihda kirjainkokoa - + Upper Case Isot kirjaimet - + Lower Case Pienet kirjaimet - + Capitalize Suuret kirjaimet - + None Tyhjä - + Selected line(s) copied Valitut rivit kopioitu - + Current line copied Nykyinen rivi kopioitu - + Selected line(s) clipped Valitut rivit leikattu - + Current line clipped Nykyinen rivi leikattu - + Paste failed: not enough memory Liittäminen epäonnistui: muisti ei riitä - + Read-Only mode is off Lukutila on pois päältä - - - - - + + + + + + Read-Only mode is on Lukutila on päällä @@ -1121,129 +1177,129 @@ Window - + Save as Tallenna nimellä - + New window Uusi ikkuna - + New tab Uusi välilehti - + Open file Avaa tiedosto - - + + Save Tallenna - + Print Tulosta - + Switch theme Vaihda teema - - + + Settings Asetukset - - + + Read-Only Luettavissa - + You do not have permission to open %1 Sinulla ei ole lupaa avata %1 - - + + Invalid file: %1 Virheellinen tiedosto: %1 - - + + Do you want to save this file? Haluatko tallentaa tämän tiedoston? - + You do not have permission to save %1 Sinulla ei ole lupaa tallentaa %1 - + Saved successfully Tallennus onnistui - - - + + + Save File Tallenna tiedosto - + Encoding Koodaus - + Read-Only mode is on Lukutila on päällä - + Current location remembered Nykyinen sijainti muistetaan - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Editori - + Untitled %1 Nimetön %1 - + Cancel Peru - + Discard Hylkää diff --git a/translations/deepin-editor_fr.ts b/translations/deepin-editor_fr.ts index 1b6588b3..c0141048 100644 --- a/translations/deepin-editor_fr.ts +++ b/translations/deepin-editor_fr.ts @@ -16,13 +16,18 @@ Characters %1 Caractères %1 + + + Loading: + Chargement : + DDropdownMenu - + + - None Aucun @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Sauvegarder - + Do you want to save this file? Voulez-vous enregistrer ce fichier ? - - + + Cancel Annuler - + Encoding changed. Do you want to save the file now? L'encodage a changé. Voulez-vous enregistrer le fichier maintenant ? - + Discard Abandonner - + + You do not have permission to save %1 Vous n'avez pas la permission de sauvegarder %1 - + File removed on the disk. Save it now? Fichier supprimé du disque. L'enregistrer maintenant ? - + File has changed on disk. Reload? Le fichier a été modifié sur le disque. Recharger ? - - + + INSERT INSÉRER - + OVERWRITE ÉCRASER - + R/O L/S - + The file cannot be read, which may be too large or has been damaged! - + Le fichier ne peut être lu, il peut être trop gros ou endommagé. @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Aller à la ligne : @@ -134,6 +140,24 @@ Éditeur de texte + + PathSettingWgt + + + Remember the last used path + Se souvenir du dernier chemin utilisé + + + + Same path as the current file + Même chemin que le fichier actuel + + + + Customize the default path + Personnaliser le chemin par défaut + + QObject @@ -142,12 +166,13 @@ Éditeur de texte - - - - - - + + + + + + + Encoding Encodage @@ -184,8 +209,8 @@ - - + + Window Fenêtre @@ -271,438 +296,467 @@ + Find Next + Trouver le suivant + + + + Find Previous + Trouver le précédent + + + Replace Remplacer - + Go to line Aller à la ligne - + Save cursor position Sauvegarder position curseur - + Reset cursor position Réinitialiser position curseur - + Exit Quitter - + Display shortcuts Afficher les raccourcis - + Print Imprimer - + Editor Éditeur - + Increase indent Augmenter espace - + Decrease indent Diminuer espace - + Forward character Caractère suivant - + Backward character Caractère précédent - + Forward word Mot suivant - + Backward word Mot précédent - + Next line Ligne suivante - + Previous line Ligne précédente - + New line Nouvelle ligne - + New line above Nouvelle ligne au dessus - + New line below Nouvelle ligne en dessous - + Duplicate line Dupliquer la ligne - + Delete to end of line Supprimer jusqu'à fin ligne - + Delete current line Supprimer la ligne actuelle - + Swap line up Basculer ligne vers haut - + Swap line down Basculer ligne vers bas - + Scroll up one line Faire défiler la ligne vers le haut - + Scroll down one line Faire défiler la ligne vers le bas - + Page up Page précédente - + Page down Page suivante - + Move to end of line Déplacer à la fin ligne - + Move to start of line Déplacer au début ligne - + Move to end of text Basculer à la fin du texte - + Move to start of text Basculer au début du texte - + Move to line indentation Basculer à l'index ligne - + Upper case Majuscule - + Lower case Minuscule - + Capitalize Mettre en majuscule - + Delete backward word Supprimer mot précédent - + Delete forward word Supprimer le mot suivant - + Forward over a pair Basculer à la fin sélection - + Backward over a pair Basculer au début sélection - + Select all Tout sélectionner - + Copy Copier - + Cut Couper - + Paste Coller - + Transpose character Caractère de transposition - + Mark Cocher - + Unmark Décocher - + Copy line Copier la ligne - + Cut line Couper la ligne - + Merge lines Fusionner les lignes - + Read-Only mode Mode lecture seule - + Add comment Ajouter un commentaire - + Remove comment Supprimer le commentaire - + Undo Annuler - + Redo Rétablir - + Add/Remove bookmark Ajouter/Supprimer un signet - + Move to previous bookmark Passer au signet précédent - + Move to next bookmark Passer au signet suivant - + Advanced Avancés - + Window size Taille de la fenêtre - + Tab width Largeur de tabulation - + + Paste by pressing a middle mouse button + Coller en appuyant sur le bouton du milieu de souris + + + + Startup + Démarrage + + + + Reopen last closed tabs + Rouvrir les derniers onglets fermés + + + + Open/Save Settings + Paramètres d'ouverture/fermeture + + + Word wrap Retour automatique à la ligne - + Code folding flag Drapeau de pliage de code - + Show line numbers Afficher les numéros de ligne - + Show bookmarks icon Afficher l'icône des signets - + Show whitespaces and tabs Afficher les espaces et les tabulations - + Highlight current line Mettre en évidence la ligne actuelle - + Color mark Marque de couleur - + Unicode Unicode - + WesternEuropean Europe de l'ouest - + CentralEuropean Europe centrale - + Baltic Baltique - + Cyrillic Cyrillique - + Arabic Arabe - + Celtic Celtique - + SouthEasternEuropean Europe du sud-est - + Greek Grec - + Hebrew Hébreu - + ChineseSimplified Chinois simplifié - + ChineseTraditional Chinois traditionnel - + Japanese Japonais - + Korean Coréen - + Thai Thaïlandais - + Turkish Turc - + Vietnamese Vietnamien - + File not saved Fichier non sauvegardé - - - + + Line Endings Fin de ligne @@ -752,58 +806,59 @@ Settings - + Standard Standard - + Customize Personnaliser - + Normal Normal - + Maximum Maximum - + Fullscreen Plein écran - + This shortcut conflicts with system shortcut %1 Ce raccourci entre en conflit avec le raccourci système %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Ce raccourci entre en conflit avec %1, cliquez sur Remplacer pour rendre ce raccourci effectif immédiatement - - + + + The shortcut %1 is invalid, please set another one. Le raccourci %1 n'est pas valide, veuillez en définir un autre. - + Cancel Annuler - + Replace Remplacer - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Annuler - + Redo Rétablir - + Cut Couper - + Copy Copier - + Paste Coller - + Delete Supprimer - + Select All Tout sélectionner - - + + Find Rechercher - - + + Replace Remplacer - + Go to Line Aller à la ligne - + Turn on Read-Only mode Activer le mode lecture seule - + Turn off Read-Only mode Désactiver le mode lecture seule - + Fullscreen Plein écran - + Exit fullscreen Quitter le mode plein écran - + Display in file manager Afficher dans l'explorateur de fichiers - - + + Add Comment Ajouter un commentaire - + Text to Speech Texte vers voix - + Stop reading Arrêter de lire - + Speech to Text Voix vers texte - + Translate Traduire - + Column Mode Mode colonne - + Add bookmark Ajouter un signet - + Remove Bookmark Supprimer le signet - + Previous bookmark Signet précédent - + Next bookmark Signet suivant - + Remove All Bookmarks Supprimer tous les signets - + Fold All Tout plier - + Fold Current Level Plier le niveau actuel - + Unfold All Tout déplier - + Unfold Current Level Déplier le niveau actuel - + Color Mark Marque de couleur - + Clear All Marks Effacer toutes les marques - + Clear Last Mark Effacer la dernière marque - + Mark Cocher - + Mark All Marquer tout - + Remove Comment Supprimer le commentaire - + Copy failed: not enough memory Copie ratée: pas assez de mémoire - + Press ALT and click lines to edit in column mode Appuyer sur ALT et cliquer sur les lignes pour éditer en mode colonne - + Change Case Changer de case - + Upper Case Mettre en majuscules - + Lower Case Mettre en minuscules - + Capitalize Mettre en majuscules - + None Aucun - + Selected line(s) copied Ligne(s) sélectionnée(s) copiée(s) - + Current line copied Ligne actuelle copiée - + Selected line(s) clipped Ligne(s) sélectionnée(s) coupée(s) - + Current line clipped Ligne actuelle coupée - + Paste failed: not enough memory Échec du collage : mémoire insuffisante - + Read-Only mode is off Le mode lecture seule est désactivé - - - - - + + + + + + Read-Only mode is on Le mode lecture seule est activé @@ -1121,129 +1177,129 @@ Window - + Save as Enregistrer sous - + New window Nouvelle fenêtre - + New tab Nouvel onglet - + Open file Ouvrir un fichier - - + + Save Enregistrer - + Print Imprimer - + Switch theme Changer de thème - - + + Settings Paramètres - - + + Read-Only Lecture seule - + You do not have permission to open %1 Vous n'avez pas la permission d'ouvrir %1 - - + + Invalid file: %1 Fichier invalide : %1 - - + + Do you want to save this file? Voulez-vous enregistrer ce fichier ? - + You do not have permission to save %1 Vous n'avez pas la permission de sauvegarder %1 - + Saved successfully Enregistré avec succès - - - + + + Save File Sauvegarder le fichier - + Encoding Encodage - + Read-Only mode is on Le mode lecture seule est activé - + Current location remembered Location actuelle sauvegardée - + Ctrl+'=' Ctrl + '=' - + Ctrl+'-' Ctrl + '-' - + Editor Éditeur - + Untitled %1 Sans titre %1 - + Cancel Annuler - + Discard Abandonner diff --git a/translations/deepin-editor_gl_ES.ts b/translations/deepin-editor_gl_ES.ts index fe8faa2d..24cf4025 100644 --- a/translations/deepin-editor_gl_ES.ts +++ b/translations/deepin-editor_gl_ES.ts @@ -2,27 +2,32 @@ BottomBar - + Row Fila - + Column Columna - + Characters %1 Caracteres %1 + + + Loading: + + DDropdownMenu - - - + + + None Ningún @@ -30,80 +35,86 @@ EditWrapper - - - - + + + + Save Gardar - + Do you want to save this file? Quere gardar este ficheiro? - - + + Cancel Cancelar - + Encoding changed. Do you want to save the file now? A codificación cambiou. Quere gardar o ficheiro agora? - + Discard Descartar - + + You do not have permission to save %1 Non tes permiso para gardar% 1 - + File removed on the disk. Save it now? Ficheiro eliminado no disco. Gardalo agora? - + File has changed on disk. Reload? O ficheiro cambiou no disco. Recargar? - - + + INSERT INSERTAR - + OVERWRITE SUBSTITUÍR - + R/O R/O + + + The file cannot be read, which may be too large or has been damaged! + + FindBar - + Find Atopar - + Previous Anterior - + Next Seguinte @@ -111,7 +122,7 @@ JumpLineBar - + Go to Line: Ir á liña: @@ -119,585 +130,633 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. Editor de texto é unha poderosa ferramenta para ver e editar ficheiros de texto. - + Text Editor Editor de texto + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject - + Text Editor Editor de texto - - - - - - + + + + + + + Encoding Codificación - + Basic Básico - + Font Style Estilo da fonte - + Font Fonte - + Font Size Tamaño da fonte - + Shortcuts Atallos - - + + Keymap Mapa de clave - - - + + + Window Xanela - + New tab Nova lapela - + New window Nova xanela - + Save Gardar - + Save as Gardar como - + Next tab Nova lapela - + Previous tab Lapela anterior - + Close tab Lapela pechada - + Close other tabs Pechar outras lapelas - + Restore tab Restaurar lapela - + Open file Abrir ficheiro - + Increment font size - + Decrement font size - + Reset font size Restablecer o tamaño da fonte - + Help Axuda - + Toggle fullscreen Alternar pantalla completa - + Find Atopar - + + Find Next + + + + + Find Previous + + + + Replace Substituír - + Go to line Ir á liña - + Save cursor position Gardar a posición do cursor - + Reset cursor position Restablecer a posición do cursor - + Exit Saír - + Display shortcuts Amosar atallos - + Print Imprimir - + Editor Editor - + Increase indent Aumentar a sangría - + Decrease indent Diminuír a sangría - + Forward character Caracter adiante - + Backward character Caracter atrás - + Forward word Adiantar a palabra - + Backward word Atrasar a palabra - + Next line Seguinte liña - + Previous line Anterior liña - + New line Nova liña - + New line above Nova liña enriba - + New line below Nova liña embaixo - + Duplicate line Duplicar liña - + Delete to end of line Eliminar o final da liña - + Delete current line Eliminar a liña actual - + Swap line up Intercambiar a liña cara enriba - + Swap line down Intercambiar a liña cara abaixo - + Scroll up one line Desprazarse cara arriba unha liña - + Scroll down one line Desprazarse cara abaixo unha liña - + Page up Mover cara arriba polas páxinas - + Page down Mover cara arriba polas páxinas - + Move to end of line Moverse ata o final da liña - + Move to start of line Moverse ao principio da liña - + Move to end of text Moverse ao final do texto - + Move to start of text Moverse ao principio do texto - + Move to line indentation Mover a sangría da liña - + Upper case Maiúscula - + Lower case Minúscula - + Capitalize Capitalizar - + Delete backward word Eliminar palabras atrás - + Delete forward word Eliminar palabras adiante - + Forward over a pair Adiantar sobre un par - + Backward over a pair Atrás sobre un par - + Select all Seleccionar todo - + Copy Copiar - + Cut Cortar - + Paste Pegar - + Transpose character Caracter transposto - + Mark Marcar - + Unmark Desmarcar - + Copy line Copiar liña - + Cut line Cortar liña - + Merge lines Fusionar liñas - + Read-Only mode Modo só-ler - + Add comment Engadir comentario - + Remove comment Eliminar comentario - + Undo Desfacer - + Redo Refacer - + Add/Remove bookmark Engadir/Eliminar marcador - + Move to previous bookmark Moverse ao anterior marcador - + Move to next bookmark Moverse ao seguinte marcador - + Advanced Avanzado - + Window size Tamaño da xanela - + Tab width Ancho da lapela - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap Axuste de liña - + Code folding flag Indicador do dobramento do código - + Show line numbers Ensinar os números das liñas - + Show bookmarks icon - + Show whitespaces and tabs - + Highlight current line - + Color mark Marcador de cor - + Unicode - + WesternEuropean - + CentralEuropean - + Baltic - + Cyrillic - + Arabic - + Celtic - + SouthEasternEuropean - + Greek - + Hebrew - + ChineseSimplified - + ChineseTraditional - + Japanese - + Korean - + Thai - + Turkish - + Vietnamese - + File not saved Ficheiro non gardado - - - + + Line Endings Finais das liñas @@ -705,32 +764,32 @@ ReplaceBar - + Find Atopar - + Replace With Substituír con - + Replace Substituír - + Skip Saltar - + Replace Rest Substituír o resto - + Replace All Substituír todo @@ -747,58 +806,59 @@ Settings - + Standard Estándar - + Customize Personalizar - + Normal Normal - + Maximum Máximo - + Fullscreen Pantalla completa - + This shortcut conflicts with system shortcut %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Este atallo entra en conflito con% 1, prema en Substituír para facer efectivo este atallo inmediatamente - - + + + The shortcut %1 is invalid, please set another one. - + Cancel Cancelar - + Replace Substituír - + OK @@ -806,7 +866,7 @@ StartManager - + Untitled %1 Sen título %1 @@ -814,32 +874,32 @@ Tabbar - + Close tab Lapela pechada - + Close other tabs Pechar outras lapelas - + More options Máis opcións - + Close tabs to the left Pechar lapelas á esquerda - + Close tabs to the right Pechar lapelas á dereita - + Close unmodified tabs Pechar lapelas non modificadas @@ -847,261 +907,260 @@ TextEdit - + Undo Desfacer - + Redo Refacer - + Cut Cortar - + Copy Copiar - + Paste Pegar - + Delete Eliminar - + Select All Seleccionar todo - - + + Find Atopar - - + + Replace Substituír - + Go to Line Ir á liña - + Turn on Read-Only mode Activar modo só-ler - + Turn off Read-Only mode Desactivar modo só-ler - + Fullscreen Pantalla completa - + Exit fullscreen Saír da pantalla completa - + Display in file manager Amosar no xestor do ficheiros - - + + Add Comment Engadir comentario - + Text to Speech Texto a Voz - + Stop reading - + Speech to Text Voz a Texto - + Translate Traducir - + Column Mode Modo columna - + Add bookmark - + Remove Bookmark Eliminar marcador - + Previous bookmark - + Next bookmark - + Remove All Bookmarks Eliminar todos os marcadores - + Fold All Dobrar todo - + Fold Current Level Dobrar o nivel actual - + Unfold All Desdobrar todo - + Unfold Current Level Desdobrar o nivel actual - + Color Mark Marcar a cor - + Clear All Marks Borrar todos os marcadores - + Clear Last Mark Borrar o último marcador - + Mark Marcar - + Mark All Marcar todo - + Remove Comment Eliminar comentario - Failed to paste text: it is too large - - - - + Copy failed: not enough memory - + Press ALT and click lines to edit in column mode - + Change Case Cambiar caso - + Upper Case Maiúscula - + Lower Case Minúscula - + Capitalize Capitalizar - + None Ningún - + Selected line(s) copied Liña(s) seleccionada/s copiada/s - + Current line copied Liña actual copiada - + Selected line(s) clipped Liña(s) selecciona/s enganchada/s - + Current line clipped Liña actual enganchada - + Paste failed: not enough memory - + Read-Only mode is off O modo só-ler está apagado - - - + + + + + + Read-Only mode is on O modo só-ler está acendido @@ -1109,7 +1168,7 @@ WarningNotices - + Reload Recargar @@ -1117,129 +1176,130 @@ Window - - + + Save as Gardar como - + New window Nova xanela - + New tab Nova lapela - + Open file Abrir ficheiro - - + + Save Gardar - + Print Imprimir - + Switch theme Cambiar tema - - + + Settings Configuracións - - + + Read-Only Só-ler - + You do not have permission to open %1 Non tes permiso para abrir% 1 - + + Invalid file: %1 Ficheiro non válido: %1 - - + + Do you want to save this file? Quere gardar este ficheiro? - + You do not have permission to save %1 Non tes permiso para gardar% 1 - + Saved successfully Gardado con éxito - - - + + + Save File Gardar ficheiro - + Encoding Codificación - + Read-Only mode is on O modo só-ler está acendido - + Current location remembered Localización actual recordada - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Editor - + Untitled %1 Sen título %1 - + Cancel Cancelar - + Discard Descartar diff --git a/translations/deepin-editor_hi_IN.ts b/translations/deepin-editor_hi_IN.ts index a7e7007f..1e03a471 100644 --- a/translations/deepin-editor_hi_IN.ts +++ b/translations/deepin-editor_hi_IN.ts @@ -2,27 +2,32 @@ BottomBar - + Row पंक्ति - + Column स्तंभ - + Characters %1 अक्षर %1 + + + Loading: + + DDropdownMenu - - - + + + None कुछ नहीं @@ -30,80 +35,86 @@ EditWrapper - - - - + + + + Save संचित करें - + Do you want to save this file? क्या आप यह फाइल संचित करना चाहते हैं? - - + + Cancel रद्द करें - + Encoding changed. Do you want to save the file now? एन्कोडिंग में परिवर्तन हुआ है। क्या आप अब फाइल को संचित करना चाहते हैं? - + Discard निरस्त करें - + + You do not have permission to save %1 आपके पास %1 संचित करने की अनुमति नहीं है - + File removed on the disk. Save it now? डिस्क से फाइल हटा दी गई है। अभी संचित करें? - + File has changed on disk. Reload? डिस्क पर फाइल में परिवर्तन हुआ है। पुनः लोड करें? - - + + INSERT प्रविष्ट करें - + OVERWRITE अधिलेखित करें - + R/O केवल-रीड योग्य + + + The file cannot be read, which may be too large or has been damaged! + + FindBar - + Find खोज - + Previous पिछली आवृत्ति - + Next अगली आवृत्ति @@ -111,7 +122,7 @@ JumpLineBar - + Go to Line: इस पंक्ति पर जाएँ : @@ -119,585 +130,633 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. लेख संपादक - टेक्स्ट फाइलों देखने व संपादन हेतु एक सशक्त साधन है। - + Text Editor लेख संपादक + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject - + Text Editor लेख संपादक - - - - - - + + + + + + + Encoding एन्कोडिंग - + Basic सामान्य - + Font Style मुद्रलिपि शैली - + Font मुद्रलिपि - + Font Size मुद्रलिपि आकार - + Shortcuts शॉर्टकट - - + + Keymap अभिन्यास - - - + + + Window विंडो - + New tab नवीन टैब - + New window नवीन विंडो - + Save संचित करें - + Save as इस रूप में संचित करें - + Next tab अगला टैब - + Previous tab पिछला टैब - + Close tab टैब बंद करें - + Close other tabs अन्य टैब बंद करें - + Restore tab टैब पुनः स्थापित करें - + Open file फाइल खोलें - + Increment font size मुद्रलिपि आकार बढ़ाएँ - + Decrement font size मुद्रलिपि आकार घटाएँ - + Reset font size मुद्रलिपि आकार पुनः सेट करें - + Help सहायता - + Toggle fullscreen पूर्ण स्क्रीन चालू/बंद - + Find खोज - + + Find Next + + + + + Find Previous + + + + Replace बदलें - + Go to line इस पंक्ति पर जाएँ - + Save cursor position कर्सर स्थिति संचित करें - + Reset cursor position कर्सर स्थिति पुनः सेट करें - + Exit बंद करें - + Display shortcuts शॉर्टकट दिखाएँ - + Print प्रिंट करें - + Editor संपादक - + Increase indent पंक्ति आरंभ सूचक का क्षेत्र बढ़ाएँ - + Decrease indent पंक्ति आरंभ सूचक का क्षेत्र घटाएँ - + Forward character अक्षर के आगे कर्सर ले जाएँ - + Backward character अक्षर के पीछे कर्सर ले जाएँ - + Forward word अगले शब्द पर ले जाएँ - + Backward word पिछले शब्द पर ले जाएँ - + Next line अगली पंक्ति - + Previous line पिछली पंक्ति - + New line नवीन पंक्ति - + New line above नवीन पंक्ति ऊपरी ओर - + New line below नवीन पंक्ति निचली ओर - + Duplicate line पंक्ति प्रतिरूपित करें - + Delete to end of line समापन पंक्ति तक की सामग्री हटाएँ - + Delete current line वर्तमान पंक्ति हटाएँ - + Swap line up ऊपरी पंक्ति से बदलें - + Swap line down निचली पंक्ति से बदलें - + Scroll up one line एक पंक्ति ऊपरी ओर स्क्रॉल करें - + Scroll down one line एक पंक्ति निचली ओर स्क्रॉल करें - + Page up पृष्ठ ऊपर करें - + Page down पृष्ठ नीचे करें - + Move to end of line पंक्ति के अंत पर ले जाएँ - + Move to start of line पंक्ति आरंभ पर ले जाएँ - + Move to end of text लेख के अंत पर ले जाएँ - + Move to start of text लेख के आरंभ पर ले जाएँ - + Move to line indentation पंक्ति आरंभ सूचक पर ले जाएँ - + Upper case अपरकेस - + Lower case लोअरकेस - + Capitalize कैपिटल अक्षर में बदलें - + Delete backward word पिछला शब्द हटाएँ - + Delete forward word अगला शब्द हटाएँ - + Forward over a pair कोष्ठक के आगे कर्सर ले जाएँ - + Backward over a pair कोष्ठक के पीछे कर्सर ले जाएँ - + Select all सभी चयनित करें - + Copy कॉपी करें - + Cut कट करें - + Paste पेस्ट करें - + Transpose character अक्षर स्थानांतरण - + Mark चिन्हित - + Unmark अचिन्हित करें - + Copy line पंक्ति कॉपी करें - + Cut line पंक्ति कट करें - + Merge lines पंक्तियों का विलय करें - + Read-Only mode केवल-रीड योग्य मोड - + Add comment टिप्पणी जोड़ें - + Remove comment टिप्पणी हटाएँ - + Undo पूर्ववत करें - + Redo पुनः करें - + Add/Remove bookmark स्मृति-चिन्ह जोड़ें/हटाएँ - + Move to previous bookmark पिछले स्मृति-चिन्ह पर जाएँ - + Move to next bookmark अगले स्मृति-चिन्ह पर जाएँ - + Advanced विस्तृत - + Window size विंडो आकार - + Tab width टैब चौड़ाई - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap विखंडन - + Code folding flag कोड के संक्षिप्त प्रदर्शन हेतु सूचक - + Show line numbers पंक्ति संख्या प्रदर्शित करें - + Show bookmarks icon स्मृति-चिन्ह आइकन दिखाएँ - + Show whitespaces and tabs रिक्त अक्षर व टैब दिखाएँ - + Highlight current line वर्तमान पंक्ति चिन्हित करें - + Color mark रंगीन चिन्ह - + Unicode यूनिकोड - + WesternEuropean पश्चिमी यूरोपीय - + CentralEuropean मध्य यूरोपीय - + Baltic बाल्टिक - + Cyrillic सिरिलिक - + Arabic अरबी - + Celtic सेल्टिक - + SouthEasternEuropean दक्षिण पूर्वी यूरोपीय - + Greek यूनानी - + Hebrew हिब्रू - + ChineseSimplified सरल चीनी - + ChineseTraditional पारंपरिक चीनी - + Japanese जापानी - + Korean कोरियाई - + Thai थाई - + Turkish तुर्क - + Vietnamese वियतनामी - + File not saved फाइल संचय विफल - - - + + Line Endings पंक्ति अंत @@ -705,32 +764,32 @@ ReplaceBar - + Find खोज - + Replace With इससे बदलें - + Replace बदलें - + Skip निरस्त - + Replace Rest शेष को बदलें - + Replace All सभी को बदलें @@ -747,58 +806,59 @@ Settings - + Standard सामान्य - + Customize अनुकूलन - + Normal सामान्य - + Maximum अधिकतम - + Fullscreen पूर्ण स्क्रीन - + This shortcut conflicts with system shortcut %1 यह शॉर्टकट %1 सिस्टम शॉर्टकट के विरुद्ध है - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately यह शॉर्टकट %1 के विरुद्ध है, बदलें पर क्लिक कर तुरंत प्रभाव से इस शॉर्टकट को क्रियान्वित करें - - + + + The shortcut %1 is invalid, please set another one. %1 शॉर्टकट अमान्य है, कृपया अन्य सेट करें। - + Cancel रद्द करें - + Replace बदलें - + OK ठीक है @@ -806,7 +866,7 @@ StartManager - + Untitled %1 शीर्षक रहित %1 @@ -814,32 +874,32 @@ Tabbar - + Close tab टैब बंद करें - + Close other tabs अन्य टैब बंद करें - + More options अधिक विकल्प - + Close tabs to the left बाईं ओर के टैब बंद करें - + Close tabs to the right दाईं ओर के टैब बंद करें - + Close unmodified tabs अपरिवर्तित टैब बंद करें @@ -847,261 +907,260 @@ TextEdit - + Undo पूर्ववत करें - + Redo पुनः करें - + Cut कट करें - + Copy कॉपी करें - + Paste पेस्ट करें - + Delete हटाएँ - + Select All सभी चयनित करें - - + + Find खोज - - + + Replace बदलें - + Go to Line इस पंक्ति पर जाएँ - + Turn on Read-Only mode केवल-रीड योग्य मोड चालू करें - + Turn off Read-Only mode केवल-रीड योग्य मोड बंद करें - + Fullscreen पूर्ण स्क्रीन - + Exit fullscreen पूर्ण स्क्रीन बंद करें - + Display in file manager फाइल प्रबंधक में दिखाएँ - - + + Add Comment टिप्पणी जोड़ें - + Text to Speech लेख से वाणी - + Stop reading वाचन बंद करें - + Speech to Text वाणी से लेख - + Translate अनुवाद - + Column Mode स्तंभ मोड - + Add bookmark स्मृति-चिन्ह जोड़ें - + Remove Bookmark स्मृति-चिन्ह हटाएँ - + Previous bookmark पिछला स्मृति-चिन्ह - + Next bookmark अगला स्मृति-चिन्ह - + Remove All Bookmarks सभी स्मृति-चिन्ह हटाएँ - + Fold All सभी संक्षिप्त करें - + Fold Current Level वर्तमान स्तर को संक्षिप्त करें - + Unfold All सभी विस्तृत करें - + Unfold Current Level वर्तमान स्तर को विस्तृत करें - + Color Mark रंगीन चिन्ह - + Clear All Marks सभी चिन्ह हटाएँ - + Clear Last Mark अंतिम चिन्ह हटाएँ - + Mark चिन्हित - + Mark All सभी चिन्हित करें - + Remove Comment टिप्पणी हटाएँ - Failed to paste text: it is too large - - - - + Copy failed: not enough memory - + Press ALT and click lines to edit in column mode स्तंभ मोड में संपादन हेतु ALT कुंजी दबाकर पंक्तियों पर क्लिक करें - + Change Case केस बदलें - + Upper Case अपरकेस - + Lower Case लोअरकेस - + Capitalize कैपिटल अक्षर में बदलें - + None कुछ नहीं - + Selected line(s) copied चयनित पंक्तियाँ कॉपी की गई - + Current line copied वर्तमान पंक्ति कॉपी की गई - + Selected line(s) clipped चयनित पंक्तियाँ क्लिप की गई - + Current line clipped वर्तमान पंक्ति क्लिप की गई - + Paste failed: not enough memory - + Read-Only mode is off केवल-रीड योग्य मोड निष्क्रिय है - - - + + + + + + Read-Only mode is on केवल-रीड योग्य मोड सक्रिय है @@ -1109,7 +1168,7 @@ WarningNotices - + Reload पुनः लोड करें @@ -1117,129 +1176,130 @@ Window - - + + Save as इस रूप में संचित करें - + New window नवीन विंडो - + New tab नवीन टैब - + Open file फाइल खोलें - - + + Save संचित करें - + Print प्रिंट करें - + Switch theme थीम बदलें - - + + Settings सेटिंग्स - - + + Read-Only केवल-रीड योग्य - + You do not have permission to open %1 आपके पास %1 खोलने की अनुमति नहीं है - + + Invalid file: %1 अमान्य फाइल : %1 - - + + Do you want to save this file? क्या आप यह फाइल संचित करना चाहते हैं? - + You do not have permission to save %1 आपके पास %1 संचित करने की अनुमति नहीं है - + Saved successfully संचित करना सफल - - - + + + Save File फाइल संचित करें - + Encoding एन्कोडिंग - + Read-Only mode is on केवल-रीड योग्य मोड सक्रिय है - + Current location remembered वर्तमान स्थान स्मरणित किया - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor संपादक - + Untitled %1 शीर्षक रहित %1 - + Cancel रद्द करें - + Discard निरस्त करें diff --git a/translations/deepin-editor_hu.ts b/translations/deepin-editor_hu.ts index 060e0694..0294937d 100644 --- a/translations/deepin-editor_hu.ts +++ b/translations/deepin-editor_hu.ts @@ -16,13 +16,18 @@ Characters %1 %1 karakter + + + Loading: + Betöltés: + DDropdownMenu - + + - None Semmi @@ -30,67 +35,68 @@ EditWrapper - - - - + + + + Save Mentés - + Do you want to save this file? El akarja menteni ezt a fájlt? - - + + Cancel Mégsem - + Encoding changed. Do you want to save the file now? A kódolás megváltozott. El akarja menteni a fájlt most? - + Discard Elvetés - + + You do not have permission to save %1 Nincs engedélye a %1 mentéséhez - + File removed on the disk. Save it now? A fájl eltávolítva a lemezről. Elmenti most? - + File has changed on disk. Reload? A fájl megváltozott a lemezen. Újra betölti? - - + + INSERT BESZÚRÁS - + OVERWRITE FELÜLÍRÁS - + R/O Írásvédett - + The file cannot be read, which may be too large or has been damaged! A fájl nem olvasható, mert túl nagy a mérete, vagy sérült! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Ugrás megadott sorra: @@ -134,6 +140,24 @@ Szövegszerkesztő + + PathSettingWgt + + + Remember the last used path + Emlékezzen az utoljára használt útvonalra + + + + Same path as the current file + Ugyanaz az elérési út, mint az aktuális fájl + + + + Customize the default path + Az alapértelmezett elérési út testreszabása + + QObject @@ -142,12 +166,13 @@ Szövegszerkesztő - - - - - - + + + + + + + Encoding Kódolás @@ -184,8 +209,8 @@ - - + + Window Ablak @@ -271,438 +296,467 @@ + Find Next + Következő keresése + + + + Find Previous + Előző keresése + + + Replace Csere - + Go to line Ugrás megadott sorra - + Save cursor position Kurzor pozíciójának mentése - + Reset cursor position Kurzor pozíciójának visszaállítása - + Exit Kilépés - + Display shortcuts Gyorsbillentyűk megjelenítése - + Print Nyomtatás - + Editor Szerkesztő - + Increase indent Behúzás növelése - + Decrease indent Behúzás csökkentése - + Forward character Előre mutató karakter - + Backward character Visszafelé mutató karakter - + Forward word Szó előre - + Backward word Szó hátra - + Next line Következő sor - + Previous line Előző sor - + New line Új sor - + New line above Új sor felülre - + New line below Új sor alulra - + Duplicate line Sor duplikálása - + Delete to end of line Sorvég törlése - + Delete current line Aktuális sor törlése - + Swap line up Sor cseréje felfelé - + Swap line down Sor cseréje lefelé - + Scroll up one line Egy sorral felfelé - + Scroll down one line Egy sorral lefelé - + Page up Lapozás felfelé - + Page down Lapozás lefelé - + Move to end of line Ugrás a sor végére - + Move to start of line Ugrás a sor elejére - + Move to end of text Ugrás a szöveg végére - + Move to start of text Ugrás a szöveg elejére - + Move to line indentation Ugrás a sorbehúzáshoz - + Upper case Nagybetűs - + Lower case Kisbetűs - + Capitalize Kapitális - + Delete backward word Hátul lévő szó törlése - + Delete forward word Elől lévő szó törlése - + Forward over a pair Előre kettővel - + Backward over a pair Vissza kettővel - + Select all Összes kijelölése - + Copy Másolás - + Cut Kivágás - + Paste Beillesztés - + Transpose character Karakter átalakítása - + Mark Jelölés - + Unmark Jelölés törlése - + Copy line Sor másolása - + Cut line Sor kivágása - + Merge lines Sorok összefűzése - + Read-Only mode Csak olvasható mód - + Add comment Megjegyzés hozzáadása - + Remove comment Megjegyzés eltávolítása - + Undo Visszavonás - + Redo Visszavonás újra - + Add/Remove bookmark Könyvjelző hozzáadása/eltávolítása - + Move to previous bookmark Ugrás az előző könyvjelzőre - + Move to next bookmark Ugrás a következő könyvjelzőre - + Advanced Haladó - + Window size Ablakméret - + Tab width Tabulátor szélesség - + + Paste by pressing a middle mouse button + Beillesztés az egér középső gombjának megnyomásával + + + + Startup + Üzembe helyezés + + + + Reopen last closed tabs + Nyissa meg újra az utoljára bezárt lapokat + + + + Open/Save Settings + Megnyitási / Mentési beállítások + + + Word wrap Sortörés - + Code folding flag Kód hajtogatási zászló - + Show line numbers Sorok számának mutatása - + Show bookmarks icon Könyvjelző ikon megjelenítése - + Show whitespaces and tabs Szóközök és fülek megjelenítése - + Highlight current line Aktuális sor kijelölése - + Color mark Színes jelölő - + Unicode Unicode - + WesternEuropean Nyugat-európai - + CentralEuropean Közép-európai - + Baltic Balti - + Cyrillic Cirill - + Arabic Arab - + Celtic Kelta - + SouthEasternEuropean Délkelet-európai - + Greek Görög - + Hebrew Héber - + ChineseSimplified Egyszerűsített kínai - + ChineseTraditional Tradicionális kínai - + Japanese Japán - + Korean Kóreai - + Thai Thai - + Turkish Török - + Vietnamese Vietnámi - + File not saved A fájl nincs elmentve - - - + + Line Endings Sorvégek @@ -752,58 +806,59 @@ Settings - + Standard Alapértelmezett - + Customize Testreszabás - + Normal Normál - + Maximum Maximum - + Fullscreen Teljes képernyő - + This shortcut conflicts with system shortcut %1 Ez a gyorsbillentyű ütközik a %1 rendszer gyorsbillentyűvel - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Ez a gyorsbillentyű ütközik a következővel: %1, kattintson a Csere gombra a gyorsbillentyű azonnali használatához - - + + + The shortcut %1 is invalid, please set another one. A %1 gyorsbillentyű érvénytelen, kérjük állítson be egy másikat. - + Cancel Mégsem - + Replace Csere - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Visszavonás - + Redo Újra visszavonás - + Cut Kivágás - + Copy Másolás - + Paste Beillesztés - + Delete Törlés - + Select All Összes kijelölése - - + + Find Találat - - + + Replace Csere - + Go to Line Ugrás megadott sorra - + Turn on Read-Only mode Csak olvasható mód bekapcsolása - + Turn off Read-Only mode Csak olvasható mód kikapcsolása - + Fullscreen Teljes képernyő - + Exit fullscreen Kilépés a teljes képernyőből - + Display in file manager Megjelenítés a fájlkezelőben - - + + Add Comment Megjegyzés hozzáadása - + Text to Speech Szövegből beszéd - + Stop reading Olvasás megállítása - + Speech to Text Beszédből szöveg - + Translate Fordítás - + Column Mode Oszlop mód - + Add bookmark Könyvjelző hozzáadása - + Remove Bookmark Könyvjelző eltávolítása - + Previous bookmark Előző könyvjelző - + Next bookmark Következő könyvjelző - + Remove All Bookmarks Összes könyvjelző eltávolítása - + Fold All Összes hajtogatása - + Fold Current Level Jelenlegi szint hajtogatása - + Unfold All Összes kihajtogatása - + Unfold Current Level Jelenlegi szint kihajtogatása - + Color Mark Színes jelölő - + Clear All Marks Összes jelölő törlése - + Clear Last Mark Utolsó jelölés törlése - + Mark Jelölő - + Mark All Összes jelölése - + Remove Comment Megjegyzés eltávolítása - + Copy failed: not enough memory A másolás sikertelen: nincs elég memória - + Press ALT and click lines to edit in column mode Nyomja meg az ALT gombot, és kattintson a sorokra az oszlop módban történő szerkesztéshez - + Change Case Kisbetű/nagybetű váltása - + Upper Case Nagybetűs - + Lower Case Kisbetűs - + Capitalize Kapitális - + None Semmi - + Selected line(s) copied A kijelölt sor(ok) átmásolva - + Current line copied A jelenlegi sor átmásolva - + Selected line(s) clipped A kijelölt sor(ok) kivágva - + Current line clipped A jelenlegi sor kivágva - + Paste failed: not enough memory A beillesztés sikertelen: Nincs elegendő memória - + Read-Only mode is off Csak olvasható mód kikapcsolva - - - - - + + + + + + Read-Only mode is on Csak olvasható mód bekapcsolva @@ -1121,129 +1177,129 @@ Window - + Save as Mentés másként - + New window Új ablak - + New tab Új lap - + Open file Fájl megnyitása - - + + Save Mentés - + Print Nyomtatás - + Switch theme Téma váltása - - + + Settings Beállítások - - + + Read-Only Csak olvasható - + You do not have permission to open %1 Nincs engedélye a %1 megnyitásához - - + + Invalid file: %1 Érvénytelen fájl: %1 - - + + Do you want to save this file? El akarja menteni ezt a fájlt? - + You do not have permission to save %1 Nincs engedélye a %1 mentéséhez - + Saved successfully A mentés sikeres - - - + + + Save File Fájl mentése - + Encoding Kódolás - + Read-Only mode is on Csak olvasható mód bekapcsolva - + Current location remembered A jelenlegi hely megjegyezve - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Szerkesztő - + Untitled %1 Cím nélküli %1 - + Cancel Mégsem - + Discard Elvetés diff --git a/translations/deepin-editor_id.ts b/translations/deepin-editor_id.ts index 6a5f0139..2079cb55 100644 --- a/translations/deepin-editor_id.ts +++ b/translations/deepin-editor_id.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row Baris - + Column Kolom - + Characters %1 - + + + + + Loading: + DDropdownMenu - - - + + + None - Tidak ada + Tidak ada EditWrapper - - File has changed on disk. Reload? - Berkas didisk sudah berubah, muat ulang? - - - - File removed on the disk. Save it now? - Berkas didisk sudah dihapus. Simpan sekarang? + + + + + Save + - + Do you want to save this file? - Apakah anda ingin menyimpan berkas ini? + Apakah anda ingin menyimpan berkas ini? - - Discard - Membuang + + + Cancel + Batal - + Encoding changed. Do you want to save the file now? - + - + + Discard + Membuang + + + + You do not have permission to save %1 - Anda tidak mempunyai ijin untuk simpan %1 + Anda tidak mempunyai ijin untuk simpan %1 + + + + File removed on the disk. Save it now? + Berkas didisk sudah dihapus. Simpan sekarang? - - + + File has changed on disk. Reload? + Berkas didisk sudah berubah, muat ulang? + + + + INSERT MASUK - + OVERWRITE TULIS ULANG - + R/O R/O - - - Cancel - Batal - - - - - - - Save - Simpan + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find Cari - - Next - Lanjut - - - + Previous Sebelum + + + Next + Lanjut + JumpLineBar - + Go to Line: Pergi ke Baris: @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. - + - + Text Editor - + - QObject + PathSettingWgt - - File not saved - + + Remember the last used path + + + + + Same path as the current file + - + + Customize the default path + + + + + QObject + + Text Editor - + - + + + + + + + + Encoding + Mengencode + + + Basic Dasar - + Font Style Gaya Huruf - + Font Huruf - + Font Size Ukuran Huruf - - - Keymap - Letak tombol - - - + Shortcuts Jalan Pintas - - Forward character - - - - - Backward character - - - - - Transpose character - - - - - Add comment - - - - - Remove comment - - - - - Add/Remove bookmark - - - - - Move to previous bookmark - - - - - Move to next bookmark - - - - - Tab width - + + + Keymap + Letak tombol - - - + + + Window Jendela - + New tab Tab Baru - + New window Jendela baru - + Save Simpan - + Save as Simpan sebagai - + Next tab Tab lanjut - + Previous tab Tab sebelum - + Close tab Tutup tab - + Close other tabs Tutup tab lainnya - + Restore tab Pulihkan tab - + Open file Buka berkas - - Reset font size - Reset ukuran huruf + + Increment font size + Peningkatan ukuran huruf - - Toggle fullscreen - Beralih layar penuh + + Decrement font size + Penurunan ukuran huruf - - Help - + + Reset font size + Reset ukuran huruf - - Increment font size - + + Help + - - Decrement font size - + + Toggle fullscreen + Beralih layar penuh - + Find Cari - + + Find Next + + + + + Find Previous + + + + Replace Ganti - + Go to line Pergi ke Baris - + Save cursor position Simpan posisi kursor - + Reset cursor position Reset posisi kursor - + Exit Keluar - + Display shortcuts Tampilkan jalan pintas - + Print Cetak - + Editor Penyunting - + Increase indent Tingkatkan indentasi - + Decrease indent Turunkan indentasi - + + Forward character + + + + + Backward character + + + + Forward word Maju kata - + Backward word Mundur kata - + Next line Baris selanjutnya - + Previous line Baris sebelumnya - + New line Garis baru - + New line above Garis baru diatas - + New line below Garis baru dibawah - + Duplicate line Duplikasi garis - + Delete to end of line Hapus sampai akhir baris - + Delete current line Hapus garis saat ini - + Swap line up Tukar baris atas - + Swap line down Tukar baris bawah - + Scroll up one line Gulir keatas satu baris - + Scroll down one line Gulir kebawah satu baris - + Page up Halaman atas - + Page down Halaman bawah - + Move to end of line Pindah baris akhir - + Move to start of line Pindah keawal baris - + Move to end of text Pindah akhir teks - + Move to start of text Pindah keawal teks - + Move to line indentation Pindah kebaris indentasi - + Upper case Huruf besar - + Lower case Huruf kecil - + Capitalize Kapital - + Delete backward word Hapus kata kebelakang - + Delete forward word Hapus kata kedepan - + Forward over a pair Maju lebih dari satu pasangan - + Backward over a pair Mundur lebih dari satu pasangan - + Select all Pilih semua - + Copy Salin - + Cut Potong - + Paste Tempel - + + Transpose character + + + + Mark Tandai - + Unmark Tidak tandai - + Copy line Salin baris - + Cut line Potong baris - + Merge lines Gabung baris - + Read-Only mode Mode Hanya-Baca - + + Add comment + + + + + Remove comment + + + + + Undo + Sebelum + + + + Redo + Sesudah + + + + Add/Remove bookmark + + + + + Move to previous bookmark + + + + + Move to next bookmark + + + + + Advanced + Terkini + + + + Window size + Ukur Jendela + + + + Tab width + + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap - + - + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + Color mark - + - + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - - - - - Undo - Sebelum - - - - Redo - Sesudah - - - - Advanced - Terkini - - - - Window size - Ukur Jendela + - - - - - - - Encoding - Mengencode + + File not saved + - - - + + Line Endings - Akhir Baris + Akhir Baris ReplaceBar - + Find - Cari + - + Replace With - + - + Replace Ganti - + Skip Lewati - + Replace Rest Ganti sisanya - + Replace All Ganti semua + + S: + + + + The first line of the short usage message. + + + Settings - + Standard Baku - + Customize Kustomisasi - + Normal Normal - + Maximum Maximum - + Fullscreen Layarpenuh - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel - Batal + Batal - + Replace - Ganti + Ganti - + OK - + StartManager - + Untitled %1 - + Tabbar - + Close tab Tutup tab - + Close other tabs Tutup tab lainnya - + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - + TextEdit - + Undo Sebelum - + Redo Sesudah - + Cut Potong - + Copy Salin - + Paste Tempel - + Delete Hapus - + Select All Pilih Semua - - + + Find Cari - - + + Replace Ganti - + Go to Line Pergi ke baris - + Turn on Read-Only mode Nyalakan mode Hanya-Baca - + Turn off Read-Only mode Matikan mode Hanya-Baca - + Fullscreen Layar Penuh - + Exit fullscreen Keluar Layar Penuh - + Display in file manager - + - - + + Add Comment - + - + Text to Speech - + - + Stop reading - + - + Speech to Text - + - + Translate - + - + Column Mode - + - + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - + Clear All Marks - + - + Clear Last Mark - + - + Mark - Tandai + Tandai - + Mark All - + - + Remove Comment - + - + Copy failed: not enough memory - + - + Press ALT and click lines to edit in column mode - + - + Change Case Ganti Huruf - + Upper Case Huruf Besar - + Lower Case Huruf Kecil - + Capitalize Kapital - + None Tidak ada - + Selected line(s) copied - + - + Current line copied - + - + Selected line(s) clipped - + - + Current line clipped - + - + Paste failed: not enough memory - + - + Read-Only mode is off Mode Hanya-Baca sudah dimatikan - - - + + + + + + Read-Only mode is on Mode Hanya-Baca sudah dinyalakan @@ -1098,139 +1168,140 @@ WarningNotices - + Reload - + Window - + + + Save as + Simpan bagai + + + New window Jendela baru - + New tab Tab baru - + Open file Buka berkas - - - Save as - Simpan bagai + + + Save + Simpan - + Print Cetak - + Switch theme Beralih tema - - + + + Settings + Pengaturan + + + + Read-Only Hanya-Baca - - Saved successfully - Berhasil disimpan + + You do not have permission to open %1 + Anda tidak mempunyai ijin untuk buka %1 - - Read-Only mode is on - Mode Hanya-Baca sudah dinyalakan + + + Invalid file: %1 + Berkas tidak valid: %1 - - Ctrl+'=' - + + + Do you want to save this file? + Apakah anda ingin menyimpan berkas ini? - - Ctrl+'-' - + + You do not have permission to save %1 + Anda tidak mempunyai ijin untuk simpan %1 - - Discard - Membuang + + Saved successfully + Berhasil disimpan - - - Settings - Pengaturan + + + + Save File + Simpan Berkas - - You do not have permission to open %1 - Anda tidak mempunyai ijin untuk buka %1 + + Encoding + Mengencode - - Invalid file: %1 - Berkas tidak valid: %1 + + Read-Only mode is on + Mode Hanya-Baca sudah dinyalakan - - - - Save File - Simpan Berkas + + Current location remembered + - - - Do you want to save this file? - Apakah anda ingin menyimpan berkas ini? + + Ctrl+'=' + - - Encoding - Mengencode + + Ctrl+'-' + - + Editor Penyunting - - You do not have permission to save %1 - Anda tidak mempunyai ijin untuk simpan %1 - - - + Untitled %1 - + - - Current location remembered - - - - + Cancel Batal - - - Save - Simpan + + Discard + Membuang - + \ No newline at end of file diff --git a/translations/deepin-editor_it.ts b/translations/deepin-editor_it.ts index 62e86e12..80962de7 100644 --- a/translations/deepin-editor_it.ts +++ b/translations/deepin-editor_it.ts @@ -16,13 +16,18 @@ Characters %1 Caratteri %1 + + + Loading: + + DDropdownMenu - + + - None No @@ -30,68 +35,69 @@ EditWrapper - - - - + + + + Save Salva - + Do you want to save this file? Desideri salvare questo file? - - + + Cancel Annulla - + Encoding changed. Do you want to save the file now?   La codifica è cambiata. Vuoi salvare il file ora? - + Discard Scarta - + + You do not have permission to save %1 Non hai i permessi per salvare %1 - + File removed on the disk. Save it now? File rimosso dal disco, salvarlo ora? - + File has changed on disk. Reload? File modificato sul Disco, ricaricarlo? - - + + INSERT INSERT - + OVERWRITE OVERWRITE - + R/O R/O - + The file cannot be read, which may be too large or has been damaged! @@ -117,7 +123,7 @@ La codifica è cambiata. Vuoi salvare il file ora? JumpLineBar - + Go to Line: Vai alla linea: @@ -136,6 +142,24 @@ Localizzazione italiana a cura di Massimo A. Carofano. Editor di Testo + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject @@ -144,12 +168,13 @@ Localizzazione italiana a cura di Massimo A. Carofano. Editor di Testo - - - - - - + + + + + + + Encoding Codifica @@ -186,8 +211,8 @@ Localizzazione italiana a cura di Massimo A. Carofano. - - + + Window Finestra @@ -273,438 +298,467 @@ Localizzazione italiana a cura di Massimo A. Carofano. + Find Next + + + + + Find Previous + + + + Replace Sostituisci - + Go to line Vai alla linea - + Save cursor position Salva la posizione del cursore - + Reset cursor position Ripristina la posizione del cursore - + Exit Esci - + Display shortcuts Mostra scorciatoie - + Print Stampa - + Editor Editor - + Increase indent Aumenta il rientro - + Decrease indent Diminuisci il rientro - + Forward character Prossimo carattere - + Backward character Carattere precedente - + Forward word Parola successiva - + Backward word Parola precedente - + Next line Prossima linea - + Previous line Linea precedente - + New line Nuova riga - + New line above Nuova riga sopra - + New line below Nuova riga sotto - + Duplicate line Duplica riga - + Delete to end of line Elimina dalla fine della riga - + Delete current line Elimina riga corrente - + Swap line up Inverti riga superiore - + Swap line down Inverti riga inferiore - + Scroll up one line Passa alla riga sopra - + Scroll down one line Passa alla riga sotto - + Page up Pagina su - + Page down Pagina giu - + Move to end of line Muovi alla fine della riga - + Move to start of line Muovi all'inizio della riga - + Move to end of text Muovi alla fine del testo - + Move to start of text Muovi all'inizio del testo - + Move to line indentation Muovi al rientro di riga - + Upper case Lettere maiuscole - + Lower case Lettere minuscole - + Capitalize Maiuscola - + Delete backward word Elimina parola precedente - + Delete forward word Elimina parola successiva - + Forward over a pair Avanti paritario - + Backward over a pair Indietro paritario - + Select all Seleziona tutto - + Copy Copia - + Cut Taglia - + Paste Incolla - + Transpose character Trasponi caratteri - + Mark Evidenzia - + Unmark Non in evidenza - + Copy line Copia riga - + Cut line Taglia riga - + Merge lines Unisci righe - + Read-Only mode Modalità sola lettura - + Add comment Aggiungi commento - + Remove comment Rimuovi commento - + Undo Annulla - + Redo Riapplica - + Add/Remove bookmark Aggiungi/rimuovi segnalibro - + Move to previous bookmark Torna al segnalibro precedente - + Move to next bookmark Vai al prossimo segnalibro - + Advanced Avanzate - + Window size Dimensione finestra - + Tab width Larghezza scheda - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap A capo automatico - + Code folding flag Opzioni di collasso del codice - + Show line numbers Mostra numero riga - + Show bookmarks icon Mostra icona segnalibri - + Show whitespaces and tabs Mostra spazi bianchi e schede - + Highlight current line Evidenzia la riga corrente - + Color mark Colori come marcatori - + Unicode Unicode - + WesternEuropean Europa occidentale - + CentralEuropean Europa centrale - + Baltic Baltici - + Cyrillic Cirillico - + Arabic Arabic - + Celtic Celtico - + SouthEasternEuropean Sud est Europa - + Greek Greek - + Hebrew Hebrew - + ChineseSimplified Cinese Semplificato - + ChineseTraditional Cinese Tradizionale - + Japanese Japanese - + Korean Korean - + Thai Thai - + Turkish Turkish - + Vietnamese Vietnamese - + File not saved File non salvato - - - + + Line Endings Fine delle righe @@ -754,58 +808,59 @@ Localizzazione italiana a cura di Massimo A. Carofano. Settings - + Standard Standard - + Customize Personalizzato - + Normal Normale - + Maximum Massimo - + Fullscreen Pieno schermo - + This shortcut conflicts with system shortcut %1 Questa scorciatoia è in conflitto con la scorciatoia di sistema %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Questa scorciatoia è in conflitto con %1, clicca su Sostituisci per rendere questa come effettiva - - + + + The shortcut %1 is invalid, please set another one. La scorciatoia %1 non è valida, inseriscine una nuova. - + Cancel Annulla - + Replace Sostituisci - + OK OK @@ -854,259 +909,260 @@ Localizzazione italiana a cura di Massimo A. Carofano. TextEdit - + Undo Annulla - + Redo Ripeti - + Cut Taglia - + Copy Copia - + Paste Incolla - + Delete Elimina - + Select All Seleziona tutto - - + + Find Trova - - + + Replace Sostituisci - + Go to Line Vai alla linea - + Turn on Read-Only mode Attiva la modalità Sola Lettura - + Turn off Read-Only mode Disattiva la modalità Sola Lettura - + Fullscreen Schermo intero - + Exit fullscreen Esci dallo schermo intero - + Display in file manager Visualizza nel gestore file - - + + Add Comment Aggiungi commento - + Text to Speech Da testo a voce - + Stop reading Interrompi lettura - + Speech to Text Da voce a testo - + Translate Traduci - + Column Mode Modlità colonna - + Add bookmark Aggiungi segnalibro - + Remove Bookmark Rimuovi segnalibro - + Previous bookmark Segnalibro precedente - + Next bookmark Prossimo segnalibro - + Remove All Bookmarks Rimuovi tutti i segnalibri - + Fold All Collassa tutti i livelli - + Fold Current Level Collassa l'attuale livello - + Unfold All Espandi tutti i livelli - + Unfold Current Level Espandi il livello corrente - + Color Mark Colori come marcatori - + Clear All Marks Rimuovi le evidenziazioni - + Clear Last Mark Rimuovi ultima evidenziazione - + Mark Evidenzia - + Mark All Evidenzia tutto - + Remove Comment Rimuovi commenti - + Copy failed: not enough memory Copia fallita: memoria non sufficiente - + Press ALT and click lines to edit in column mode Premi ALT e clicca sulle linee per editare in modalità colonna - + Change Case Cambia maiuscole - + Upper Case Maiuscolo - + Lower Case Minuscolo - + Capitalize Maiuscola iniziale - + None No - + Selected line(s) copied Linea(e) selezionate copiate - + Current line copied Linea corrente copiata - + Selected line(s) clipped Linea(e) selezionate copiate negli appunti - + Current line clipped Linea corrente copiata negli appunti - + Paste failed: not enough memory Copia fallita: memoria non sufficiente - + Read-Only mode is off La modalità sola lettura è disattivata - - - - - + + + + + + Read-Only mode is on La modalità sola lettura è attiva @@ -1123,129 +1179,129 @@ Localizzazione italiana a cura di Massimo A. Carofano. Window - + Save as Salva con nome - + New window Nuova finestra - + New tab Nuova scheda - + Open file Apri file - - + + Save Salva - + Print Stampa - + Switch theme Cambia tema - - + + Settings Impostazioni - - + + Read-Only Sola lettura - + You do not have permission to open %1 Non hai i permessi per aprire %1 - - + + Invalid file: %1 File non valido: %1 - - + + Do you want to save this file? Desideri salvare questo file? - + You do not have permission to save %1 Non hai i permessi per salvare %1 - + Saved successfully Salvato con successo - - - + + + Save File Salva file - + Encoding Codifica - + Read-Only mode is on La modalità sola lettura è attiva - + Current location remembered Locazione corrente memorizzata - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Editor - + Untitled %1 %1 senza titolo - + Cancel Annulla - + Discard Scarta diff --git a/translations/deepin-editor_ko.ts b/translations/deepin-editor_ko.ts index 00678365..7a803039 100644 --- a/translations/deepin-editor_ko.ts +++ b/translations/deepin-editor_ko.ts @@ -2,27 +2,32 @@ BottomBar - + Row - + Column - + Characters %1 문자 %1 + + + Loading: + + DDropdownMenu - - - + + + None 없음 @@ -30,80 +35,86 @@ EditWrapper - - - - + + + + Save 저장 - + Do you want to save this file? 이 파일을 저장하시겠습니까? - - + + Cancel 취소 - + Encoding changed. Do you want to save the file now? 인코딩이 변경되었습니다. 지금 파일을 저장하시겠습니까? - + Discard 폐기 - + + You do not have permission to save %1 %1을(를) 저장할 권한이 없습니다 - + File removed on the disk. Save it now? 디스크에서 파일이 제거되었습니다. 지금 저장 하시겠습니까? - + File has changed on disk. Reload? 디스크의 파일이 변경되었습니다. 다시 불러오시겠습니까? - - + + INSERT 삽입 - + OVERWRITE 덮어쓰기 - + R/O 읽기 전용 + + + The file cannot be read, which may be too large or has been damaged! + + FindBar - + Find 찾기 - + Previous 이전 - + Next 다음 @@ -111,7 +122,7 @@ JumpLineBar - + Go to Line: 줄로 이동: @@ -119,585 +130,633 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. 텍스트 편집기는 텍스트 파일을 보고 편집할 수 있는 강력한 도구입니다. - + Text Editor 텍스트 편집기 + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject - + Text Editor 텍스트 편집기 - - - - - - + + + + + + + Encoding 인코딩 - + Basic 기본 - + Font Style 글꼴 유형 - + Font 글꼴 - + Font Size 글꼴 크기 - + Shortcuts 단축키 - - + + Keymap 키맵 - - - + + + Window - + New tab 새 탭 - + New window 새 창 - + Save 저장 - + Save as 다른 이름으로 저장 - + Next tab 다음 탭 - + Previous tab 이전 탭 - + Close tab 탭 닫기 - + Close other tabs 다른 탭 닫기 - + Restore tab 복원 탭 - + Open file 파일 열기 - + Increment font size - + Decrement font size - + Reset font size 글꼴 크기 재설정 - + Help 도움말 - + Toggle fullscreen 전체 화면 전환 - + Find 찾기 - + + Find Next + + + + + Find Previous + + + + Replace 바꾸기 - + Go to line 줄로 이동 - + Save cursor position 커서 위치 저장 - + Reset cursor position 커서 위치 재설정 - + Exit 종료 - + Display shortcuts 단축키 표시 - + Print 인쇄 - + Editor 편집기 - + Increase indent 들여쓰기 늘리기 - + Decrease indent 들여쓰기 줄이기 - + Forward character 정방향 문자 - + Backward character 역방향 문자 - + Forward word 정방향 단어 - + Backward word 역방향 단어 - + Next line 다음 줄 - + Previous line 이전 줄 - + New line 새 줄 - + New line above 위로 새 줄 - + New line below 아래로 새 줄 - + Duplicate line 줄 복제 - + Delete to end of line 현재 위치에서 줄의 끝까지 삭제 - + Delete current line 현재 줄 삭제 - + Swap line up 줄 위로 올리기 - + Swap line down 줄 아래로 내리기 - + Scroll up one line 한 줄 위로 스크롤 - + Scroll down one line 한 줄 아래로 스크롤 - + Page up 페이지 위로 - + Page down 페이지 아래로 - + Move to end of line 줄의 끝으로 이동 - + Move to start of line 줄의 시작으로 이동 - + Move to end of text 텍스트의 끝으로 이동 - + Move to start of text 텍스트의 시작으로 이동 - + Move to line indentation 줄 들여쓰기로 이동 - + Upper case 대문자 - + Lower case 소문자 - + Capitalize 대문자로 쓰기 - + Delete backward word 뒤의 단어 삭제 - + Delete forward word 앞의 단어 삭제 - + Forward over a pair 한 쌍이상 앞으로 - + Backward over a pair 한 쌍이상 뒤로 - + Select all 모두 선택 - + Copy 복사하기 - + Cut 잘라내기 - + Paste 붙여넣기 - + Transpose character 글자 바꾸기 - + Mark 선택표시 시작 - + Unmark 선택표시 시작점 이동 - + Copy line 줄 복사하기 - + Cut line 줄 잘라내기 - + Merge lines 줄 합치기 - + Read-Only mode 읽기 전용 모드 - + Add comment 주석 추가하기 - + Remove comment 주석 지우기 - + Undo 되돌리기 - + Redo 재실행 - + Add/Remove bookmark 책갈피 추가/제거 - + Move to previous bookmark 이전 책갈피로 이동 - + Move to next bookmark 다음 책갈피로 이동 - + Advanced 고급 - + Window size 창 크기 - + Tab width 탭 너비 - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap 단어 넘김 - + Code folding flag 접을 수 있는 코드 표시하기 - + Show line numbers 줄 번호 표시 - + Show bookmarks icon - + Show whitespaces and tabs - + Highlight current line - + Color mark 색상 표시 - + Unicode - + WesternEuropean - + CentralEuropean - + Baltic - + Cyrillic - + Arabic - + Celtic - + SouthEasternEuropean - + Greek - + Hebrew - + ChineseSimplified - + ChineseTraditional - + Japanese - + Korean - + Thai - + Turkish - + Vietnamese - + File not saved 파일이 저장되지 않음 - - - + + Line Endings 줄 끝 @@ -705,32 +764,32 @@ ReplaceBar - + Find 찾기 - + Replace With 바꿀 대상 - + Replace 바꾸기 - + Skip 건너뛰기 - + Replace Rest 나머지 바꾸기 - + Replace All 모두 바꾸기 @@ -747,58 +806,59 @@ Settings - + Standard 표준 - + Customize 사용자 정의 - + Normal 보통 - + Maximum 최대 - + Fullscreen 전체 화면 - + This shortcut conflicts with system shortcut %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately 이 단축키는 %1과 충돌합니다. 이 단축키를 즉시 적용하려면 바꾸기를 클릭하십시오. - - + + + The shortcut %1 is invalid, please set another one. - + Cancel 취소 - + Replace 바꾸기 - + OK @@ -806,7 +866,7 @@ StartManager - + Untitled %1 제목 없음 %1 @@ -814,32 +874,32 @@ Tabbar - + Close tab 탭 닫기 - + Close other tabs 다른 탭 닫기 - + More options 더보기 - + Close tabs to the left 왼쪽으로 탭 닫기 - + Close tabs to the right 오른쪽으로 탭 닫기 - + Close unmodified tabs 수정되지 않은 탭 닫기 @@ -847,261 +907,260 @@ TextEdit - + Undo 되돌리기 - + Redo 재실행 - + Cut 잘라내기 - + Copy 복사하기 - + Paste 붙여넣기 - + Delete 삭제하기 - + Select All 모두 선택 - - + + Find 찾기 - - + + Replace 바꾸기 - + Go to Line 줄로 이동 - + Turn on Read-Only mode 읽기 전용 모드 켜기 - + Turn off Read-Only mode 읽기 전용 모드 끄기 - + Fullscreen 전체 화면 - + Exit fullscreen 전체 화면 종료 - + Display in file manager 파일 관리자에 표시 - - + + Add Comment 주석 추가하기 - + Text to Speech 텍스트 음성 변환 - + Stop reading - + Speech to Text 음성 텍스트 변환 - + Translate 번역 - + Column Mode 열 모드 - + Add bookmark - + Remove Bookmark 책갈피 제거 - + Previous bookmark - + Next bookmark - + Remove All Bookmarks 모든 책갈피 제거 - + Fold All 모두 접기 - + Fold Current Level 현재 레벨 접기 - + Unfold All 모두 펼치기 - + Unfold Current Level 현재 레벨 펼치기 - + Color Mark 색상 표시 - + Clear All Marks 모든 표시 지우기 - + Clear Last Mark 마지막 표시 지우기 - + Mark 선택표시 시작 - + Mark All 모두 표시하기 - + Remove Comment 주석 제거하기 - Failed to paste text: it is too large - - - - + Copy failed: not enough memory - + Press ALT and click lines to edit in column mode - + Change Case 대/소문자 변경 - + Upper Case 대문자 - + Lower Case 소문자 - + Capitalize 대문자로 쓰기 - + None 없음 - + Selected line(s) copied 선택된 줄 복사됨 - + Current line copied 현재 줄 복사됨 - + Selected line(s) clipped 선택된 줄 복사됨 - + Current line clipped 현재 줄 복사됨 - + Paste failed: not enough memory - + Read-Only mode is off 읽기 전용 모드가 꺼져 있음 - - - + + + + + + Read-Only mode is on 읽기 전용 모드가 켜져 있음 @@ -1109,7 +1168,7 @@ WarningNotices - + Reload 새로고침 @@ -1117,129 +1176,130 @@ Window - - + + Save as 다른 이름으로 저장 - + New window 새 창 - + New tab 새 탭 - + Open file 파일 열기 - - + + Save 저장 - + Print 인쇄 - + Switch theme 테마 전환 - - + + Settings 설정 - - + + Read-Only 읽기 전용 - + You do not have permission to open %1 %1을(를) 열 수 있는 권한이 없음 - + + Invalid file: %1 잘못된 파일: %1 - - + + Do you want to save this file? 이 파일을 저장하시겠습니까? - + You do not have permission to save %1 %1을(를) 저장할 권한이 없습니다 - + Saved successfully 성공적으로 저장됨 - - - + + + Save File 파일 저장 - + Encoding 인코딩 - + Read-Only mode is on 읽기 전용 모드가 켜져 있음 - + Current location remembered 기억된 현재 위치 - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor 편집기 - + Untitled %1 제목 없음 %1 - + Cancel 취소 - + Discard 폐기 diff --git a/translations/deepin-editor_lt.ts b/translations/deepin-editor_lt.ts index 6eda3f55..f754f48a 100644 --- a/translations/deepin-editor_lt.ts +++ b/translations/deepin-editor_lt.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row Eilutė - + Column Stulpelis - + Characters %1 Simboliai %1 + + + Loading: + + DDropdownMenu - - - + + + None - Nėra + Nėra EditWrapper - - File has changed on disk. Reload? - Failas diske pasikeitė. Įkelti jį iš naujo? - - - - File removed on the disk. Save it now? - Failas diske buvo pašalintas. Įrašyti jį dabar? + + + + + Save + Įrašyti - + Do you want to save this file? - Ar norite įrašyti šį failą? + Ar norite įrašyti šį failą? - - Discard - Atmesti + + + Cancel + Atsisakyti - + Encoding changed. Do you want to save the file now? - + Pasikeitė koduotė. Ar norite dabar įrašyti failą? - + + Discard + Atmesti + + + + You do not have permission to save %1 - Jūs neturite leidimo įrašyti %1 + Jūs neturite leidimo įrašyti %1 + + + + File removed on the disk. Save it now? + Failas diske buvo pašalintas. Įrašyti jį dabar? - - + + File has changed on disk. Reload? + Failas diske pasikeitė. Įkelti jį iš naujo? + + + + INSERT ĮTERPTI - + OVERWRITE PERRAŠYTI - + R/O TIK SKAITYMUI - - - Cancel - Atsisakyti - - - - - - - Save - Įrašyti + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find Rasti - - Next - Kitas - - - + Previous Ankstesnis + + + Next + Kitas + JumpLineBar - + Go to Line: Pereiti į eilutę: @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. Tekstų redaktorius yra galingas įrankis, skirtas rodyti ir redaguoti tekstinius failus. - + Text Editor Tekstų redaktorius - QObject + PathSettingWgt - - File not saved - + + Remember the last used path + - + + Same path as the current file + + + + + Customize the default path + + + + + QObject + + Text Editor Tekstų redaktorius - + + + + + + + + Encoding + Koduotė + + + Basic Pagrindiniai - + Font Style Šrifto stilius - + Font Šriftas - + Font Size Šrifto dydis - - - Keymap - Klavišų išdėstymas - - - + Shortcuts Trumpiniai - - Forward character - Kitas simbolis - - - - Backward character - Ankstesnis simbolis - - - - Transpose character - Apkeisti simbolius vietomis - - - - Add comment - - - - - Remove comment - - - - - Add/Remove bookmark - - - - - Move to previous bookmark - - - - - Move to next bookmark - - - - - Tab width - Tabuliacijos plotis + + + Keymap + Klavišų išdėstymas - - - + + + Window Langas - + New tab Nauja kortelė - + New window Naujas langas - + Save Įrašyti - + Save as Įrašyti kaip - + Next tab Kita kortelė - + Previous tab Ankstesnė kortelė - + Close tab Užverti kortelę - + Close other tabs Užverti kitas korteles - + Restore tab Atkurti kortelę - + Open file Atverti failą - - Reset font size - Atstatyti šrifto dydį + + Increment font size + Padidinti šrifto dydį - - Toggle fullscreen - Perjungti visą ekraną + + Decrement font size + Sumažinti šrifto dydį - - Help - Žinynas + + Reset font size + Atstatyti šrifto dydį - - Increment font size - + + Help + Žinynas - - Decrement font size - + + Toggle fullscreen + Perjungti visą ekraną - + Find Rasti - + + Find Next + + + + + Find Previous + + + + Replace Pakeisti - + Go to line Pereiti į eilutę - + Save cursor position Įrašyti žymeklio vietą - + Reset cursor position Atstatyti žymeklio vietą - + Exit Išeiti - + Display shortcuts Rodyti trumpinius - + Print Spausdinti - + Editor Redaktorius - + Increase indent Padidinti įtrauką - + Decrease indent Sumažinti įtrauką - + + Forward character + Kitas simbolis + + + + Backward character + Ankstesnis simbolis + + + Forward word Kitas žodis - + Backward word Ankstesnis žodis - + Next line Kita eilutė - + Previous line Ankstesnė eilutė - + New line Nauja eilutė - + New line above Nauja eilutė aukščiau - + New line below Nauja eilutė žemiau - + Duplicate line Dubliuoti eilutę - + Delete to end of line Ištrinti iki eilutės galo - + Delete current line Ištrinti esamą eilutę - + Swap line up Pakelti eilutę - + Swap line down Nuleisti eilutę - + Scroll up one line Slinkti viena eilute aukštyn - + Scroll down one line Slinkti viena eilute žemyn - + Page up Ankstesnis puslapis - + Page down Kitas puslapis - + Move to end of line Perkelti į eilutės galą - + Move to start of line Perkelti į eilutės pradžią - + Move to end of text Perkelti į teksto galą - + Move to start of text Perkelti į teksto pradžią - + Move to line indentation Pereiti į eilutės įtrauką - + Upper case Didžiosios raidės - + Lower case Mažosios raidės - + Capitalize Iš didžiosios raidės - + Delete backward word Ištrinti ankstesnį žodį - + Delete forward word Ištrinti kitą žodį - + Forward over a pair Kiti skliaustai - + Backward over a pair Ankstesni skliaustai - + Select all Žymėti viską - + Copy Kopijuoti - + Cut Iškirpti - + Paste Įdėti - + + Transpose character + Apkeisti simbolius vietomis + + + Mark Žymėti - + Unmark Nuimti žymėjimą - + Copy line Kopijuoti eilutę - + Cut line Iškirpti eilutę - + Merge lines Sulieti eilutes - + Read-Only mode Tik skaitymo veiksena - + + Add comment + + + + + Remove comment + + + + + Undo + Atšaukti + + + + Redo + Grąžinti + + + + Add/Remove bookmark + + + + + Move to previous bookmark + + + + + Move to next bookmark + + + + + Advanced + Išplėstiniai + + + + Window size + Lango dydis + + + + Tab width + Tabuliacijos plotis + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap - + - + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + Color mark - + - + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - + - - Undo - Atšaukti - - - - Redo - Grąžinti - - - - Advanced - Išplėstiniai - - - - Window size - Lango dydis - - - - - - - - - Encoding - Koduotė + + File not saved + - - - + + Line Endings - Eilučių pabaigos + Eilučių pabaigos ReplaceBar - + Find Rasti - + Replace With Kuo pakeisti - + Replace Pakeisti - + Skip Praleisti - + Replace Rest Pakeisti likusius - + Replace All Pakeisti visus + + S: + + + + The first line of the short usage message. + + + Settings - + Standard Standartinis - + Customize Tinkinti - + Normal Normalus - + Maximum Didžiausias - + Fullscreen Visas ekranas - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel - Atsisakyti + Atsisakyti - + Replace - Pakeisti + Pakeisti - + OK - + StartManager - + Untitled %1 - Be pavadinimo %1 + Be pavadinimo %1 Tabbar - + Close tab Užverti kortelę - + Close other tabs Užverti kitas korteles - + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - + TextEdit - + Undo Atšaukti - + Redo Grąžinti - + Cut Iškirpti - + Copy Kopijuoti - + Paste Įdėti - + Delete Ištrinti - + Select All Žymėti viską - - + + Find Rasti - - + + Replace Pakeisti - + Go to Line Pereiti į eilutę - + Turn on Read-Only mode Įjungti tik skaitymo veikseną - + Turn off Read-Only mode Išjungti tik skaitymo veikseną - + Fullscreen Visas ekranas - + Exit fullscreen Išeiti iš viso ekrano - + Display in file manager Rodyti failų tvarkytuvėje - - + + Add Comment - + - + Text to Speech - + - + Stop reading - + - + Speech to Text - + - + Translate - + - + Column Mode - + - + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - + Clear All Marks - + - + Clear Last Mark - + - + Mark - Žymėti + Žymėti - + Mark All - + - + Remove Comment - + - + Copy failed: not enough memory - + - + Press ALT and click lines to edit in column mode - + - + Change Case Keisti raidžių dydį - + Upper Case Didžiosios raidės - + Lower Case Mažosios raidės - + Capitalize Iš didžiosios raidės - + None Nėra - + Selected line(s) copied - + - + Current line copied Dabartinė eilutė nukopijuota - + Selected line(s) clipped - + - + Current line clipped - + - + Paste failed: not enough memory - + - + Read-Only mode is off Tik skaitymo veiksena yra išjungta - - - + + + + + + Read-Only mode is on Tik skaitymo veiksena yra įjungta @@ -1098,7 +1168,7 @@ WarningNotices - + Reload Įkelti iš naujo @@ -1106,131 +1176,132 @@ Window - + + + Save as + Įrašyti kaip + + + New window Naujas langas - + New tab Nauja kortelė - + Open file Atverti failą - - - Save as - Įrašyti kaip + + + Save + Įrašyti - + Print Spausdinti - + Switch theme Perjungti temą - - + + + Settings + Nustatymai + + + + Read-Only Tik skaitymui - - Saved successfully - Sėkmingai įrašyta + + You do not have permission to open %1 + Jūs neturite leidimo atverti %1 - - Read-Only mode is on - Tik skaitymo veiksena yra įjungta + + + Invalid file: %1 + Neteisingas failas: %1 - - Ctrl+'=' - + + + Do you want to save this file? + Ar norite įrašyti šį failą? - - Ctrl+'-' - + + You do not have permission to save %1 + Jūs neturite leidimo įrašyti %1 - - Discard - Atmesti + + Saved successfully + Sėkmingai įrašyta - - - Settings - Nustatymai + + + + Save File + Įrašyti failą - - You do not have permission to open %1 - Jūs neturite leidimo atverti %1 + + Encoding + Koduotė - - Invalid file: %1 - Neteisingas failas: %1 + + Read-Only mode is on + Tik skaitymo veiksena yra įjungta - - - - Save File - Įrašyti failą + + Current location remembered + - - - Do you want to save this file? - Ar norite įrašyti šį failą? + + Ctrl+'=' + - - Encoding - Koduotė + + Ctrl+'-' + - + Editor Redaktorius - - You do not have permission to save %1 - Jūs neturite leidimo įrašyti %1 - - - + Untitled %1 Be pavadinimo %1 - - Current location remembered - - - - + Cancel Atsisakyti - - - Save - Įrašyti + + Discard + Atmesti - + \ No newline at end of file diff --git a/translations/deepin-editor_ms.ts b/translations/deepin-editor_ms.ts index 91c6d6ac..1f80796a 100644 --- a/translations/deepin-editor_ms.ts +++ b/translations/deepin-editor_ms.ts @@ -16,13 +16,18 @@ Characters %1 Aksara %1 + + + Loading: + Memuatkan: + DDropdownMenu - + + - None Tiada @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Simpan - + Do you want to save this file? Anda mahu menyimpan fail ini? - - + + Cancel Batal - + Encoding changed. Do you want to save the file now? Pengekodan berubah. Anda mahu menyimpan fail sekarang? - + Discard Singkir - + + You do not have permission to save %1 Anda tidak mempunyai keizinan untuk menyimpan %1 - + File removed on the disk. Save it now? Fail dalam cakera telah dibuang. Simpan ia sekarang? - + File has changed on disk. Reload? Fail telah berubah di dalam cakera. Muat semula? - - + + INSERT SISIP - + OVERWRITE TULISGANTI - + R/O R/O - + The file cannot be read, which may be too large or has been damaged! - + Fail tidak boleh dibaca, mungkin saiznya terlalu besar atau sudah rosak! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Pergi ke Baris: @@ -134,6 +140,24 @@ Penyunting Teks + + PathSettingWgt + + + Remember the last used path + Ingat laluan yang terakhir digunakan + + + + Same path as the current file + Laluan serupa sebagai fail semasa + + + + Customize the default path + Suai laluan lalai + + QObject @@ -142,12 +166,13 @@ Penyunting Teks - - - - - - + + + + + + + Encoding Pengekodan @@ -184,8 +209,8 @@ - - + + Window Tetingkap @@ -271,438 +296,467 @@ + Find Next + + + + + Find Previous + + + + Replace Ganti - + Go to line Pergi ke baris - + Save cursor position Simpan kedudukan kursor - + Reset cursor position Tetap semula kedudukan kursor - + Exit Keluar - + Display shortcuts Papar pintasan - + Print Cetak - + Editor Penyunting - + Increase indent Tingkatkan inden - + Decrease indent Kurangkan inden - + Forward character Aksara maju - + Backward character Aksara undur - + Forward word Maju perkataan - + Backward word Undur perkataan - + Next line Baris berikutnya - + Previous line Baris terdahulu - + New line Baris baharu - + New line above Baris baharu di atas - + New line below Baris baharu di bawah - + Duplicate line Gandakan baris - + Delete to end of line Padam ke penghujung baris - + Delete current line Padam baris semasa - + Swap line up Silih baris ke atas - + Swap line down Silih baris ke bawah - + Scroll up one line Tatal ke atas satu baris - + Scroll down one line Tatal ke bawah satu baris - + Page up Halaman ke atas - + Page down Halaman ke bawah - + Move to end of line Gerak ke penghujung baris - + Move to start of line Gerak ke permulaan baris - + Move to end of text Gerak ke penghujung teks - + Move to start of text Gerak ke permulaan teks - + Move to line indentation Alih ke indentasi baris - + Upper case Huruf besar - + Lower case Huruf kecil - + Capitalize Huruf Besarkan - + Delete backward word Padam perkataan mengundur - + Delete forward word Padam perkataan ke hadapan - + Forward over a pair Majukan melangkaui pasangan - + Backward over a pair Undur melangkaui pasangan - + Select all Pilih semua - + Copy Salin - + Cut Potong - + Paste Tampal - + Transpose character Transposisi aksara - + Mark Tanda - + Unmark Nyahtanda - + Copy line Salin baris - + Cut line Potong baris - + Merge lines Gabung baris - + Read-Only mode Mod Baca-Sahaja - + Add comment Tambah ulasan - + Remove comment Buang ulasan - + Undo Buat Asal - + Redo Buat Semula - + Add/Remove bookmark Tambah/Buang tanda buku - + Move to previous bookmark Alih ke tanda buku terdahulu - + Move to next bookmark Alih ke tanda buku berikutnya - + Advanced Lanjutan - + Window size Saiz tetingkap - + Tab width Lebar tab - + + Paste by pressing a middle mouse button + Tampal dengan menekan butang tengah tetikus + + + + Startup + Permulaan + + + + Reopen last closed tabs + Buka semula tab terakhir yang ditutup + + + + Open/Save Settings + Tetapan Buka/Simpan + + + Word wrap Lilit perkataan - + Code folding flag Bendera melipat kod - + Show line numbers Tunjuk nombor baris - + Show bookmarks icon Tunjuk ikon tanda buku - + Show whitespaces and tabs Tunjuk jarak dan tab - + Highlight current line Sorot baris semasa - + Color mark Tanda warna - + Unicode Unikod - + WesternEuropean Eropah Barat - + CentralEuropean Eropah Tengah - + Baltic Baltik - + Cyrillic Cyril - + Arabic Arab - + Celtic Celt - + SouthEasternEuropean Eropah Tenggara - + Greek Yunani - + Hebrew Ibrani - + ChineseSimplified Cina Ringkas - + ChineseTraditional Cina Tradisional - + Japanese Jepun - + Korean Korea - + Thai Siam - + Turkish Turki - + Vietnamese Vietnam - + File not saved Fail tidak disimpan - - - + + Line Endings Penghujung Baris @@ -752,58 +806,59 @@ Settings - + Standard Piawai - + Customize Suai - + Normal Biasa - + Maximum Maksimum - + Fullscreen Skrin Penuh - + This shortcut conflicts with system shortcut %1 Pintasan ini berkonflik dengan pintasan sistem %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Pintasan ini berkonflik dengan %1, klik Ganti untuk menjadikan pintasan ini berkesan serta-merta - - + + + The shortcut %1 is invalid, please set another one. Pintasan %1 tidak sah, sila tetapkan yang lain. - + Cancel Batal - + Replace Ganti - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Buat Asal - + Redo Buat Semula - + Cut Potong - + Copy Salin - + Paste Tampal - + Delete Padam - + Select All Pilih Semua - - + + Find Cari - - + + Replace Ganti - + Go to Line Pergi ke Baris - + Turn on Read-Only mode Hidupkan mod Baca-Sahaja - + Turn off Read-Only mode Matikan mod Baca-Sahaja - + Fullscreen Skrin Penuh - + Exit fullscreen Keluar dari skrin penuh - + Display in file manager Papar dalam pengurus fail - - + + Add Comment Tambah Ulasan - + Text to Speech Teks ke Pertuturan - + Stop reading Berhenti membaca - + Speech to Text Pertuturan ke Teks - + Translate Terjemah - + Column Mode Mod Lajur - + Add bookmark Tambah tanda buku - + Remove Bookmark Buang Tanda Buku - + Previous bookmark Tanda buku terdahulu - + Next bookmark Tanda buku berikutnya - + Remove All Bookmarks Buang Semua Tanda Buku - + Fold All Lipat Semua - + Fold Current Level Lipat Aras Semasa - + Unfold All Nyahlipat Semua - + Unfold Current Level Nyahlipat Aras Semasa - + Color Mark Tanda Warna - + Clear All Marks Kosongkan Semua Tanda - + Clear Last Mark Kosongkan Tanda Terakhir - + Mark Tanda - + Mark All Tanda Semua - + Remove Comment Buang Ulasan - + Copy failed: not enough memory Gagal salin: ingatan tidak mencukupi - + Press ALT and click lines to edit in column mode Tekan ALT dan klik baris untuk menyunting dalam mod lajur - + Change Case Ubah Kata - + Upper Case Huruf Besar - + Lower Case Huruf Kecil - + Capitalize Huruf Besarkan - + None Tiada - + Selected line(s) copied Baris terpilih disalin - + Current line copied Baris semasa disalin - + Selected line(s) clipped Baris terpilih dikerat - + Current line clipped Baris semasa dikerat - + Paste failed: not enough memory Gagal tampal: ingatan tidak mencukupi - + Read-Only mode is off Mod Baca-Sahaja dimatikan - - - - - + + + + + + Read-Only mode is on Mod Baca-Sahaja dihidupkan @@ -1121,129 +1177,129 @@ Window - + Save as Simpan sebagai - + New window Tetingkap baharu - + New tab Tab baharu - + Open file Buka fail - - + + Save Simpan - + Print Cetak - + Switch theme Tukar tema - - + + Settings Tetapan - - + + Read-Only Baca-Sahaja - + You do not have permission to open %1 Anda tidak mempunyai keizinan untuk membuka %1 - - + + Invalid file: %1 Fail tidak sah: %1 - - + + Do you want to save this file? Anda mahu menyimpan fail ini? - + You do not have permission to save %1 Anda tidak mempunyai keizinan untuk menyimpan %1 - + Saved successfully Berjaya disimpan - - - + + + Save File Simpan Fail - + Encoding Pengekodan - + Read-Only mode is on Mod Baca-Sahaja dihidupkan - + Current location remembered Lokasi semasa diingati - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Penyunting - + Untitled %1 %1 Tidak Bertajuk - + Cancel Batal - + Discard Singkir diff --git a/translations/deepin-editor_ne.ts b/translations/deepin-editor_ne.ts index 5f7f49ce..82c6b6ba 100644 --- a/translations/deepin-editor_ne.ts +++ b/translations/deepin-editor_ne.ts @@ -1,119 +1,128 @@ - - - + BottomBar - + Row पंक्ति - + Column स्तम्भ - + Characters %1 क्यारेक्टर% 1 + + + Loading: + + DDropdownMenu - - - + + + None - कुनै पनि होइन + कुनै पनि होइन EditWrapper - - File has changed on disk. Reload? - डिस्कमा फाइल परिवर्तन भएको छ। पुन: लोड गर्नुहोस? - - - - File removed on the disk. Save it now? - डिस्कबाट फाइल हटाइयो सुरक्षित गर्नुहोस्। + + + + + Save + सुरक्षित गर्नु - + Do you want to save this file? - के तपाइँ यो फाईल सुरक्षित गर्न चाहनुहुन्छ? + के तपाइँ यो फाईल सुरक्षित गर्न चाहनुहुन्छ? - - Discard - त्याग्नुहोस् + + + Cancel + रद्द गर्नुहोस् - + Encoding changed. Do you want to save the file now? - + एन्कोडिंग परिवर्तन भयो। के तपाईं अब फाईल बचत गर्न चाहानुहुन्छ? - + + Discard + त्याग्नुहोस् + + + + You do not have permission to save %1 - तपाईंसँग% 1 सुरक्षित गर्न अनुमति छैन + तपाईंसँग% 1 सुरक्षित गर्न अनुमति छैन + + + + File removed on the disk. Save it now? + डिस्कबाट फाइल हटाइयो सुरक्षित गर्नुहोस्। - - + + File has changed on disk. Reload? + डिस्कमा फाइल परिवर्तन भएको छ। पुन: लोड गर्नुहोस? + + + + INSERT हाल्नु - + OVERWRITE त्योमाथि - + R/O आर / ओ - - - Cancel - रद्द गर्नुहोस् - - - - - - - Save - सुरक्षित गर्नु + + The file cannot be read, which may be too large or has been damaged! + FindBar - + Find खोज्नुहोस् - - Next - अर्को - - - + Previous अघिल्लो + + + Next + अर्को + JumpLineBar - + Go to Line: रेखामा जानुहोस् @@ -121,976 +130,1037 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. पाठ सम्पादक हेर्न र सम्पादन गर्न पाठ फाइलहरू एक शक्तिशाली उपकरण हो। - + Text Editor पाठ सम्पादक - QObject + PathSettingWgt - - File not saved - फाइल बचत भएन + + Remember the last used path + + + + + Same path as the current file + - + + Customize the default path + + + + + QObject + + Text Editor पाठ सम्पादक - + + + + + + + + Encoding + सङ्केतन + + + Basic आधारभूत - + Font Style फन्टको शैली - + Font फन्ट - + Font Size फन्टको आकार - - - Keymap - किम्याप - - - + Shortcuts सर्टकटहरू - - Forward character - फर्वार्ड क्यारेक्टर - - - - Backward character - पछाडि क्यारेक्टर - - - - Transpose character - रूपान्तरण अक्षर - - - - Add comment - - - - - Remove comment - - - - - Add/Remove bookmark - - - - - Move to previous bookmark - - - - - Move to next bookmark - - - - - Tab width - ट्याब चौडाइ + + + Keymap + किम्याप - - - + + + Window विन्डो - + New tab नयाँ ट्याब - + New window नयाँ विन्डो - + Save सुरक्षित गर्नु - + Save as यसरी राख - + Next tab अर्को ट्याब - + Previous tab अघिल्लो ट्याब - + Close tab ट्याब बन्द गर्नुहोस् - + Close other tabs अन्य ट्याबहरू बन्द गर्नुहोस् - + Restore tab ट्याब पुनर्स्थापित गर्नुहोस् - + Open file फाईल खोल्नुहोस् - - Reset font size - फन्ट साइज रिसेट गर्नुहोस् + + Increment font size + फन्ट साइज बढाउनुहोस् - - Toggle fullscreen - पूरा स्क्रिन टगल गर्नुहोस् + + Decrement font size + फन्ट साइज घटाउनुहोस् - - Help - मद्दत + + Reset font size + फन्ट साइज रिसेट गर्नुहोस् - - Increment font size - + + Help + मद्दत - - Decrement font size - + + Toggle fullscreen + पूरा स्क्रिन टगल गर्नुहोस् - + Find खोज्नुहोस - + + Find Next + + + + + Find Previous + + + + Replace बदल्नुहोस् - + Go to line रेखामा जानुहोस् - + Save cursor position कर्सरको स्थिति बचत गर्नुहोस् - + Reset cursor position कर्सरको स्थिति रिसेट गर्नुहोस् - + Exit बाहिर निस्कनुहोस् - + Display shortcuts सर्टकटहरू प्रदर्शन गर्नुहोस् - + Print प्रिन्ट गर्नुहोस् - + Editor संपादक - + Increase indent इन्डेन्ट बढाउनुहोस् - + Decrease indent इन्डेन्ट घटाउनुहोस् - + + Forward character + फर्वार्ड क्यारेक्टर + + + + Backward character + पछाडि क्यारेक्टर + + + Forward word फर्वार्ड शब्द - + Backward word पछाडि शब्द - + Next line अर्को रेखा जानुहोस् - + Previous line अघिल्लो रेखा - + New line नयाँ रेखा - + New line above माथि नयाँ रेखा - + New line below तल नयाँ रेखा - + Duplicate line डुप्लिकेट रेखा - + Delete to end of line रेखाको अन्त्य मेटाउनुहोस् - + Delete current line हालको रेखा मेट्नुहोस् - + Swap line up स्वाइप रेखा माथि - + Swap line down स्वाइप रेखा तल - + Scroll up one line एक रेखा माथि स्क्रोल गर्नुहोस् - + Scroll down one line एक रेखा तल स्क्रोल गर्नुहोस् - + Page up पृष्ठ माथि - + Page down पृष्ठ तल - + Move to end of line रेखाको अन्त्यमा सार्नुहोस् - + Move to start of line रेखाको सुरूमा सार्नुहोस् - + Move to end of text पाठको अन्त्यमा सार्नुहोस् - + Move to start of text पाठको सुरुमा सार्नुहोस् - + Move to line indentation रेखाको इन्डेन्टेशनमा सार्नुहोस् - + Upper case माथिल्लो केस - + Lower case तल्लो केस - + Capitalize क्यापिटलिज गर्नुहोस् - + Delete backward word पछाडिको शब्द मेटाउनुहोस् - + Delete forward word अगाडिको शब्द मेटाउनुहोस् - + Forward over a pair एउटा जोडा माथि फर्वार्ड गर्नुहोस् - + Backward over a pair एक जोडा माथि पछाडि गर्नुहोस् - + Select all सबै छान्नु - + Copy कपी - + Cut काट्नुहोस् - + Paste टाँस्नुहोस् - + + Transpose character + रूपान्तरण अक्षर + + + Mark चिन्ह लगाउनुहोस् - + Unmark चिन्ह हटाउनुहोस - + Copy line लाइन प्रतिलिपि गर्नुहोस् - + Cut line रेखा कटौती गर्नुहोस् - + Merge lines रेखा जोड्नुहोस् - + Read-Only mode पढ्ने मात्र मोड - + + Add comment + + + + + Remove comment + + + + + Undo + पूर्ववत गर्नुहोस् + + + + Redo + फेरि गर्नुहोस् + + + + Add/Remove bookmark + + + + + Move to previous bookmark + + + + + Move to next bookmark + + + + + Advanced + उच्च + + + + Window size + विन्डोको आकार + + + + Tab width + ट्याब चौडाइ + + + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap - + - + Code folding flag - + - + Show line numbers - + - + Show bookmarks icon - + - + Show whitespaces and tabs - + - + Highlight current line - + - + Color mark - + - + Unicode - + - + WesternEuropean - + - + CentralEuropean - + - + Baltic - + - + Cyrillic - + - + Arabic - + - + Celtic - + - + SouthEasternEuropean - + - + Greek - + - + Hebrew - + - + ChineseSimplified - + - + ChineseTraditional - + - + Japanese - + - + Korean - + - + Thai - + - + Turkish - + - + Vietnamese - - - - - Undo - पूर्ववत गर्नुहोस् - - - - Redo - फेरि गर्नुहोस् - - - - Advanced - उच्च - - - - Window size - विन्डोको आकार + - - - - - - - Encoding - सङ्केतन + + File not saved + फाइल बचत भएन - - - + + Line Endings - रेखा समाप्ति + रेखा समाप्ति ReplaceBar - + Find खोज्नुहोस् - + Replace With संग बदल्नुहोस् - + Replace बदल्नुहोस् - + Skip छोड्नुहोस् - + Replace Rest पुन: बदल्नुहोस् - + Replace All सबै बदल्नुहोस् + + S: + + + + The first line of the short usage message. + + + Settings - + Standard स्तर - + Customize अनुकूलन गर्नुहोस् - + Normal साधारण - + Maximum अधिकतम - + Fullscreen पूरा स्क्रीन - + This shortcut conflicts with system shortcut %1 - + - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - + - - + + + The shortcut %1 is invalid, please set another one. - + - + Cancel - रद्द गर्नुहोस् + रद्द गर्नुहोस् - + Replace - बदल्नुहोस् + बदल्नुहोस् - + OK - + StartManager - + Untitled %1 - शीर्षकविहिन% 1 + शीर्षकविहिन% 1 Tabbar - + Close tab ट्याब बन्द गर्नुहोस् - + Close other tabs अन्य ट्याबहरू बन्द गर्नुहोस् - + More options - + - + Close tabs to the left - + - + Close tabs to the right - + - + Close unmodified tabs - + TextEdit - + Undo पूर्ववत गर्नुहोस् - + Redo फेरि गर्नुहोस् - + Cut काट्नुहोस् - + Copy कपी - + Paste टाँस्नुहोस् - + Delete मेटाउनुहोस् - + Select All सबै छान्नु - - + + Find खोज्नुहोस् - - + + Replace बदल्नुहोस् - + Go to Line रेखामा जानुहोस् - + Turn on Read-Only mode पढ्ने-मात्र मोड खोल्नुहोस् - + Turn off Read-Only mode पढ्ने-मात्र मोड बन्द गर्नुहोस् - + Fullscreen पूरा स्क्रीन - + Exit fullscreen पूरा स्क्रिनबाट निस्कनुहोस् - + Display in file manager फाईल प्रबन्धकमा प्रदर्शन गर्नुहोस् - - + + Add Comment - + - + Text to Speech टेक्स्ट तु स्पीच - + Stop reading - + - + Speech to Text स्पीच तु टेक्स्ट - + Translate - + - + Column Mode - + - + Add bookmark - + - + Remove Bookmark - + - + Previous bookmark - + - + Next bookmark - + - + Remove All Bookmarks - + - + Fold All - + - + Fold Current Level - + - + Unfold All - + - + Unfold Current Level - + - + Color Mark - + - + Clear All Marks - + - + Clear Last Mark - + - + Mark - चिन्ह लगाउनुहोस् + चिन्ह लगाउनुहोस् - + Mark All - + - + Remove Comment - + - + Copy failed: not enough memory - + - + Press ALT and click lines to edit in column mode - + - + Change Case केस परिवर्तन गर्नुहोस् - + Upper Case माथिल्लो केस - + Lower Case तल्लो केस - + Capitalize क्यापिटलिज गर्नुहोस् - + None कुनै पनि होइन - + Selected line(s) copied चयनित लाइन (हरू) प्रतिलिपि गरियो - + Current line copied हालको लाइन प्रतिलिपि गरियो - + Selected line(s) clipped चयनित लाइन (हरू) क्लिप गरियो - + Current line clipped हालको लाइन क्लिप गरियो - + Paste failed: not enough memory - + - + Read-Only mode is off पढ्ने मात्र मोड बन्द छ - - - + + + + + + Read-Only mode is on पढ्ने मात्र मोड चालू छ @@ -1098,7 +1168,7 @@ WarningNotices - + Reload पुन: लोड गर्नुहोस् @@ -1106,131 +1176,132 @@ Window - + + + Save as + यसरी राख + + + New window नयाँ विन्डो - + New tab नयाँ ट्याब - + Open file फाईल खोल्नुहोस् - - - Save as - यसरी राख + + + Save + सुरक्षित गर्नु - + Print प्रिन्ट गर्नुहोस् - + Switch theme स्विच थेम - - + + + Settings + सेटिङ्हरू + + + + Read-Only पढ्ने मात्र - - Saved successfully - सफलतापूर्वक सुरक्षित गरियो + + You do not have permission to open %1 + तपाईंसँग% 1 खोल्न अनुमति छैन - - Read-Only mode is on - पढ्ने मात्र मोड चालू छ + + + Invalid file: %1 + अमान्य फाइल:% 1 - - Ctrl+'=' - + + + Do you want to save this file? + के तपाइँ यो फाईल सुरक्षित गर्न चाहनुहुन्छ? - - Ctrl+'-' - + + You do not have permission to save %1 + तपाईंसँग% 1 सुरक्षित गर्न अनुमति छैन - - Discard - त्याग्नुहोस् + + Saved successfully + सफलतापूर्वक सुरक्षित गरियो - - - Settings - सेटिङ्हरू + + + + Save File + फाइल सुरक्षित गर्नु - - You do not have permission to open %1 - तपाईंसँग% 1 खोल्न अनुमति छैन + + Encoding + सङ्केतन - - Invalid file: %1 - अमान्य फाइल:% 1 + + Read-Only mode is on + पढ्ने मात्र मोड चालू छ - - - - Save File - फाइल सुरक्षित गर्नु + + Current location remembered + हालको स्थान सम्झियो - - - Do you want to save this file? - के तपाइँ यो फाईल सुरक्षित गर्न चाहनुहुन्छ? + + Ctrl+'=' + - - Encoding - सङ्केतन + + Ctrl+'-' + - + Editor संपादक - - You do not have permission to save %1 - तपाईंसँग% 1 सुरक्षित गर्न अनुमति छैन - - - + Untitled %1 शीर्षकविहिन% 1 - - Current location remembered - हालको स्थान सम्झियो - - - + Cancel रद्द गर्नुहोस् - - - Save - सुरक्षित गर्नु + + Discard + त्याग्नुहोस् - + \ No newline at end of file diff --git a/translations/deepin-editor_nl.ts b/translations/deepin-editor_nl.ts index 4d360dda..2e320a33 100644 --- a/translations/deepin-editor_nl.ts +++ b/translations/deepin-editor_nl.ts @@ -16,13 +16,18 @@ Characters %1 %1 tekens + + + Loading: + Bezig met laden van + DDropdownMenu - + + - None Geen @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Opslaan - + Do you want to save this file? Wil je dit bestand opslaan? - - + + Cancel Annuleren - + Encoding changed. Do you want to save the file now? De tekencodering is aangepast. Wil je het bestand opslaan? - + Discard Verwerpen - + + You do not have permission to save %1 Je bent niet gemachtigd om %1 op te slaan - + File removed on the disk. Save it now? Het bestand is verwijderd van de schijf. Wil je het opslaan? - + File has changed on disk. Reload? Het bestand is aangepast op de schijf. Wil je het opnieuw laden? - - + + INSERT INSERT - + OVERWRITE OVERSCHRIJVEN - + R/O ALLEEN-LEZEN - + The file cannot be read, which may be too large or has been damaged! - + Het bestand kan niet worden ingelezen omdat het te groot of beschadigd is! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Ga naar regel: @@ -134,6 +140,24 @@ Tekstbewerker + + PathSettingWgt + + + Remember the last used path + Laatstgebruikte locatie onthouden + + + + Same path as the current file + Dezelfde locatie als huidig bestand + + + + Customize the default path + Standaardlocatie wijzigen + + QObject @@ -142,12 +166,13 @@ Tekstbewerker - - - - - - + + + + + + + Encoding Tekencodering @@ -184,8 +209,8 @@ - - + + Window Venster @@ -271,438 +296,467 @@ + Find Next + Volgende zoeken + + + + Find Previous + Vorige zoeken + + + Replace Vervangen - + Go to line Ga naar regel - + Save cursor position Cursorpositie opslaan - + Reset cursor position Cursorpositie herstellen - + Exit Afsluiten - + Display shortcuts Sneltoetsen tonen - + Print Afdrukken - + Editor Bewerker - + Increase indent Inspringing vergroten - + Decrease indent Inspringing verkleinen - + Forward character Teken vooruit - + Backward character Teken achteruit - + Forward word Woord vooruit - + Backward word Woord achteruit - + Next line Volgende regel - + Previous line Vorige regel - + New line Nieuwe regel - + New line above Nieuwe regel erboven - + New line below Nieuwe regel eronder - + Duplicate line Regel dupliceren - + Delete to end of line Wissen tot einde van regel - + Delete current line Huidige regel wissen - + Swap line up Regel omhoog verwisselen - + Swap line down Regel omlaag verwisselen - + Scroll up one line Eén regel omhoog scrollen - + Scroll down one line Eén regel omlaag scrollen - + Page up Pagina omhoog - + Page down Pagina omlaag - + Move to end of line Verplaatsen naar einde van regel - + Move to start of line Verplaatsen naar begin van regel - + Move to end of text Verplaatsen naar einde van tekst - + Move to start of text Verplaatsen naar begin van tekst - + Move to line indentation Verplaatsen naar regelinspringing - + Upper case Hoofdletters - + Lower case Kleine letters - + Capitalize Omzetten naar hoofdletters - + Delete backward word Woord achterwaarts wissen - + Delete forward word Woord voorwaarts wissen - + Forward over a pair Voorwaarts over een stel - + Backward over a pair Achterwaarts over een stel - + Select all Alles selecteren - + Copy Kopiëren - + Cut Knippen - + Paste Plakken - + Transpose character Teken omzetten - + Mark Markeren - + Unmark Demarkeren - + Copy line Regel kopiëren - + Cut line Regel knippen - + Merge lines Regels samenvoegen - + Read-Only mode Alleen-lezenmodus - + Add comment Opmerking toevoegen - + Remove comment Opmerking verwijderen - + Undo Ongedaan maken - + Redo Opnieuw - + Add/Remove bookmark Bladwijzer toevoegen/verwijderen - + Move to previous bookmark Naar vorige bladwijzer - + Move to next bookmark Naar volgende bladwijzer - + Advanced Geavanceerd - + Window size Venstergrootte - + Tab width Tabbreedte - + + Paste by pressing a middle mouse button + Plakken met middelste muisknop + + + + Startup + Opstarten + + + + Reopen last closed tabs + Vorige tabbladen heropenen + + + + Open/Save Settings + Openen/Opslaan + + + Word wrap Regelafbreking - + Code folding flag Codefloodvlag - + Show line numbers Regelnummers tonen - + Show bookmarks icon Bladwijzerpictogram tonen - + Show whitespaces and tabs Witruimtes en tabs tonen - + Highlight current line Huidige regel markeren - + Color mark Markeerkleur - + Unicode Unicode - + WesternEuropean West-Europees - + CentralEuropean Centraal-Europees - + Baltic Baltisch - + Cyrillic Cyrillisch - + Arabic Arabisch - + Celtic Keltisch - + SouthEasternEuropean Zuidoost-Europees - + Greek Grieks - + Hebrew Hebreeuws - + ChineseSimplified Chinees (Vereenvoudigd) - + ChineseTraditional Chinees (Traditioneel) - + Japanese Japans - + Korean Koreaans - + Thai Thais - + Turkish Turks - + Vietnamese Vietnamees - + File not saved Bestand is niet opgeslagen - - - + + Line Endings Regeleindes @@ -752,58 +806,59 @@ Settings - + Standard Standaard - + Customize Aanpassen - + Normal Normaal - + Maximum Maximaal - + Fullscreen Beeldvullende modus - + This shortcut conflicts with system shortcut %1 Deze sneltoets is wordt al gebruikt door de algemene sneltoets %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Deze sneltoets is al in gebruik door %1 - klik om deze sneltoets in plaats daarvan te gebruiken - - + + + The shortcut %1 is invalid, please set another one. De sneltoets '%1' is ongeldig. Stel een andere in. - + Cancel Annuleren - + Replace Vervangen - + OK Oké @@ -852,259 +907,260 @@ TextEdit - + Undo Ongedaan maken - + Redo Opnieuw - + Cut Knippen - + Copy Kopiëren - + Paste Plakken - + Delete Verwijderen - + Select All Alles selecteren - - + + Find Zoeken - - + + Replace Vervangen - + Go to Line Ga naar regel - + Turn on Read-Only mode Alleen-lezenmodus inschakelen - + Turn off Read-Only mode Alleen-lezenmodus uitschakelen - + Fullscreen Beeldvullende modus - + Exit fullscreen Beeldvullende modus verlaten - + Display in file manager Tonen in bestandsbeheerder - - + + Add Comment Opmerking toevoegen - + Text to Speech Tekst-naar-spraak - + Stop reading Stoppen met lezen - + Speech to Text Spraak-naar-tekst - + Translate Vertalen - + Column Mode Kolommodus - + Add bookmark Bladwijzer toevoegen - + Remove Bookmark Bladwijzer verwijderen - + Previous bookmark Vorige bladwijzer - + Next bookmark Volgende bladwijzer - + Remove All Bookmarks Alle bladwijzers verwijderen - + Fold All Alles inklappen - + Fold Current Level Huidig niveau inklappen - + Unfold All Alles uitklappen - + Unfold Current Level Huidig niveau uitklappen - + Color Mark Markeerkleur - + Clear All Marks Alle markeringen missen - + Clear Last Mark Recentste markering demarkeren - + Mark Markeren - + Mark All Alles markeren - + Remove Comment Opmerking verwijderen - + Copy failed: not enough memory Het kopiëren is mislukt omdat er onvoldoende vrij geheugen is - + Press ALT and click lines to edit in column mode Druk op Alt en klik op regels om te bewerken in kolommodus - + Change Case Hoofdletters/Kleine letters - + Upper Case Hoofdletters - + Lower Case Kleine letters - + Capitalize Omzetten naar hoofdletters - + None Geen - + Selected line(s) copied De geselecteerde regel(s) is (zijn) gekopieerd - + Current line copied De huidige regel is gekopieerd - + Selected line(s) clipped De geselecteerde regel(s) is (zijn) ingekort - + Current line clipped De huidige regel is ingekort - + Paste failed: not enough memory Het plakken is mislukt omdat er onvoldoende vrij geheugen is - + Read-Only mode is off Alleen-lezenmodus is uitgeschakeld - - - - - + + + + + + Read-Only mode is on Alleen-lezenmodus is ingeschakeld @@ -1121,129 +1177,129 @@ Window - + Save as Opslaan als - + New window Nieuw venster - + New tab Nieuw tabblad - + Open file Bestand openen - - + + Save Opslaan - + Print Afdrukken - + Switch theme Thema wijzigen - - + + Settings Instellingen - - + + Read-Only Alleen-lezen - + You do not have permission to open %1 Je bent niet gemachtigd om %1 te openen - - + + Invalid file: %1 Ongeldig bestand: %1 - - + + Do you want to save this file? Wil je dit bestand opslaan? - + You do not have permission to save %1 Je bent niet gemachtigd om %1 op te slaan - + Saved successfully Opgeslagen - - - + + + Save File Bestand opslaan - + Encoding Tekencodering - + Read-Only mode is on Alleen-lezenmodus is ingeschakeld - + Current location remembered De huidige locatie wordt onthouden - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Bewerker - + Untitled %1 Naamloos %1 - + Cancel Annuleren - + Discard Verwerpen diff --git a/translations/deepin-editor_pl.ts b/translations/deepin-editor_pl.ts index 38ddad7f..15b1833c 100644 --- a/translations/deepin-editor_pl.ts +++ b/translations/deepin-editor_pl.ts @@ -16,13 +16,18 @@ Characters %1 Znaki %1 + + + Loading: + Wczytywanie: + DDropdownMenu - + + - None Brak @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Zapisz - + Do you want to save this file? Czy chcesz zapisać plik? - - + + Cancel Anuluj - + Encoding changed. Do you want to save the file now? Kodowanie zostało zmienione. Czy chcesz teraz zapisać plik? - + Discard Odrzuć - + + You do not have permission to save %1 Nie posiadasz uprawnień do zapisania %1 - + File removed on the disk. Save it now? Plik został usunięty z dysku. Czy chcesz go zapisać? - + File has changed on disk. Reload? Plik został zmieniony na dysku. Czy chcesz go ponownie wczytać? - - + + INSERT WSTAWIANIE - + OVERWRITE NADPISYWANIE - + R/O TYLKO DO ODCZYTU - + The file cannot be read, which may be too large or has been damaged! - + Nie można odczytać pliku, może być za duży lub jest uszkodzony! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Przejdź do wiersza: @@ -134,6 +140,24 @@ Edytor tekstu + + PathSettingWgt + + + Remember the last used path + Zapamiętaj ostatnio użytą ścieżkę + + + + Same path as the current file + Taka sama ścieżka jak bieżącego pliku + + + + Customize the default path + Dostosuj ścieżkę domyślną + + QObject @@ -142,12 +166,13 @@ Edytor tekstu - - - - - - + + + + + + + Encoding Kodowanie @@ -184,8 +209,8 @@ - - + + Window Okno @@ -252,7 +277,7 @@ Reset font size - Zresetuj rozmiar czcionki + Resetuj rozmiar czcionki @@ -271,438 +296,467 @@ + Find Next + Znajdź następne + + + + Find Previous + Znajdź poprzednie + + + Replace Zamień - + Go to line Przejdź do wiersza - + Save cursor position Zapisz pozycję kursora - + Reset cursor position - Zresetuj pozycję kursora + Resetuj pozycję kursora - + Exit Wyjdź - + Display shortcuts Wyświetl skróty - + Print Drukuj - + Editor Edytor - + Increase indent Zwiększ wcięcie - + Decrease indent Zmniejsz wcięcie - + Forward character Znak do przodu - + Backward character Znak do tyłu - + Forward word Następne słowo - + Backward word Poprzednie słowo - + Next line Następny wiersz - + Previous line Poprzedni wiersz - + New line Nowy wiersz - + New line above Nowy wiersz powyżej - + New line below Nowy wiersz poniżej - + Duplicate line Duplikuj wiersz - + Delete to end of line Usuń do końca wiersza - + Delete current line Usuń bieżący wiersz - + Swap line up Zamień wiersz z powyższym - + Swap line down Zamień wiersz z poniższym - + Scroll up one line Przewiń jeden wiersz w górę - + Scroll down one line Przewiń jeden wiersz w dół - + Page up Strona w górę - + Page down Strona w dół - + Move to end of line Przejdź do końca wiersza - + Move to start of line Przejdź do początku wiersza - + Move to end of text Przejdź do końca tekstu - + Move to start of text Przejdź do początku tekstu - + Move to line indentation Przejdź do wcięcia wiersza - + Upper case Wielkie litery - + Lower case Małe litery - + Capitalize Wielka litera - + Delete backward word - Usuń poprzedzające słowo + Usuń słowo poprzedzające - + Delete forward word - Usuń następujące słowo + Usuń słowo następujące - + Forward over a pair Przenieś się za nawias - + Backward over a pair Przenieś się przed nawias - + Select all Zaznacz wszystko - + Copy Kopiuj - + Cut Wytnij - + Paste Wklej - + Transpose character Przenieś znak - + Mark Oznacz - + Unmark Odznacz - + Copy line Kopiuj wiersz - + Cut line Wytnij wiersz - + Merge lines Połącz wiersze - + Read-Only mode Tryb tylko-do-odczytu - + Add comment Dodaj komentarz - + Remove comment Usuń komentarz - + Undo Cofnij - + Redo Ponów - + Add/Remove bookmark Dodaj/Usuń zakładkę - + Move to previous bookmark Przejdź do poprzedniej zakładki - + Move to next bookmark Przejdź do następnej zakładki - + Advanced Zaawansowane - + Window size Rozmiar okna - + Tab width Szerokość zakładki - + + Paste by pressing a middle mouse button + Wklej za pomocą środkowego przycisku myszy + + + + Startup + Start programu + + + + Reopen last closed tabs + Przywróć ostatnio zamknięte karty + + + + Open/Save Settings + Otwórz/Zapisz ustawienia + + + Word wrap Zawijanie tekstu - + Code folding flag Pokaż strzałki zawijające kod - + Show line numbers Pokaż numery wierszy - + Show bookmarks icon Pokaż ikonę zakładek - + Show whitespaces and tabs Pokaż spacje i tabulatory - + Highlight current line - Podkreśl bieżący wiersz + Wyróżnij bieżący wiersz - + Color mark Kolor oznaczenia - + Unicode Unicode - + WesternEuropean Zachodnio Europejski - + CentralEuropean Europa Centralna - + Baltic Bałtycki - + Cyrillic Cyrylica - + Arabic Arabski - + Celtic Celtycki - + SouthEasternEuropean Południowo-Wschodnia Europa - + Greek Grecki - + Hebrew Hebrajski - + ChineseSimplified Chiński uproszczony - + ChineseTraditional Chiński tradycyjny - + Japanese Japoński - + Korean Koreański - + Thai Tajlandzki - + Turkish Turecki - + Vietnamese Wietnamski - + File not saved Plik nie został zapisany - - - + + Line Endings Zakończenia wiersza @@ -752,58 +806,59 @@ Settings - + Standard Standardowe - + Customize Dostosuj - + Normal Normalny - + Maximum Maksymalny - + Fullscreen Pełny ekran - + This shortcut conflicts with system shortcut %1 Ten skrót jest w konflikcie ze skrótem systemowym %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately - Ten skrót jest w konflikcie z %1, kliknij Zamień, aby skrót zaczął działać od razu + Ten skrót jest w konflikcie z %1, kliknij Zastąp, aby go nadpisać - - + + + The shortcut %1 is invalid, please set another one. Skrót %1 jest nieprawidłowy, ustaw inny. - + Cancel Anuluj - + Replace Zamień - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Cofnij - + Redo Ponów - + Cut Wytnij - + Copy Kopiuj - + Paste Wklej - + Delete Usuń - + Select All Zaznacz wszystko - - + + Find Znajdź - - + + Replace Zamień - + Go to Line Przejdź do wiersza - + Turn on Read-Only mode Włącz tryb tylko-do-odczytu - + Turn off Read-Only mode Wyłącz tryb tylko-do-odczytu - + Fullscreen Pełny ekran - + Exit fullscreen Opuść pełny ekran - + Display in file manager Wyświetl w Menedżerze plików - - + + Add Comment Dodaj komentarz - + Text to Speech Tekst na mowę - + Stop reading Przestań czytać - + Speech to Text Mowa na tekst - + Translate Przetłumacz - + Column Mode Tryb kolumnowy - + Add bookmark Dodaj zakładkę - + Remove Bookmark Usuń zakładkę - + Previous bookmark Poprzednia zakładka - + Next bookmark Następna zakładka - + Remove All Bookmarks Usuń wszystkie zakładki - + Fold All Zwiń wszystko - + Fold Current Level Zwiń bieżący poziom - + Unfold All Rozwiń wszystko - + Unfold Current Level Rozwiń bieżący poziom - + Color Mark Kolor oznaczenia - + Clear All Marks Wyczyść wszystkie oznaczenia - + Clear Last Mark Wyczyść ostatnie oznaczenie - + Mark Oznacz - + Mark All Oznacz wszystko - + Remove Comment Usuń komentarz - + Copy failed: not enough memory Kopiowanie nieudane: niewystarczająca ilość pamięci - + Press ALT and click lines to edit in column mode Naciśnij ALT i kliknij wiersz, aby edytować w trybie kolumnowym - + Change Case Zmień wielkość znaków - + Upper Case Wielkie litery - + Lower Case Małe litery - + Capitalize Wielka litera - + None Brak - + Selected line(s) copied Skopiowano zaznaczone wiersz(e) - + Current line copied Skopiowano bieżący wiersz - + Selected line(s) clipped Wycięto zaznaczone wiersz(e) - + Current line clipped Wycięto bieżący wiersz - + Paste failed: not enough memory Wklejanie nieudane: niewystarczająca ilość pamięci - + Read-Only mode is off Tryb tylko-do-odczytu jest nieaktywny - - - - - + + + + + + Read-Only mode is on Tryb tylko-do-odczytu jest aktywny @@ -1121,129 +1177,129 @@ Window - + Save as Zapisz jako - + New window Nowe okno - + New tab Nowa karta - + Open file Otwórz plik - - + + Save Zapisz - + Print Drukuj - + Switch theme Przełącz motyw - - + + Settings Ustawienia - - + + Read-Only Tylko-do-odczytu - + You do not have permission to open %1 Nie posiadasz uprawnień do otwarcia %1 - - + + Invalid file: %1 Nieprawidłowy plik: %1 - - + + Do you want to save this file? Czy chcesz zapisać ten plik? - + You do not have permission to save %1 Nie posiadasz uprawnień do zapisania %1 - + Saved successfully Zapisano pomyślnie - - - + + + Save File Zapisz plik - + Encoding Kodowanie - + Read-Only mode is on Tryb tylko-do-odczytu jest aktywny - + Current location remembered Bieżąca pozycja kursora została zapamiętana - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Edytor - + Untitled %1 Bez tytułu %1 - + Cancel Anuluj - + Discard Odrzuć diff --git a/translations/deepin-editor_pt.ts b/translations/deepin-editor_pt.ts index 226d1717..39ae415d 100644 --- a/translations/deepin-editor_pt.ts +++ b/translations/deepin-editor_pt.ts @@ -16,13 +16,18 @@ Characters %1 Caracteres %1 + + + Loading: + A carregar: + DDropdownMenu - + + - None Nenhum @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Guardar - + Do you want to save this file? Quer guardar este ficheiro? - - + + Cancel Cancelar - + Encoding changed. Do you want to save the file now? A codificação foi alterada. Deseja guardar o ficheiro agora? - + Discard Descartar - + + You do not have permission to save %1 Não possui permissões para guardar %1 - + File removed on the disk. Save it now? Ficheiro removido no disco. Guardar agora? - + File has changed on disk. Reload? Ficheiro foi alterado no disco. Recarregar? - - + + INSERT INSERIR - + OVERWRITE SOBRESCREVER - + R/O A/L - + The file cannot be read, which may be too large or has been damaged! - + O ficheiro não pode ser lido, o mesmo pode ser demasiado grande ou ter sido danificado! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Ir para linha: @@ -134,6 +140,24 @@ Editor de texto + + PathSettingWgt + + + Remember the last used path + Lembrar o último caminho usado + + + + Same path as the current file + O mesmo caminho que o ficheiro atual + + + + Customize the default path + Personalizar o caminho predefinido + + QObject @@ -142,12 +166,13 @@ Editor de texto - - - - - - + + + + + + + Encoding Codificação @@ -184,8 +209,8 @@ - - + + Window Janela @@ -271,438 +296,467 @@ + Find Next + + + + + Find Previous + + + + Replace Substituir - + Go to line Ir para linha - + Save cursor position Guardar posição do cursor - + Reset cursor position Redefinir posição do cursor - + Exit Sair - + Display shortcuts Mostrar atalhos - + Print Imprimir - + Editor Editor - + Increase indent Aumentar indentação - + Decrease indent Diminuir indentação - + Forward character Avançar caracter - + Backward character Recuar caracter - + Forward word Avançar palavra - + Backward word Recuar palavra - + Next line Linha seguinte - + Previous line Linha anterior - + New line Nova linha - + New line above Nova linha acima - + New line below Nova linha abaixo - + Duplicate line Duplicar linha - + Delete to end of line Eliminar até ao fim da linha - + Delete current line Eliminar esta linha - + Swap line up Trocar para linha acima - + Swap line down Trocar para linha abaixo - + Scroll up one line Rolar uma linha para cima - + Scroll down one line Rolar uma linha para baixo - + Page up Página acima - + Page down Página abaixo - + Move to end of line Mover para o fim da linha - + Move to start of line Mover para o início da linha - + Move to end of text Mover para o fim do texto - + Move to start of text Mover para o início do texto - + Move to line indentation Mover para indentação da linha - + Upper case Maiúsculas - + Lower case Minúsculas - + Capitalize Maiúsculas - + Delete backward word Eliminar palavra anterior - + Delete forward word Eliminar palavra seguinte - + Forward over a pair Avançar em pares - + Backward over a pair Recuar em pares - + Select all Selecionar tudo - + Copy Copiar - + Cut Cortar - + Paste Colar - + Transpose character Transpor caracter - + Mark Marcar - + Unmark Desmarcar - + Copy line Copiar linha - + Cut line Cortar linha - + Merge lines Juntar linhas - + Read-Only mode Modo de Apenas-Leitura - + Add comment Adicionar comentário - + Remove comment Remover comentário - + Undo Anular - + Redo Refazer - + Add/Remove bookmark Adicionador/Remover marcador - + Move to previous bookmark Mover para o marcador anterior - + Move to next bookmark Mover para o marcador seguinte - + Advanced Avançado - + Window size Tamanho da janela - + Tab width Largura do separador - + + Paste by pressing a middle mouse button + Colar ao premir botão central do rato + + + + Startup + Início + + + + Reopen last closed tabs + Reabrir os últimos separadores fechadas + + + + Open/Save Settings + Definições Abrir/Guardar + + + Word wrap Quebra de linha - + Code folding flag Marcador de código minimizado - + Show line numbers Mostrar números de linha - + Show bookmarks icon Mostrar ícone de marcadores - + Show whitespaces and tabs Mostrar espaços em branco e separadores - + Highlight current line Destacar a linha atual - + Color mark Marca de cor - + Unicode Unicode - + WesternEuropean EuropeuOcidental - + CentralEuropean CentroEuropeu - + Baltic Báltico - + Cyrillic Cirílico - + Arabic Árabe - + Celtic Celta - + SouthEasternEuropean SudesteEuropeu - + Greek Grego - + Hebrew Hebraico - + ChineseSimplified ChinêsSimplificado - + ChineseTraditional ChinêsTradicional - + Japanese Japonês - + Korean Coreano - + Thai Tailandês - + Turkish Turco - + Vietnamese Vietnamita - + File not saved Ficheiro não guardado - - - + + Line Endings Terminações de linha @@ -752,58 +806,59 @@ Settings - + Standard Predefinição - + Customize Personalizar - + Normal Normal - + Maximum Máximo - + Fullscreen Ecrã Inteiro - + This shortcut conflicts with system shortcut %1 Este atalho entra em conflito com o atalho do sistema %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Esta tecla de atalho entra em conflito com %1, clique em Substituir para que esta tecla de atalho entre em vigor imediatamente - - + + + The shortcut %1 is invalid, please set another one. O atalho %1 é inválido, defina outro. - + Cancel Cancelar - + Replace Substituir - + OK Aceitar @@ -852,259 +907,260 @@ TextEdit - + Undo Anular - + Redo Refazer - + Cut Cortar - + Copy Copiar - + Paste Colar - + Delete Eliminar - + Select All Selecionar tudo - - + + Find Procurar - - + + Replace Substituir - + Go to Line Ir para linha - + Turn on Read-Only mode Ativar modo de Apenas-Leitura - + Turn off Read-Only mode Desativar modo de Apenas-Leitura - + Fullscreen Ecrã inteiro - + Exit fullscreen Sair de ecrã inteiro - + Display in file manager Mostrar no gestor de ficheiros - - + + Add Comment Adicionar comentário - + Text to Speech Texto para voz - + Stop reading Parar a leitura - + Speech to Text Voz para texto - + Translate Traduzir - + Column Mode Modo de coluna - + Add bookmark Adicionador marcador - + Remove Bookmark Remover marcador - + Previous bookmark Marcador anterior - + Next bookmark Marcador seguinte - + Remove All Bookmarks Remover todos os marcadores - + Fold All Minimizar tudo - + Fold Current Level Minimizar nível atual - + Unfold All Mostrar tudo - + Unfold Current Level Mostrar nível atual - + Color Mark Marca de cor - + Clear All Marks Limpar selecionados - + Clear Last Mark Limpar último selecionado - + Mark Marcar - + Mark All Marcar tudo - + Remove Comment Remover comentário - + Copy failed: not enough memory Falha ao copiar: não há memória suficiente - + Press ALT and click lines to edit in column mode Prima ALT e clique em linhas para editar em modo de coluna - + Change Case Maiúsculas e Minúsculas - + Upper Case Maiúsculas - + Lower Case Minúsculas - + Capitalize Maiúsculas - + None Nenhum - + Selected line(s) copied Linha(s) selecionada(s) copiada(s) - + Current line copied Linha atual copiada - + Selected line(s) clipped Linha(s) selecionada(s) cortada(s) - + Current line clipped Linha atual cortada - + Paste failed: not enough memory Falha ao colar: memória insuficiente - + Read-Only mode is off O modo de Apenas-Leitura está desligado - - - - - + + + + + + Read-Only mode is on O modo de Apenas-Leitura está ligado @@ -1121,129 +1177,129 @@ Window - + Save as Guardar como - + New window Nova janela - + New tab Novo separador - + Open file Abrir ficheiro - - + + Save Guardar - + Print Imprimir - + Switch theme Alterar tema - - + + Settings Definições - - + + Read-Only Apenas-Leitura - + You do not have permission to open %1 Não possui permissões para abrir %1 - - + + Invalid file: %1 Ficheiro inválido: %1 - - + + Do you want to save this file? Quer guardar este ficheiro? - + You do not have permission to save %1 Não possui permissões para guardar %1 - + Saved successfully Gravado com sucesso - - - + + + Save File Guardar ficheiro - + Encoding Codificação - + Read-Only mode is on O modo de Apenas-Leitura está ligado - + Current location remembered Localização atual memorizada - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Editor - + Untitled %1 Sem título %1 - + Cancel Cancelar - + Discard Descartar diff --git a/translations/deepin-editor_pt_BR.ts b/translations/deepin-editor_pt_BR.ts index fb97fdf4..213fb076 100644 --- a/translations/deepin-editor_pt_BR.ts +++ b/translations/deepin-editor_pt_BR.ts @@ -2,27 +2,32 @@ BottomBar - + Row Linha - + Column Coluna - + Characters %1 %1 Caracteres + + + Loading: + Carregando: + DDropdownMenu - - - + + + None Nenhum @@ -30,80 +35,86 @@ EditWrapper - - - - + + + + Save Salvar - + Do you want to save this file? Salvar este arquivo? - - + + Cancel Cancelar - + Encoding changed. Do you want to save the file now? Codificação alterada. Salvar? - + Discard Descartar - + + You do not have permission to save %1 Você não tem permissão para salvar %1 - + File removed on the disk. Save it now? Arquivo removido no disco. Salvar agora? - + File has changed on disk. Reload? O arquivo foi alterado no disco. Recarregar? - - + + INSERT INSERIR - + OVERWRITE SOBRESCREVER - + R/O R/O + + + The file cannot be read, which may be too large or has been damaged! + O arquivo não pode ser lido, ele pode ser muito grande ou está danificado! + FindBar - + Find Localizar - + Previous Anterior - + Next Próximo @@ -111,7 +122,7 @@ JumpLineBar - + Go to Line: Ir para Linha: @@ -119,585 +130,633 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. O Editor de Textos é uma ferramenta poderosa para visualizar e editar arquivos de texto. - + Text Editor Editor de Textos + + PathSettingWgt + + + Remember the last used path + Lembrar a última pasta usada + + + + Same path as the current file + A mesma pasta do arquivo atual + + + + Customize the default path + Personalizar a pasta padrão + + QObject - + Text Editor Editor de Textos - - - - - - + + + + + + + Encoding Codificação - + Basic Básico - + Font Style Estilo de Fonte - + Font Fonte - + Font Size Tamanho da Fonte - + Shortcuts Atalhos - - + + Keymap Mapear Teclado - - - + + + Window Janela - + New tab Nova Aba - + New window Nova janela - + Save Salvar - + Save as Salvar como - + Next tab Próxima aba - + Previous tab Aba anterior - + Close tab Fechar Aba - + Close other tabs Fechar outras abas - + Restore tab Restaurar aba - + Open file Abrir arquivo - + Increment font size Aumentar o tamanho da fonte - + Decrement font size Reduzir o tamanho da fonte - + Reset font size Redefinir o tamanho da fonte - + Help Ajuda - + Toggle fullscreen Alternar para a tela cheia - + Find Localizar - + + Find Next + Encontrar próximo + + + + Find Previous + Encontrar anterior + + + Replace Substituir - + Go to line Ir para linha - + Save cursor position Salvar a posição do cursor - + Reset cursor position Redefinir a posição do cursor - + Exit Sair - + Display shortcuts Exibir atalhos - + Print Imprimir - + Editor Editor de Textos - + Increase indent Aumentar recuo - + Decrease indent Reduzir recuo - + Forward character Caractere à Frente - + Backward character Caractere Atrás - + Forward word Palavra à frente - + Backward word Palavra para trás - + Next line Próxima linha - + Previous line Linha anterior - + New line Nova linha - + New line above Nova linha acima - + New line below Nova linha inferior - + Duplicate line Duplicar Linha - + Delete to end of line Excluir até o final da linha - + Delete current line Excluir a linha atual - + Swap line up Inverter com a linha superior - + Swap line down Inverter com a linha inferior - + Scroll up one line Subir uma linha - + Scroll down one line Rolar uma Linha para Baixo - + Page up Página acima - + Page down Uma página abaixo - + Move to end of line Ir para o Final da Linha - + Move to start of line Mover para o início da linha - + Move to end of text Mover para o final do texto - + Move to start of text Mover para o início do texto - + Move to line indentation Ir à indentação da linha - + Upper case Maiúscula - + Lower case Minúscula - + Capitalize Autocapitalizar - + Delete backward word Excluir a palavra anterior - + Delete forward word Excluir a palavra seguinte - + Forward over a pair Ir um par à frente - + Backward over a pair Ir um par para trás - + Select all Selecionar tudo - + Copy Copiar - + Cut Recortar - + Paste Colar - + Transpose character Inverter caractere - + Mark Marcar - + Unmark Desmarcar - + Copy line Copiar Linha - + Cut line Cortar Linha - + Merge lines Mesclar linhas - + Read-Only mode Modo Somente Leitura - + Add comment Adicionar comentário - + Remove comment Remover comentário - + Undo Desfazer - + Redo Refazer - + Add/Remove bookmark Adicionar/Remover marcador - + Move to previous bookmark Mover para o marcador anterior - + Move to next bookmark Mover para o próximo marcador - + Advanced Avançado - + Window size Tamanho da janela - + Tab width Largura da Guia - + + Paste by pressing a middle mouse button + Colar ao apertar o botão central do mouse + + + + Startup + Inicialização + + + + Reopen last closed tabs + Reabrir as últimas abas fechadas + + + + Open/Save Settings + Configurações de Abrir/Salvar + + + Word wrap Quebra de linha - + Code folding flag Bandeira de código dobrável - + Show line numbers Exibir os números das linhas - + Show bookmarks icon Exibir o ícone dos marcadores - + Show whitespaces and tabs Exibir os espaços em branco e as abas - + Highlight current line Destacar a linha atual - + Color mark Marca colorida - + Unicode Unicode - + WesternEuropean Europa Ocidental - + CentralEuropean Europa Central - + Baltic Báltico - + Cyrillic Cirílico - + Arabic Árabe - + Celtic Celta - + SouthEasternEuropean Sudeste Europeu - + Greek Grego - + Hebrew Hebraico - + ChineseSimplified Chinês Simplificado - + ChineseTraditional Chinês Tradicional - + Japanese Japonês - + Korean Coreano - + Thai Tailandês - + Turkish Turco - + Vietnamese Vietnamita - + File not saved Arquivo não salvo - - - + + Line Endings Terminações de Linha @@ -705,32 +764,32 @@ ReplaceBar - + Find Localizar - + Replace With Substituir com - + Replace Substituir - + Skip Ignorar - + Replace Rest Substituir o Restante - + Replace All Substituir Tudo @@ -747,58 +806,59 @@ Settings - + Standard Padrão - + Customize Personalizar - + Normal Normal - + Maximum Maximizado - + Fullscreen Tela Cheia - + This shortcut conflicts with system shortcut %1 Este atalho entra em conflito com o atalho %1 do sistema - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Este atalho entra em conflito com %1; clique em Substituir para efetivar esse atalho imediatamente - - + + + The shortcut %1 is invalid, please set another one. O atalho %1 é inválido; defina outro. - + Cancel Cancelar - + Replace Substituir - + OK Ok @@ -806,7 +866,7 @@ StartManager - + Untitled %1 Sem título %1 @@ -814,32 +874,32 @@ Tabbar - + Close tab Fechar Aba - + Close other tabs Fechar outras abas - + More options Mais opções - + Close tabs to the left Fechar as abas à esquerda - + Close tabs to the right Fechar as abas à direita - + Close unmodified tabs Fechar as abas não modificadas @@ -847,261 +907,260 @@ TextEdit - + Undo Desfazer - + Redo Refazer - + Cut Recortar - + Copy Copiar - + Paste Colar - + Delete Excluir - + Select All Selecionar Tudo - - + + Find Localizar - - + + Replace Substituir - + Go to Line Ir para Linha - + Turn on Read-Only mode Ativar o modo Somente Leitura - + Turn off Read-Only mode Desativar o modo Somente Leitura - + Fullscreen Tela Cheia - + Exit fullscreen Sair da tela cheia - + Display in file manager Exibir no Gerenciador de Arquivos - - + + Add Comment Adicionar Comentário - + Text to Speech Texto em Voz - + Stop reading Parar a leitura - + Speech to Text Voz em Texto - + Translate Traduzir - + Column Mode Modo de Coluna - + Add bookmark Adicionar marcador - + Remove Bookmark Remover Marcador - + Previous bookmark Marcador anterior - + Next bookmark Próximo marcador - + Remove All Bookmarks Remover Todos os Marcadores - + Fold All Dobrar Tudo - + Fold Current Level Dobrar o Nível Atual - + Unfold All Desdobrar Tudo - + Unfold Current Level Desdobrar o Nível Atual - + Color Mark Marca Colorida - + Clear All Marks Limpar Todas as Marcações - + Clear Last Mark Limpar a Última Marcação - + Mark Marcar - + Mark All Marcar Tudo - + Remove Comment Remover Comentário - Failed to paste text: it is too large - - - - + Copy failed: not enough memory - + Falha ao copiar: não há memória suficiente. - + Press ALT and click lines to edit in column mode Pressione ALT e clique nas linhas para editar no modo de coluna - + Change Case Alterar entre Maiúscula e Minúscula - + Upper Case Maiúscula - + Lower Case Minúscula - + Capitalize Autocapitalizar - + None Nenhum - + Selected line(s) copied Linha(s) selecionada(s) copiada(s) - + Current line copied Linha atual copiada - + Selected line(s) clipped Linha(s) selecionada(s) recortada(s) - + Current line clipped Linha atual recortada - + Paste failed: not enough memory - + Falha ao colar: memória insuficiente - + Read-Only mode is off O modo Somente Leitura está desativado - - - + + + + + + Read-Only mode is on O modo Somente Leitura está ativado @@ -1109,7 +1168,7 @@ WarningNotices - + Reload Recarregar @@ -1117,129 +1176,130 @@ Window - - + + Save as Salvar como - + New window Nova janela - + New tab Nova aba - + Open file Abrir arquivo - - + + Save Salvar - + Print Imprimir - + Switch theme Alternar tema - - + + Settings Configurações - - + + Read-Only Somente-Leitura - + You do not have permission to open %1 Você não tem permissão para abrir %1 - + + Invalid file: %1 Arquivo Inválido: %1 - - + + Do you want to save this file? Salvar este arquivo? - + You do not have permission to save %1 Você não tem permissão para salvar %1 - + Saved successfully Salvo - - - + + + Save File Salvar Arquivo - + Encoding Codificação - + Read-Only mode is on O modo Somente Leitura está ativado - + Current location remembered Lembrar o local atual - + Ctrl+'=' Ctrl + = - + Ctrl+'-' Ctrl + - - + Editor Editor de Textos - + Untitled %1 Sem título %1 - + Cancel Cancelar - + Discard Descartar diff --git a/translations/deepin-editor_ru.ts b/translations/deepin-editor_ru.ts index 934dc449..fc4692fb 100644 --- a/translations/deepin-editor_ru.ts +++ b/translations/deepin-editor_ru.ts @@ -16,13 +16,18 @@ Characters %1 Символы %1 + + + Loading: + Загрузка: + DDropdownMenu - + + - None Ничего @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Сохранить - + Do you want to save this file? Вы хотите сохранить этот документ? - - + + Cancel Отмена - + Encoding changed. Do you want to save the file now? Кодирование изменилось. Вы хотите сохранить файл сейчас? - + Discard Забыть - + + You do not have permission to save %1 Вы не имеете разрешения на сохранение %1 - + File removed on the disk. Save it now? Файл удален на диске. Сохранить его сейчас? - + File has changed on disk. Reload? Файл изменился на диске. Обновить? - - + + INSERT ВСТАВИТЬ - + OVERWRITE ПЕРЕЗАПИСАТЬ - + R/O Т/Ч - + The file cannot be read, which may be too large or has been damaged! - + Файл не может быть прочитан, возможно, он слишком велик или поврежден! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Перейти к Строке: @@ -134,6 +140,24 @@ Текстовый Редактор + + PathSettingWgt + + + Remember the last used path + Запомнить последний использованный путь + + + + Same path as the current file + Тот же путь, что и к текущему файлу + + + + Customize the default path + Настройка пути по умолчанию + + QObject @@ -142,12 +166,13 @@ Текстовый редактор - - - - - - + + + + + + + Encoding Кодировка @@ -184,8 +209,8 @@ - - + + Window Окно @@ -271,438 +296,467 @@ + Find Next + Найти далее + + + + Find Previous + Найти ранее + + + Replace Заменить - + Go to line Перейти к строке - + Save cursor position Сохранить позицию курсора - + Reset cursor position Сбросить позицию курсора - + Exit Выйти - + Display shortcuts Показать горячие клавиши - + Print Печать - + Editor Редактор - + Increase indent Показать ярлыки - + Decrease indent Уменьшить отступ - + Forward character Символ спереди - + Backward character Символ задом наперёд - + Forward word Начальное слово - + Backward word Последнее слово - + Next line Следующая строка - + Previous line Предыдущая строка - + New line Новая строка - + New line above Новая строка выше - + New line below Новая строка ниже - + Duplicate line Дублированная строка - + Delete to end of line Удалить конец строки - + Delete current line Удалить текущую строку - + Swap line up заменить верхнюю строку - + Swap line down Заменить нижнюю строку - + Scroll up one line Прокрутка вверх на одну строку - + Scroll down one line Прокрутка вниз на одну строку - + Page up Страница вверх - + Page down Страница вниз - + Move to end of line Переход к конецу строки - + Move to start of line Переход к началу строки - + Move to end of text Переход к концу текста - + Move to start of text Переход к началу текста - + Move to line indentation Переход к строке отступа - + Upper case Верхний регистр - + Lower case Нижний регистр - + Capitalize Прописной - + Delete backward word Удалить слово с конца - + Delete forward word Удалить слово с начала - + Forward over a pair Вперед по паре - + Backward over a pair Назад по паре - + Select all Выбрать всё - + Copy Копировать - + Cut Вырезать - + Paste Вставить - + Transpose character Перемещаемый символ - + Mark Пометить - + Unmark Снять отметку - + Copy line Копировать строку - + Cut line Вырезать строку - + Merge lines Совместить строки - + Read-Only mode Режим Только Чтение - + Add comment Добавить комментарий - + Remove comment Удалить комментарий - + Undo Отменить - + Redo Готово - + Add/Remove bookmark Добавить/удалить закладку - + Move to previous bookmark К предыдущей закладке - + Move to next bookmark К следующей закладке - + Advanced Расширенные - + Window size Размер окна - + Tab width Ширина вкладки - + + Paste by pressing a middle mouse button + Вставить, нажав среднюю кнопку мыши + + + + Startup + Запуск + + + + Reopen last closed tabs + Снова открыть последние закрытые вкладки + + + + Open/Save Settings + Открыть/сохранить параметры + + + Word wrap Перенос cлова - + Code folding flag Флаг сворачивания кода - + Show line numbers Показать номера строк - + Show bookmarks icon Показать значок закладок - + Show whitespaces and tabs Показать пробелы и табуляции - + Highlight current line Выделить текущую строку - + Color mark Цветная метка - + Unicode Unicode - + WesternEuropean Западноевропейский - + CentralEuropean Центральноевропейский - + Baltic Балтийский - + Cyrillic Кириллица - + Arabic Арабский - + Celtic Кельтский - + SouthEasternEuropean Юго-Восточная Европа - + Greek Греческий - + Hebrew Еврейский - + ChineseSimplified Китайский упрощенный - + ChineseTraditional Китайский традиционный - + Japanese Японский - + Korean Корейский - + Thai Тайландский - + Turkish Турецкий - + Vietnamese Вьетнамский - + File not saved Файл не сохранен - - - + + Line Endings Окончание строк @@ -752,58 +806,59 @@ Settings - + Standard Стандартный - + Customize Настроить - + Normal Обычный - + Maximum Максимум - + Fullscreen Полный экран - + This shortcut conflicts with system shortcut %1 Это сочетание конфликтует с системным сочитанием %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Это сочетание конфликтует с %1, нажмите Заменить, чтобы это сочетание вступило в силу немедленно - - + + + The shortcut %1 is invalid, please set another one. Сочетание %1 недействительно, установите другое. - + Cancel Отмена - + Replace Заменить - + OK OK @@ -852,259 +907,260 @@ TextEdit - + Undo Отменить - + Redo Готово - + Cut Вырезать - + Copy Копировать - + Paste Вставить - + Delete Удалить - + Select All Выбрать всё - - + + Find Найти - - + + Replace Заменить - + Go to Line Перейти к строке - + Turn on Read-Only mode Включить режим Только Чтение - + Turn off Read-Only mode Отключить режим Только Чтение - + Fullscreen Полноэкранный режим - + Exit fullscreen Выйти из полноэкранного режима - + Display in file manager Показать в файловом менеджере - - + + Add Comment Добавить комментарий - + Text to Speech Текст в речь - + Stop reading Прекратить читать - + Speech to Text Речь в текст - + Translate Перевести - + Column Mode Режим колонки - + Add bookmark Добавить закладку - + Remove Bookmark Удалить закладку - + Previous bookmark Предыдущая закладка - + Next bookmark Следующая закладка - + Remove All Bookmarks Удалить все закладки - + Fold All Свернуть всё - + Fold Current Level Свернуть текущий уровень - + Unfold All Развернуть всё - + Unfold Current Level Развернуть текущий уровень - + Color Mark Цветная метка - + Clear All Marks Очистить все метки - + Clear Last Mark Очистить последнюю метку - + Mark Пометить - + Mark All Пометить всё - + Remove Comment Удалить комментарий - + Copy failed: not enough memory Копирование не удалось: недостаточно памяти - + Press ALT and click lines to edit in column mode Нажмите ALT и щелкните строки для редактирования в режиме колонки - + Change Case Изменить регистр - + Upper Case Верхний регистр - + Lower Case Нижний регистр - + Capitalize Заглавные буквы - + None Ничего - + Selected line(s) copied Выбранные строки скопированы - + Current line copied Текущая строка скопирована - + Selected line(s) clipped Выбранные строки обрезаны - + Current line clipped Текущая строка отрезана - + Paste failed: not enough memory Вставка не удалось: недостаточно памяти - + Read-Only mode is off Режим Только Чтение отключён - - - - - + + + + + + Read-Only mode is on Режим Только Чтение включён @@ -1121,129 +1177,129 @@ Window - + Save as Сохранить как - + New window Новое окно - + New tab Новая вкладка - + Open file Открыть файл - - + + Save Сохранить - + Print Печать - + Switch theme Переключить тему - - + + Settings Настройки - - + + Read-Only Только Чтение - + You do not have permission to open %1 Вы не имеете разрешения на открытие %1 - - + + Invalid file: %1 Недопустимый файл: %1 - - + + Do you want to save this file? Вы хотите сохранить этот документ? - + You do not have permission to save %1 Вы не имеете разрешения на сохранение %1 - + Saved successfully Успешно сохранено - - - + + + Save File Сохранить Файл - + Encoding Кодировка - + Read-Only mode is on Режим Только Чтение включён - + Current location remembered Текущее местоположение запомнилось - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Редактор - + Untitled %1 Без названия %1 - + Cancel Отмена - + Discard Отмена diff --git a/translations/deepin-editor_sl.ts b/translations/deepin-editor_sl.ts index 7374cacd..10cfd001 100644 --- a/translations/deepin-editor_sl.ts +++ b/translations/deepin-editor_sl.ts @@ -16,13 +16,18 @@ Characters %1 Znakov %1 + + + Loading: + + DDropdownMenu - + + - None brez @@ -30,67 +35,68 @@ EditWrapper - - - - + + + + Save Shrani - + Do you want to save this file? Bi radi shranili to datoteko? - - + + Cancel Prekini - + Encoding changed. Do you want to save the file now? Kodiranje je bilo spremenjeno. Želite sedaj shraniti to datoteko? - + Discard Opusti - + + You do not have permission to save %1 Nimate pravic za shranjevanje %1 - + File removed on the disk. Save it now? Datoteka je bila odstranjena z diska. Shranim sedaj? - + File has changed on disk. Reload? Datoteka je bila spremenjena na disku. Ponovno naložim? - - + + INSERT VSTAVI - + OVERWRITE PREPIŠI - + R/O S/B - + The file cannot be read, which may be too large or has been damaged! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Skok na vrstico: @@ -134,6 +140,24 @@ Urejevalnik besedil + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject @@ -142,12 +166,13 @@ Urejevalnik besedil - - - - - - + + + + + + + Encoding Kodiranje @@ -184,8 +209,8 @@ - - + + Window Okno @@ -271,438 +296,467 @@ + Find Next + + + + + Find Previous + + + + Replace Zamenjaj - + Go to line Skok na vrstico - + Save cursor position Shrani položaj kurzorja - + Reset cursor position Ponastavi položaj kurzorja - + Exit Izhod - + Display shortcuts Prikaži bljižnice - + Print Tiskanje - + Editor Urejevalnik - + Increase indent Povečaj zamik - + Decrease indent Zmanjšaj zamik - + Forward character Znak naprej - + Backward character Znak nazaj - + Forward word Besedo naprej - + Backward word Besedo nazaj - + Next line Naslednja vrstica - + Previous line Prejšnja vrstica - + New line Nova vrstica - + New line above Nova vrstica zograj - + New line below Nova vrstica spodaj - + Duplicate line Podvoji vrstico - + Delete to end of line Izbriši do konca vrstice - + Delete current line Izbriši trenutno vrstico - + Swap line up Zamenja vrstico navzgor - + Swap line down Zamenjaj vrstico navzdol - + Scroll up one line Pomakni eno vrstico navzgor - + Scroll down one line Pomakni eno vrstico navzdol - + Page up Prejšnja stran - + Page down Naslednja stran - + Move to end of line Na konec vrstice - + Move to start of line Na začetek vrstice - + Move to end of text Na konec besedila - + Move to start of text Na začetek besedila - + Move to line indentation Na zamik vrstice - + Upper case Velike črke - + Lower case Male črke - + Capitalize Velika začetnica - + Delete backward word Izbriši prejšnjo besedo - + Delete forward word briši naslednjo besedo - + Forward over a pair Naprej preko para - + Backward over a pair Nazaj preko para - + Select all Izberi vse - + Copy Kopiraj - + Cut Izreži - + Paste Prilepi - + Transpose character Spremeni velikost znaka - + Mark Označi - + Unmark Odznači - + Copy line Kopiraj vrstico - + Cut line Izreži vrstico - + Merge lines Združi vrstice - + Read-Only mode Samo branje - + Add comment Dodaj komentar - + Remove comment Odstrani komentar - + Undo razveljavi - + Redo Uveljavi - + Add/Remove bookmark Dodaj/odstrani zaznamek - + Move to previous bookmark Na prejšnji zaznamek - + Move to next bookmark Na naslednji zaznamek - + Advanced Napredno - + Window size Velikost okna - + Tab width Širina zavihka - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap Deljenje besed - + Code folding flag Zastavica za zlaganje kode - + Show line numbers Prikaži teilko vrstice - + Show bookmarks icon Prikaži ikone zaznamkov - + Show whitespaces and tabs Prikaži presledke in tabulatorje - + Highlight current line Osvetli trenutno vrstico - + Color mark barvna oznaka - + Unicode Unicode - + WesternEuropean Zahodnoevropski - + CentralEuropean Srednjeevropski - + Baltic Baltik - + Cyrillic Cirilica - + Arabic Arabsko - + Celtic Keltsko - + SouthEasternEuropean JugovzhodnaEvropa - + Greek Grško - + Hebrew Hebrejsko - + ChineseSimplified KitajščinaPoenostavljena - + ChineseTraditional KitajščinaTradicionalna - + Japanese Japonsko - + Korean Korejsko - + Thai Tajsko - + Turkish Turško - + Vietnamese Vietnamsko - + File not saved Datoteka ni bila shranjena - - - + + Line Endings Zaključki vrstic @@ -752,58 +806,59 @@ Settings - + Standard Standardno - + Customize Prilagodi - + Normal Normalno - + Maximum Maksimalno - + Fullscreen Celozaslonsko - + This shortcut conflicts with system shortcut %1 Ta bljižnica je enaka sistemski bližnjici %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Ta bližnjica je enaka kot %1. Kliknite na Zamenjaj, da jo nemudoma vklopite - - + + + The shortcut %1 is invalid, please set another one. Bližnjica %1 ni veljavna. Določite drugo. - + Cancel Prekini - + Replace Zamenjaj - + OK V redu @@ -852,259 +907,260 @@ TextEdit - + Undo razveljavi - + Redo Uveljavi - + Cut Izreži - + Copy Kopiraj - + Paste Prilepi - + Delete Izbriši - + Select All Označi vse - - + + Find Najdi - - + + Replace Zamenjaj - + Go to Line Skok na vrstico - + Turn on Read-Only mode Vklopi samo branje - + Turn off Read-Only mode Izklopi samo branje - + Fullscreen Celozaslonsko - + Exit fullscreen Zapri celozaslonski način - + Display in file manager Prikaži v upravljalniku datotek - - + + Add Comment Dodaj komentar - + Text to Speech Besedilo v govor - + Stop reading Zaustavi branje - + Speech to Text Govor v besedilo - + Translate Prevedi - + Column Mode Stolpčni način - + Add bookmark Dodaj zaznamek - + Remove Bookmark Odstrani zaznamek - + Previous bookmark Prejšnji zaznamek - + Next bookmark Naslednji zaznamek - + Remove All Bookmarks Odstrani vse zaznamke - + Fold All Zloži vse - + Fold Current Level Zloži trenutni nivo - + Unfold All Razpri vse - + Unfold Current Level Razpri trenutni nivo - + Color Mark Barvna oznaka - + Clear All Marks Odstrani vse oznake - + Clear Last Mark Odstrani zadnjo oznako - + Mark Označi - + Mark All Označi vse - + Remove Comment Odstrani komentar - + Copy failed: not enough memory Kopiranje ni uspelo: ni dovolj pomnilnika - + Press ALT and click lines to edit in column mode Pritisnite ALT in kliknite na vrstice za urejanje v stolpcu - + Change Case Spremeni velikost črk - + Upper Case Velike črke - + Lower Case Male črke - + Capitalize Velika začetnica - + None brez - + Selected line(s) copied Izbrane vrstice so bile kopirane - + Current line copied Trenutna vrstica je bila skopirana - + Selected line(s) clipped Izbrane vrstice so bile porezane - + Current line clipped Trenutna vrstica je bila porezana - + Paste failed: not enough memory Kopiranje ni uspelo: ni dovolj pomnilnika - + Read-Only mode is off Samo branje je izklopljeno - - - - - + + + + + + Read-Only mode is on Vklopljeno je samo branje @@ -1121,129 +1177,129 @@ Window - + Save as Shrani kot - + New window Novo okno - + New tab Nov zavihek - + Open file Odpir datoteko - - + + Save Shrani - + Print Tiskanje - + Switch theme Zamenjaj temo - - + + Settings nastavitve - - + + Read-Only Samo branje - + You do not have permission to open %1 Nimate pravic za odpiranje %1 - - + + Invalid file: %1 Napačna datoteka: %1 - - + + Do you want to save this file? Bi radi shranili to datoteko? - + You do not have permission to save %1 Nimate pravic za shranjevanje %1 - + Saved successfully Uspešno shranjeno - - - + + + Save File Shrani datoteko - + Encoding Kodiranje - + Read-Only mode is on Vklopljeno je samo branje - + Current location remembered Trenutni položaj je shranjen - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Urejevalnik - + Untitled %1 Neimenovano %1 - + Cancel Prekini - + Discard Opusti diff --git a/translations/deepin-editor_sq.ts b/translations/deepin-editor_sq.ts index 4f14107e..d9ca9410 100644 --- a/translations/deepin-editor_sq.ts +++ b/translations/deepin-editor_sq.ts @@ -16,13 +16,18 @@ Characters %1 Shenja %1 + + + Loading: + Po ngarkohet: + DDropdownMenu - + + - None Asnjë @@ -30,65 +35,71 @@ EditWrapper - - - - + + + + Save Ruaje - + Do you want to save this file? Doni të ruhet kjo kartelë? - - + + Cancel Anuloje - + Encoding changed. Do you want to save the file now? Kodimi ndryshoi. Doni të ruhet kartela tani? - + Discard Hidhe Tej - + + You do not have permission to save %1 S’keni leje të ruani %1 - + File removed on the disk. Save it now? Kartela u hoq nga disku. Të ruhet tani? - + File has changed on disk. Reload? Kartela ka ndryshuar në disk. Të ringarkohet? - - + + INSERT FUTE - + OVERWRITE MBISHKRUAJE - + R/O V/L + + + The file cannot be read, which may be too large or has been damaged! + Kartela s’mund të lexohet, ngaqë mund të jetë shumë e madhe, ose është dëmtuar! + The file cannot be read, which may be too large or has been damaged! @@ -116,7 +127,7 @@ JumpLineBar - + Go to Line: Shko te Rreshti: @@ -134,6 +145,24 @@ Përpunues Tekstesh + + PathSettingWgt + + + Remember the last used path + Mbaj mend shtegun e përdorur së fundi + + + + Same path as the current file + I njëjti shteg me kartelën e tanishme + + + + Customize the default path + Përshtatni shtegun parazgjedhje + + QObject @@ -142,12 +171,13 @@ Përpunues Tekstesh - - - - - - + + + + + + + Encoding Kodim @@ -184,8 +214,8 @@ - - + + Window Dritare @@ -271,438 +301,467 @@ + Find Next + Gjej Pasuesen + + + + Find Previous + Gjej të Mëparshmen + + + Replace Zëvendësoje - + Go to line Shko te rreshti - + Save cursor position Ruaj pozicionin e kursorit - + Reset cursor position Zero pozicionin e kursorit - + Exit Dil - + Display shortcuts Shfaq shkurtore - + Print Shtype - + Editor Përpunues - + Increase indent Rrit hapësirë kryeradhe - + Decrease indent Zvogëlo hapësirë kryeradhe - + Forward character - + Backward character - + Forward word Fjala përpara - + Backward word Fjala prapa - + Next line Rreshti pasues - + Previous line Rreshti i mëparshëm - + New line Rresht i ri - + New line above Rresht i ri sipër - + New line below Rresht i ri poshtë - + Duplicate line Përsëdyte rreshtin - + Delete to end of line Fshije deri në fund të rreshtit - + Delete current line Fshi rreshtin e tanishëm - + Swap line up Këmbeje me rreshtin sipër - + Swap line down Këmbeje me rreshtin poshtë - + Scroll up one line Ngjitu një rresht më sipër - + Scroll down one line Zbrit një rresht më poshtë - + Page up Page Up - + Page down Page Down - + Move to end of line Kalo te fund rreshti - + Move to start of line Kalo në fillim rreshti - + Move to end of text Kalo në fund të tekstit - + Move to start of text Kalo në fillim të tekstit - + Move to line indentation Kalo te kryeradhë rreshti - + Upper case Shkronja të mëdha - + Lower case Shkronja të vogla - + Capitalize Kaloje Në Shkronjë të Madhe - + Delete backward word Fshi fjalën prapa - + Delete forward word Fshi fjalën përpara - + Forward over a pair Përpara tej një dysheje - + Backward over a pair Mbrapsht tej një dysheje - + Select all Përzgjidhe krejt - + Copy Kopjoje - + Cut Prije - + Paste Ngjite - + Transpose character Ndërkëmbe shenjën - + Mark Vëri shenjë - + Unmark Hiqja shenjën - + Copy line Kopjo rreshtin - + Cut line Prije rreshtin - + Merge lines Përzie rreshta - + Read-Only mode Mënyrë “Vetëm Për Lexim” - + Add comment Shtoni koment - + Remove comment Hiqe komentin - + Undo Zhbëje - + Redo Ribëje - + Add/Remove bookmark Shtoni/Hiqni faqerojtës - + Move to previous bookmark Kalo te faqerojtësi i mëparshëm - + Move to next bookmark Kalo te faqerojtësi pasues - + Advanced Të mëtejshme - + Window size Madhësi dritareje - + Tab width Gjerësi Tabulacioni - + + Paste by pressing a middle mouse button + Ngjiteni duke shtypur butonin e mesit të miut + + + + Startup + Nisje + + + + Reopen last closed tabs + Rihap skedat e mbyllura në fund + + + + Open/Save Settings + Hapni/Ruani Rregullimet + + + Word wrap Mbështjellje fjale - + Code folding flag Shenjë për mbështjellje kodi - + Show line numbers Shfaq numra rreshtash - + Show bookmarks icon Shfaq ikonë faqerojtësish - + Show whitespaces and tabs Shfaq hapësira të zbrazëta dhe tabulacione - + Highlight current line Thekso rreshtin e tanishëm - + Color mark Shenjë ngjyre - + Unicode Unikod - + WesternEuropean Europiane Perëndimore - + CentralEuropean Europiane Qendrore - + Baltic Baltike - + Cyrillic Cirilike - + Arabic Arabe - + Celtic Kelte - + SouthEasternEuropean Europiane Juglindore - + Greek Greke - + Hebrew Hebraishte - + ChineseSimplified Kineze të Thjeshtuara - + ChineseTraditional Kineze Tradicionale - + Japanese Japoneze - + Korean Koreane - + Thai Tajlandeze - + Turkish Turke - + Vietnamese Vietnameze - + File not saved Kartela s’u ruajt - - - + + Line Endings Funde Rreshtash @@ -752,58 +811,59 @@ Settings - + Standard Standarde - + Customize Përshtateni - + Normal Normale - + Maximum Maksimum - + Fullscreen Sa krejt ekrani - + This shortcut conflicts with system shortcut %1 Kjo shkurtore përplaset me shkurtoren e sistemit %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Kjo shkurtore përplaset me %1, klikoni mbi Zëvendësoje për ta bërë këtë shkurtore të hyjë në fuqi menjëherë - - + + + The shortcut %1 is invalid, please set another one. Shkurtorja %1 është e pavlefshme, ju lutemi, caktoni një tjetër. - + Cancel Anuloje - + Replace Zëvendësoje - + OK OK @@ -852,259 +912,260 @@ TextEdit - + Undo Zhbëje - + Redo Ribëje - + Cut Prije - + Copy Kopjoje - + Paste Ngjite - + Delete Fshije - + Select All Përzgjidhi Krejt - - + + Find Gjej - - + + Replace Zëvendësoje - + Go to Line Shko te Rreshti - + Turn on Read-Only mode Aktivizo mënyrën “Vetëm Për Lexim” - + Turn off Read-Only mode Çaktivizo mënyrën “Vetëm Për Lexim” - + Fullscreen Sa krejt ekrani - + Exit fullscreen Dil nga mënyra sa krejt ekrani - + Display in file manager Shfaqe në përgjegjës kartelash - - + + Add Comment Shtoni Koment - + Text to Speech Nga Tekst Në të Folur - + Stop reading Ndale leximin - + Speech to Text Nga e Folur Në Tekst - + Translate Përkthejeni - + Column Mode Mënyrë Shtylla - + Add bookmark Shtoni faqerojtës - + Remove Bookmark Hiqe Faqerojtësin - + Previous bookmark Faqerojtësi i mëparshëm - + Next bookmark Faqerojtësi pasues - + Remove All Bookmarks Hiqi Krejt Faqerojtësit - + Fold All Palosi Krejt - + Fold Current Level Palos Nivelin e Tanishëm - + Unfold All Shpalosi Krejt - + Unfold Current Level Shpalos Nivelin e Tanishëm - + Color Mark Shenjë Ngjyre - + Clear All Marks Hiqi Krejt Shenjat - + Clear Last Mark Spastro Shenjën e Fundit - + Mark Vëri shenjë - + Mark All Vëru Shenjë të Tërëve - + Remove Comment Hiqe Komentin - + Copy failed: not enough memory Kopjimi dështoi: s’ka kujtesë të mjaftueshme - + Press ALT and click lines to edit in column mode Shtypni tastin ALT dhe klikoni mbi rreshtat që të përpunohen nën mënyrën shtyllë - + Change Case Këmbe Shkronja - + Upper Case Kaloje në Shkronja të Mëdha - + Lower Case Kaloje në Shkronja të Vogla - + Capitalize Kaloje Në Shkronjë të Madhe - + None Asnjë - + Selected line(s) copied U kopjua rreshti(at) i përzgjedhur - + Current line copied U kopjua rreshti i tanishëm - + Selected line(s) clipped Rreshti(at) i përzgjedhur u qeth - + Current line clipped Rreshti i tanishëm u qeth - + Paste failed: not enough memory Ngjitja dështoi: kujtesë e pamjaftueshme - + Read-Only mode is off Mënyra “Vetëm Për Lexim” është off - - - - - + + + + + + Read-Only mode is on Mënyra “Vetëm Për Lexim” është on @@ -1121,129 +1182,129 @@ Window - + Save as Ruaje si - + New window Dritare e re - + New tab Skedë e re - + Open file Hap kartelë - - + + Save Ruaje - + Print Shtype - + Switch theme Këmbeni temë - - + + Settings Rregullime - - + + Read-Only Vetëm-Lexim - + You do not have permission to open %1 S’keni leje të hapni %1 - - + + Invalid file: %1 Kartelë e pavlefshme: %1 - - + + Do you want to save this file? Doni të ruhet kjo kartelë? - + You do not have permission to save %1 S’keni leje të ruani %1 - + Saved successfully U ruajt me sukses - - - + + + Save File Ruaje Kartelën - + Encoding Kodim - + Read-Only mode is on Mënyra “Vetëm Për Lexim” është on - + Current location remembered Vendi i tanishëm u mbajt mend - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Përpunues - + Untitled %1 %1 pa titull - + Cancel Anuloje - + Discard Hidhe Tej diff --git a/translations/deepin-editor_sr.ts b/translations/deepin-editor_sr.ts index 3c5b0a4d..f9fbfafe 100644 --- a/translations/deepin-editor_sr.ts +++ b/translations/deepin-editor_sr.ts @@ -2,27 +2,32 @@ BottomBar - + Row Ред - + Column Колона - + Characters %1 Карактера %1 + + + Loading: + + DDropdownMenu - - - + + + None Ништа @@ -30,80 +35,86 @@ EditWrapper - - - - + + + + Save Сачувај - + Do you want to save this file? Желите ли да сачувате ову датотеку? - - + + Cancel Откажи - + Encoding changed. Do you want to save the file now? Промењено кодирање. Желите ли да сачувате датотеку сад? - + Discard Одбаци - + + You do not have permission to save %1 Немате дозволу да сачувате %1 - + File removed on the disk. Save it now? Датотека је уклоњена са диска. Сачувајте је сад? - + File has changed on disk. Reload? Датотека је промењена на диску. Поново учитати? - - + + INSERT УМЕТНИ - + OVERWRITE ПРЕПИШИ - + R/O С/Ч + + + The file cannot be read, which may be too large or has been damaged! + + FindBar - + Find Тражи - + Previous Претходно - + Next Следеће @@ -111,7 +122,7 @@ JumpLineBar - + Go to Line: Иди на ред: @@ -119,585 +130,633 @@ MainWindow - + Text Editor is a powerful tool for viewing and editing text files. Уређивач Текста је моћан алат за приказ и уређивање текстуалних датотека. - + Text Editor Уређивач текста + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject - + Text Editor Уређивач текста - - - - - - + + + + + + + Encoding Кодирање - + Basic Основно - + Font Style Стил фонта - + Font Фонт - + Font Size Величина фонта - + Shortcuts Пречице - - + + Keymap Мапа тастера - - - + + + Window Прозор - + New tab Нова картица - + New window Нови прозор - + Save Сачувај - + Save as Сачувај као - + Next tab Следећа картица - + Previous tab Претходна картица - + Close tab Затвори картицу - + Close other tabs Затвори остале картице - + Restore tab Обнови картицу - + Open file Отвори датотеку - + Increment font size Повећај величину фонта - + Decrement font size Смањи величину фонта - + Reset font size Врати величину фонта - + Help Помоћ - + Toggle fullscreen Цео екран - + Find Тражи - + + Find Next + + + + + Find Previous + + + + Replace Замени - + Go to line Иди на ред - + Save cursor position Сачувај позицију показивача - + Reset cursor position Врати позицију показивача - + Exit Изађи - + Display shortcuts Прикажи пречице - + Print Штампај - + Editor Уређивач - + Increase indent Повећај увученост - + Decrease indent Смањи увученост - + Forward character Карактер унапред - + Backward character Карактер уназад - + Forward word Реч унапред - + Backward word Реч уназад - + Next line Следећи ред - + Previous line Претходни ред - + New line Нови ред - + New line above Нови ред изнад - + New line below Нови ред испод - + Duplicate line Удвостручи ред - + Delete to end of line Обриши до краја реда - + Delete current line Обриши тренутни ред - + Swap line up Замени са редом изнад - + Swap line down Замени са редом испод - + Scroll up one line Клизај један ред горе - + Scroll down one line Клизај један ред доле - + Page up Страница нагоре - + Page down Страница надоле - + Move to end of line Иди на крај реда - + Move to start of line Иди на почетак реда - + Move to end of text Иди на крај текста - + Move to start of text Иди на почетак текста - + Move to line indentation Помери до увучености реда - + Upper case Велика слова - + Lower case Мала слова - + Capitalize Почетна велика - + Delete backward word Брисање речи уназад - + Delete forward word Брисање речи унапред - + Forward over a pair Напред преко пара - + Backward over a pair Назад преко пара - + Select all Изабери све - + Copy Копирај - + Cut Исеци - + Paste Убаци - + Transpose character Ротирај карактере - + Mark Истакни - + Unmark Уклони истицање - + Copy line Копирај ред - + Cut line Исеци ред - + Merge lines Сједини редове - + Read-Only mode Режим Само-Читање - + Add comment Додај коментар - + Remove comment Уклони коментар - + Undo Опозови - + Redo Обнови - + Add/Remove bookmark Додај/Уклони забелешку - + Move to previous bookmark Иди на претходну забелешку - + Move to next bookmark Иди на следећу забелешку - + Advanced Напредно - + Window size Величина прозора - + Tab width Ширина табулатора - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap Преламање редова - + Code folding flag Назнака скупљеног кода - + Show line numbers Прикажи бројеве редова - + Show bookmarks icon Прикажи иконице забелешки - + Show whitespaces and tabs Прикажи белине и табулаторе - + Highlight current line Истакни тренутни ред - + Color mark Истицање у боји - + Unicode Unicode - + WesternEuropean Западноевропски - + CentralEuropean Централноевропски - + Baltic Балтички - + Cyrillic Ћирилични - + Arabic Арапски - + Celtic Келтски - + SouthEasternEuropean Југоисточно-европски - + Greek Грчки - + Hebrew Хебрејски - + ChineseSimplified Поједностављени кинески - + ChineseTraditional Традиционални кински - + Japanese Јапански - + Korean Корејски - + Thai Тајландски - + Turkish Турски - + Vietnamese Вијетнамски - + File not saved Датотека није сачувана - - - + + Line Endings Крајеви редова @@ -705,32 +764,32 @@ ReplaceBar - + Find Тражи - + Replace With Замени са - + Replace Замени - + Skip Прескочи - + Replace Rest Замени остатак - + Replace All Замени све @@ -747,58 +806,59 @@ Settings - + Standard Стандардно - + Customize Прилагоди - + Normal Нормална - + Maximum Максимум - + Fullscreen Цео екран - + This shortcut conflicts with system shortcut %1 Ова пречица је у сукобу са системском пречицом %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Ова пречица је у сукобу са %1, кликните на Замени да пречица одмах ступи на снагу - - + + + The shortcut %1 is invalid, please set another one. Пречица %1 је неважећа, поставите другу. - + Cancel Откажи - + Replace Замени - + OK У реду @@ -806,7 +866,7 @@ StartManager - + Untitled %1 Ненасловњено %1 @@ -814,32 +874,32 @@ Tabbar - + Close tab Затвори картицу - + Close other tabs Затвори остале картице - + More options Више опција - + Close tabs to the left Затвори леве картице - + Close tabs to the right Затвори десне картице - + Close unmodified tabs Затвори непромењене картице @@ -847,261 +907,260 @@ TextEdit - + Undo Опозови - + Redo Обнови - + Cut Исеци - + Copy Копирај - + Paste Убаци - + Delete Обриши - + Select All Изабери све - - + + Find Тражи - - + + Replace Замени - + Go to Line Иди на ред - + Turn on Read-Only mode Укључи режим Само-Читање - + Turn off Read-Only mode Искључи режим Само-Читање - + Fullscreen Цео екран - + Exit fullscreen Напусти цео екран - + Display in file manager Прикажи у управнику података - - + + Add Comment Додај коментар - + Text to Speech Текст у говор - + Stop reading Заустави читање - + Speech to Text Говор у текст - + Translate Преведи - + Column Mode Режим колона - + Add bookmark Додај забелешку - + Remove Bookmark Уклони забелешку - + Previous bookmark Претходна забелешка - + Next bookmark Следећа забелешка - + Remove All Bookmarks Уклони све забелешке - + Fold All Скупи све - + Fold Current Level Скупи тренутни ниво - + Unfold All Рашири све - + Unfold Current Level Рашири тренутни ниво - + Color Mark Истицање у боји - + Clear All Marks Уклони сва истицања - + Clear Last Mark Уклони последње истицање - + Mark Обележи - + Mark All Обележи све - + Remove Comment Уклони коментар - Failed to paste text: it is too large - - - - + Copy failed: not enough memory - + Press ALT and click lines to edit in column mode Притисните ALT и кликните на редове да уредите у режиму колона - + Change Case Промени величину слова - + Upper Case Велика слова - + Lower Case Мала слова - + Capitalize Почетна велика - + None Ништа - + Selected line(s) copied Изабрани редови копирани - + Current line copied Тренутни ред копиран - + Selected line(s) clipped Изабрани редови копирани - + Current line clipped Тренутни ред копиран - + Paste failed: not enough memory - + Read-Only mode is off Режим Само-Читање је искључен - - - + + + + + + Read-Only mode is on Режим Само-Читање је укључен @@ -1109,7 +1168,7 @@ WarningNotices - + Reload Поново учитај @@ -1117,129 +1176,130 @@ Window - - + + Save as Сачувај као - + New window Нови прозор - + New tab Нова картица - + Open file Отвори датотеку - - + + Save Сачувај - + Print Штампај - + Switch theme Промени тему - - + + Settings Подешавања - - + + Read-Only Само-Чтање - + You do not have permission to open %1 Немате дозволу да отворите %1 - + + Invalid file: %1 Неважећа датотека: %1 - - + + Do you want to save this file? Да ли желите да сачувате ову датотеку? - + You do not have permission to save %1 Немате дозволу да сачувате %1 - + Saved successfully Успешно сачувано - - - + + + Save File Сачувај датотеку - + Encoding Кодирање - + Read-Only mode is on Режим Само-Читање је укључен - + Current location remembered Тренутна локација запамћена - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Уређивач - + Untitled %1 Ненасловњено %1 - + Cancel Откажи - + Discard Одбаци diff --git a/translations/deepin-editor_tr.ts b/translations/deepin-editor_tr.ts index a0cebede..e80a4e91 100644 --- a/translations/deepin-editor_tr.ts +++ b/translations/deepin-editor_tr.ts @@ -16,13 +16,18 @@ Characters %1 %1 Karakter + + + Loading: + + DDropdownMenu - + + - None Yok @@ -30,67 +35,68 @@ EditWrapper - - - - + + + + Save Kaydet - + Do you want to save this file? Bu dosyayı kaydetmek ister misiniz? - - + + Cancel İptal - + Encoding changed. Do you want to save the file now? Kodlama değişti. Dosyayı şimdi kaydetmek istiyor musunuz? - + Discard Yoksay - + + You do not have permission to save %1 %1 dosyasını kaydetme izniniz yok - + File removed on the disk. Save it now? Dosya diskten silinmiş. Şimdi kaydetmek ister misiniz? - + File has changed on disk. Reload? Disk üzerindeki dosya değişmiş. Yeniden yüklensin mi? - - + + INSERT EKLE - + OVERWRITE ÜZERİNE YAZ - + R/O S/O - + The file cannot be read, which may be too large or has been damaged! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Şu Satıra Git: @@ -134,6 +140,24 @@ Metin Düzenleyici + + PathSettingWgt + + + Remember the last used path + + + + + Same path as the current file + + + + + Customize the default path + + + QObject @@ -142,12 +166,13 @@ Metin Düzenleyici - - - - - - + + + + + + + Encoding Kodlama @@ -184,8 +209,8 @@ - - + + Window Pencere @@ -271,438 +296,467 @@ + Find Next + + + + + Find Previous + + + + Replace Değiştir - + Go to line Şu satıra git - + Save cursor position İmleç konumunu kaydet - + Reset cursor position İmleç konumunu sıfırla - + Exit Çıkış - + Display shortcuts Kısayolları görüntüle - + Print Yazdır - + Editor Düzenleyici - + Increase indent Girinti düzeyini arttır - + Decrease indent Girinti düzeyini azalt - + Forward character Sonraki karakter - + Backward character Önceki karakter - + Forward word Sonraki sözcük - + Backward word Önceki sözcük - + Next line Sonraki satır - + Previous line Önceki satır - + New line Yeni satır - + New line above Üste yeni satır - + New line below Alta yeni satır - + Duplicate line Yinelenen satır - + Delete to end of line Satır sonuna kadar sil - + Delete current line Mevcut satırı sil - + Swap line up Üstteki satır ile değiştir - + Swap line down Alttaki satır ile değiştir - + Scroll up one line Bir satır yukarı kaydır - + Scroll down one line Bir satır aşağı kaydır - + Page up Sayfa üstü - + Page down Sayfa altı - + Move to end of line Satır sonuna git - + Move to start of line Satır başına git - + Move to end of text Metnin sonuna git - + Move to start of text Metnin başına git - + Move to line indentation Satır girintisine git - + Upper case Büyük harf - + Lower case Küçük harf - + Capitalize İlk harfleri büyüt - + Delete backward word Önceki sözcüğü sil - + Delete forward word Sonraki sözcüğü sil - + Forward over a pair Sonraki çift - + Backward over a pair Önceki çift - + Select all Tümünü seç - + Copy Kopyala - + Cut Kes - + Paste Yapıştır - + Transpose character Karakteri dönüştür - + Mark İşaretle - + Unmark İşareti kaldır - + Copy line Satırı kopyala - + Cut line Satırı kes - + Merge lines Satırları birleştir - + Read-Only mode Salt okunur kip - + Add comment Yorum ekle - + Remove comment Yorumu kaldır - + Undo Geri al - + Redo Yinele - + Add/Remove bookmark Yer imi Ekle/Kaldır - + Move to previous bookmark Önceki yer imine git - + Move to next bookmark Sonraki yer imine git - + Advanced Gelişmiş - + Window size Pencere boyutu - + Tab width Sekme genişliği - + + Paste by pressing a middle mouse button + + + + + Startup + + + + + Reopen last closed tabs + + + + + Open/Save Settings + + + + Word wrap Sözcük kaydır - + Code folding flag Kod katlama bayrağı - + Show line numbers Satır numaralarını göster - + Show bookmarks icon Yer imi simgesini göster - + Show whitespaces and tabs Boşluk ve sekmeleri göster - + Highlight current line Mevcut satırı vurgula - + Color mark Renk işareti - + Unicode Unicode - + WesternEuropean WesternEuropean - + CentralEuropean CentralEuropean - + Baltic Baltic - + Cyrillic Cyrillic - + Arabic Arabic - + Celtic Celtic - + SouthEasternEuropean SouthEasternEuropean - + Greek Greek - + Hebrew Hebrew - + ChineseSimplified ChineseSimplified - + ChineseTraditional ChineseTraditional - + Japanese Japonca - + Korean Korece - + Thai Tayca - + Turkish Türkçe - + Vietnamese Vietnamca - + File not saved Dosya kaydedilmedi - - - + + Line Endings Satır Sonları @@ -752,58 +806,59 @@ Settings - + Standard Standart - + Customize Özelleştir - + Normal Normal - + Maximum En fazla - + Fullscreen Tam ekran - + This shortcut conflicts with system shortcut %1 Bu kısayol, %1 sistem kısayolu ile çakışıyor - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Bu kısayol %1 ile çakışıyor, bu kısayolu hemen etkin hale getirmek için Değiştire tıklayın - - + + + The shortcut %1 is invalid, please set another one. %1 kısayolu geçersiz, lütfen başka bir tane ayarlayın. - + Cancel İptal - + Replace Değiştir - + OK Tamam @@ -852,259 +907,260 @@ TextEdit - + Undo Geri al - + Redo Yinele - + Cut Kes - + Copy Kopyala - + Paste Yapıştır - + Delete Sil - + Select All Tümünü Seç - - + + Find Bul - - + + Replace Değiştir - + Go to Line Şu Satıra Git - + Turn on Read-Only mode Salt Okunur Kipi Aç - + Turn off Read-Only mode Salt Okunur Kipi Kapat - + Fullscreen Tam ekran - + Exit fullscreen Tam ekrandan çık - + Display in file manager Dosya yöneticisinde görüntüle - - + + Add Comment Yorum Ekle - + Text to Speech Yazıdan Konuşmaya - + Stop reading Okumayı durdur - + Speech to Text Konuşmadan Yazıya - + Translate Çeviri - + Column Mode Sütun Kipi - + Add bookmark Yer imlerine ekle - + Remove Bookmark Yer İmini Kaldır - + Previous bookmark Önceki yer imi - + Next bookmark Sonraki yer imi - + Remove All Bookmarks Tüm Yer İmlerini Kaldır - + Fold All Tümünü Katla - + Fold Current Level Mevcut Seviyeyi Katla - + Unfold All Tümünü Katlama - + Unfold Current Level Mevcut Seviyeyi Katlama - + Color Mark Renk İşareti - + Clear All Marks Tüm İşaretleri Temizle - + Clear Last Mark Son İşareti Temizle - + Mark İşaretle - + Mark All Tümünü İşaretle - + Remove Comment Yorumu Kaldır - + Copy failed: not enough memory Kopyalama başarısız: yeterli bellek yok - + Press ALT and click lines to edit in column mode Sütun kipinde düzenlemek için ALT tuşuna bas ve satırları tıkla - + Change Case Büyük Küçük Harfi Değiştir - + Upper Case Büyük Harf - + Lower Case Küçük Harf - + Capitalize İlk Harfleri Büyüt - + None Yok - + Selected line(s) copied Seçilen satır(lar) kopyalandı - + Current line copied Mevcut satır kopyalandı - + Selected line(s) clipped Seçilen satır(lar) kırpıldı - + Current line clipped Mevcut satır kopyalandı - + Paste failed: not enough memory Yapıştırılamadı: yeterli bellek yok - + Read-Only mode is off Salt okunur kip kapalı - - - - - + + + + + + Read-Only mode is on Salt okunur kip açık @@ -1121,129 +1177,129 @@ Window - + Save as Farklı kaydet - + New window Yeni pencere - + New tab Yeni sekme - + Open file Dosya aç - - + + Save Kaydet - + Print Yazdır - + Switch theme Temayı değiştir - - + + Settings Ayarlar - - + + Read-Only Salt Okunur - + You do not have permission to open %1 %1 dosyasını açma izniniz yok - - + + Invalid file: %1 Geçersiz dosya: %1 - - + + Do you want to save this file? Bu dosyayı kaydetmek ister misiniz? - + You do not have permission to save %1 %1 dosyasını kaydetme izniniz yok - + Saved successfully Başarıyla kaydedildi - - - + + + Save File Dosyayı Kaydet - + Encoding Kodlama - + Read-Only mode is on Salt okunur kip açık - + Current location remembered Mevcut konum hatırlandı - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Düzenleyici - + Untitled %1 Başlıksız %1 - + Cancel İptal - + Discard Yoksay diff --git a/translations/deepin-editor_ug.ts b/translations/deepin-editor_ug.ts index d1bdecd8..23cb661e 100644 --- a/translations/deepin-editor_ug.ts +++ b/translations/deepin-editor_ug.ts @@ -16,13 +16,18 @@ Characters %1 ھەرپ-بەلگە سانى %1 + + + Loading: + ھۆججەت يۈكلىنىۋاتىدۇ: + DDropdownMenu - + + - None يوق @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save ساقلاش - + Do you want to save this file? بۇ ھۆججەتنى ساقلامسىز؟ - - + + Cancel بىكار قىلىش - + Encoding changed. Do you want to save the file now? ھۆججەت كودلاش ئۇسۇلى ئۆزگەرتىلدى، ئۇنى ئاۋۋال ساقلىماقچىمۇ؟ - + Discard ساقلىمايمەن - + + You do not have permission to save %1 %1نى ساقلاش ھوقۇقىڭىز يوق - + File removed on the disk. Save it now? دىسكىدىكى ئەسلى ھۆججەت ئۆچۈرۈلدى، قايتا ساقلىماقچىمۇ؟ - + File has changed on disk. Reload? دىسكىدىكى ئەسلى ھۆججەت ئۆزگەرتىلدى، قايتا يۈكلىمەكچىمۇ؟ - - + + INSERT كىرگۈزۈش - + OVERWRITE باستۇرۇش - + R/O پەقەت ئوقۇش - + The file cannot be read, which may be too large or has been damaged! - + بۇ ھۆججەتنى ئوقۇغىلى بولمىدى، ھۆججەت بەك چوڭ ياكى بۇزۇلۇپ كەتكەن @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: سەكرەش: @@ -134,6 +140,24 @@ تېكىست تەھرىرلىگۈچ + + PathSettingWgt + + + Remember the last used path + ئەڭ ئاخىرقى مەشغۇلات مۇندەرىجىسىنى ئەستە ساقلىسۇن + + + + Same path as the current file + ھازىرقى ھۆججەت بىلەن بىردەكلىكنى ساقلىسۇن + + + + Customize the default path + مەشغۇلات مۇندەرىجىسى بەلگىلەش + + QObject @@ -142,12 +166,13 @@ تېكىست تەھرىرلىگۈچ - - - - - - + + + + + + + Encoding كودلاش @@ -184,8 +209,8 @@ - - + + Window كۆزنەك @@ -271,438 +296,467 @@ + Find Next + كېيىنكىسىنى ئىزدەش + + + + Find Previous + ئالدىنقىسىنى ئىزدەش + + + Replace ئالماشتۇرۇش - + Go to line سەكرەش - + Save cursor position نۇر بەلگىسىنىڭ ئورنىنى ساقلاش - + Reset cursor position نۇر بەلگىسى ساقلانغان ئورۇنغا سەكرىسۇن - + Exit چېكىنىش - + Display shortcuts تېزلەتمە كۆرۈنسۇن - + Print بېسىش - + Editor تەھرىرلەش - + Increase indent قۇر بېشىنى قىسقارتىش - + Decrease indent قۇر بېسىنى كېڭەيتىش - + Forward character ئوڭغا بىر ھەرپ-بەلگە سۈرۈلسۇن - + Backward character سولغا بىر ھەرپ-بەلگە سۈرۈلسۇن - + Forward word ئوڭغا بىر سۆز يۆتكەلسۇن - + Backward word سولغا بىر سۆز يۆتكەلسۇن - + Next line كېيىنكى قۇر - + Previous line ئالدىنقى قۇر - + New line قۇر ئالمىشىش - + New line above ئۈستىگە بىر قۇر قوشۇش - + New line below ئاستىغا بىر قۇر قوشۇش - + Duplicate line ھازىرقى ئورۇنغا كۆچۈرۈش ۋە چاپلاش - + Delete to end of line قۇر ئاخىرىغىچە ئۆچۈرۈش - + Delete current line بۇ قۇرنى ئۆچۈرۈش - + Swap line up ئۈستىگە بىر قۇر يۆتكەش - + Swap line down ئاستىغا بىر قۇر يۆتكەش - + Scroll up one line ئۈستىگە بىر قۇر سىيرىش - + Scroll down one line ئاستىغا بىر قۇر سىيرىش - + Page up ئۈستىگە بىر بەت سىيرىش - + Page down ئاستىغا بىر بەت سىيرىش - + Move to end of line قۇر ئاخىرىغا يۆتكەش - + Move to start of line قۇر بېشىغا يۆتكەش - + Move to end of text تېكىست ئاخىرىغا يۆتكەش - + Move to start of text تېكىست بېشىغا يۆتكەش - + Move to line indentation قۇر قىسقارغۇچە يۆتكەش - + Upper case چوڭ يېزىلىشقا ئالماشتۇرۇش - + Lower case كىچىك يېزىلىشقا ئالماشتۇرۇش - + Capitalize 1-ھەرپ چوڭ يېزىلسۇن - + Delete backward word سولغا بىر خەت ئۆچۈرسۇن - + Delete forward word ئوڭغا بىر خەت ئۆچۈرسۇن - + Forward over a pair ئوڭغا ماسلاشسۇن - + Backward over a pair سولغا ماسلاشسۇن - + Select all ھەممىسى - + Copy كۆچۈرۈش - + Cut كېسىش - + Paste چاپلاش - + Transpose character ھەرپ-بەلگە ئالماشتۇرۇش - + Mark بەلگە قويۇش - + Unmark بەلگىنى ئېلىۋېتىش - + Copy line قۇرنى كۆچۈرۈش - + Cut line قۇرنى كېسىۋېلىش - + Merge lines قۇرنى قوشۇۋېتىش - + Read-Only mode پەقەت ئوقۇيدىغان قىلىش - + Add comment ئىزاھات قوشۇش - + Remove comment ئىزاھاتنى بىكار قىلىش - + Undo ئەمەلدىن قالدۇرۇش - + Redo قايتا - + Add/Remove bookmark خەتكۈچ قوشۇش/چىقىرىۋېتىش - + Move to previous bookmark ئالدىنقى خەتكۈچ - + Move to next bookmark كېيىنكى خەتكۈچ - + Advanced ئالىي تەڭشەك - + Window size كۆزنەك ھالىتى - + Tab width Tab ھەرپ-بەلگىسىنىڭ كەڭلىكى - + + Paste by pressing a middle mouse button + مائۇسنىڭ ئوتتۇرا كۇنۇپكىسى بىلەن چاپلاشقا رۇخسەت قىلىش + + + + Startup + قوزغىتىش + + + + Reopen last closed tabs + نۆۋەتتىكى بەتكۈچ تاقاق تۇرسۇن + + + + Open/Save Settings + تەڭشەكنى ئېچىش/ساقلاش + + + Word wrap قۇر ئاپتوماتىك ئالماشسۇن - + Code folding flag كود قاتلىۋەتكەن بەلگىلەرنى كۆرسىتىش - + Show line numbers قۇر نومۇرى كۆرۈنسۇن - + Show bookmarks icon خەتكۈچ سىنبەلگىسى كۆرۈنسۇن - + Show whitespaces and tabs قۇرۇق ھەرپ/بەتكۈچلەر كۆرۈنسۇن - + Highlight current line نۆۋەتتىكى قۇر ئىگىزلىكى يورۇقلۇقى - + Color mark رەڭ بەلگىسى - + Unicode يۇنىكود - + WesternEuropean غەربىي ياۋروپا تىل سىستېمىسى - + CentralEuropean ئوتتۇرا ياۋروپا تىل سىستېمىسى - + Baltic بالتىق دىڭىزى تىللىرى - + Cyrillic سىرىل يېزىقى - + Arabic ئەرەب تىلى - + Celtic كېلتىك تىلى - + SouthEasternEuropean شەرقىي جەنۇبىي ياۋروپا تىل سىستېمىسى - + Greek گرېك تىلى - + Hebrew ئىبرانى تىلى - + ChineseSimplified ئاددىي خەنزۇ يېزىقى - + ChineseTraditional مۇرەككەپ خەنزۇ يېزىقى - + Japanese ياپونچە - + Korean كورىيەچە - + Thai تەي - + Turkish تۈرك تىلى - + Vietnamese ۋېيتنامچە - + File not saved ھۆججەت ساقلانمىغان - - - + + Line Endings قۇر تاشلاش بەلگىسى @@ -752,58 +806,59 @@ Settings - + Standard ئۆلچەملىك - + Customize بەلگىلەش - + Normal نورمال كۆزنەك - + Maximum كىچىكلىتىش - + Fullscreen پۈتۈن ئېكران - + This shortcut conflicts with system shortcut %1 بۇ تېزلەتمە سىستېما تېزلەتمىسى %1 بىلەن توقۇنۇشىدۇ - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately بۇ تېزلەتمە %1 بىلەن توقۇنۇشىدۇ، ئالماشتۇرۇشنى بېسىپ بۇ تېزلەتمنى ئۈنۈملۈك قىلىڭ - - + + + The shortcut %1 is invalid, please set another one. %1 ئۈنۈمسىز، قايتا بەلگىلەڭ - + Cancel بىكار قىلىش - + Replace ئالماشتۇرۇش - + OK ھەئە @@ -852,259 +907,260 @@ TextEdit - + Undo ئەمەلدىن قالدۇرۇش - + Redo قايتا - + Cut چاپلاش - + Copy كۆچۈرۈش - + Paste چاپلاش - + Delete ئۆچۈرۈش - + Select All ھەممىنى - - + + Find ئىزدەش - - + + Replace ئالماشتۇرۇش - + Go to Line سەكرەش - + Turn on Read-Only mode پەقەت ئوقۇيدىغان ھالەتنى ئېچىش - + Turn off Read-Only mode پەقەت ئوقۇيدىغان ھالەتنى تاقاش - + Fullscreen پۈتۈن ئېكران - + Exit fullscreen پۈتۈن ئېكراندىن چېكىنىش - + Display in file manager ھۆججەت باشقۇرغۇچتا كۆرسىتىش - - + + Add Comment ئىزاھات قوشۇش - + Text to Speech تېكىستنى ئاۋازغا ئايلاندۇرۇش - + Stop reading ئوقۇشنى توختىتىش - + Speech to Text ئاۋازنى تېكىستكە ئايلاندۇرۇش - + Translate تەرجىمان - + Column Mode ئىستون تەھرىرلەش ھالىتى - + Add bookmark خەتكۈچ قوشۇش - + Remove Bookmark خەتكۈچ چىقىرىۋېتىش - + Previous bookmark ئالدىنقى خەتكۈچ - + Next bookmark كېيىنكى خەتكۈچ - + Remove All Bookmarks بارلىق خەتكۈچنى چىقىرىۋېتىش - + Fold All بارلىق قاتلامنى قاتلاش - + Fold Current Level ھازىرقى قاتلامنى قاتلاش - + Unfold All بارلىق قاتلامنى ئېچىش - + Unfold Current Level ھازىرقى قاتلامنى ئېچىش - + Color Mark رەڭ بەلگىسى - + Clear All Marks بارلىق بەلگىلەرنى چىقىرىۋېتىش - + Clear Last Mark ئالدىنقى بەلگىنى چىقىرىۋېتىش - + Mark بەلگە قويۇش - + Mark All ھەممىسىگە بەلگە قويۇش - + Remove Comment ئىزاھاتنى بىكار قىلىش - + Copy failed: not enough memory ئىچكى ساقلىغۇچ يېتىشمىدى، كۆچۈرەلمىدى - + Press ALT and click lines to edit in column mode ئىستون تەھرىرلەش ھالىتىنى ئالماشتۇرۇش ئۈچۈن ALT بىلەن مائۇسنى ئىشلىتىڭ - + Change Case چوڭ-كىچىك يېزىلىشىنى ئالماشتۇرۇش - + Upper Case چوڭ يېزىلىش - + Lower Case كىچىك يېزىلىش - + Capitalize 1-ھەرپ چوڭ يېزىلسۇن - + None يوق - + Selected line(s) copied تاللانغان قۇر چاپلاش تاختىسىغا كۆچۈرۈلدى - + Current line copied نۆۋەتتىكى قۇر چاپلاش تاختىسىغا كۆچۈرۈلدى - + Selected line(s) clipped تاللانغان قۇر چاپلاش تاختىسىغا كېسىلدى - + Current line clipped نۆۋەتتىكى قۇر چاپلاش تاختىسىغا كېسىلدى - + Paste failed: not enough memory ئىچكى ساقلىغۇچ يېتىشمىدى، چاپلانمىدى - + Read-Only mode is off پەقەت ئوقۇيدىغان ھالەت تاقالدى - - - - - + + + + + + Read-Only mode is on پەقەت ئوقۇيدىغان ھالەتنى ئېچىلدى @@ -1121,129 +1177,129 @@ Window - + Save as باشقا ساقلاش - + New window يېڭى كۆزنەك - + New tab يېڭى خەتكۈچ - + Open file ئېچىش - - + + Save ساقلاش - + Print بېسىش - + Switch theme ئۇسلۇب ئالماشتۇرۇش - - + + Settings تەڭشەك - - + + Read-Only پەقەت ئوقۇيدىغان قىلىش - + You do not have permission to open %1 %1نى ئېچىش ھوقۇقىڭىز يوق - - + + Invalid file: %1 ئۈنۈمسىز ھۆججەت: %1 - - + + Do you want to save this file? بۇ ھۆججەتنى ساقلامسىز؟ - + You do not have permission to save %1 %1نى ساقلاش ھوقۇقىڭىز يوق - + Saved successfully ھۆججەت ساقلاندى - - - + + + Save File ساقلاش - + Encoding كودلاش - + Read-Only mode is on پەقەت ئوقۇيدىغان ھالەتنى ئېچىلدى - + Current location remembered نۆۋەتتىكى ئورۇن ئەستە ساقلاندى - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor تەھرىرلەش - + Untitled %1 %1نىڭ نامىنى ئۆزگەتىش - + Cancel بىكار قىلىش - + Discard ساقلىمايمەن diff --git a/translations/deepin-editor_uk.ts b/translations/deepin-editor_uk.ts index 481c2874..91e3fc2f 100644 --- a/translations/deepin-editor_uk.ts +++ b/translations/deepin-editor_uk.ts @@ -16,13 +16,18 @@ Characters %1 %1 символів + + + Loading: + Завантаження: + DDropdownMenu - + + - None Ніякий @@ -30,69 +35,70 @@ EditWrapper - - - - + + + + Save Зберегти - + Do you want to save this file? Хочете зберегти цей файл? - - + + Cancel Скасувати - + Encoding changed. Do you want to save the file now? Кодування змінено. Хочете зберегти файл зараз? - + Discard Відкинути - + + You do not have permission to save %1 У вас немає прав на збереження %1 - + File removed on the disk. Save it now? Файл вилучено з диска. Зберегти його? - + File has changed on disk. Reload? Файл на диску був змінений. Перезавантажити? - - + + INSERT ВСТАВЛЯТИ - + OVERWRITE ПЕРЕЗАПИСУВАТИ - + R/O ЛИШЕ ЧИТАННЯ - + The file cannot be read, which may be too large or has been damaged! - + Файл не може бути прочитано. Він може бути надто великим або пошкодженим! @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: Перейти до рядка: @@ -134,6 +140,24 @@ Текстовий редактор + + PathSettingWgt + + + Remember the last used path + Запам'ятовувати останній використаний шлях + + + + Same path as the current file + Той самий шлях, що і для поточного файла + + + + Customize the default path + Налаштувати типовий шлях + + QObject @@ -142,12 +166,13 @@ Текстовий редактор - - - - - - + + + + + + + Encoding Кодування @@ -184,8 +209,8 @@ - - + + Window Вікно @@ -271,438 +296,467 @@ + Find Next + Знайти наступний + + + + Find Previous + Знайти попередній + + + Replace Замінити - + Go to line Перейти до рядка - + Save cursor position Зберегти розташування курсора - + Reset cursor position Скинути розташування курсора - + Exit Вийти - + Display shortcuts Показати сполучення клавіш - + Print Друк - + Editor Редактор - + Increase indent Збільшити відступ - + Decrease indent Зменшити відступ - + Forward character Вперед на символ - + Backward character Назад на символ - + Forward word Вперед на слово - + Backward word Назад на слово - + Next line Наступний рядок - + Previous line Попередній рядок - + New line Новий рядок - + New line above Новий рядок вище - + New line below Новий рядок нижче - + Duplicate line Дублювати рядок - + Delete to end of line Видалити до кінця рядка - + Delete current line Видалити поточний рядок - + Swap line up Поміняти місцями з рядком вище - + Swap line down Поміняти місцями з рядком нижче - + Scroll up one line Прокрутити вище на рядок - + Scroll down one line Прокрутити нижче на рядок - + Page up На сторінку вгору - + Page down На сторінку вниз - + Move to end of line Перейти до кінця рядка - + Move to start of line Перейти до початку рядка - + Move to end of text Перейти до кінця тексту - + Move to start of text Перейти до початку тексту - + Move to line indentation Перейти до відступу рядка - + Upper case Верхній регістр - + Lower case Нижній регістр - + Capitalize Великі перші літери - + Delete backward word Вилучити слово назад - + Delete forward word Вилучити слово вперед - + Forward over a pair Вперед через пару - + Backward over a pair Назад через пару - + Select all Вибрати все - + Copy Копіювати - + Cut Вирізати - + Paste Вставити - + Transpose character Транспонувати символ - + Mark Позначити - + Unmark Зняти позначку - + Copy line Копіювати рядок - + Cut line Вирізати рядок - + Merge lines Об'єднати рядки - + Read-Only mode Режим лише для читання - + Add comment Додати коментування - + Remove comment Вилучити коментар - + Undo Скасувати - + Redo Повторити - + Add/Remove bookmark Додати або вилучити закладку - + Move to previous bookmark Перейти до попередньої закладки - + Move to next bookmark Перейти до наступної закладки - + Advanced Розширені - + Window size Розмір вікна - + Tab width Ширина табуляції - + + Paste by pressing a middle mouse button + Вставляти клацанням середньої кнопки миші + + + + Startup + Запуск + + + + Reopen last closed tabs + Повторно відкрити останні закриті вкладки + + + + Open/Save Settings + Відкрити/Зберегти параметри + + + Word wrap Перенесення рядків - + Code folding flag Прапорець згортання коду - + Show line numbers Показувати номери рядків - + Show bookmarks icon Показувати піктограму закладок - + Show whitespaces and tabs Показувати пробіли і табуляції - + Highlight current line Підсвічувати поточний рядок - + Color mark Кольорова позначка - + Unicode Юнікод - + WesternEuropean Західноевропейське - + CentralEuropean Центральноєвропейське - + Baltic Балтійське - + Cyrillic Кириличне - + Arabic Арабська - + Celtic Кельтське - + SouthEasternEuropean Південно-східноєвропейське - + Greek Грецька - + Hebrew Іврит - + ChineseSimplified Китайське спрощене - + ChineseTraditional Китайське традиційне - + Japanese Японська - + Korean Корейська - + Thai Тайська - + Turkish Турецька - + Vietnamese В'єтнамська - + File not saved Файл не збережено - - - + + Line Endings Символ закінчення рядка @@ -752,58 +806,59 @@ Settings - + Standard Стандартна - + Customize Налаштувати - + Normal Звичайний - + Maximum Максимум - + Fullscreen На весь екран - + This shortcut conflicts with system shortcut %1 Це клавіатурне скорочення конфліктує із загальносистемним скороченням %1 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately Це клавіатурне скорочення конфліктує з %1. Натисніть кнопку «Замінити», щоб це клавіатурне скорочення набуло чинності негайно. - - + + + The shortcut %1 is invalid, please set another one. Скорочення %1 є некоректним. Будь ласка, встановіть інше. - + Cancel Скасувати - + Replace Замінити - + OK Гаразд @@ -852,259 +907,260 @@ TextEdit - + Undo Скасувати - + Redo Повторити - + Cut Вирізати - + Copy Копіювати - + Paste Вставити - + Delete Видалити - + Select All Вибрати все - - + + Find Знайти - - + + Replace Замінити - + Go to Line Перейти до рядка - + Turn on Read-Only mode Увімкнути режим лише для читання - + Turn off Read-Only mode Вимкнути режим лише для читання - + Fullscreen На весь екран - + Exit fullscreen Вийти з повноекранного режиму - + Display in file manager Показати у файловому менеджері - - + + Add Comment Додати коментування - + Text to Speech Озвучення тексту - + Stop reading Припинити читання - + Speech to Text Перетворення звуку на текст - + Translate Перекласти - + Column Mode Режим стовпчиків - + Add bookmark Додати закладку - + Remove Bookmark Вилучити закладку - + Previous bookmark Попередня закладка - + Next bookmark Наступна закладка - + Remove All Bookmarks Вилучити усі закладки - + Fold All Згорнути усе - + Fold Current Level Згорнути поточний рівень - + Unfold All Розгорнути усе - + Unfold Current Level Розгорнути поточний рівень - + Color Mark Кольорова позначка - + Clear All Marks Вилучити усі позначки - + Clear Last Mark Вилучити останню позначку - + Mark Позначити - + Mark All Позначити усе - + Remove Comment Вилучити коментування - + Copy failed: not enough memory Не вдалося скопіювати: недостатньо пам'яті - + Press ALT and click lines to edit in column mode Натисніть клавішу Alt і клацайте на рядках, щоб редагувати текст у режимі стовпчиків - + Change Case Змінити регістр - + Upper Case Верхній регістр - + Lower Case Нижній регістр - + Capitalize Починати з великої літери - + None Ніякий - + Selected line(s) copied Вибрані рядки(ок) скопійовано - + Current line copied Поточний рядок скопійовано - + Selected line(s) clipped Вибрані рядки(ок) вирізано - + Current line clipped Поточний рядок вирізано - + Paste failed: not enough memory Не вдалося вставити: недостатньо пам'яті - + Read-Only mode is off Режим лише для читання вимкнено - - - - - + + + + + + Read-Only mode is on Режим лише для читання увімкнено @@ -1121,129 +1177,129 @@ Window - + Save as Зберегти як - + New window Нове вікно - + New tab Нова вкладка - + Open file Відкрити файл - - + + Save Зберегти - + Print Друк - + Switch theme Змінити тему - - + + Settings Налаштування - - + + Read-Only Лише читання - + You do not have permission to open %1 У вас немає прав на відкриття %1 - - + + Invalid file: %1 Некоректний файл: %1 - - + + Do you want to save this file? Хочете зберегти цей файл? - + You do not have permission to save %1 У вас немає прав на збереження %1 - + Saved successfully Успішно збережено - - - + + + Save File Зберегти файл - + Encoding Кодування - + Read-Only mode is on Режим лише для читання увімкнено - + Current location remembered Програма запам'ятала поточне місце - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor Редактор - + Untitled %1 Без назви %1 - + Cancel Скасувати - + Discard Відкинути diff --git a/translations/deepin-editor_zh_CN.ts b/translations/deepin-editor_zh_CN.ts index 324f6604..081087b0 100644 --- a/translations/deepin-editor_zh_CN.ts +++ b/translations/deepin-editor_zh_CN.ts @@ -16,13 +16,18 @@ Characters %1 字数 %1 + + + Loading: + 文件加载中: + DDropdownMenu - + + - None @@ -30,67 +35,68 @@ EditWrapper - - - - + + + + Save 保存 - + Do you want to save this file? 您是否要保存此文件? - - + + Cancel 取消 - + Encoding changed. Do you want to save the file now? 文件编码已更改,是否先进行保存? - + Discard 不保存 - + + You do not have permission to save %1 您没有权限保存%1 - + File removed on the disk. Save it now? 磁盘中的原文件已被移除,是否另存? - + File has changed on disk. Reload? 磁盘中的原文件已被修改,是否重新载入? - - + + INSERT 插入 - + OVERWRITE 覆盖 - + R/O 只读 - + The file cannot be read, which may be too large or has been damaged! 无法读取该文件,文件可能过大或损坏 @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: 跳到行: @@ -134,6 +140,24 @@ 文本编辑器 + + PathSettingWgt + + + Remember the last used path + 记住最后的操作路径 + + + + Same path as the current file + 与当前文件保持一致 + + + + Customize the default path + 自定义操作路径 + + QObject @@ -142,12 +166,13 @@ 文本编辑器 - - - - - - + + + + + + + Encoding 编码 @@ -184,8 +209,8 @@ - - + + Window 窗口 @@ -271,438 +296,467 @@ + Find Next + 查找下一个 + + + + Find Previous + 查找上一个 + + + Replace 替换 - + Go to line 跳到行 - + Save cursor position 保存光标位置 - + Reset cursor position 跳转到保存光标位置 - + Exit 退出 - + Display shortcuts 显示快捷键 - + Print 打印 - + Editor 编辑 - + Increase indent 增加缩进 - + Decrease indent 减少缩进 - + Forward character 右移一个字符 - + Backward character 左移一个字符 - + Forward word 右移一个词 - + Backward word 左移一个词 - + Next line 下一行 - + Previous line 上一行 - + New line 换行 - + New line above 向上插入一行 - + New line below 向下插入一行 - + Duplicate line 复制并粘贴当前行 - + Delete to end of line 删除到行尾 - + Delete current line 删除当前行 - + Swap line up 上移一行 - + Swap line down 下移一行 - + Scroll up one line 向上滚动一行 - + Scroll down one line 向下滚动一行 - + Page up 向上滚动一页 - + Page down 向下滚动一页 - + Move to end of line 移动到行尾 - + Move to start of line 移动到行头 - + Move to end of text 移动到文本结尾 - + Move to start of text 移动到文本开头 - + Move to line indentation 移动到行缩进 - + Upper case 转换为大写 - + Lower case 转换为小写 - + Capitalize 首字母大写 - + Delete backward word 向左删除一个词 - + Delete forward word 向右删除一个词 - + Forward over a pair 向右匹配 - + Backward over a pair 向左匹配 - + Select all 全选 - + Copy 复制 - + Cut 剪切 - + Paste 粘贴 - + Transpose character 调换字符 - + Mark 设置标记 - + Unmark 取消标记 - + Copy line 复制行 - + Cut line 剪切行 - + Merge lines 合并行 - + Read-Only mode 切换到只读模式 - + Add comment 添加注释 - + Remove comment 取消注释 - + Undo 撤销 - + Redo 重做 - + Add/Remove bookmark 添加/清除书签 - + Move to previous bookmark 跳转到上一个书签 - + Move to next bookmark 跳转到下一个书签 - + Advanced 高级设置 - + Window size 窗口状态 - + Tab width Tab字符宽度 - + + Paste by pressing a middle mouse button + 允许鼠标中键粘贴 + + + + Startup + 启动 + + + + Reopen last closed tabs + 保留关闭前的页签 + + + + Open/Save Settings + 打开/保存设置 + + + Word wrap 自动换行 - + Code folding flag 显示代码折叠标志 - + Show line numbers 显示行号 - + Show bookmarks icon 显示书签图标 - + Show whitespaces and tabs 显示空白字符/制表符 - + Highlight current line 当前行高亮 - + Color mark 颜色标记 - + Unicode Unicode - + WesternEuropean 西欧语系 - + CentralEuropean 中欧语系 - + Baltic 波罗的海语言 - + Cyrillic 西里尔文 - + Arabic 阿拉伯语 - + Celtic 凯尔特语 - + SouthEasternEuropean 东南欧语系 - + Greek 希腊语 - + Hebrew 希伯来语 - + ChineseSimplified 简体中文 - + ChineseTraditional 繁体中文 - + Japanese 日语 - + Korean 韩语 - + Thai 泰语 - + Turkish 土耳其语 - + Vietnamese 越南语 - + File not saved 文件未保存 - - - + + Line Endings 换行符 @@ -752,58 +806,59 @@ Settings - + Standard 标准 - + Customize 自定义 - + Normal 正常窗口 - + Maximum 最大化 - + Fullscreen 全屏 - + This shortcut conflicts with system shortcut %1 此快捷键与系统快捷键%1冲突 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately 此快捷键与%1冲突,点击替换使这个快捷键立即生效 - - + + + The shortcut %1 is invalid, please set another one. %1为无效快捷键,请重新设置 - + Cancel 取消 - + Replace 替换 - + OK 确定 @@ -852,259 +907,260 @@ TextEdit - + Undo 撤销 - + Redo 重做 - + Cut 剪切 - + Copy 复制 - + Paste 粘贴 - + Delete 删除 - + Select All 全选 - - + + Find 查找 - - + + Replace 替换 - + Go to Line 跳到行 - + Turn on Read-Only mode 开启只读模式 - + Turn off Read-Only mode 关闭只读模式 - + Fullscreen 全屏 - + Exit fullscreen 退出全屏 - + Display in file manager 在文件管理器中显示 - - + + Add Comment 添加注释 - + Text to Speech 语音朗读 - + Stop reading 停止朗读 - + Speech to Text 语音听写 - + Translate 文本翻译 - + Column Mode 列编辑模式 - + Add bookmark 添加书签 - + Remove Bookmark 清除书签 - + Previous bookmark 上一个书签 - + Next bookmark 下一个书签 - + Remove All Bookmarks 清除所有书签 - + Fold All 折叠所有层次 - + Fold Current Level 折叠当前层次 - + Unfold All 展开所有层次 - + Unfold Current Level 展开当前层次 - + Color Mark 颜色标记 - + Clear All Marks 清除所有标记 - + Clear Last Mark 清除上次标记 - + Mark 添加标记 - + Mark All 标记所有 - + Remove Comment 取消注释 - + Copy failed: not enough memory 内存不足,复制失败 - + Press ALT and click lines to edit in column mode 请使用ALT+鼠标点选切换列编辑模式 - + Change Case 切换大小写 - + Upper Case 大写 - + Lower Case 小写 - + Capitalize 首字母大写 - + None - + Selected line(s) copied 已复制选中行到剪贴板 - + Current line copied 已复制当前行到剪贴板 - + Selected line(s) clipped 已剪切选中行到剪贴板 - + Current line clipped 已剪切当前行到剪贴板 - + Paste failed: not enough memory 内存不足,粘贴失败 - + Read-Only mode is off 只读模式已关闭 - - - - - + + + + + + Read-Only mode is on 只读模式已开启 @@ -1121,129 +1177,129 @@ Window - + Save as 另存为 - + New window 新窗口 - + New tab 新标签页 - + Open file 打开文件 - - + + Save 保存 - + Print 打印 - + Switch theme 切换主题 - - + + Settings 设置 - - + + Read-Only 只读 - + You do not have permission to open %1 您没有权限打开%1 - - + + Invalid file: %1 无效文件:%1 - - + + Do you want to save this file? 您是否要保存此文件? - + You do not have permission to save %1 您没有权限保存%1 - + Saved successfully 文件已保存 - - - + + + Save File 保存 - + Encoding 编码 - + Read-Only mode is on 只读模式已开启 - + Current location remembered 已记住当前位置 - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor 编辑 - + Untitled %1 未命名文档%1 - + Cancel 取消 - + Discard 不保存 diff --git a/translations/deepin-editor_zh_HK.ts b/translations/deepin-editor_zh_HK.ts index b903aca9..1b50b84c 100644 --- a/translations/deepin-editor_zh_HK.ts +++ b/translations/deepin-editor_zh_HK.ts @@ -16,13 +16,18 @@ Characters %1 字數 %1 + + + Loading: + 文件加載中: + DDropdownMenu - + + - None @@ -30,67 +35,68 @@ EditWrapper - - - - + + + + Save 保存 - + Do you want to save this file? 您是否要保存此文件? - - + + Cancel 取消 - + Encoding changed. Do you want to save the file now? 文件編碼已更改,是否先進行保存? - + Discard 不保存 - + + You do not have permission to save %1 您沒有權限保存%1 - + File removed on the disk. Save it now? 磁盤中的原文件已被移除,是否另存? - + File has changed on disk. Reload? 磁盤中的原文件已被修改,是否重新載入? - - + + INSERT 插入 - + OVERWRITE 覆蓋 - + R/O 只讀 - + The file cannot be read, which may be too large or has been damaged! 無法讀取該文件,文件可能過大或損壞 @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: 跳到行: @@ -134,6 +140,24 @@ 文本編輯器 + + PathSettingWgt + + + Remember the last used path + 記住最後的操作路徑 + + + + Same path as the current file + 與當前文件保持一致 + + + + Customize the default path + 自定義操作路徑 + + QObject @@ -142,12 +166,13 @@ 文本編輯器 - - - - - - + + + + + + + Encoding 編碼 @@ -184,8 +209,8 @@ - - + + Window 窗口 @@ -271,438 +296,467 @@ + Find Next + 查找下一個 + + + + Find Previous + 查找上一個 + + + Replace 替換 - + Go to line 跳到行 - + Save cursor position 保存光標位置 - + Reset cursor position 跳轉到保存光標位置 - + Exit 退出 - + Display shortcuts 顯示快捷鍵 - + Print 打印 - + Editor 編輯 - + Increase indent 增加縮進 - + Decrease indent 減少縮進 - + Forward character 右移一個字符 - + Backward character 左移一個字符 - + Forward word 右移一個詞 - + Backward word 左移一個詞 - + Next line 下一行 - + Previous line 上一行 - + New line 換行 - + New line above 向上插入一行 - + New line below 向下插入一行 - + Duplicate line 複製並黏貼當前行 - + Delete to end of line 刪除到行尾 - + Delete current line 刪除當前行 - + Swap line up 上移一行 - + Swap line down 下移一行 - + Scroll up one line 向上滾動一行 - + Scroll down one line 向下滾動一行 - + Page up 向上滾動一頁 - + Page down 向下滾動一頁 - + Move to end of line 移動到行尾 - + Move to start of line 移動到行頭 - + Move to end of text 移動到文本結尾 - + Move to start of text 移動到文本開頭 - + Move to line indentation 移動到行縮進 - + Upper case 轉換為大寫 - + Lower case 轉換為小寫 - + Capitalize 首字母大寫 - + Delete backward word 向左刪除一個詞 - + Delete forward word 向右刪除一個詞 - + Forward over a pair 向右匹配 - + Backward over a pair 向左匹配 - + Select all 全選 - + Copy 複製 - + Cut 剪切 - + Paste 黏貼 - + Transpose character 調換字符 - + Mark 設置標記 - + Unmark 取消標記 - + Copy line 複製行 - + Cut line 剪切行 - + Merge lines 合併行 - + Read-Only mode 切換到只讀模式 - + Add comment 添加注釋 - + Remove comment 取消注釋 - + Undo 撤銷 - + Redo 重做 - + Add/Remove bookmark 添加/清除書籤 - + Move to previous bookmark 跳轉到上一個書籤 - + Move to next bookmark 跳轉到下一個書籤 - + Advanced 高級設置 - + Window size 窗口狀態 - + Tab width Tab字符寬度 - + + Paste by pressing a middle mouse button + 允許鼠標中鍵黏貼 + + + + Startup + 啟動 + + + + Reopen last closed tabs + 保留關閉前的頁簽 + + + + Open/Save Settings + 打開/保存設置 + + + Word wrap 自動換行 - + Code folding flag 顯示代碼摺疊標誌 - + Show line numbers 顯示行號 - + Show bookmarks icon 顯示書籤圖標 - + Show whitespaces and tabs 顯示空白字符/制表符 - + Highlight current line 當前行高亮 - + Color mark 顏色標記 - + Unicode Unicode - + WesternEuropean 西歐語系 - + CentralEuropean 中歐語系 - + Baltic 波羅的海語言 - + Cyrillic 西里爾文 - + Arabic 阿拉伯語 - + Celtic 凱爾特語 - + SouthEasternEuropean 東南歐語系 - + Greek 希臘語 - + Hebrew 希伯來語 - + ChineseSimplified 簡體中文 - + ChineseTraditional 繁體中文 - + Japanese 日語 - + Korean 韓語 - + Thai 泰語 - + Turkish 土耳其語 - + Vietnamese 越南語 - + File not saved 文件未保存 - - - + + Line Endings 換行符 @@ -752,58 +806,59 @@ Settings - + Standard 標準 - + Customize 自定義 - + Normal 正常窗口 - + Maximum 最大化 - + Fullscreen 全屏 - + This shortcut conflicts with system shortcut %1 此快捷鍵與系統快捷鍵%1衝突 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately 此快捷鍵與%1衝突,點擊替換使這個快捷鍵立即生效 - - + + + The shortcut %1 is invalid, please set another one. %1為無效快捷鍵,請重新設置 - + Cancel 取消 - + Replace 替換 - + OK 確定 @@ -852,259 +907,260 @@ TextEdit - + Undo 撤銷 - + Redo 重做 - + Cut 剪切 - + Copy 複製 - + Paste 黏貼 - + Delete 刪除 - + Select All 全選 - - + + Find 查找 - - + + Replace 替換 - + Go to Line 跳到行 - + Turn on Read-Only mode 開啟只讀模式 - + Turn off Read-Only mode 關閉只讀模式 - + Fullscreen 全屏 - + Exit fullscreen 退出全屏 - + Display in file manager 在檔案管理員中顯示 - - + + Add Comment 添加注釋 - + Text to Speech 語音朗讀 - + Stop reading 停止朗讀 - + Speech to Text 語音聽寫 - + Translate 文本翻譯 - + Column Mode 列編輯模式 - + Add bookmark 添加書籤 - + Remove Bookmark 清除書籤 - + Previous bookmark 上一個書籤 - + Next bookmark 下一個書籤 - + Remove All Bookmarks 清除所有書籤 - + Fold All 摺疊所有層次 - + Fold Current Level 摺疊當前層次 - + Unfold All 展開所有層次 - + Unfold Current Level 展開當前層次 - + Color Mark 顏色標記 - + Clear All Marks 清除所有標記 - + Clear Last Mark 清除上次標記 - + Mark 設置標記 - + Mark All 標記所有 - + Remove Comment 取消注釋 - + Copy failed: not enough memory 內存不足,複製失敗 - + Press ALT and click lines to edit in column mode 請使用ALT+鼠標點選切換列編輯模式 - + Change Case 切換大小寫 - + Upper Case 大寫 - + Lower Case 小寫 - + Capitalize 首字母大寫 - + None - + Selected line(s) copied 已複製選中行到剪貼板 - + Current line copied 已複製當前行到剪貼板 - + Selected line(s) clipped 已剪切選中行到剪貼板 - + Current line clipped 已剪切當前行到剪貼板 - + Paste failed: not enough memory 內存不足,黏貼失敗 - + Read-Only mode is off 只讀模式已關閉 - - - - - + + + + + + Read-Only mode is on 只讀模式已開啟 @@ -1121,129 +1177,129 @@ Window - + Save as 另存為 - + New window 新窗口 - + New tab 新標籤頁 - + Open file 打開文件 - - + + Save 保存 - + Print 打印 - + Switch theme 切換主題 - - + + Settings 設置 - - + + Read-Only 只讀 - + You do not have permission to open %1 您沒有權限打開%1 - - + + Invalid file: %1 無效文件:%1 - - + + Do you want to save this file? 您是否要保存此文件? - + You do not have permission to save %1 您沒有權限保存%1 - + Saved successfully 文件已保存 - - - + + + Save File 保存 - + Encoding 編碼 - + Read-Only mode is on 只讀模式已開啟 - + Current location remembered 已記住當前位置 - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor 編輯 - + Untitled %1 未命名文檔%1 - + Cancel 取消 - + Discard 不保存 diff --git a/translations/deepin-editor_zh_TW.ts b/translations/deepin-editor_zh_TW.ts index 50459085..9ed2848d 100644 --- a/translations/deepin-editor_zh_TW.ts +++ b/translations/deepin-editor_zh_TW.ts @@ -16,13 +16,18 @@ Characters %1 字數 %1 + + + Loading: + 文件載入中: + DDropdownMenu - + + - None @@ -30,67 +35,68 @@ EditWrapper - - - - + + + + Save 儲存 - + Do you want to save this file? 是否儲存此檔案? - - + + Cancel 取消 - + Encoding changed. Do you want to save the file now? 文件編碼已更改,是否先進行儲存? - + Discard 捨棄 - + + You do not have permission to save %1 您沒有權限儲存 %1 - + File removed on the disk. Save it now? 磁碟上的檔案已被移除。是否現在儲存? - + File has changed on disk. Reload? 磁碟上的檔案已被更改。是否重新載入? - - + + INSERT 插入 - + OVERWRITE 覆寫 - + R/O 唯讀 - + The file cannot be read, which may be too large or has been damaged! 無法讀取該文件,文件可能過大或損壞 @@ -116,7 +122,7 @@ JumpLineBar - + Go to Line: 前往該行: @@ -134,6 +140,24 @@ 文字編輯器 + + PathSettingWgt + + + Remember the last used path + 記住最後的操作路徑 + + + + Same path as the current file + 與目前文件保持一致 + + + + Customize the default path + 自訂操作路徑 + + QObject @@ -142,12 +166,13 @@ 文字編輯器 - - - - - - + + + + + + + Encoding 編碼方式 @@ -184,8 +209,8 @@ - - + + Window 視窗 @@ -271,438 +296,467 @@ + Find Next + 尋找下一個 + + + + Find Previous + 尋找上一個 + + + Replace 取代 - + Go to line 前往該行 - + Save cursor position 儲存游標位置 - + Reset cursor position 重設游標位置 - + Exit 退出 - + Display shortcuts 顯示快捷鍵 - + Print 列印 - + Editor 編輯器 - + Increase indent 增加縮排 - + Decrease indent 減少縮排 - + Forward character 右移字元 - + Backward character 左移字元 - + Forward word 後一個字詞 - + Backward word 前一個字詞 - + Next line 下一行 - + Previous line 上一行 - + New line 換行 - + New line above 於上方換行 - + New line below 於下方換行 - + Duplicate line 複製一行 - + Delete to end of line 刪除至行結尾所有字元 - + Delete current line 刪除目前整行 - + Swap line up 切到上一行 - + Swap line down 切到下一行 - + Scroll up one line 捲到上一行 - + Scroll down one line 捲到下一行 - + Page up 往上一頁 - + Page down 往下一頁 - + Move to end of line 移動到行結尾 - + Move to start of line 移動到行開頭 - + Move to end of text 移動到文字結尾 - + Move to start of text 移動到文字開頭 - + Move to line indentation 移到行縮排區塊 - + Upper case 大寫 - + Lower case 小寫 - + Capitalize 首字母大寫 - + Delete backward word 刪除前一個字詞 - + Delete forward word 刪除後一個字詞 - + Forward over a pair 往後一對 - + Backward over a pair 往前一對 - + Select all 全部選取 - + Copy 複製 - + Cut 剪下 - + Paste 貼上 - + Transpose character 交換字元 - + Mark 標記 - + Unmark 取消標記 - + Copy line 複製一行 - + Cut line 剪下一行 - + Merge lines 合併一行 - + Read-Only mode 唯讀模式 - + Add comment 添加注釋 - + Remove comment 取消注釋 - + Undo 復原 - + Redo 重做 - + Add/Remove bookmark 添加/清除書籤 - + Move to previous bookmark 跳轉到上一個書籤 - + Move to next bookmark 跳轉到下一個書籤 - + Advanced 進階 - + Window size 視窗大小 - + Tab width Tab 寬度 - + + Paste by pressing a middle mouse button + 允許滑鼠中鍵貼上 + + + + Startup + 啟動 + + + + Reopen last closed tabs + 保留關閉前的頁簽 + + + + Open/Save Settings + 打開/儲存設定 + + + Word wrap 文字換行 - + Code folding flag 顯示代碼摺疊標誌 - + Show line numbers 顯示行號 - + Show bookmarks icon 顯示書籤圖標 - + Show whitespaces and tabs 顯示空白字符/制表符 - + Highlight current line 當前行高亮 - + Color mark 顏色標記 - + Unicode Unicode - + WesternEuropean 西歐語系 - + CentralEuropean 中歐語系 - + Baltic 波羅的海語言 - + Cyrillic 西里爾文 - + Arabic 阿拉伯語 - + Celtic 凱爾特語 - + SouthEasternEuropean 東南歐語系 - + Greek 希臘語 - + Hebrew 希伯來語 - + ChineseSimplified 簡體中文 - + ChineseTraditional 繁體中文 - + Japanese 日語 - + Korean 韓語 - + Thai 泰語 - + Turkish 土耳其語 - + Vietnamese 越南語 - + File not saved 文件未儲存 - - - + + Line Endings 換行符 @@ -752,58 +806,59 @@ Settings - + Standard 標準 - + Customize 自訂 - + Normal 一般 - + Maximum 最大 - + Fullscreen 全螢幕 - + This shortcut conflicts with system shortcut %1 此快捷鍵與系統快捷鍵%1衝突 - + This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately 此快捷鍵與%1衝突,點擊替換使這個快捷鍵立即生效 - - + + + The shortcut %1 is invalid, please set another one. %1為無效快捷鍵,請重新設定 - + Cancel 取消 - + Replace 取代 - + OK 確定 @@ -852,259 +907,260 @@ TextEdit - + Undo 復原 - + Redo 重做 - + Cut 剪下 - + Copy 複製 - + Paste 貼上 - + Delete 刪除 - + Select All 全部選取 - - + + Find 尋找 - - + + Replace 取代 - + Go to Line 前往該行 - + Turn on Read-Only mode 開啟唯讀模式 - + Turn off Read-Only mode 關閉唯讀模式 - + Fullscreen 全螢幕 - + Exit fullscreen 退出全螢幕 - + Display in file manager 在檔案管理器中顯示 - - + + Add Comment 添加注釋 - + Text to Speech 語音朗讀 - + Stop reading 停止朗讀 - + Speech to Text 語音聽寫 - + Translate 文字翻譯 - + Column Mode 列編輯模式 - + Add bookmark 添加書籤 - + Remove Bookmark 清除書籤 - + Previous bookmark 上一個書籤 - + Next bookmark 下一個書籤 - + Remove All Bookmarks 清除所有書籤 - + Fold All 摺疊所有層次 - + Fold Current Level 摺疊當前層次 - + Unfold All 展開所有層次 - + Unfold Current Level 展開當前層次 - + Color Mark 顏色標記 - + Clear All Marks 清除所有標記 - + Clear Last Mark 清除上次標記 - + Mark 標記 - + Mark All 標記所有 - + Remove Comment 取消注釋 - + Copy failed: not enough memory 記憶體不足,複製失敗 - + Press ALT and click lines to edit in column mode 請使用ALT+滑鼠點選切換列編輯模式 - + Change Case 變更大小寫 - + Upper Case 大寫 - + Lower Case 小寫 - + Capitalize 首字母大寫 - + None - + Selected line(s) copied 已複製選中行到剪貼簿 - + Current line copied 已複製目前行到剪貼簿 - + Selected line(s) clipped 已剪下選中行到剪貼簿 - + Current line clipped 已剪下目前行到剪貼簿 - + Paste failed: not enough memory 記憶體不足,貼上失敗 - + Read-Only mode is off 唯讀模式已關閉 - - - - - + + + + + + Read-Only mode is on 唯讀模式已開啟 @@ -1121,129 +1177,129 @@ Window - + Save as 另存新檔 - + New window 建立新視窗 - + New tab 建立新標籤頁 - + Open file 開啟檔案 - - + + Save 儲存 - + Print 列印 - + Switch theme 切換主題 - - + + Settings 設定 - - + + Read-Only 唯讀 - + You do not have permission to open %1 您沒有權限開啟 %1 - - + + Invalid file: %1 無效檔案:%1 - - + + Do you want to save this file? 是否儲存此檔案? - + You do not have permission to save %1 您沒有權限儲存 %1 - + Saved successfully 儲存成功 - - - + + + Save File 儲存檔案 - + Encoding 編碼方式 - + Read-Only mode is on 唯讀模式已開啟 - + Current location remembered 已記住目前位置 - + Ctrl+'=' Ctrl+'=' - + Ctrl+'-' Ctrl+'-' - + Editor 編輯器 - + Untitled %1 未命名文件%1 - + Cancel 取消 - + Discard 捨棄 diff --git a/translations/desktop/desktop_el.ts b/translations/desktop/desktop_el.ts new file mode 100644 index 00000000..fc6f6f9c --- /dev/null +++ b/translations/desktop/desktop_el.ts @@ -0,0 +1 @@ +desktopDeepin Text EditorDeepin Επεξεργαστής ΚειμένουText EditorΕπεξεργαστής ΚειμένουSimple and easy to use text editorΑπλός κι εύχρηστος επεξεργαστής κειμένου \ No newline at end of file