diff --git a/.github/workflows/LinuxDeb.yml b/.github/workflows/LinuxDeb.yml
index 7a58aff..ddf307f 100644
--- a/.github/workflows/LinuxDeb.yml
+++ b/.github/workflows/LinuxDeb.yml
@@ -2,8 +2,8 @@ name: LinuxDeb
on:
push:
paths-ignore:
- # - '**'
- - 'README.md'
+ - '**'
+ # - 'README.md'
pull_request:
paths-ignore:
- 'README.md'
@@ -67,7 +67,7 @@ jobs:
run: |
sudo apt clean
sudo apt update
- sudo apt install wget tar dh-make debmake lintian cmake devscripts qtbase5-dev qt5-default libqt5*-dev
+ sudo apt install wget tar dh-make debmake lintian cmake devscripts qtbase5-dev qt5-default libqt5*-dev
# tag 打包 .deb,无动态库
- name: DebPackage
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a864f58..dbbac3e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)
set(PROJECT_NAME PicShot)
-project(${PROJECT_NAME} VERSION 0.4.7 LANGUAGES CXX)
+project(${PROJECT_NAME} VERSION 0.4.8 LANGUAGES CXX)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
file(COPY config/config.ini DESTINATION ${CMAKE_BINARY_DIR}/bin)
@@ -130,44 +130,22 @@ foreach(_qt_module ${QT_MODULES})
endforeach()
# Translation
-file (GLOB PICSHOT_TS_FILES data/translations/*.ts)
-set (PICSHOT_CPP_FILES_FOR_I18N
- ${SRC_MAIN}
- ${SRC_PLATFORM}
- ${SRC_CORE}
- ${SRC_WIDGET}
- ${SRC_TOOL}
- ${SRC_PERFERENCE}
- ${SRC_WINSCREEN}
- ${SRC_EXAMPLE}
- ${SRC_PLUGIN_INTERFACE}
- ${SRC_RESOURCES})
-
-qt5_create_translation(PICSHOT_QM_FILES ${PICSHOT_CPP_FILES_FOR_I18N} ${PICSHOT_TS_FILES})
-
-#option(GENERATE_TS "Regenerate translation source files" ON)
-#set(TS_FILES
-# ${CMAKE_CURRENT_SOURCE_DIR}/data/translations/zh_CN.ts
-# ${CMAKE_CURRENT_SOURCE_DIR}/data/translations/zh_TW.ts
-# ${CMAKE_CURRENT_SOURCE_DIR}/data/translations/en_US.ts)
-
-#set(TS_FILES
-# zh_CN.ts
-# zh_TW.ts
-# en_US.ts)
-
-##if (GENERATE_TS)
-# qt5_create_translation(QM_FILES "${CMAKE_CURRENT_SOURCE_DIR}/data/translations" ${TS_FILES} OPTIONS -source-language en_US -no-obsolete)
-##else ()
-## qt5_add_translation(QM_FILES ${TS_FILES})
-##endif ()
-
-message(@1--> ${TS_FILES})
-message(@2--> ${QM_FILES})
-#1. 自动批量生成 *.ts 文件
-#2. 每次都能够更新 *ts 的增量
-#3. 每次 清理 不会删除 .ts 文件
-#4. 能够自定义导出 .ts 和 .qm 文件
+option(PICSHOT_GENERATE_TS "Regenerate translation source files" OFF)
+set(PICSHOT_TS_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/data/translations/zh_CN.ts
+ ${CMAKE_CURRENT_SOURCE_DIR}/data/translations/zh_TW.ts
+ ${CMAKE_CURRENT_SOURCE_DIR}/data/translations/en_US.ts)
+
+if (PICSHOT_GENERATE_TS)
+ message("PICSHOT_GENERATE_TS is ON")
+ qt5_create_translation(PICSHOT_QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${PICSHOT_TS_FILES} OPTIONS -source-language en_US -no-obsolete)
+else ()
+ message("PICSHOT_GENERATE_TS is OFF")
+ qt5_add_translation(PICSHOT_QM_FILES ${PICSHOT_TS_FILES}) # Avoid deleting *.ts files during project cleanup
+endif ()
+
+message(@1--> ${PICSHOT_TS_FILES})
+message(@2--> ${PICSHOT_QM_FILES})
include_directories(${CMAKE_SOURCE_DIR}/3rdparty/spdlog/include
${CMAKE_SOURCE_DIR}/3rdparty/QHotkey/QHotkey)
@@ -198,13 +176,13 @@ add_executable(${PROJECT_NAME}
# # set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
#endif()
-IF (WIN32)
+if (WIN32)
target_link_libraries(${PROJECT_NAME} ${QT_VERSION_MODULES} qhotkey)
-ELSEIF (APPLE)
+elseif (APPLE)
target_link_libraries(${PROJECT_NAME} ${QT_VERSION_MODULES} qhotkey)
-ELSEIF (UNIX)
+elseif (UNIX)
target_link_libraries(${PROJECT_NAME} ${QT_VERSION_MODULES} qhotkey X11)
-ENDIF ()
+endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER org.XMuli.PicShot
@@ -227,7 +205,7 @@ source_group(TREE ${_src_root_path} FILES ${_source_list})
target_compile_definitions(${PROJECT_NAME} PUBLIC _PROJECT_NAME="${PROJECT_NAME}")
target_compile_definitions(${PROJECT_NAME} PUBLIC _PROJECT_VERSION="${PROJECT_VERSION}")
target_compile_definitions(${PROJECT_NAME} PUBLIC _BIT_ARCH=${CMAKE_SIZEOF_VOID_P}) # 4/8
-target_compile_definitions(${PROJECT_NAME} PUBLIC _COMPILER=${CMAKE_HOST_SYSTEM_PROCESSOR}) # i386/i686/x86_64/unknown
+target_compile_definitions(${PROJECT_NAME} PUBLIC _COMPILER=${CMAKE_HOST_SYSTEM_PROCESSOR}) # i386/i686/x86_64/unknown Win: AMD64
target_compile_definitions(${PROJECT_NAME} PUBLIC _COMPILER_ID="${CMAKE_CXX_COMPILER_ID}") # Clang/GCC/MSVC
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE
@@ -237,43 +215,36 @@ if(WIN32)
_UNICODE)
endif()
+foreach (FILE ${PICSHOT_QM_FILES})
+ get_filename_component(F_NAME ${FILE} NAME)
+ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${F_NAME}
+ ${CMAKE_CURRENT_BINARY_DIR}/../bin/translations/${F_NAME})
+
+ message("Copy *.qm Path: " ${CMAKE_CURRENT_BINARY_DIR}/../bin/translations/${F_NAME})
+endforeach ()
+
message("==========BRGIN============")
message("_PROJECT_NAME:${PROJECT_NAME}")
message("_PROJECT_VERSION:" ${PROJECT_VERSION})
message("_BIT_ARCH:" ${CMAKE_SIZEOF_VOID_P})
message("_COMPILER:" ${CMAKE_HOST_SYSTEM_PROCESSOR})
message("_COMPILER_ID:" ${CMAKE_CXX_COMPILER_ID})
-message("==========END============")
-
-if(QT_VERSION_MAJOR EQUAL 6)
- qt_finalize_executable(PicShot)
-endif()
-
-message("---@3--->" "PROJECT_NAME:" ${PROJECT_NAME}
+message("CMake Path"
+ "\n PROJECT_NAME:" ${PROJECT_NAME}
"\n CMAKE_INSTALL_PREFIX: " ${CMAKE_INSTALL_PREFIX}
"\n PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR}
"\n CMAKE_INSTALL_BINDIR: " ${CMAKE_INSTALL_BINDIR}
"\n CMAKE_INSTALL_LIBDIR: " ${CMAKE_INSTALL_LIBDIR}
"\n CMAKE_INSTALL_INCLUDEDIR: " ${CMAKE_INSTALL_INCLUDEDIR})
-
-foreach (FILE ${PICSHOT_QM_FILES})
- get_filename_component(F_NAME ${FILE} NAME)
- add_custom_command(
- TARGET ${PROJECT_NAME}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${F_NAME}
- ${CMAKE_CURRENT_BINARY_DIR}/../bin/translations/${F_NAME})
-
- message(@2a---> ${CMAKE_CURRENT_BINARY_DIR}/translations/${F_NAME})
-endforeach ()
+message("==========END============")
#=========================================================================================
# Install settings CMAKE_NSTALL_PREFIX: "/usr/local" or "c:/Program Files/${PROJECT_NAME}"
if (WIN32)
install(TARGETS ${PROJECT_NAME}
- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
+ RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
elseif (APPLE)
- # ...
elseif (UNIX)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/bin")
@@ -281,57 +252,48 @@ elseif (UNIX)
# Install Translations
install(FILES ${PICSHOT_QM_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/data/translations)
-
- # message(@3a---> ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/translations)
-
install(TARGETS ${PROJECT_NAME}
- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} # bin
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # lib
- )
+ RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} # bin
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) # lib
endif()
-message("---@4--->" "CMake_SOURCE_DIR:" ${CMake_SOURCE_DIR}
- "\n CMAKE_CURRENT_SOURCE_DIR:" ${CMAKE_CURRENT_SOURCE_DIR}
- "\n CPACK_PACKAGE_INSTALL_DIRECTORY:" ${CPACK_PACKAGE_INSTALL_DIRECTORY})
-
-
-# CPACK: General Settings
-set(CPACK_PACKAGE_NAME "PicShot")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Lightweight, beautiful and cross-platform screenshot tool")
-set(CPACK_PACKAGE_CONTACT "https://github.com/XMuli/PicShot/issues")
-#set (CPACK_GENERATOR "TBZ2")
-set(CPACK_SET_DESTDIR ON) # ON 安装指定路径,设置下一个; OFF 则使用 CMAKE_INSTALL_PREFIX
-set(CPACK_INSTALL_PREFIX "C:/Program Files(x86)/PicShot") # 安装到的目录路径
-set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) # 生成的安装的版本号信息
-set(CPACK_RPM_PACKAGE_GROUP "XMuli")
-set(CPACK_PACKAGE_VENDOR "XMuli")
-set(CPACK_RPM_PACKAGE_LICENSE "MIT")
-
-if (WIN32)
- # see: https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html
- set(CPACK_GENERATOR NSIS)
-# set(CPACK_NSIS_MUI_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\CMakeLogo.ico")
-# set(CPACK_NSIS_MUI_UNIICON "${CMake_SOURCE_DIR}/Utilities/Release\\CMakeLogo.ico")
-# set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
- set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME} ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}")
-# set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\CMakeInstall.bmp")
-# set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
-
- set(CPACK_NSIS_MODIFY_PATH ON)
- set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
-
-# set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
- set(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}" )
- set(CPACK_NSIS_MENU_LINKS
- "doc/${PROJECT_NAME}-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}/${PROJECT_NAME}.html"
- "${PROJECT_NAME} Help" "https://github.com/XMuli/PicShot" "${PROJECT_NAME} Web Site")
-
-elseif (APPLE)
- # ...
-elseif (UNIX)
- set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
- set (CPACK_DEBIAN_PACKAGE_SHILIBDEPS ON)
-# set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "kimageformat-plugins")
-endif()
+## CPACK: General Settings
+#set(CPACK_PACKAGE_NAME "PicShot")
+#set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Lightweight, beautiful and cross-platform screenshot tool")
+#set(CPACK_PACKAGE_CONTACT "https://github.com/XMuli/PicShot/issues")
+##set (CPACK_GENERATOR "TBZ2")
+#set(CPACK_SET_DESTDIR ON) # ON 安装指定路径,设置下一个; OFF 则使用 CMAKE_INSTALL_PREFIX
+#set(CPACK_INSTALL_PREFIX "C:/Program Files(x86)/PicShot") # 安装到的目录路径
+#set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) # 生成的安装的版本号信息
+#set(CPACK_RPM_PACKAGE_GROUP "XMuli")
+#set(CPACK_PACKAGE_VENDOR "XMuli")
+#set(CPACK_RPM_PACKAGE_LICENSE "MIT")
+
+#if (WIN32)
+# # see: https://cmake.org/cmake/help/book/mastering-cmake/chapter/Packaging%20With%20CPack.html
+# set(CPACK_GENERATOR NSIS)
+## set(CPACK_NSIS_MUI_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\CMakeLogo.ico")
+## set(CPACK_NSIS_MUI_UNIICON "${CMake_SOURCE_DIR}/Utilities/Release\\CMakeLogo.ico")
+## set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
+# set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME} ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}")
+## set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\CMakeInstall.bmp")
+## set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+
+# set(CPACK_NSIS_MODIFY_PATH ON)
+# set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
+
+## set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
+# set(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}" )
+# set(CPACK_NSIS_MENU_LINKS
+# "doc/${PROJECT_NAME}-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}/${PROJECT_NAME}.html"
+# "${PROJECT_NAME} Help" "https://github.com/XMuli/PicShot" "${PROJECT_NAME} Web Site")
+
+#elseif (APPLE)
+# # ...
+#elseif (UNIX)
+# set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
+# set (CPACK_DEBIAN_PACKAGE_SHILIBDEPS ON)
+## set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "kimageformat-plugins")
+#endif()
-include(CPack)
+#include(CPack)
diff --git a/src/data/translations/en_US.ts b/src/data/translations/en_US.ts
index fb575dc..1351a61 100644
--- a/src/data/translations/en_US.ts
+++ b/src/data/translations/en_US.ts
@@ -4,13 +4,15 @@
ColorParaBar
-
+
+
HotkeysWidget
+
@@ -18,42 +20,52 @@
PinWidget
+
+
+
+
+
+
+
+
+
+
@@ -61,248 +73,313 @@
Preference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -310,10 +387,12 @@ and -1 to use the default settings.
ScreenShot
+
+
@@ -321,54 +400,67 @@ and -1 to use the default settings.
SelectBar
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -376,46 +468,57 @@ and -1 to use the default settings.
Tray
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/data/translations/zh_CN.ts b/src/data/translations/zh_CN.ts
index c59931a..d173f70 100644
--- a/src/data/translations/zh_CN.ts
+++ b/src/data/translations/zh_CN.ts
@@ -1,16 +1,18 @@
-
+
ColorParaBar
-
-
+
+
+ 选择颜色
HotkeysWidget
+
恢复默认
@@ -18,42 +20,52 @@
PinWidget
+
复制
+
保存
+
阴影
+
不透光度
+
+
移动到分组
+
删除
+
关闭(不销毁)
+
+
保存文件
@@ -61,189 +73,237 @@
Preference
+
常规
+
界面
+
输出
+
贴图
+
快捷键
+
关于
+
重置
+
PicShot 偏好
+
语言:
+
启动:
+
日志级别:
+
更新:
+
开机自启
+
管理员启动
+
自动检查更新
+
更新
+
English
+
简体中文
+
繁體中文
+
trace
+
debug
+
info
+
warn
+
error
+
critical
+
off
+
选框样式:
+
选框颜色:
+
选框宽度:
+
十字线颜色:
+
十字线宽度:
+
智能窗口
+
十字线
+
捕捉光标
+
自动复制到剪切板
+
直译
1_picshot
+
直译
2_mac
+
直译
3_deepin
+
图片质量:
+
文件名:
+
快捷保存路径:
+
自动保存路径:
+
配置路径:
+
+
+
+
更改路径
+
@@ -252,62 +312,79 @@ and -1 to use the default settings.
和-1表示使用默认设置。
+
窗口阴影:
+
不透明度:
+
最大尺寸:
+
开启
+
+
+
PicShot 为跨平台的截图工具。
+
作者:
+
+
+
+
鸣谢
+
+
+
+
+
选择路径
@@ -315,10 +392,12 @@ and -1 to use the default settings.
ScreenShot
+
+
保存文件
@@ -326,54 +405,67 @@ and -1 to use the default settings.
SelectBar
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -381,46 +473,57 @@ and -1 to use the default settings.
Tray
+
截图
+
偏好
+
退出
+
窗口截图
+
滚动截图
+
延时截图
+
全屏截图
+
尺寸截图
+
粘贴
+
隐藏/显示所有贴图
+
切换当前贴图组
diff --git a/src/data/translations/zh_TW.ts b/src/data/translations/zh_TW.ts
index f231809..6b02c39 100644
--- a/src/data/translations/zh_TW.ts
+++ b/src/data/translations/zh_TW.ts
@@ -1,16 +1,18 @@
-
+
ColorParaBar
-
-
+
+
+ 选择颜色
HotkeysWidget
+
恢復預設
@@ -18,42 +20,52 @@
PinWidget
+
+
+
+
+
+
+
+
+
+
@@ -61,248 +73,313 @@
Preference
+
常規
+
介面
+
輸出
+
貼圖
+
快捷鍵
+
關於
+
恢復預設
+
PicShot 偏好
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -310,10 +387,12 @@ and -1 to use the default settings.
ScreenShot
+
+
@@ -321,54 +400,67 @@ and -1 to use the default settings.
SelectBar
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -376,46 +468,57 @@ and -1 to use the default settings.
Tray
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/tool/base/colorparabar.cpp b/src/tool/base/colorparabar.cpp
index e3fb387..a3299e9 100644
--- a/src/tool/base/colorparabar.cpp
+++ b/src/tool/base/colorparabar.cpp
@@ -163,7 +163,7 @@ bool ColorParaBar::eventFilter(QObject *watched, QEvent *event)
if (event->type() == QEvent::MouseButtonRelease) {
if (lab->objectName().compare(m_labMap.lastKey()) == 0) {
- m_curCol = QColorDialog::getColor(lab->palette().color(QPalette::Window), this, tr("选择文本颜色"));
+ m_curCol = QColorDialog::getColor(lab->palette().color(QPalette::Window), this, tr("select color"));
} else {
const auto& it = m_labMap.find(lab->objectName());
m_curCol.setNamedColor(it.value());