Compare commits

...

147 Commits

Author SHA1 Message Date
a29302e2e6 Added additional poll method without timeout 2020-07-16 12:03:27 +03:00
a5e5c289db Merge pull request 'fix qad_export.h' (#51) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-07-10 21:46:56 +03:00
a49aeda257 fix qad_export.h 2020-07-10 21:46:36 +03:00
79db8ea408 Merge pull request 'master' (#50) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-07-10 09:21:40 +03:00
c359ba34a6 update pip 2020-07-09 22:25:46 +03:00
760c57a843 FindQAD multiple add target fix 2020-07-09 13:11:23 +03:00
61316462fa Imported targets for QAD 2020-06-28 17:11:42 +03:00
4e3baadd70 Merge pull request 'master' (#49) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-06-28 01:16:49 +03:00
8324776fb8 fix for Qt4 2020-06-28 01:04:28 +03:00
65f3cc0698 pip update 2020-06-28 00:18:49 +03:00
b72ef08892 Merge pull request 'master' (#48) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-06-26 09:56:46 +03:00
8363ad29ef pip 2020-06-26 09:51:27 +03:00
ab4f2a3d40 Graphic mouse signals fix 2020-06-25 12:05:45 +03:00
754d46a250 missing Graphic::setGraphicStyle(const Qt::PenStyle & style, int index) 2020-06-24 11:45:56 +03:00
ba5a30a7dd Android graphic fix 2020-06-24 02:09:08 +03:00
50efa51975 version 1.5.0
IconedLabel now remove spacings in case of empty text or icon
2020-06-23 19:57:16 +03:00
8bb52f59fe Merge pull request 'update pip' (#47) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-06-19 22:53:42 +03:00
3acec2297b Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-06-19 22:53:05 +03:00
d39488397c update pip 2020-06-19 22:52:54 +03:00
97a0bad71d Merge pull request 'master' (#46) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head Something is wrong with the build of this commit
2020-06-19 22:48:53 +03:00
f02c38884b LogView fixes and optimizations 2020-06-19 19:17:30 +03:00
a195ec4006 logview improvments and fixes 2020-06-18 22:46:16 +03:00
d15b6ff855 yet clean qad/graphic 2020-06-18 20:21:37 +03:00
bd6e672568 clean qad/graphic/graphic.cpp and qad/graphic/graphic.h 2020-06-18 19:57:15 +03:00
2c9279248d Merge pull request 'master' (#45) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-06-17 22:58:20 +03:00
e67c1925b1 version 1.4.0_alpha
add LogView
patch MatrixEdit for old Qt
2020-06-17 22:15:47 +03:00
7741878f3e fxes for new qt 2020-06-15 11:08:35 +03:00
61e16d4f1b Merge pull request 'master' (#44) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-06-10 15:38:40 +03:00
5bd869968e Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-06-10 15:38:04 +03:00
94f1b68b6f pip 2020-06-10 15:38:00 +03:00
86439ae05c Merge pull request 'pip' (#43) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-06-10 15:11:55 +03:00
a64e03b28d pip 2020-06-10 15:11:36 +03:00
9d708342ca Merge pull request 'pip 1.20' (#42) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-06-10 14:38:27 +03:00
265251d47d pip 2020-06-10 14:36:43 +03:00
8962d051ea update pip to 1.20 2020-06-10 14:30:55 +03:00
e513e2f16a copyright clean 2020-06-10 14:12:43 +03:00
8ab6a4716f Merge pull request 'graphic default theme color in session save/load' (#40) from master into release 2020-06-09 21:00:58 +03:00
ab330967f3 version 2020-06-09 21:00:30 +03:00
46dd2eeaad graphic default theme color in session save/load 2020-06-09 20:57:49 +03:00
fdee11cbc0 Merge pull request 'pip' (#39) from master into release 2020-06-09 18:12:16 +03:00
4dbca6f145 pip 2020-06-09 18:05:26 +03:00
57c19a2e8c Merge pull request 'Jenkinsfile' (#37) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-06-02 15:32:40 +03:00
14c8a359bd Jenkinsfile 2020-06-02 15:31:47 +03:00
e45464f480 Merge pull request 'fix PIMathMatrix in pip' (#36) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-06-02 13:26:20 +03:00
892c2e48a3 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-06-02 13:06:08 +03:00
f0340c5d48 update pip 2020-06-02 13:06:03 +03:00
db37f8b963 Merge pull request 'master' (#34) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-28 17:34:27 +03:00
a7f182a7cb Jenkinsfile doc, PIP 2020-05-28 17:32:31 +03:00
b8e4e7203f Jenkinsfile pip doc works
Some checks failed
pipdoc/pipeline/head Something is wrong with the build of this commit
2020-05-28 15:06:32 +03:00
1010eaf6db Jenkinsfile
All checks were successful
pipdoc/pipeline/head This commit looks good
2020-05-28 15:00:25 +03:00
007e3db9ef Jenkinsfile
Some checks failed
pipdoc/pipeline/head There was a failure building this commit
2020-05-28 14:59:04 +03:00
dbff7cec26 Merge branch 'master' of https://git.shs.tools/SHS/libs
Some checks failed
pipdoc/pipeline/head There was a failure building this commit
2020-05-28 14:44:29 +03:00
3c94cce018 Jenkinsfile 2020-05-28 14:44:20 +03:00
ab356664e2 pip PIVector2D resize
Some checks failed
pipdoc/pipeline/head Something is wrong with the build of this commit
2020-05-28 14:21:30 +03:00
2945c07a31 Jenkinsfile pip doc
Some checks failed
pipdoc/pipeline/head There was a failure building this commit
2020-05-28 14:04:35 +03:00
0ffcedb5ef Merge pull request 'master' (#33) from master into release
Some checks failed
pipdoc/pipeline/head There was a failure building this commit
2020-05-28 10:47:24 +03:00
87f49853b2 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-05-28 10:17:15 +03:00
c269dd6b9e update pip and matrixedit.ui size 2020-05-28 10:17:10 +03:00
cb739f61b0 Merge pull request 'pip' (#31) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-26 16:50:23 +03:00
54ad05ffef pip 2020-05-26 16:49:21 +03:00
2857dee71c Merge pull request 'v1.3.1_beta, session default path and dynamic translations, PIP' (#28) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-05-26 16:30:12 +03:00
5abe72697d version 1.3.1_beta
qad_locations simplify
pip
2020-05-26 16:27:21 +03:00
e90f5d23c4 remove translations before load 2020-05-25 18:47:28 +03:00
c1fa375145 add dynamic language change support
add "en" ts
2020-05-25 16:59:19 +03:00
69b0ee9d1a EMainWindow session fix 2020-05-25 13:56:55 +03:00
b6e86b6160 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-05-25 11:51:00 +03:00
1384cf3c21 add default session path 2020-05-25 11:50:44 +03:00
6a84167a58 add default session path 2020-05-25 11:49:49 +03:00
da32c7c723 multiline fix 2020-05-23 21:55:31 +03:00
0418638fc9 QPIConfig multiline support 2020-05-23 21:42:00 +03:00
8dd574fef1 pip 2020-05-23 17:42:30 +03:00
3137dc7c03 pip 2020-05-23 16:39:06 +03:00
a627ea557e DrawTools, ui fix (line mode) 2020-05-23 16:26:24 +03:00
da939e30c7 ProjectFilesystemPlugin 1.1.0: pseudo-threaded tree rebuild 2020-05-22 18:25:27 +03:00
a8625e2333 Merge pull request 'update pip' (#27) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-22 12:25:41 +03:00
8406767c76 update pip 2020-05-22 12:24:53 +03:00
7395146bfb Merge pull request 'master' (#26) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-21 13:15:32 +03:00
09511b6afd pip 2020-05-21 13:07:21 +03:00
2d509afe89 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-05-20 18:14:56 +03:00
fda0983d0b translations 2020-05-20 18:14:45 +03:00
880bda410a Merge pull request 'master' (#25) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-19 21:49:11 +03:00
3d64351da6 update pip 2020-05-19 21:15:03 +03:00
52b00ac0ab Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-05-19 21:13:41 +03:00
e3000e5ebc Jenkinsfile comment 2020-05-19 21:13:31 +03:00
d9cb8da8ae Merge pull request 'master' (#24) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-19 18:39:59 +03:00
7855536959 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-05-19 18:32:39 +03:00
9bbe763184 version 1.2.0_beta
QAD_SETUP_APPLICATION, QtWraps.cmake
2020-05-19 18:32:26 +03:00
68945371f5 Jenkinsfile stage download 2020-05-19 16:19:30 +03:00
5d1706834b Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-05-19 12:07:55 +03:00
e3ab26dc4c remove old Dockerfile 2020-05-19 12:06:57 +03:00
af8c3a44ff Merge pull request 'retry' (#23) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-18 19:34:55 +03:00
4bc671584c retry 2020-05-18 19:34:12 +03:00
bed8f9e2f0 Merge pull request 'Jenkinsfile' (#22) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-05-18 19:24:36 +03:00
72e7b42813 Jenkinsfile 2020-05-18 19:24:11 +03:00
961dd32c69 Merge pull request 'docker' (#21) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-05-18 19:18:47 +03:00
b65f154f29 docker 2020-05-18 19:18:21 +03:00
cab5d7334a Merge pull request 'pip' (#20) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-18 17:42:21 +03:00
03442306b9 pip 2020-05-18 17:41:57 +03:00
c5b61c619c Merge pull request 'pip, qad version' (#19) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-18 16:40:04 +03:00
ada132e992 pip, qad version 2020-05-18 16:39:37 +03:00
54954c9ae7 Merge pull request 'master' (#18) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-16 11:31:45 +03:00
2e59133c66 version 1.1.1_alpha 2020-05-16 11:26:13 +03:00
9db04f5aa0 qad_locations 2020-05-16 10:02:44 +03:00
30d1faff9a qad_locations 2020-05-15 22:49:08 +03:00
864940446d mobile about 2020-05-13 13:36:38 +03:00
36487e636f Merge pull request 'docker system prune' (#14) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-12 22:41:22 +03:00
47fd2bfc8a docker system prune 2020-05-12 22:40:22 +03:00
a10ba790f5 Merge pull request 'master' (#13) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-12 18:50:56 +03:00
446e74a51d linux deploy, buildnumber 2020-05-12 18:50:01 +03:00
ef9e75d584 jobs 2020-05-12 11:22:22 +03:00
854f1dc3e9 Merge pull request 'master' (#12) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-11 12:01:41 +03:00
965d845a64 pip 2020-05-11 12:00:40 +03:00
682e493fa3 Jenkins: add stages 2020-05-08 22:26:56 +03:00
63012cd7e4 Merge pull request 'Изменить 'Jenkinsfile'' (#10) from andrey-patch-1 into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-08 15:29:55 +03:00
ccd6838508 Изменить 'Jenkinsfile' 2020-05-08 15:27:30 +03:00
0df5b36586 Merge pull request 'RPI Dockerfile' (#9) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
SHS/libs/pipeline/head This commit looks good
2020-05-07 18:47:50 +03:00
9e2032cd27 RPI Dockerfile
All checks were successful
SHS/libs/pipeline/head This commit looks good
2020-05-07 18:47:08 +03:00
aa5b8af51c Merge pull request 'Jenkinsfile' (#8) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-05-07 18:16:22 +03:00
b5f69363cc Jenkinsfile 2020-05-07 18:15:25 +03:00
d4ddaf5f58 Merge remote-tracking branch 'remotes/origin/master' into HEAD
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-05-07 17:46:47 +03:00
3267e13aa8 migrate to docker tree 2020-05-07 17:41:48 +03:00
96dd4202d5 CROSSTOOLS support 2020-05-04 12:51:32 +03:00
f674b6fe2f README 2020-04-30 16:10:11 +03:00
b60e2db625 Licence add LGPLv3 2020-04-30 16:07:01 +03:00
b3d9dc8133 fix CMake "qt_install_lang()"
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-04-30 11:56:12 +03:00
18854891f4 fix CMake "qt_install_lang()" 2020-04-30 11:49:37 +03:00
11e903dc24 Исправляем сборку PIP
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-04-29 18:50:22 +03:00
6a037a8367 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-04-29 18:42:48 +03:00
90d73ba248 update pip 2020-04-29 18:42:44 +03:00
fa7851ade0 Merge pull request 'pip' (#4) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-04-29 18:34:44 +03:00
13e20d7c83 pip 2020-04-29 18:33:52 +03:00
163a5b943e Merge pull request 'update to PIP 1.14' (#3) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-04-29 18:19:31 +03:00
ad5bb3a750 cmake_android.bat 2020-04-29 18:13:19 +03:00
c8369d2bd9 pip fixes 2020-04-29 17:44:37 +03:00
a4eada7441 update to PIP 1.14 2020-04-29 17:21:24 +03:00
fdedf11f00 Merge pull request 'master' (#2) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-04-29 13:18:27 +03:00
2c7528fe6d Merge remote-tracking branch 'remotes/origin/release'
# Conflicts:
#	.gitmodules
2020-04-29 13:16:46 +03:00
c38ad9f907 deploy 2020-04-29 12:58:42 +03:00
dcee031d8b clean
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-04-28 14:50:26 +03:00
92d469750e c 2020-04-28 14:44:17 +03:00
ced89be7c8 clean 2020-04-28 14:42:42 +03:00
5519d4117b Jenkinsfile
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-04-28 13:33:24 +03:00
3606f0c90a README.md
Some checks failed
SHS Gitea/libs/pipeline/head Something is wrong with the build of this commit
2020-04-28 13:09:53 +03:00
59a20f4cd8 Jenkinsfile
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-04-27 21:15:01 +03:00
0e3aec8539 Jenkinsfile
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-04-27 20:47:48 +03:00
fe715857fb Jenkinsfile
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-04-27 20:22:57 +03:00
2c3310250a Jenkinsfile
Some checks failed
SHS Gitea/libs/pipeline/head Something is wrong with the build of this commit
2020-04-27 20:15:30 +03:00
292 changed files with 9358 additions and 1384 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
/.svn
CMakeLists.txt.user*
/project_fs_build
/qad/qad_version.h
/qglengine/core/qglengine_version.h

View File

@@ -15,6 +15,9 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if(NOT DEFINED BUILD_NUMBER) if(NOT DEFINED BUILD_NUMBER)
set(BUILD_NUMBER 9999) set(BUILD_NUMBER 9999)
endif() endif()
if("x${BUILD_NUMBER}" STREQUAL "x")
set(BUILD_NUMBER 0)
endif()
set(_COMPANY SHS) set(_COMPANY SHS)
set(_DOMAIN org.SHS) set(_DOMAIN org.SHS)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/pip) include_directories(${CMAKE_CURRENT_BINARY_DIR}/pip)
@@ -31,7 +34,7 @@ else()
link_directories(/usr/local/lib) link_directories(/usr/local/lib)
endif() endif()
else() else()
set(CMAKE_INSTALL_RPATH "\$ORIGIN/lib") set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib")
endif() endif()
endif() endif()
if (DEFINED ANDROID_PLATFORM) if (DEFINED ANDROID_PLATFORM)
@@ -51,11 +54,19 @@ if(CMAKE_CROSSCOMPILING)
set(INSTALL_PREFIX "${CMAKE_STAGING_PREFIX}") set(INSTALL_PREFIX "${CMAKE_STAGING_PREFIX}")
endif() endif()
endif() endif()
option(CROSSTOOLS "Crosstools minimal build" 0)
option(LIB "System install" 1) option(LIB "System install" 1)
option(QGLVIEW "Build QGLview library and utils" 0) option(QGLVIEW "Build QGLview library and utils" 0)
option(QGLENGINE "Build QGLENGINE library and utils" 0) option(QGLENGINE "Build QGLENGINE library and utils" 0)
option(UTILS "Build various utils" ${_plugins_default_}) option(UTILS "Build various utils" ${_plugins_default_})
option(DESIGNER_PLUGINS "Build qt designer plugins" ${_plugins_default_}) option(DESIGNER_PLUGINS "Build qt designer plugins" ${_plugins_default_})
if (CROSSTOOLS)
set(LIB 1)
set(QGLVIEW 0)
set(QGLENGINE 0)
set(UTILS 0)
set(DESIGNER_PLUGINS 0)
endif()
if (CMAKE_BUILD_TYPE MATCHES Debug) if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -Wall")
@@ -91,15 +102,17 @@ else()
endif() endif()
foreach(F ${PIP_FOLDERS}) foreach(F ${PIP_FOLDERS})
list(APPEND PIP_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/pip/src_main/${F}") list(APPEND PIP_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/pip/lib/main/${F}")
endforeach(F) endforeach(F)
#message(${PIP_INCLUDES}) #message(${PIP_INCLUDES})
if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM)) if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM))
set(PIP_CMG "pip_cmg") set(PIP_CMG "pip_cmg")
set(PIP_RC "pip_rc") set(PIP_RC "pip_rc")
set(PIP_DEPLOY_TOOL "deploy_tool")
else() else()
set(PIP_CMG "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/code_model_generator/pip_cmg") set(PIP_CMG "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/code_model_generator/pip_cmg")
set(PIP_RC "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/resources_compiler/pip_rc") set(PIP_RC "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/resources_compiler/pip_rc")
set(PIP_DEPLOY_TOOL "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/deploy_tool/deploy_tool")
endif() endif()
if(WIN32) if(WIN32)
set(PIP_DLL_DIR "${CMAKE_CURRENT_BINARY_DIR}/pip") set(PIP_DLL_DIR "${CMAKE_CURRENT_BINARY_DIR}/pip")
@@ -107,53 +120,64 @@ endif()
set(QAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qad) set(QAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qad)
include(QtWraps) if (CROSSTOOLS)
find_qt(Core QUIET)
set(QtVersions) add_subdirectory(pip)
set(SomeQtFound 0) file(GLOB CMAKES "qad/cmake/*.cmake" "qad/cmake/*.in")
foreach(_v ${_QT_VERSIONS_}) install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules)
option(Qt${_v} "Build for Qt${_v}" 1)
if (Qt${_v})
#message("Qt${_v} -> ${LOCAL_FOUND${_v}}")
if (LOCAL_FOUND${_v})
list(APPEND QtVersions Qt${_v})
set(SomeQtFound 1)
endif()
endif()
endforeach()
if(UTILS)
message(STATUS "Building with utils")
else() else()
message(STATUS "Building only libraries")
endif()
add_subdirectory(pip) include(QtWraps)
set(_DIRS) find_qt(Core QUIET)
if (SomeQtFound) set(QtVersions)
message(STATUS "Building Qt-derived targets for ${QtVersions}") set(SomeQtFound 0)
add_subdirectory(qad) foreach(_v ${_QT_VERSIONS_})
set(_DIRS piqt piqt_utils qcd_utils) option(Qt${_v} "Build for Qt${_v}" 1)
if (Qt5) if (Qt${_v})
if (QGLVIEW) #message("Qt${_v} -> ${LOCAL_FOUND${_v}}")
list(APPEND _DIRS qglview) if (LOCAL_FOUND${_v})
endif() list(APPEND QtVersions Qt${_v})
if (QGLENGINE) set(SomeQtFound 1)
list(APPEND _DIRS qglengine) endif()
endif() endif()
endforeach()
if(UTILS)
message(STATUS "Building with utils")
else()
message(STATUS "Building only libraries")
endif() endif()
add_subdirectory(pip)
set(_DIRS)
if (SomeQtFound)
message(STATUS "Building Qt-derived targets for ${QtVersions}")
add_subdirectory(qad)
set(_DIRS piqt piqt_utils qcd_utils)
if (Qt5)
list(APPEND _DIRS)
if (QGLVIEW)
list(APPEND _DIRS qglview)
endif()
if (QGLENGINE)
list(APPEND _DIRS qglengine)
endif()
endif()
foreach(_D ${_DIRS})
list(APPEND QT_MULTILIB_LIST ${_D})
endforeach(_D)
include_directories(piqt)
else()
message(STATUS "None of Qt found, skip Qt-derived targets")
endif()
include_directories(cd_utils)
list(INSERT _DIRS 0 cd_utils)
foreach(_D ${_DIRS}) foreach(_D ${_DIRS})
list(APPEND QT_MULTILIB_LIST ${_D}) add_subdirectory(${_D})
endforeach(_D) endforeach(_D)
include_directories(piqt)
else()
message(STATUS "None of Qt found, skip Qt-derived targets")
endif() endif()
include_directories(cd_utils)
list(INSERT _DIRS 0 cd_utils)
foreach(_D ${_DIRS})
add_subdirectory(${_D})
endforeach(_D)
if(WIN32) if(WIN32)
foreach(PIP_LT ${PIP_LIBS_TARGETS}) foreach(PIP_LT ${PIP_LIBS_TARGETS})

70
Jenkinsfile vendored
View File

@@ -1,10 +1,62 @@
node { def build_docker(name) {
def img def image = "${name}-libs"
def def_args = "--no-cache --build-arg LIBS_BUILD_NUMBER=${env.BUILD_NUMBER} --build-arg JOBS_COUNT=4" echo "Build image ${image}"
if (env.DOCKER_PREFIX) { def pref = ""
img = docker.build("${env.DOCKER_PREFIX}/libs", "${def_args} --build-arg DOCKER_PREFIX=${env.DOCKER_PREFIX} .") if (env.DOCKER_PREFIX) {
} else { pref = "--build-arg DOCKER_PREFIX=${env.DOCKER_PREFIX}/"
img = docker.build("libs", "${def_args} .")
} }
img.push() def jobs = 4
} if (env.JOBS_COUNT) {
jobs = "${env.JOBS_COUNT}"
}
def args = "${pref} --build-arg LIBS_BUILD_NUMBER=${env.BUILD_NUMBER} --build-arg JOBS_COUNT=${jobs}"
dir ("docker/${image}") {
sh "docker build ${args} --no-cache -t ${image} ."
}
return "\n - ${image}"
}
node {
stage("checkout") {
checkout scm
}
def _envmap = [:]
def _env = sh(script: "env", returnStdout: true).trim().split("\n")
_env.each{ l ->
def _ind = l.indexOf('=');
def _n = l.substring(0, _ind);
def _v = l.substring(_ind + 1);
_envmap["${_n}"] = "${_v}";
}
def _msg = "Built images:"
def platforms = ['debian', 'osx', 'windows', 'android', 'pi']
for (int i = 0; i < platforms.size(); ++i) {
if (_envmap["BUILD_${platforms[i]}"] == "1") {
stage("${platforms[i]}-libs") {
_msg += build_docker("${platforms[i]}")
}
}
}
sh "docker system prune -f"
echo "${_msg}"
}
pipeline {
agent {
label 'master'
}
stages {
stage("PIP doc") {
steps {
checkout scm
sh "rm -rf share"
sh "rm -vf *.zip"
sh "mkdir -p build"
sh "cd build && cmake -DLIB=0 -DCMAKE_INSTALL_PREFIX=`pwd` ../"
sh "cd build && make doc"
sh "cd share/doc && zip -r ../../pip_doc.zip pip"
sh "cp share/doc/pip/html/pip.qch ./"
archiveArtifacts 'pip_doc.zip'
archiveArtifacts 'pip.qch'
}
}
}
}

165
LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,5 +1,7 @@
# Main SHS SDK libraries repo # Main SHS SDK libraries repo
## Introduction ## Introduction
This repo contains PIP, QAD and derived projects: This repo contains PIP, QAD and derived projects:
* cd_utils - PIP-based client/server library for read, transmit and use custom structures of coefficients * cd_utils - PIP-based client/server library for read, transmit and use custom structures of coefficients
* qcd_utils - Qt bindings to CDUtils and "CD Pult" executable - full-featured CD client * qcd_utils - Qt bindings to CDUtils and "CD Pult" executable - full-featured CD client
@@ -7,6 +9,7 @@ This repo contains PIP, QAD and derived projects:
* piqt_utils - Gui libraries and executables to edit PIConnection configs and watch PIIntrospection * piqt_utils - Gui libraries and executables to edit PIConnection configs and watch PIIntrospection
* qglview - old Qt-base OpenGL engine * qglview - old Qt-base OpenGL engine
* qglengine - new Qt-base OpenGL engine * qglengine - new Qt-base OpenGL engine
## Compile ## Compile
This repo can be compile with GCC/MinGW/Clang, for Qt 4/5. This repo can be compile with GCC/MinGW/Clang, for Qt 4/5.
@@ -18,6 +21,7 @@ CMake options:
* **DESIGNER_PLUGINS** - build or not Qt Designer plugins, enabled by default * **DESIGNER_PLUGINS** - build or not Qt Designer plugins, enabled by default
* **QGLVIEW** - build or not QGLView, disabled by default * **QGLVIEW** - build or not QGLView, disabled by default
* **QGLENGINE** - build or not QGLEngine, disabled by default * **QGLENGINE** - build or not QGLEngine, disabled by default
## Windows scripts ## Windows scripts
Build steps for i686 architecture: Build steps for i686 architecture:
1. unzip mingw.7z to C:\mingw 1. unzip mingw.7z to C:\mingw
@@ -36,6 +40,15 @@ Build steps for amd64 architecture:
Build steps for both architectures: Build steps for both architectures:
-- follow previos steps, but on '4' state run make_libs_all.bat -- follow previos steps, but on '4' state run make_libs_all.bat
## Non-Windows scripts
Script "make_libs.sh" compile and install SDK for current environment, e.g. ## Non-Windows scripts
`./make_libs.sh -j4` Script "make_libs.sh" compile and install SDK for current environment, e.g.
`./make_libs.sh -j4`
## Docker
This repo provide Dockerfile, so you can exec `docker build -t libs .` in this directory
and make docker image "libs" with installed SHS SDK for:
* Debian 10
* Windows x64
* MacOS
* Android ndk 21 armeabi-v71, arm64-v8a, x86, x86_64

165
cd_utils/LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_C_H #ifndef CDUTILS_C_H
#define CDUTILS_C_H #define CDUTILS_C_H

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_CORE_H #ifndef CDUTILS_CORE_H
#define CDUTILS_CORE_H #define CDUTILS_CORE_H

View File

@@ -135,7 +135,7 @@ bool Interface::configure(const PIString & config) {
PIConfig conf(config, PIIODevice::ReadOnly); PIConfig conf(config, PIIODevice::ReadOnly);
PIConfig::Entry & e(conf.getValue(core->typeLetter(s->cd_type_))); PIConfig::Entry & e(conf.getValue(core->typeLetter(s->cd_type_)));
bool ret = false; bool ret = false;
setFileName(e.getValue("file", file(), &ret)); setFileName(e.getValue("file", file(), &ret).toString());
return ret; return ret;
} }

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_INTERFACE_H #ifndef CDUTILS_INTERFACE_H
#define CDUTILS_INTERFACE_H #define CDUTILS_INTERFACE_H

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_K_H #ifndef CDUTILS_K_H
#define CDUTILS_K_H #define CDUTILS_K_H

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_M_H #ifndef CDUTILS_M_H
#define CDUTILS_M_H #define CDUTILS_M_H

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_PARSER_H #ifndef CDUTILS_PARSER_H
#define CDUTILS_PARSER_H #define CDUTILS_PARSER_H

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_PROTOCOL_H #ifndef CDUTILS_PROTOCOL_H
#define CDUTILS_PROTOCOL_H #define CDUTILS_PROTOCOL_H

View File

@@ -524,7 +524,7 @@ void CDSection::read(const void * ep) {
case CDType::cdNull: break; case CDType::cdNull: break;
case CDType::cdK: case CDType::cdK:
c = CDType(id, e->getValue("v").comment(), e->getValue("v").type(), e->getValue("v").value(), e->getValue("f").value(), e->getValue("f").comment(), cd_type_); c = CDType(id, e->getValue("v").comment(), e->getValue("v").type(), e->getValue("v").value(), e->getValue("f").value(), e->getValue("f").comment(), cd_type_);
ev = e->getValue("ev", ""); ev = e->getValue("ev", "").value();
if (!ev.isEmpty()) if (!ev.isEmpty())
c.enum_values = c.parseEnumComment(ev); c.enum_values = c.parseEnumComment(ev);
break; break;

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_TYPES_H #ifndef CDUTILS_TYPES_H
#define CDUTILS_TYPES_H #define CDUTILS_TYPES_H

View File

@@ -1,3 +1,22 @@
/*
CD Utils - Control-Debug utilites
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CDUTILS_X_H #ifndef CDUTILS_X_H
#define CDUTILS_X_H #define CDUTILS_X_H

View File

@@ -43,7 +43,7 @@ set Qt5_ROOT=%ANDROID_QT5_DIR%\lib\cmake
rem set Qt5_DIR=%Qt5_ROOT%\Qt5 rem set Qt5_DIR=%Qt5_ROOT%\Qt5
if NOT [%QARCH%]==[] ( if NOT [%QARCH%]==[] (
@echo on @echo on
cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=1 -DQGLVIEW=0 -DQGLENGINE=0 -DQt5_DIR=%Qt5_ROOT%\Qt5 -DQt5LinguistTools_DIR=%Qt5_ROOT%\Qt5LinguistTools -DQt5UiPlugin_DIR=%Qt5_ROOT%\Qt5UiPlugin -DQt5UiTools_DIR=%Qt5_ROOT%\Qt5UiTools -DQt5Widgets_DIR=%Qt5_ROOT%\Qt5Widgets -DQt5Core_DIR=%Qt5_ROOT%\Qt5Core -DQt5Gui_DIR=%Qt5_ROOT%\Qt5Gui -DQt5Sql_DIR=%Qt5_ROOT%\Qt5Sql -DQt5OpenGL_DIR=%Qt5_ROOT%\Qt5OpenGL -DQt5PrintSupport_DIR=%Qt5_ROOT%\Qt5PrintSupport -DQt5Script_DIR=%Qt5_ROOT%\Qt5Script -DQt5Positioning_DIR=%Qt5_ROOT%\Qt5Positioning -DQt5Network_DIR=%Qt5_ROOT%\Qt5Network -DQt5Qml_DIR=%Qt5_ROOT%\Qt5Qml -DQt5Quick_DIR=%Qt5_ROOT%\Qt5Quick -DQt5QuickWidgets_DIR=%Qt5_ROOT%\Qt5QuickWidgets %~3 %~4 %~5 %~6 cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=1 -DQGLVIEW=0 -DQGLENGINE=0 -DQt5_DIR=%Qt5_ROOT%\Qt5 -DQt5LinguistTools_DIR=%Qt5_ROOT%\Qt5LinguistTools -DQt5UiPlugin_DIR=%Qt5_ROOT%\Qt5UiPlugin -DQt5UiTools_DIR=%Qt5_ROOT%\Qt5UiTools -DQt5Widgets_DIR=%Qt5_ROOT%\Qt5Widgets -DQt5Core_DIR=%Qt5_ROOT%\Qt5Core -DQt5Gui_DIR=%Qt5_ROOT%\Qt5Gui -DQt5Sql_DIR=%Qt5_ROOT%\Qt5Sql -DQt5OpenGL_DIR=%Qt5_ROOT%\Qt5OpenGL -DQt5PrintSupport_DIR=%Qt5_ROOT%\Qt5PrintSupport -DQt5Script_DIR=%Qt5_ROOT%\Qt5Script -DQt5Positioning_DIR=%Qt5_ROOT%\Qt5Positioning -DQt5Network_DIR=%Qt5_ROOT%\Qt5Network -DQt5Qml_DIR=%Qt5_ROOT%\Qt5Qml -DQt5Quick_DIR=%Qt5_ROOT%\Qt5Quick -DQt5QuickWidgets_DIR=%Qt5_ROOT%\Qt5QuickWidgets -DQt5QmlModels_DIR=%Qt5_ROOT%\Qt5QmlModels -DQt5AndroidExtras_DIR=%Qt5_ROOT%\Qt5AndroidExtras %~3 %~4 %~5 %~6
) else ( ) else (
@echo on @echo on
cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=0 -DQGLVIEW=0 %~3 %~4 %~5 %~6 cmake_mgw -Wno-dev -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%\build\cmake\android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_PLATFORM=android-%_PLATFORM_% -DANDROID_ABI=%AARCH% -DICU=0 -DQt4=0 -DQt5=0 -DQGLVIEW=0 %~3 %~4 %~5 %~6

View File

@@ -1,50 +1,38 @@
ARG DOCKER_PREFIX=wapmobil ARG DOCKER_PREFIX=wapmobil/
FROM ${DOCKER_PREFIX}android
FROM ${DOCKER_PREFIX}/android
ARG LIBS_BUILD_NUMBER=9999 ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4 ARG JOBS_COUNT=4
WORKDIR /soft WORKDIR /soft
#RUN svn co svn://db.shs.com.ru/libs --username peri4 --password a --no-auth-cache --non-interactive --trust-server-cert
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/build_libs_linux WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs/ \ RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \
&& make install -j${JOBS_COUNT} && rm -rf * \ && make install -j${JOBS_COUNT} \
&& rm -rf * \
&& ldconfig && ldconfig
WORKDIR /soft/build_libs_windows
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/windows -DICU=0 -DLIB=0 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=/soft/toolchain-Windows.cmake ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/build_libs_macos
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/osx -DICU=0 -DLIB=0 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=/soft/toolchain-Darwin.cmake ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/libs_build_anroid
ENV _ANDROID_TOOLCHAIN=/usr/lib/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake ENV _ANDROID_TOOLCHAIN=/usr/lib/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake
ENV _CUR_ABI=armeabi-v7a ENV _CUR_ABI=armeabi-v7a
WORKDIR /soft/build_libs_android_${_CUR_ABI}
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \ RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf * && make install -j${JOBS_COUNT} && rm -rf *
ENV _CUR_ABI=arm64-v8a ENV _CUR_ABI=arm64-v8a
WORKDIR /soft/build_libs_android_${_CUR_ABI} WORKDIR /soft/libs_build_android_${_CUR_ABI}
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \ RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf * && make install -j${JOBS_COUNT} && rm -rf *
ENV _CUR_ABI=x86 ENV _CUR_ABI=x86
WORKDIR /soft/build_libs_android_${_CUR_ABI} WORKDIR /soft/libs_build_android_${_CUR_ABI}
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \ RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf * && make install -j${JOBS_COUNT} && rm -rf *
ENV _CUR_ABI=x86_64 ENV _CUR_ABI=x86_64
WORKDIR /soft/build_libs_android_${_CUR_ABI} WORKDIR /soft/libs_build_android_${_CUR_ABI}
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \ RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/android/${_CUR_ABI} -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=${_ANDROID_TOOLCHAIN} -DQt5_DIR=/soft/android/qt/lib/cmake/Qt5 -DANDROID_PLATFORM=${NDK_PLATFORM} -DANDROID_ABI=${_CUR_ABI} ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf * && make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/src WORKDIR /soft/src
# examples
# docker build --no-cache -t libs .
# cd <your_project_dir>
# docker run --rm -it -v $(pwd):/soft/src libs bash

View File

@@ -0,0 +1,16 @@
ARG DOCKER_PREFIX=wapmobil/
FROM ${DOCKER_PREFIX}debian
ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4
WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_debian
RUN cmake -DICU=0 -DLIB=1 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \
&& make install -j${JOBS_COUNT} \
&& rm -rf * \
&& ldconfig
WORKDIR /soft/src

View File

@@ -0,0 +1,20 @@
ARG DOCKER_PREFIX=wapmobil/
FROM ${DOCKER_PREFIX}osx
ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4
WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \
&& make install -j${JOBS_COUNT} \
&& rm -rf * \
&& ldconfig
WORKDIR /soft/libs_build_osx
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/osx -DICU=0 -DLIB=0 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=/soft/toolchain-Darwin.cmake ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/src

20
docker/pi-libs/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
ARG DOCKER_PREFIX=wapmobil/
FROM ${DOCKER_PREFIX}pi
ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4
WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \
&& make install -j${JOBS_COUNT} \
&& rm -rf * \
&& ldconfig
WORKDIR /soft/libs_build_pi
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/pi/usr -DICU=0 -DLIB=0 -DQGLENGINE=0 -DQGLVIEW=0 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=/soft/toolchain-RPi.cmake ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/src

View File

@@ -0,0 +1,20 @@
ARG DOCKER_PREFIX=wapmobil/
FROM ${DOCKER_PREFIX}windows
ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4
WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \
&& make install -j${JOBS_COUNT} \
&& rm -rf * \
&& ldconfig
WORKDIR /soft/libs_build_windows
RUN cmake -DCMAKE_INSTALL_PREFIX=/soft/windows -DICU=0 -DLIB=0 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} -DCMAKE_TOOLCHAIN_FILE=/soft/toolchain-Windows.cmake ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/src

View File

@@ -4,19 +4,19 @@
/* /*
PIP - Platform Independent Primitives PIP - Platform Independent Primitives
Protocol, input/output channel (COM, UDP) Protocol, input/output channel (COM, UDP)
Copyright (C) 2020 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */

2
pip

Submodule pip updated: f4cbd499a8...5df43a45f2

165
piqt/LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,3 +1,22 @@
/*
PIQt - PIP <-> Qt convertions
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PIQT_H #ifndef PIQT_H
#define PIQT_H #define PIQT_H

View File

@@ -23,7 +23,7 @@ list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME})
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
include_directories(${PIP_INCLUDES} ${QAD_INCLUDES}) include_directories(${PIP_INCLUDES} ${QAD_INCLUDES})
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
pip_code_model(CCM "../pip/src_main/io_devices/piiodevice.h" "../pip/src_main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es") pip_code_model(CCM "../pip/lib/main/io_devices/piiodevice.h" "../pip/lib/main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es")
find_qt(${QtVersions} Core Gui) find_qt(${QtVersions} Core Gui)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM) qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM)

165
piqt_utils/LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,6 +1,6 @@
project(piintrospector) project(piintrospector)
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
set(PII_ROOT "../../pip/src_main/introspection") set(PII_ROOT "../../pip/lib/main/introspection")
pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es") pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es")
find_qt(${QtVersions} Core Gui) find_qt(${QtVersions} Core Gui)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)

View File

@@ -1,3 +1,22 @@
/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONNECTION_EDIT_H #ifndef CONNECTION_EDIT_H
#define CONNECTION_EDIT_H #define CONNECTION_EDIT_H

View File

@@ -1,3 +1,22 @@
/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONNECTION_VIEW_H #ifndef CONNECTION_VIEW_H
#define CONNECTION_VIEW_H #define CONNECTION_VIEW_H

View File

@@ -1,3 +1,22 @@
/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONF_HIGHLIGHTER_H #ifndef CONF_HIGHLIGHTER_H
#define CONF_HIGHLIGHTER_H #define CONF_HIGHLIGHTER_H

View File

@@ -1,3 +1,22 @@
/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PIQT_IODEVICE_EDIT_H #ifndef PIQT_IODEVICE_EDIT_H
#define PIQT_IODEVICE_EDIT_H #define PIQT_IODEVICE_EDIT_H

View File

@@ -1,3 +1,22 @@
/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PIQT_IODEVICE_EDIT_DIALOG_H #ifndef PIQT_IODEVICE_EDIT_DIALOG_H
#define PIQT_IODEVICE_EDIT_DIALOG_H #define PIQT_IODEVICE_EDIT_DIALOG_H

View File

@@ -1,3 +1,22 @@
/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QPICONNECTION_H #ifndef QPICONNECTION_H
#define QPICONNECTION_H #define QPICONNECTION_H

View File

@@ -1,7 +1,7 @@
{ {
\"Name\" : \"ProjectFilesystemPlugin\", \"Name\" : \"ProjectFilesystemPlugin\",
\"Version\" : \"1.0.0\", \"Version\" : \"1.1.0\",
\"CompatVersion\" : \"1.0.0\", \"CompatVersion\" : \"1.1.0\",
\"Vendor\" : \"Peri4\", \"Vendor\" : \"Peri4\",
\"Copyright\" : \"(C) Peri4\", \"Copyright\" : \"(C) Peri4\",
\"License\" : \"LGPLv3\", \"License\" : \"LGPLv3\",

View File

@@ -29,6 +29,7 @@ QFileInfo projectfs_menu_target;
ProjectFilesystemWidget::ProjectFilesystemWidget(QWidget * parent): QWidget(parent) { ProjectFilesystemWidget::ProjectFilesystemWidget(QWidget * parent): QWidget(parent) {
setupUi(this); setupUi(this);
in_proc = need_rebuild = false;
int is = style()->pixelMetric(QStyle::PM_ButtonIconSize, 0, this); int is = style()->pixelMetric(QStyle::PM_ButtonIconSize, 0, this);
label->setFixedSize(is, is); label->setFixedSize(is, is);
buttonClear->setIcon(Utils::Icons::CLEAN.icon()); buttonClear->setIcon(Utils::Icons::CLEAN.icon());
@@ -74,6 +75,7 @@ void ProjectFilesystemWidget::changeEvent(QEvent *e) {
void ProjectFilesystemWidget::createTree(QTreeWidgetItem * ti, const QString & dir) { void ProjectFilesystemWidget::createTree(QTreeWidgetItem * ti, const QString & dir) {
QFileInfoList fl = QDir(dir).entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot, QDir::LocaleAware | QDir::DirsFirst); QFileInfoList fl = QDir(dir).entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot, QDir::LocaleAware | QDir::DirsFirst);
checkProcEvents();
for (QFileInfo i: fl) { for (QFileInfo i: fl) {
QString nit = i.fileName(); QString nit = i.fileName();
if (i.isDir()) { if (i.isDir()) {
@@ -163,7 +165,20 @@ void ProjectFilesystemWidget::setExtVariable() {
} }
void ProjectFilesystemWidget::checkProcEvents() {
if (tm.elapsed() < 10) return;
QApplication::processEvents();
tm.start();
}
void ProjectFilesystemWidget::projectsChanged() { void ProjectFilesystemWidget::projectsChanged() {
if (in_proc) {
need_rebuild = true;
return;
}
in_proc = true;
tm.start();
last_expanded.clear(); last_expanded.clear();
item_map.clear(); item_map.clear();
int spos = tree->verticalScrollBar()->value(); int spos = tree->verticalScrollBar()->value();
@@ -192,6 +207,11 @@ void ProjectFilesystemWidget::projectsChanged() {
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
qApp->processEvents(); qApp->processEvents();
tree->verticalScrollBar()->setValue(spos); tree->verticalScrollBar()->setValue(spos);
in_proc = false;
if (need_rebuild) {
need_rebuild = false;
projectsChanged();
}
} }

View File

@@ -6,6 +6,7 @@
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QFileSystemModel> #include <QFileSystemModel>
#include <QElapsedTimer>
#include <QMenu> #include <QMenu>
extern QFileInfo projectfs_menu_target; extern QFileInfo projectfs_menu_target;
@@ -32,13 +33,16 @@ protected:
void rememberExpanded(QTreeWidgetItem * ti); void rememberExpanded(QTreeWidgetItem * ti);
void restoreExpanded(QTreeWidgetItem * ti); void restoreExpanded(QTreeWidgetItem * ti);
void setExtVariable(); void setExtVariable();
void checkProcEvents();
bool in_proc, need_rebuild;
ExtensionSystem::IPlugin * proj_plug; ExtensionSystem::IPlugin * proj_plug;
QMenu popup_menu; QMenu popup_menu;
QMap<QString, QTreeWidgetItem*> item_map; QMap<QString, QTreeWidgetItem*> item_map;
QSet<QString> last_expanded; QSet<QString> last_expanded;
FilterDialog filter_dialog; FilterDialog filter_dialog;
FilterDialog::Filter cur_filter; FilterDialog::Filter cur_filter;
QElapsedTimer tm;
public slots: public slots:
void projectsChanged(); void projectsChanged();

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0017 NEW) # need include() with .cmake cmake_policy(SET CMP0017 NEW) # need include() with .cmake
project(qad) project(qad)
set(_QAD_MAJOR 1) set(_QAD_MAJOR 1)
set(_QAD_MINOR 1) set(_QAD_MINOR 5)
set(_QAD_REVISION 0) set(_QAD_REVISION 0)
set(_QAD_SUFFIX ) set(_QAD_SUFFIX )
set(_QAD_COMPANY SHS) set(_QAD_COMPANY SHS)
@@ -48,7 +48,10 @@ endif()
# Version # Version
set(QAD_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/qad_version.h") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/qad_version.h")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/qad_version.h")
endif()
set(QAD_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/qad_version.h")
set_version(QAD set_version(QAD
MAJOR "${_QAD_MAJOR}" MAJOR "${_QAD_MAJOR}"
MINOR "${_QAD_MINOR}" MINOR "${_QAD_MINOR}"

165
qad/LICENSE.txt Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -63,7 +63,7 @@ AboutWindow::AboutWindow(QWidget * parent): QDialog(parent), ui(new Ui::AboutWin
//ui->verticalSpacer->changeSize(1, 1, QSizePolicy::Preferred, QSizePolicy::Preferred); //ui->verticalSpacer->changeSize(1, 1, QSizePolicy::Preferred, QSizePolicy::Preferred);
#endif #endif
#ifdef MOBILE_VIEW #ifdef MOBILE_VIEW
// ui->layoutMain->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding)); ui->layoutMain->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding));
#else #else
QRect r; QRect r;
# if QT_VERSION < 0x050000 # if QT_VERSION < 0x050000
@@ -154,6 +154,7 @@ void AboutWindow::changeEvent(QEvent *e) {
switch (e->type()) { switch (e->type()) {
case QEvent::LanguageChange: case QEvent::LanguageChange:
ui->retranslateUi(this); ui->retranslateUi(this);
setWindowTitle(QApplication::applicationName() + " - " + tr("About"));
break; break;
case QEvent::FontChange: case QEvent::FontChange:
case QEvent::Polish: case QEvent::Polish:

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ABOUTWINDOW_H #ifndef ABOUTWINDOW_H
#define ABOUTWINDOW_H #define ABOUTWINDOW_H

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EDOCKWIDGET_H #ifndef EDOCKWIDGET_H
#define EDOCKWIDGET_H #define EDOCKWIDGET_H
@@ -15,8 +34,8 @@ class QAD_EXPORT EDockWidget: public QDockWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EDockWidget(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0): QDockWidget(title, parent, flags) {init();} explicit EDockWidget(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()): QDockWidget(title, parent, flags) {init();}
explicit EDockWidget(QWidget * parent = 0, Qt::WindowFlags flags = 0): QDockWidget(parent, flags) {init();} explicit EDockWidget(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()): QDockWidget(parent, flags) {init();}
~EDockWidget() {delete btn_hide; delete btn_dock; delete lbl_title; delete lbl_icon; delete header;} ~EDockWidget() {delete btn_hide; delete btn_dock; delete lbl_title; delete lbl_icon; delete header;}
void setFeatures(QDockWidget::DockWidgetFeatures features); void setFeatures(QDockWidget::DockWidgetFeatures features);

View File

@@ -31,7 +31,6 @@ action_show_all_docks(this), action_hide_all_docks(this), first_show(true) {
EMainWindow::~EMainWindow() { EMainWindow::~EMainWindow() {
if (tid > 0) killTimer(tid); if (tid > 0) killTimer(tid);
tid = 0; tid = 0;
saveSession();
} }
@@ -72,6 +71,7 @@ void EMainWindow::showEvent(QShowEvent * e) {
void EMainWindow::closeEvent(QCloseEvent * e) { void EMainWindow::closeEvent(QCloseEvent * e) {
if (!checkSave()) e->ignore(); if (!checkSave()) e->ignore();
else saveSession();
} }
@@ -119,6 +119,22 @@ void EMainWindow::timerEvent(QTimerEvent * e) {
} }
void EMainWindow::changeEvent(QEvent * e) {
QMainWindow::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
action_show_all_tools.setText(tr("Show all"));
action_show_all_docks.setText(tr("Show all"));
action_hide_all_tools.setText(tr("Hide all"));
action_hide_all_docks.setText(tr("Hide all"));
action_clear_recent->setText(tr("Clear recent list"));
break;
default:
break;
}
}
QMenu * EMainWindow::createPopupMenu() { QMenu * EMainWindow::createPopupMenu() {
QMenu * menuPopup = new QMenu; QMenu * menuPopup = new QMenu;
QWidgetAction * wa; QWidgetAction * wa;

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EMAINWINDOW_H #ifndef EMAINWINDOW_H
#define EMAINWINDOW_H #define EMAINWINDOW_H
@@ -73,6 +92,7 @@ protected:
void closeEvent(QCloseEvent * ); void closeEvent(QCloseEvent * );
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void timerEvent(QTimerEvent * e); void timerEvent(QTimerEvent * e);
void changeEvent(QEvent * e);
QMenu * createPopupMenu(); QMenu * createPopupMenu();
void addToRecent(const QString & path); void addToRecent(const QString & path);
void prepareRecent(); void prepareRecent();

View File

@@ -91,6 +91,18 @@ bool ETabWidget::eventFilter(QObject * o, QEvent * e) {
} }
void ETabWidget::changeEvent(QEvent * e) {
QTabWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
retranslate();
break;
default:
break;
}
}
void ETabWidget::buttonClicked() { void ETabWidget::buttonClicked() {
QToolButton * s = qobject_cast<QToolButton * >(sender()); QToolButton * s = qobject_cast<QToolButton * >(sender());
if (s == 0) return; if (s == 0) return;

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ETABWIDGET_H #ifndef ETABWIDGET_H
#define ETABWIDGET_H #define ETABWIDGET_H
@@ -30,6 +49,7 @@ private:
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void tabInserted(int) {emit countChanged();} void tabInserted(int) {emit countChanged();}
void tabRemoved(int) {emit countChanged();} void tabRemoved(int) {emit countChanged();}
void changeEvent(QEvent * e);
struct TabButton { struct TabButton {
TabButton(int r, const QIcon & i, const QString & t) {role = r; icon = i; visible = true; srcToolTip = t; toolTip = QApplication::translate("MainWindow", t.toUtf8(), 0/*, QCoreApplication::UnicodeUTF8*/);} TabButton(int r, const QIcon & i, const QString & t) {role = r; icon = i; visible = true; srcToolTip = t; toolTip = QApplication::translate("MainWindow", t.toUtf8(), 0/*, QCoreApplication::UnicodeUTF8*/);}

View File

@@ -1,4 +1,5 @@
#include "historyview.h" #include "historyview.h"
#include <QEvent>
HistoryView::HistoryView(QWidget* parent): QListWidget(parent) { HistoryView::HistoryView(QWidget* parent): QListWidget(parent) {
@@ -89,6 +90,18 @@ void HistoryView::checkLimit() {
} }
void HistoryView::changeEvent(QEvent * e) {
QListWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
actions_[-1].text = tr("History cleared");
break;
default:
break;
}
}
void HistoryView::itemClicked(QListWidgetItem * item) { void HistoryView::itemClicked(QListWidgetItem * item) {
if (!active_) return; if (!active_) return;
if (index == row(item) + 1) return; if (index == row(item) + 1) return;

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HISTORYVIEW_H #ifndef HISTORYVIEW_H
#define HISTORYVIEW_H #define HISTORYVIEW_H
@@ -46,6 +65,7 @@ private:
}; };
void checkLimit(); void checkLimit();
void changeEvent(QEvent * e);
QString actionText(int action, int count_); QString actionText(int action, int count_);
QMap<int, Action> actions_; QMap<int, Action> actions_;

View File

@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>AboutWindow</name>
<message>
<location filename="../aboutwindow.ui" line="14"/>
<source> - About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="41"/>
<source>Versions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="56"/>
<source>Build</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="71"/>
<source>Authors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="100"/>
<source>About Qt...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="111"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="33"/>
<location filename="../aboutwindow.cpp" line="157"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EMainWindow</name>
<message>
<location filename="../emainwindow.cpp" line="12"/>
<location filename="../emainwindow.cpp" line="130"/>
<source>Clear recent list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="15"/>
<location filename="../emainwindow.cpp" line="16"/>
<location filename="../emainwindow.cpp" line="126"/>
<location filename="../emainwindow.cpp" line="127"/>
<source>Show all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="17"/>
<location filename="../emainwindow.cpp" line="18"/>
<location filename="../emainwindow.cpp" line="128"/>
<location filename="../emainwindow.cpp" line="129"/>
<source>Hide all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="152"/>
<source>Toolbars</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="177"/>
<source>Docks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="395"/>
<source>Select file to open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="404"/>
<source>Select files to open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="414"/>
<source>Save changes%1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="414"/>
<source> in</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="427"/>
<source>Select file to save</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>HistoryView</name>
<message>
<location filename="../historyview.cpp" line="17"/>
<location filename="../historyview.cpp" line="97"/>
<source>History cleared</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LogView</name>
<message>
<location filename="../logview.ui" line="92"/>
<source>Category:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../logview.ui" line="119"/>
<location filename="../logview.cpp" line="37"/>
<location filename="../logview.cpp" line="133"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../logview.cpp" line="35"/>
<location filename="../logview.cpp" line="131"/>
<source>Select All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../logview.cpp" line="36"/>
<location filename="../logview.cpp" line="132"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../logview.cpp" line="46"/>
<source>All</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -1,47 +1,101 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="ru_RU"> <TS version="2.1" language="ru_RU">
<context>
<name>AboutWindow</name>
<message>
<location filename="../aboutwindow.ui" line="14"/>
<source> - About</source>
<translation> - О программе</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="41"/>
<source>Versions</source>
<translation>Версии</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="56"/>
<source>Build</source>
<translation>Сборка</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="71"/>
<source>Authors</source>
<translation>Авторы</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="100"/>
<source>About Qt...</source>
<translation>О Qt ...</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="111"/>
<source>OK</source>
<translation></translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="33"/>
<location filename="../aboutwindow.cpp" line="157"/>
<source>About</source>
<translation>О программе</translation>
</message>
</context>
<context> <context>
<name>EMainWindow</name> <name>EMainWindow</name>
<message> <message>
<location filename="../emainwindow.cpp" line="28"/> <location filename="../emainwindow.cpp" line="12"/>
<location filename="../emainwindow.cpp" line="29"/> <location filename="../emainwindow.cpp" line="130"/>
<source>Clear recent list</source>
<translation>Очистить список недавних</translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="15"/>
<location filename="../emainwindow.cpp" line="16"/>
<location filename="../emainwindow.cpp" line="126"/>
<location filename="../emainwindow.cpp" line="127"/>
<source>Show all</source> <source>Show all</source>
<translation>Показать все</translation> <translation>Показать все</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="30"/> <location filename="../emainwindow.cpp" line="17"/>
<location filename="../emainwindow.cpp" line="31"/> <location filename="../emainwindow.cpp" line="18"/>
<location filename="../emainwindow.cpp" line="128"/>
<location filename="../emainwindow.cpp" line="129"/>
<source>Hide all</source> <source>Hide all</source>
<translation>Скрыть все</translation> <translation>Скрыть все</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="125"/> <location filename="../emainwindow.cpp" line="152"/>
<source>Toolbars</source> <source>Toolbars</source>
<translation>Панели инструментов</translation> <translation>Панели инструментов</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="150"/> <location filename="../emainwindow.cpp" line="177"/>
<source>Docks</source> <source>Docks</source>
<translation>Окна</translation> <translation>Окна</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="309"/> <location filename="../emainwindow.cpp" line="395"/>
<source>Select file to open</source> <source>Select file to open</source>
<translation>Выбрать файл для открытия</translation> <translation>Выбрать файл для открытия</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="317"/> <location filename="../emainwindow.cpp" line="404"/>
<source>Select files to open</source>
<translation>Выберите файлы для открытия</translation>
</message>
<message>
<location filename="../emainwindow.cpp" line="414"/>
<source>Save changes%1?</source> <source>Save changes%1?</source>
<translation>Сохранить изменения%1?</translation> <translation>Сохранить изменения%1?</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="317"/> <location filename="../emainwindow.cpp" line="414"/>
<source> in</source> <source> in</source>
<translation> в</translation> <translation> в</translation>
</message> </message>
<message> <message>
<location filename="../emainwindow.cpp" line="329"/> <location filename="../emainwindow.cpp" line="427"/>
<source>Select file to save</source> <source>Select file to save</source>
<translation>Выберите файл для сохранения</translation> <translation>Выберите файл для сохранения</translation>
</message> </message>
@@ -49,9 +103,42 @@
<context> <context>
<name>HistoryView</name> <name>HistoryView</name>
<message> <message>
<location filename="../historyview.cpp" line="15"/> <location filename="../historyview.cpp" line="17"/>
<location filename="../historyview.cpp" line="97"/>
<source>History cleared</source> <source>History cleared</source>
<translation>История очищена</translation> <translation>История очищена</translation>
</message> </message>
</context> </context>
<context>
<name>LogView</name>
<message>
<location filename="../logview.ui" line="92"/>
<source>Category:</source>
<translation>Категория:</translation>
</message>
<message>
<location filename="../logview.ui" line="119"/>
<location filename="../logview.cpp" line="37"/>
<location filename="../logview.cpp" line="133"/>
<source>Clear</source>
<translation>Очистить</translation>
</message>
<message>
<location filename="../logview.cpp" line="35"/>
<location filename="../logview.cpp" line="131"/>
<source>Select All</source>
<translation>Выделить всё</translation>
</message>
<message>
<location filename="../logview.cpp" line="36"/>
<location filename="../logview.cpp" line="132"/>
<source>Copy</source>
<translation>Копировать</translation>
</message>
<message>
<location filename="../logview.cpp" line="46"/>
<source>All</source>
<translation>Все</translation>
</message>
</context>
</TS> </TS>

View File

@@ -0,0 +1,2 @@
lupdate ../ -ts qad_application_ru.ts
lupdate ../ -ts qad_application_en.ts

294
qad/application/logview.cpp Normal file
View File

@@ -0,0 +1,294 @@
#include "logview.h"
#include "ui_logview.h"
#include "qad_types.h"
#include "ecombobox.h"
#include <QTextDocument>
#include <QAbstractTextDocumentLayout>
#include <QTextEdit>
#include <QTextBlock>
#include <QScrollBar>
#include <QPixmap>
#include <QEvent>
LogView::Category::Category() {
bold = false;
}
void LogView::Category::makeIcon(QSize size, QSize size_icon) {
icon_image = QImage();
if (!image.isNull())
icon_image = image.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPixmap px = QPixmap::fromImage(image.scaled(size_icon, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
icon.addPixmap(px, QIcon::Active);
icon.addPixmap(px, QIcon::Disabled);
icon.addPixmap(px, QIcon::Normal);
icon.addPixmap(px, QIcon::Selected);
}
LogView::LogView(QWidget * parent): QWidget(parent) {
ui = new Ui::LogView();
ui->setupUi(this);
ui->textEdit->setContextMenuPolicy(Qt::ActionsContextMenu);
actionLogSelectAll = new QAction(QIcon(":/icons/select-all.png"), tr("Select All"), this);
actionLogCopy = new QAction(QIcon(":/icons/edit-copy.png"), tr("Copy"), this);
actionLogClear = new QAction(QIcon(":/icons/edit-clear.png"), tr("Clear"), this);
connect(actionLogSelectAll, SIGNAL(triggered(bool)), ui->textEdit, SLOT(selectAll()));
connect(actionLogCopy, SIGNAL(triggered(bool)), ui->textEdit, SLOT(copy()));
connect(actionLogClear, SIGNAL(triggered(bool)), ui->textEdit, SLOT(clear()));
ui->textEdit->addAction(actionLogSelectAll);
ui->textEdit->addAction(actionLogCopy);
ui->textEdit->addAction(actionLogClear);
ui->buttonClear->setDefaultAction(ui->actionClear);
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
ui->comboCategory->addItem(tr("All"));
ui->textEdit->document()->setUndoRedoEnabled(false);
setLinesLimit(10000);
QTextCursor tc(ui->textEdit->document());
def_cf = tc.charFormat();
}
LogView::~LogView() {
delete ui;
}
const QTextEdit * LogView::textEdit() const {
return ui->textEdit;
}
void LogView::setLogFont(QFont f) {
ui->textEdit->document()->setDefaultFont(f);
QTextCursor tc(ui->textEdit->document());
def_cf = tc.charFormat();
}
QFont LogView::logFont() const {
return ui->textEdit->document()->defaultFont();
}
bool LogView::isFilterVisible() const {
return ui->widgetToolbar->isVisible();
}
int LogView::linesLimit() const {
int ret = ui->textEdit->document()->maximumBlockCount();
if (ret > 0) --ret;
return ret;
}
void LogView::registerCategory(const QString & label, QString keyword, const QImage & icon, QColor color, bool bold) {
QRegularExpression regexp(keyword,
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QRegularExpression::PatternOptions(QRegularExpression::CaseInsensitiveOption)
#else
Qt::CaseInsensitive
#endif
);
registerCategory(label, regexp, icon, color, bold);
}
void LogView::registerCategory(const QString & label, QRegularExpression regexp, const QImage & icon, QColor color, bool bold) {
if (!regexp.isValid() || regexp.pattern().isEmpty()) return;
removeCategory(regexp);
Category c;
c.regexp = regexp;
c.label = label;
c.image = icon;
c.color = color;
c.bold = bold;
c.makeIcon(iconImageSize(), preferredIconSize(1., this));
categories.append(c);
ui->comboCategory->addItem(c.icon, label, QVariant(regexp));
}
void LogView::removeCategory(QString keyword) {
QRegularExpression regexp(keyword,
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QRegularExpression::PatternOptions(QRegularExpression::CaseInsensitiveOption)
#else
Qt::CaseInsensitive
#endif
);
removeCategory(regexp);
}
void LogView::removeCategory(QRegularExpression regexp) {
Category c;
c.regexp = regexp;
categories.removeAll(c);
for (int i = 1; i < ui->comboCategory->count(); ++i) {
if (ui->comboCategory->itemData(i).
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
toRegularExpression()
#else
toRegExp()
#endif
.pattern() == regexp.pattern()) {
ui->comboCategory->removeItem(i);
--i;
}
}
}
void LogView::clearCategories() {
ui->comboCategory->blockSignals(true);
while (ui->comboCategory->count() > 1)
ui->comboCategory->removeItem(ui->comboCategory->count() - 1);
categories.clear();
ui->comboCategory->blockSignals(false);
filter();
}
void LogView::addText(const QString & text, bool insert_newline) {
if (text.isEmpty()) return;
QTextCursor tc(ui->textEdit->document());
QStringList sl = text.split("\n");
tc.movePosition(QTextCursor::End);
QScrollBar * bar = ui->textEdit->verticalScrollBar();
bool at_end = (bar->value() == bar->maximum()) || bar->isHidden();
for (int i = 0; i < sl.size(); ++i) {
tc.insertText(sl[i]);
if ((i < sl.size() - 1) || insert_newline)
newLine();
}
if (at_end)
scrollToBottom();
}
void LogView::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
ui->comboCategory->setItemText(0, tr("All"));
actionLogSelectAll->setText(tr("Select All"));
actionLogCopy->setText(tr("Copy"));
actionLogClear->setText(tr("Clear"));
break;
case QEvent::Polish: {
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
QSize is = iconImageSize(), is_i = preferredIconSize(1., this);
for (int i = 0; i < categories.size(); ++i)
categories[i].makeIcon(is, is_i);
} break;
default: break;
}
}
void LogView::newLine() {
QTextCursor tc(ui->textEdit->document());
tc.movePosition(QTextCursor::End);
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
QString line = tc.selectedText();
QImage icon;
foreach (const Category & c, categories) {
if (line.contains(c.regexp)) {
QTextCharFormat cf = def_cf;
cf.setForeground(c.color);
if (c.bold)
cf.setFontWeight(QFont::Bold);
tc.setCharFormat(cf);
icon = c.icon_image;
break;
}
}
if (!icon.isNull()) {
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);
tc.insertImage(icon);
}
QRegularExpression regexp =
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
ui->comboCategory->currentData().toRegularExpression();
#else
ui->comboCategory->itemData(ui->comboCategory->currentIndex()).toRegExp();
#endif
QString fs = ui->lineEdit->text();
if (isFilterVisible())
filterBlock(tc.block(), fs, regexp);
tc.movePosition(QTextCursor::End);
tc.setCharFormat(def_cf);
tc.insertBlock();
}
QSize LogView::iconImageSize() {
int hei = QFontMetrics(ui->textEdit->document()->defaultFont()).height() / 1.25;
return QSize(hei, hei);
}
void LogView::filterBlock(QTextBlock block, const QString & fs, const QRegularExpression & regexp) {
bool vis = true;//, pvis = block.isVisible();
QString line = block.text();
if (!line.isEmpty()) {
if (line[0] == QChar::ObjectReplacementCharacter)
line.remove(0, 1);
}
if (regexp.isValid()) vis = vis && line.contains(regexp);
if (!fs.isEmpty()) vis = vis && line.contains(fs, Qt::CaseInsensitive);
block.setVisible(vis);
//qDebug() << "filterBlock" << line << vis;
//if (vis != pvis)
// ;//ui->textEdit->document()->mar
}
void LogView::setFilterVisible(bool yes) {
ui->widgetToolbar->setHidden(!yes);
filter();
}
void LogView::setLinesLimit(int l) {
ui->textEdit->document()->setMaximumBlockCount(l <= 0 ? 0 : l + 1);
}
void LogView::clear() {
ui->textEdit->clear();
}
void LogView::scrollToBottom() {
QScrollBar * bar = ui->textEdit->verticalScrollBar();
bar->setValue(bar->maximum());
}
void LogView::filter() {
QTextDocument * doc = ui->textEdit->document();
int bc = doc->blockCount();
QRegularExpression regexp;
QString fs;
if (isFilterVisible()) {
regexp =
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
ui->comboCategory->currentData().toRegularExpression();
#else
ui->comboCategory->itemData(ui->comboCategory->currentIndex()).toRegExp();
#endif
fs = ui->lineEdit->text();
}
QTextBlock bl;
for (int i = 0; i < bc; ++i) {
bl = doc->findBlockByNumber(i);
filterBlock(bl, fs, regexp);
}
doc->markContentsDirty(0, bl.position() + bl.length());
}

114
qad/application/logview.h Normal file
View File

@@ -0,0 +1,114 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOGVIEW_H
#define LOGVIEW_H
#include <QWidget>
#include <QIcon>
#include <QImage>
#include <QTextBlockFormat>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
# include <QRegularExpression>
#else
# include <QRegExp>
typedef QRegExp QRegularExpression;
#endif
#include "qad_export.h"
class QTextEdit;
class QTextBlock;
class QAction;
namespace Ui {
class LogView;
}
class QAD_EXPORT LogView: public QWidget
{
Q_OBJECT
Q_PROPERTY(bool filterVisible READ isFilterVisible WRITE setFilterVisible)
Q_PROPERTY(int linesLimit READ linesLimit WRITE setLinesLimit)
Q_PROPERTY(QFont logFont READ logFont WRITE setLogFont)
public:
explicit LogView(QWidget * parent = 0);
~LogView();
const QTextEdit * textEdit() const;
void setLogFont(QFont f);
QFont logFont() const;
bool isFilterVisible() const;
int linesLimit() const;
void registerCategory(const QString & label,
QString keyword = QString(),
const QImage & icon = QImage(),
QColor color = QColor(),
bool bold = false);
void registerCategory(const QString & label,
QRegularExpression regexp,
const QImage & icon = QImage(),
QColor color = QColor(),
bool bold = false);
void removeCategory(QString keyword);
void removeCategory(QRegularExpression regexp);
void clearCategories();
void addText(const QString & text, bool insert_newline = true);
private:
struct Category {
Category();
void makeIcon(QSize size, QSize size_icon);
QString label;
QRegularExpression regexp;
QImage image, icon_image;
QIcon icon;
QColor color;
bool bold;
inline bool operator ==(const Category & it) const {return (regexp.pattern() == it.regexp.pattern());}
};
void changeEvent(QEvent * e);
void newLine();
QSize iconImageSize();
void filterBlock(QTextBlock block, const QString & fs, const QRegularExpression & regexp);
Ui::LogView * ui;
QList<Category> categories;
QTextCharFormat def_cf;
QAction * actionLogSelectAll, * actionLogCopy, * actionLogClear;
public slots:
void setFilterVisible(bool yes);
void setLinesLimit(int l);
void clear();
private slots:
void scrollToBottom();
void filter();
signals:
};
#endif // LOGVIEW_H

198
qad/application/logview.ui Normal file
View File

@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LogView</class>
<widget class="QWidget" name="LogView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>724</width>
<height>502</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widgetToolbar" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="buttonClear"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelIconSearch">
<property name="pixmap">
<pixmap resource="qad_application.qrc">:/icons/edit-find.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="CLineEdit" name="lineEdit"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Category:</string>
</property>
</widget>
</item>
<item>
<widget class="EComboBox" name="comboCategory"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEdit">
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
<action name="actionClear">
<property name="icon">
<iconset resource="qad_application.qrc">
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
</property>
<property name="text">
<string>Clear</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>CLineEdit</class>
<extends>QLineEdit</extends>
<header>clineedit.h</header>
</customwidget>
<customwidget>
<class>EComboBox</class>
<extends>QComboBox</extends>
<header>ecombobox.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="qad_application.qrc"/>
</resources>
<connections>
<connection>
<sender>actionClear</sender>
<signal>triggered()</signal>
<receiver>LogView</receiver>
<slot>clear()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>361</x>
<y>250</y>
</hint>
</hints>
</connection>
<connection>
<sender>lineEdit</sender>
<signal>textChanged(QString)</signal>
<receiver>LogView</receiver>
<slot>filter()</slot>
<hints>
<hint type="sourcelabel">
<x>544</x>
<y>138</y>
</hint>
<hint type="destinationlabel">
<x>728</x>
<y>90</y>
</hint>
</hints>
</connection>
<connection>
<sender>comboCategory</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>LogView</receiver>
<slot>filter()</slot>
<hints>
<hint type="sourcelabel">
<x>675</x>
<y>134</y>
</hint>
<hint type="destinationlabel">
<x>728</x>
<y>76</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>clear()</slot>
<slot>filter()</slot>
</slots>
</ui>

View File

@@ -0,0 +1,69 @@
#include "logview.h"
#include "logviewplugin.h"
#include <QtCore/QtPlugin>
LogViewPlugin::LogViewPlugin(QObject * parent): QObject(parent) {
m_initialized = false;
}
void LogViewPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
if (m_initialized)
return;
// Add extension registrations, etc. here
m_initialized = true;
}
bool LogViewPlugin::isInitialized() const {
return m_initialized;
}
QWidget * LogViewPlugin::createWidget(QWidget * parent) {
return new LogView(parent);
}
QString LogViewPlugin::name() const {
return QLatin1String("LogView");
}
QString LogViewPlugin::group() const {
return QLatin1String("Display Widgets");
}
QIcon LogViewPlugin::icon() const {
return QIcon(":/icons/logview.png");
}
QString LogViewPlugin::toolTip() const {
return QLatin1String("");
}
QString LogViewPlugin::whatsThis() const {
return QLatin1String("");
}
bool LogViewPlugin::isContainer() const {
return true;
}
QString LogViewPlugin::domXml() const {
return QLatin1String("<widget class=\"LogView\" name=\"logView\">\n</widget>\n");
}
QString LogViewPlugin::includeFile() const {
return QLatin1String("logview.h");
}

View File

@@ -0,0 +1,36 @@
#ifndef LOGVIEWPLUGIN_H
#define LOGVIEWPLUGIN_H
#include <QObject>
#if QT_VERSION >= 0x050000
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
#else
# include <QDesignerCustomWidgetInterface>
#endif
class LogViewPlugin: public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
LogViewPlugin(QObject * parent = 0);
bool isContainer() const;
bool isInitialized() const;
QIcon icon() const;
QString domXml() const;
QString group() const;
QString includeFile() const;
QString name() const;
QString toolTip() const;
QString whatsThis() const;
QWidget * createWidget(QWidget * parent);
void initialize(QDesignerFormEditorInterface * core);
private:
bool m_initialized;
};
#endif // LOGVIEWPLUGIN_H

View File

@@ -2,12 +2,14 @@
#include "edockwidgetplugin.h" #include "edockwidgetplugin.h"
#include "emainwindowplugin.h" #include "emainwindowplugin.h"
#include "historyviewplugin.h" #include "historyviewplugin.h"
#include "logviewplugin.h"
QADApplication::QADApplication(QObject * parent): QObject(parent) { QADApplication::QADApplication(QObject * parent): QObject(parent) {
//m_widgets.append(new EDockWidgetPlugin(this)); //m_widgets.append(new EDockWidgetPlugin(this));
m_widgets.append(new EMainWindowPlugin(this)); m_widgets.append(new EMainWindowPlugin(this));
m_widgets.append(new HistoryViewPlugin(this)); m_widgets.append(new HistoryViewPlugin(this));
m_widgets.append(new LogViewPlugin(this));
} }
@@ -17,5 +19,5 @@ QList<QDesignerCustomWidgetInterface * > QADApplication::customWidgets() const {
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(qad_graphic_plugin, QADApplication) Q_EXPORT_PLUGIN2(qad_application_plugin, QADApplication)
#endif #endif

View File

@@ -27,6 +27,9 @@
<file>../icons/clear-history.png</file> <file>../icons/clear-history.png</file>
<file>../icons/layer-visible-off.png</file> <file>../icons/layer-visible-off.png</file>
<file>../icons/layer-visible-on.png</file> <file>../icons/layer-visible-on.png</file>
<file>../icons/logview.png</file>
<file>../icons/qt.png</file> <file>../icons/qt.png</file>
<file>../icons/select-all.png</file>
<file>../icons/select-none.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QSINGLEAPPLICATION_H #ifndef QSINGLEAPPLICATION_H
#define QSINGLEAPPLICATION_H #define QSINGLEAPPLICATION_H

View File

@@ -49,6 +49,18 @@ void Ribbon::timerEvent(QTimerEvent * e) {
} }
void Ribbon::changeEvent(QEvent * e) {
QToolBar::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
retranslate();
break;
default:
break;
}
}
void Ribbon::_resize() { void Ribbon::_resize() {
return; // WARNING return; // WARNING
for (int i = 0; i < tab->count(); ++i) { for (int i = 0; i < tab->count(); ++i) {

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RIBBON_H #ifndef RIBBON_H
#define RIBBON_H #define RIBBON_H
@@ -35,6 +54,7 @@ public:
private: private:
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void timerEvent(QTimerEvent * e); void timerEvent(QTimerEvent * e);
void changeEvent(QEvent *e);
void _resize(); void _resize();
void _setIconsSize(); void _setIconsSize();

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ALIGNEDTEXTITEM_H #ifndef ALIGNEDTEXTITEM_H
#define ALIGNEDTEXTITEM_H #define ALIGNEDTEXTITEM_H

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKBASE_H #ifndef BLOCKBASE_H
#define BLOCKBASE_H #define BLOCKBASE_H

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKBUSITEM_H #ifndef BLOCKBUSITEM_H
#define BLOCKBUSITEM_H #define BLOCKBUSITEM_H

View File

@@ -173,6 +173,17 @@ bool BlockEditor::eventFilter(QObject *o, QEvent *e) {
} }
void BlockEditor::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default: break;
}
}
void BlockEditor::on_actionRemove_items_triggered() { void BlockEditor::on_actionRemove_items_triggered() {
QList<QGraphicsItem*> si = ui->blockView->scene()->selectedItems(); QList<QGraphicsItem*> si = ui->blockView->scene()->selectedItems();
foreach (QGraphicsItem * i, si) foreach (QGraphicsItem * i, si)
@@ -342,12 +353,12 @@ QWidget * PinAlignDelegate::createEditor(QWidget * parent, const QStyleOptionVie
QString PinAlignDelegate::displayText(const QVariant & value, const QLocale & locale) const { QString PinAlignDelegate::displayText(const QVariant & value, const QLocale & locale) const {
int cv = value.toInt(); int cv = value.toInt();
switch (cv) { switch (cv) {
case Qt::AlignLeft: return "Left"; break; case Qt::AlignLeft: return tr("Left"); break;
case Qt::AlignRight: return "Right"; break; case Qt::AlignRight: return tr("Right"); break;
case Qt::AlignTop: return "Top"; break; case Qt::AlignTop: return tr("Top"); break;
case Qt::AlignBottom: return "Bottom"; break; case Qt::AlignBottom: return tr("Bottom"); break;
} }
return "unknown"; return tr("unknown");
} }

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKEDITOR_H #ifndef BLOCKEDITOR_H
#define BLOCKEDITOR_H #define BLOCKEDITOR_H
@@ -52,6 +71,7 @@ private slots:
private: private:
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void changeEvent(QEvent * e);
Ui::BlockEditor *ui; Ui::BlockEditor *ui;
QMap<int, QTreeWidgetItem*> pin_tli; QMap<int, QTreeWidgetItem*> pin_tli;

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKITEM_H #ifndef BLOCKITEM_H
#define BLOCKITEM_H #define BLOCKITEM_H

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKITEMPIN_H #ifndef BLOCKITEMPIN_H
#define BLOCKITEMPIN_H #define BLOCKITEMPIN_H

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKVIEW_H #ifndef BLOCKVIEW_H
#define BLOCKVIEW_H #define BLOCKVIEW_H

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BLOCKVIEWWAVETRACE_H #ifndef BLOCKVIEWWAVETRACE_H
#define BLOCKVIEWWAVETRACE_H #define BLOCKVIEWWAVETRACE_H

View File

@@ -225,7 +225,7 @@ bool _DTSizeItem::sceneEventFilter(QGraphicsItem * watched, QEvent * event) {
DrawTools::DrawTools(BlockView * parent): QObject(parent), DrawTools::DrawTools(BlockView * parent): QWidget(parent),
actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(this) { actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(this) {
widget_props = new QWidget(); widget_props = new QWidget();
ui = new Ui::DrawTools(); ui = new Ui::DrawTools();
@@ -238,9 +238,6 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
int fh = qMax<int>(QApplication::fontMetrics().size(0, "0").height(), 22); int fh = qMax<int>(QApplication::fontMetrics().size(0, "0").height(), 22);
int thick = lineThickness(); int thick = lineThickness();
QSize sz(fh * 2.5, fh); QSize sz(fh * 2.5, fh);
QStringList styles;
styles << tr("NoPen") << tr("Solid") << tr("Dash")
<< tr("Dot") << tr("Dash-Dot") << tr("Dash-Dot-Dot");
ui->comboLineStyle->setIconSize(sz); ui->comboLineStyle->setIconSize(sz);
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
QPixmap pix(sz); QPixmap pix(sz);
@@ -249,7 +246,7 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
p.setPen(QPen(Qt::black, thick, (Qt::PenStyle)i)); p.setPen(QPen(Qt::black, thick, (Qt::PenStyle)i));
p.drawLine(0, pix.height() / 2, pix.width(), pix.height() / 2); p.drawLine(0, pix.height() / 2, pix.width(), pix.height() / 2);
p.end(); p.end();
ui->comboLineStyle->addItem(QIcon(pix), styles[i]); ui->comboLineStyle->addItem(QIcon(pix), "");
} }
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
setAlignCompact(true); setAlignCompact(true);
@@ -264,22 +261,21 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
new_item = cur_item = 0; new_item = cur_item = 0;
view_ = 0; view_ = 0;
resize_enabled = true; resize_enabled = true;
text_dlg.setWindowTitle(tr("Edit text"));
text_dlg.setLayout(new QBoxLayout(QBoxLayout::TopToBottom)); text_dlg.setLayout(new QBoxLayout(QBoxLayout::TopToBottom));
QDialogButtonBox * bbox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel); QDialogButtonBox * bbox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
connect(bbox, SIGNAL(accepted()), &text_dlg, SLOT(accept())); connect(bbox, SIGNAL(accepted()), &text_dlg, SLOT(accept()));
connect(bbox, SIGNAL(rejected()), &text_dlg, SLOT(reject())); connect(bbox, SIGNAL(rejected()), &text_dlg, SLOT(reject()));
text_dlg.layout()->addWidget(&text_edit); text_dlg.layout()->addWidget(&text_edit);
text_dlg.layout()->addWidget(bbox); text_dlg.layout()->addWidget(bbox);
actions_Z_up.setText(tr("Bring\nforward")); actions_Z_up.setIcon(QIcon(":/icons/z-up.png")); actions_Z_up.setEnabled(false); actions_Z_up.setIcon(QIcon(":/icons/z-up.png")); actions_Z_up.setEnabled(false);
actions_Z_top.setText(tr("Bring\nto front")); actions_Z_top.setIcon(QIcon(":/icons/z-top.png")); actions_Z_top.setEnabled(false); actions_Z_top.setIcon(QIcon(":/icons/z-top.png")); actions_Z_top.setEnabled(false);
actions_Z_down.setText(tr("Send\nbackward")); actions_Z_down.setIcon(QIcon(":/icons/z-down.png")); actions_Z_down.setEnabled(false); actions_Z_down.setIcon(QIcon(":/icons/z-down.png")); actions_Z_down.setEnabled(false);
actions_Z_bottom.setText(tr("Send\nto back")); actions_Z_bottom.setIcon(QIcon(":/icons/z-bottom.png")); actions_Z_bottom.setEnabled(false); actions_Z_bottom.setIcon(QIcon(":/icons/z-bottom.png")); actions_Z_bottom.setEnabled(false);
actions_add << newAction(tr("Draw\nRectangle"), QIcon(":/icons/draw-rectangle.png"), 1) actions_add << newAction(QIcon(":/icons/draw-rectangle.png"), 1)
<< newAction(tr("Draw\nEllipse"), QIcon(":/icons/draw-ellipse.png"), 2) << newAction(QIcon(":/icons/draw-ellipse.png"), 2)
<< newAction(tr("Draw\nLine"), QIcon(":/icons/draw-line.png"), 4) << newAction(QIcon(":/icons/draw-line.png"), 4)
<< newAction(tr("Draw\nText"), QIcon(":/icons/draw-text.png"), 0) << newAction(QIcon(":/icons/draw-text.png"), 0)
<< newAction(tr("Draw\nImage"), QIcon(":/icons/view-preview.png"), 3); << newAction(QIcon(":/icons/view-preview.png"), 3);
buttons_align << ui->buttonAlignTL << ui->buttonAlignTC << ui->buttonAlignTR buttons_align << ui->buttonAlignTL << ui->buttonAlignTC << ui->buttonAlignTR
<< ui->buttonAlignCL << ui->buttonAlignCC << ui->buttonAlignCR << ui->buttonAlignCL << ui->buttonAlignCC << ui->buttonAlignCR
<< ui->buttonAlignBL << ui->buttonAlignBC << ui->buttonAlignBR; << ui->buttonAlignBL << ui->buttonAlignBC << ui->buttonAlignBR;
@@ -321,6 +317,7 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
connect(&actions_Z_down, SIGNAL(triggered(bool)), this, SLOT(actionZ_triggered())); connect(&actions_Z_down, SIGNAL(triggered(bool)), this, SLOT(actionZ_triggered()));
connect(&actions_Z_bottom, SIGNAL(triggered(bool)), this, SLOT(actionZ_triggered())); connect(&actions_Z_bottom, SIGNAL(triggered(bool)), this, SLOT(actionZ_triggered()));
setBlockView(parent); setBlockView(parent);
retranslate();
} }
@@ -331,6 +328,24 @@ DrawTools::~DrawTools() {
} }
void DrawTools::retranslate() {
QStringList styles;
styles << tr("NoPen") << tr("Solid") << tr("Dash")
<< tr("Dot") << tr("Dash-Dot") << tr("Dash-Dot-Dot");
for (int i = 0; i < styles.size(); i++) ui->comboLineStyle->setItemText(i, styles[i]);
text_dlg.setWindowTitle(tr("Edit text"));
actions_Z_up.setText(tr("Bring\nforward"));
actions_Z_top.setText(tr("Bring\nto front"));
actions_Z_down.setText(tr("Send\nbackward"));
actions_Z_bottom.setText(tr("Send\nto back"));
actions_add[0]->setText(tr("Draw\nRectangle"));
actions_add[1]->setText(tr("Draw\nEllipse"));
actions_add[2]->setText(tr("Draw\nLine"));
actions_add[3]->setText(tr("Draw\nText"));
actions_add[4]->setText(tr("Draw\nImage"));
}
void DrawTools::setBlockView(BlockView * v) { void DrawTools::setBlockView(BlockView * v) {
if (view_) view_->viewport()->removeEventFilter(this); if (view_) view_->viewport()->removeEventFilter(this);
disconnect(this, SLOT(selectionChanged())); disconnect(this, SLOT(selectionChanged()));
@@ -454,6 +469,18 @@ bool DrawTools::eventFilter(QObject * o, QEvent * e) {
} }
void DrawTools::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
retranslate();
break;
default: break;
}
}
QComboBox * DrawTools::textEditCombo() const { QComboBox * DrawTools::textEditCombo() const {
return ui->comboText; return ui->comboText;
} }
@@ -468,8 +495,8 @@ void DrawTools::changeEvent(QEvent * e) {
} }
*/ */
QAction * DrawTools::newAction(const QString & text, const QIcon & icon, int type) { QAction * DrawTools::newAction(const QIcon & icon, int type) {
QAction * ret = new QAction(icon, text, this); QAction * ret = new QAction(icon, QString(), this);
ret->setCheckable(true); ret->setCheckable(true);
ret->setData(type); ret->setData(type);
return ret; return ret;
@@ -509,7 +536,7 @@ void DrawTools::alignClicked() {
} }
void DrawTools::setTollButtonsEnabled(bool pen, bool brush, bool wid_hei) { void DrawTools::setToolButtonsEnabled(bool pen, bool brush, bool wid_hei) {
ui->labelPen->setEnabled(pen); ui->labelPen->setEnabled(pen);
ui->colorButtonPen->setEnabled(pen); ui->colorButtonPen->setEnabled(pen);
ui->labelBrush->setEnabled(brush); ui->labelBrush->setEnabled(brush);
@@ -620,7 +647,7 @@ void DrawTools::selectionChanged() {
font_dlg.blockSignals(true); font_dlg.blockSignals(true);
font_dlg.setCurrentFont(itext->font()); font_dlg.setCurrentFont(itext->font());
font_dlg.blockSignals(false); font_dlg.blockSignals(false);
setTollButtonsEnabled(true, false, false); setToolButtonsEnabled(true, false, false);
ui->widgetAlign2->setEnabled(false); ui->widgetAlign2->setEnabled(false);
ui->widgetAlign9->setEnabled(false); ui->widgetAlign9->setEnabled(false);
size_item.assignObject(itext); size_item.assignObject(itext);
@@ -631,7 +658,7 @@ void DrawTools::selectionChanged() {
font_dlg.blockSignals(true); font_dlg.blockSignals(true);
font_dlg.setCurrentFont(iatext->font()); font_dlg.setCurrentFont(iatext->font());
font_dlg.blockSignals(false); font_dlg.blockSignals(false);
setTollButtonsEnabled(true, false, false); setToolButtonsEnabled(true, false, false);
foreach (QAction * a, menu_hor.actions()) a->setChecked(false); foreach (QAction * a, menu_hor.actions()) a->setChecked(false);
foreach (QAction * a, menu_ver.actions()) a->setChecked(false); foreach (QAction * a, menu_ver.actions()) a->setChecked(false);
align = iatext->alignment(); align = iatext->alignment();
@@ -655,7 +682,7 @@ void DrawTools::selectionChanged() {
} else if (ipixmap) { } else if (ipixmap) {
ui->stackedProperties->setCurrentIndex(2); ui->stackedProperties->setCurrentIndex(2);
ui->spinScale->setValue(sqrt(ipixmap->transform().determinant())); ui->spinScale->setValue(sqrt(ipixmap->transform().determinant()));
setTollButtonsEnabled(false, false, false); setToolButtonsEnabled(false, false, false);
size_item.assignObject(ipixmap); size_item.assignObject(ipixmap);
} else if (irect || iell) { } else if (irect || iell) {
ui->stackedProperties->setCurrentIndex(1); ui->stackedProperties->setCurrentIndex(1);
@@ -675,7 +702,7 @@ void DrawTools::selectionChanged() {
ui->colorButtonBrush->setColor(ishape->brush().color()); ui->colorButtonBrush->setColor(ishape->brush().color());
ui->spinThick->setValue(ishape->pen().widthF()); ui->spinThick->setValue(ishape->pen().widthF());
ui->comboLineStyle->setCurrentIndex(qMin<int>((int)ishape->pen().style(), ui->comboLineStyle->count() - 1)); ui->comboLineStyle->setCurrentIndex(qMin<int>((int)ishape->pen().style(), ui->comboLineStyle->count() - 1));
setTollButtonsEnabled(true, true, true); setToolButtonsEnabled(true, true, true);
if (resize_enabled) if (resize_enabled)
size_item.assignObject(ishape); size_item.assignObject(ishape);
} }
@@ -684,7 +711,7 @@ void DrawTools::selectionChanged() {
ui->colorButtonPen->setColor(iline->pen().color()); ui->colorButtonPen->setColor(iline->pen().color());
ui->spinThick->setValue(iline->pen().widthF()); ui->spinThick->setValue(iline->pen().widthF());
ui->comboLineStyle->setCurrentIndex(qMin<int>((int)iline->pen().style(), ui->comboLineStyle->count() - 1)); ui->comboLineStyle->setCurrentIndex(qMin<int>((int)iline->pen().style(), ui->comboLineStyle->count() - 1));
setTollButtonsEnabled(true, false, false); setToolButtonsEnabled(true, false, false);
if (resize_enabled) if (resize_enabled)
size_item.assignObject(iline); size_item.assignObject(iline);
} else { } else {

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DRAWTOOLS_H #ifndef DRAWTOOLS_H
#define DRAWTOOLS_H #define DRAWTOOLS_H
@@ -53,7 +72,7 @@ namespace Ui {
} }
class QAD_EXPORT DrawTools: public QObject class QAD_EXPORT DrawTools: public QWidget
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool resizeHandlesEnabled READ isResizeHandlesEnabled WRITE setResizeHandlesEnabled) Q_PROPERTY(bool resizeHandlesEnabled READ isResizeHandlesEnabled WRITE setResizeHandlesEnabled)
@@ -73,9 +92,10 @@ public:
protected: protected:
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void changeEvent(QEvent * e);
QAction * newAction(const QString & text, const QIcon & icon, int type); QAction * newAction(const QIcon & icon, int type);
void setTollButtonsEnabled(bool pen, bool brush, bool wid_hei); void setToolButtonsEnabled(bool pen, bool brush, bool wid_hei);
void blockPropSignals(bool block_); void blockPropSignals(bool block_);
void actionAlignTrigger(bool vert, Qt::AlignmentFlag value); void actionAlignTrigger(bool vert, Qt::AlignmentFlag value);
void emitZAvailabe(QGraphicsItem * item = 0); void emitZAvailabe(QGraphicsItem * item = 0);
@@ -131,6 +151,8 @@ signals:
void itemEdited(QGraphicsItem * item); void itemEdited(QGraphicsItem * item);
void itemZChanged(QGraphicsItem * item); void itemZChanged(QGraphicsItem * item);
private:
void retranslate();
}; };

View File

@@ -526,22 +526,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" rowspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3"> <item row="1" column="3">
<widget class="QLabel" name="labelStyle"> <widget class="QLabel" name="labelStyle">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -561,6 +545,22 @@
<item row="1" column="4"> <item row="1" column="4">
<widget class="QComboBox" name="comboLineStyle"/> <widget class="QComboBox" name="comboLineStyle"/>
</item> </item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@@ -0,0 +1,383 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>BlockBusItem</name>
<message>
<location filename="../blockbusitem.cpp" line="499"/>
<source>Add point: Ctrl + LeftClick
Remove point\segment: Ctrl + RightClick
New branch: Shift + LeftClick
Remove connection: Shift + RightClick</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BlockEditor</name>
<message>
<location filename="../blockeditor.ui" line="14"/>
<source>Block editor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="32"/>
<source>Block parameters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="59"/>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="79"/>
<source>Heigth:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="99"/>
<source>Pins margin:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="119"/>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="130"/>
<source>Pins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="179"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="184"/>
<source>Bus</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="194"/>
<source>Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="205"/>
<source>Clone</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="232"/>
<source>Remove selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="243"/>
<source>Remove all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="346"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="353"/>
<location filename="../blockeditor.ui" line="383"/>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="376"/>
<source>Save as ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="406"/>
<source>Load ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="413"/>
<source>Ctrl+O</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="433"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="450"/>
<source>Remove items</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.ui" line="453"/>
<source>Del</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DrawTools</name>
<message>
<location filename="../drawtools.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="51"/>
<source>Font ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="62"/>
<source>Text:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="91"/>
<location filename="../drawtools.ui" line="94"/>
<source>Edit text ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="123"/>
<location filename="../drawtools.ui" line="137"/>
<location filename="../drawtools.ui" line="230"/>
<source>Align center left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="178"/>
<source>Align center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="204"/>
<source>Align center right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="256"/>
<source>Align top right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="282"/>
<source>Align bottom right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="308"/>
<source>Align bottom center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="334"/>
<source>Align top left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="360"/>
<source>Align top center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="386"/>
<source>Align bottom left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="471"/>
<source>Width: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="506"/>
<source>Thickness: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="522"/>
<source>Height:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="538"/>
<source>Style:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="591"/>
<source>Load image ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="608"/>
<source>Paste image ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="641"/>
<source>Scale:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="750"/>
<source>Top</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="758"/>
<location filename="../drawtools.ui" line="761"/>
<location filename="../drawtools.ui" line="780"/>
<location filename="../drawtools.ui" line="783"/>
<source>Center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="769"/>
<location filename="../drawtools.ui" line="772"/>
<source>Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="791"/>
<location filename="../drawtools.ui" line="794"/>
<source>Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.ui" line="802"/>
<location filename="../drawtools.ui" line="805"/>
<source>Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="333"/>
<source>NoPen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="333"/>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="333"/>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="334"/>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="334"/>
<source>Dash-Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="334"/>
<source>Dash-Dot-Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="336"/>
<source>Edit text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="337"/>
<source>Bring
forward</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="338"/>
<source>Bring
to front</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="339"/>
<source>Send
backward</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="340"/>
<source>Send
to back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="341"/>
<source>Draw
Rectangle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="342"/>
<source>Draw
Ellipse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="343"/>
<source>Draw
Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="344"/>
<source>Draw
Text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="345"/>
<source>Draw
Image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../drawtools.cpp" line="824"/>
<source>Select image</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PinAlignDelegate</name>
<message>
<location filename="../blockeditor.cpp" line="356"/>
<source>Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="357"/>
<source>Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="358"/>
<source>Top</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="359"/>
<source>Bottom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="361"/>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -4,7 +4,7 @@
<context> <context>
<name>BlockBusItem</name> <name>BlockBusItem</name>
<message> <message>
<location filename="../blockbusitem.cpp" line="453"/> <location filename="../blockbusitem.cpp" line="499"/>
<source>Add point: Ctrl + LeftClick <source>Add point: Ctrl + LeftClick
Remove point\segment: Ctrl + RightClick Remove point\segment: Ctrl + RightClick
New branch: Shift + LeftClick New branch: Shift + LeftClick
@@ -18,110 +18,110 @@ Remove connection: Shift + RightClick</source>
<context> <context>
<name>BlockEditor</name> <name>BlockEditor</name>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="14"/> <location filename="../blockeditor.ui" line="14"/>
<source>Block editor</source> <source>Block editor</source>
<translation type="unfinished"></translation> <translation>Редактор блока</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="32"/> <location filename="../blockeditor.ui" line="32"/>
<source>Block parameters</source> <source>Block parameters</source>
<translation type="unfinished"></translation> <translation>Параметры блока</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="59"/> <location filename="../blockeditor.ui" line="59"/>
<source>Width:</source> <source>Width:</source>
<translation type="unfinished"></translation> <translation>Ширина:</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="79"/> <location filename="../blockeditor.ui" line="79"/>
<source>Heigth:</source> <source>Heigth:</source>
<translation type="unfinished"></translation> <translation>Высота:</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="99"/> <location filename="../blockeditor.ui" line="99"/>
<source>Pins margin:</source> <source>Pins margin:</source>
<translation type="unfinished"></translation> <translation>Поля пина:</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="119"/> <location filename="../blockeditor.ui" line="119"/>
<source>Color:</source> <source>Color:</source>
<translation type="unfinished"></translation> <translation>Цвет:</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="130"/> <location filename="../blockeditor.ui" line="130"/>
<source>Pins</source> <source>Pins</source>
<translation type="unfinished"></translation> <translation>Пины</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="179"/> <location filename="../blockeditor.ui" line="179"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation>Имя</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="184"/> <location filename="../blockeditor.ui" line="184"/>
<source>Bus</source> <source>Bus</source>
<translation type="unfinished"></translation> <translation>Шина</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="194"/> <location filename="../blockeditor.ui" line="194"/>
<source>Add</source> <source>Add</source>
<translation type="unfinished"></translation> <translation>Добавить</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="205"/> <location filename="../blockeditor.ui" line="205"/>
<source>Clone</source> <source>Clone</source>
<translation type="unfinished"></translation> <translation>Клонировать</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="232"/> <location filename="../blockeditor.ui" line="232"/>
<source>Remove selected</source> <source>Remove selected</source>
<translation type="unfinished"></translation> <translation>Удалить выбранные</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="243"/> <location filename="../blockeditor.ui" line="243"/>
<source>Remove all</source> <source>Remove all</source>
<translation type="unfinished"></translation> <translation>Удалить все</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="330"/> <location filename="../blockeditor.ui" line="346"/>
<source>Save</source> <source>Save</source>
<translation type="unfinished"></translation> <translation>Сохранить</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="337"/> <location filename="../blockeditor.ui" line="353"/>
<location filename="../blockeditor/blockeditor.ui" line="367"/> <location filename="../blockeditor.ui" line="383"/>
<source>Ctrl+S</source> <source>Ctrl+S</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="360"/> <location filename="../blockeditor.ui" line="376"/>
<source>Save as ...</source> <source>Save as ...</source>
<translation type="unfinished"></translation> <translation>Сохранить как ...</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="390"/> <location filename="../blockeditor.ui" line="406"/>
<source>Load ...</source> <source>Load ...</source>
<translation type="unfinished"></translation> <translation>Открыть ...</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="397"/> <location filename="../blockeditor.ui" line="413"/>
<source>Ctrl+O</source> <source>Ctrl+O</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="417"/> <location filename="../blockeditor.ui" line="433"/>
<source>Clear</source> <source>Clear</source>
<translation type="unfinished"></translation> <translation>Очистить</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="434"/> <location filename="../blockeditor.ui" line="450"/>
<source>Remove items</source> <source>Remove items</source>
<translation type="unfinished"></translation> <translation>Удалить элементы</translation>
</message> </message>
<message> <message>
<location filename="../blockeditor/blockeditor.ui" line="437"/> <location filename="../blockeditor.ui" line="453"/>
<source>Del</source> <source>Del</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
</context> </context>
<context> <context>
@@ -214,7 +214,7 @@ Remove connection: Shift + RightClick</source>
<translation>Высота:</translation> <translation>Высота:</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="554"/> <location filename="../drawtools.ui" line="538"/>
<source>Style:</source> <source>Style:</source>
<translation>Стиль:</translation> <translation>Стиль:</translation>
</message> </message>
@@ -224,143 +224,176 @@ Remove connection: Shift + RightClick</source>
<translation>Загрузить картинку ...</translation> <translation>Загрузить картинку ...</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="624"/> <location filename="../drawtools.ui" line="608"/>
<source>Paste image ...</source>
<translation>Вставить картинку ...</translation>
</message>
<message>
<location filename="../drawtools.ui" line="641"/>
<source>Scale:</source> <source>Scale:</source>
<translation>Масштаб:</translation> <translation>Масштаб:</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="727"/> <location filename="../drawtools.ui" line="750"/>
<source>Top</source> <source>Top</source>
<translation type="unfinished"></translation> <translation>Верх</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="735"/> <location filename="../drawtools.ui" line="758"/>
<location filename="../drawtools.ui" line="738"/> <location filename="../drawtools.ui" line="761"/>
<location filename="../drawtools.ui" line="757"/> <location filename="../drawtools.ui" line="780"/>
<location filename="../drawtools.ui" line="760"/> <location filename="../drawtools.ui" line="783"/>
<source>Center</source> <source>Center</source>
<translation type="unfinished"></translation> <translation>Центр</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="746"/> <location filename="../drawtools.ui" line="769"/>
<location filename="../drawtools.ui" line="749"/> <location filename="../drawtools.ui" line="772"/>
<source>Bottom</source> <source>Bottom</source>
<translation type="unfinished"></translation> <translation>Низ</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="768"/> <location filename="../drawtools.ui" line="791"/>
<location filename="../drawtools.ui" line="771"/> <location filename="../drawtools.ui" line="794"/>
<source>Left</source> <source>Left</source>
<translation type="unfinished"></translation> <translation>Лево</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.ui" line="779"/> <location filename="../drawtools.ui" line="802"/>
<location filename="../drawtools.ui" line="782"/> <location filename="../drawtools.ui" line="805"/>
<source>Right</source> <source>Right</source>
<translation type="unfinished"></translation> <translation>Право</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="236"/> <location filename="../drawtools.cpp" line="333"/>
<source>NoPen</source> <source>NoPen</source>
<translation>НетЛинии</translation> <translation>НетЛинии</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="236"/> <location filename="../drawtools.cpp" line="333"/>
<source>Solid</source> <source>Solid</source>
<translation>Сплошная</translation> <translation>Сплошная</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="236"/> <location filename="../drawtools.cpp" line="333"/>
<source>Dash</source> <source>Dash</source>
<translation>Штриховая</translation> <translation>Штриховая</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="237"/> <location filename="../drawtools.cpp" line="334"/>
<source>Dot</source> <source>Dot</source>
<translation>Пунктирная</translation> <translation>Пунктирная</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="237"/> <location filename="../drawtools.cpp" line="334"/>
<source>Dash-Dot</source> <source>Dash-Dot</source>
<translation>ШтрихПунктирная</translation> <translation>ШтрихПунктирная</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="237"/> <location filename="../drawtools.cpp" line="334"/>
<source>Dash-Dot-Dot</source> <source>Dash-Dot-Dot</source>
<translation>ШтрихПунктирПунктирная</translation> <translation>ШтрихПунктирПунктирная</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="257"/> <location filename="../drawtools.cpp" line="336"/>
<source>Edit text</source> <source>Edit text</source>
<translation>Редактировать текст</translation> <translation>Редактировать текст</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="264"/> <location filename="../drawtools.cpp" line="337"/>
<source>Bring <source>Bring
forward</source> forward</source>
<translation>Переместить <translation>Переместить
выше</translation> выше</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="265"/> <location filename="../drawtools.cpp" line="338"/>
<source>Bring <source>Bring
to front</source> to front</source>
<translation>На передний <translation>На передний
фон</translation> фон</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="266"/> <location filename="../drawtools.cpp" line="339"/>
<source>Send <source>Send
backward</source> backward</source>
<translation>Переместить <translation>Переместить
ниже</translation> ниже</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="267"/> <location filename="../drawtools.cpp" line="340"/>
<source>Send <source>Send
to back</source> to back</source>
<translation>На задний <translation>На задний
фон</translation> фон</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="268"/> <location filename="../drawtools.cpp" line="341"/>
<source>Draw <source>Draw
Rectangle</source> Rectangle</source>
<translation>Нарисовать <translation>Нарисовать
прямоугольник</translation> прямоугольник</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="269"/> <location filename="../drawtools.cpp" line="342"/>
<source>Draw <source>Draw
Ellipse</source> Ellipse</source>
<translation>Нарисовать <translation>Нарисовать
эллипс</translation> эллипс</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="270"/> <location filename="../drawtools.cpp" line="343"/>
<source>Draw <source>Draw
Line</source> Line</source>
<translation>Нарисовать <translation>Нарисовать
линию</translation> линию</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="271"/> <location filename="../drawtools.cpp" line="344"/>
<source>Draw <source>Draw
Text</source> Text</source>
<translation>Нарисовать <translation>Нарисовать
текст</translation> текст</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="272"/> <location filename="../drawtools.cpp" line="345"/>
<source>Draw <source>Draw
Image</source> Image</source>
<translation>Нарисовать <translation>Нарисовать
картинку</translation> картинку</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="778"/> <location filename="../drawtools.cpp" line="824"/>
<source>Select image</source> <source>Select image</source>
<translation>Выбрать картинку</translation> <translation>Выбрать картинку</translation>
</message> </message>
</context> </context>
<context>
<name>PinAlignDelegate</name>
<message>
<location filename="../blockeditor.cpp" line="356"/>
<source>Left</source>
<translation>Лево</translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="357"/>
<source>Right</source>
<translation>Право</translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="358"/>
<source>Top</source>
<translation>Верх</translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="359"/>
<source>Bottom</source>
<translation>Низ</translation>
</message>
<message>
<location filename="../blockeditor.cpp" line="361"/>
<source>unknown</source>
<translation>неизвестно</translation>
</message>
</context>
</TS> </TS>

View File

@@ -0,0 +1,2 @@
lupdate ../ -ts qad_blockview_ru.ts
lupdate ../ -ts qad_blockview_en.ts

View File

@@ -1,3 +1,19 @@
#[[
Also create imported targets:
* QAD::Utils
* QAD::Widgets
* QAD::Application
* QAD::Blockview
* QAD::Graphic
* QAD::SQLTable
* QAD::TouchWidgets
* QAD::Doc
These targets include directories and dependencies
]]
cmake_policy(SET CMP0011 NEW) # don`t affect includer policies cmake_policy(SET CMP0011 NEW) # don`t affect includer policies
cmake_policy(SET CMP0020 NEW) # Automatically link Qt executables to qtmain target on Windows cmake_policy(SET CMP0020 NEW) # Automatically link Qt executables to qtmain target on Windows
if(NOT LIBPROJECT) if(NOT LIBPROJECT)
@@ -41,6 +57,24 @@ find_file(QAD_H_INCLUDE "qad_types.h" HINTS ${PIP_DIR}/include/qad ${_QAD_INCDIR
#endif() #endif()
set(_SEARCH_DIR ${_QAD_LIBDIR} $ENV{SMSDK_DIR}/lib) set(_SEARCH_DIR ${_QAD_LIBDIR} $ENV{SMSDK_DIR}/lib)
set(_QAD_LIBS utils widgets application blockview graphic sql_table touch_widgets doc) set(_QAD_LIBS utils widgets application blockview graphic sql_table touch_widgets doc)
set(_ITN_utils "Utils" )
set(_ITN_widgets "Widgets" )
set(_ITN_application "Application" )
set(_ITN_blockview "Blockview" )
set(_ITN_graphic "Graphic" )
set(_ITN_sql_table "SQLTable" )
set(_ITN_touch_widgets "TouchWidgets")
set(_ITN_doc "Doc" )
set(_ITLL_widgets "QAD::Utils")
set(_ITLL_application "QAD::Widgets")
set(_ITLL_blockview "QAD::Widgets")
set(_ITLL_graphic "QAD::Widgets")
set(_ITLL_sql_table "QAD::Widgets")
set(_ITLL_touch_widgets "")
set(_ITLL_doc "")
if(LIBPROJECT) if(LIBPROJECT)
set(QAD_INCLUDES ${QAD_DIR}) set(QAD_INCLUDES ${QAD_DIR})
endif() endif()
@@ -52,15 +86,41 @@ foreach(_Q ${_QAD_LIBS})
else() else()
foreach(_v ${_QT_VERSIONS_}) foreach(_v ${_QT_VERSIONS_})
find_library(QAD${_v}_${_QU}_LIBRARY qad_${_Q}${_v} HINTS ${_SEARCH_DIR}) find_library(QAD${_v}_${_QU}_LIBRARY qad_${_Q}${_v} HINTS ${_SEARCH_DIR})
set(MULTILIB_${_Q}_SUFFIX_Qt${_v} ${_v}) set(MULTILIB_qad_${_Q}_SUFFIX_Qt${_v} ${_v})
if(hasParent) if(hasParent)
set(MULTILIB_${_Q}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE) set(MULTILIB_qad_${_Q}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
endif() endif()
#message(STATUS "MULTILIB_qad_${_Q}_SUFFIX_Qt${_v} = ${_v}")
endforeach() endforeach()
endif() endif()
#message(STATUS "Library qad_${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}") #message(STATUS "Library qad_${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
list(APPEND QT_MULTILIB_LIST qad_${_Q}) list(APPEND QT_MULTILIB_LIST qad_${_Q})
endforeach() endforeach()
foreach(_Q ${_QAD_LIBS})
string(TOUPPER ${_Q} _QU)
set(_target QAD::${_ITN_${_Q}})
string(REPLACE ":" "_" _target_str "${_target}")
foreach(_v ${_QT_VERSIONS_})
if(NOT TARGET ${_target}${_v})
set(_link_list)
foreach(_l ${_ITLL_${_Q}})
list(APPEND _link_list ${_l}${_v})
endforeach()
add_library(${_target}${_v} UNKNOWN IMPORTED)
set_target_properties(${_target}${_v} PROPERTIES
IMPORTED_LOCATION "${QAD${_v}_${_QU}_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${QAD_INCLUDES}"
INTERFACE_LINK_LIBRARIES "${_link_list}")
set(MULTILIB_${_target_str}_SUFFIX_Qt${_v} ${_v})
if(hasParent)
set(MULTILIB_${_target_str}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
endif()
#message(STATUS "add imported ${_target}${_v}")
#message(STATUS "add MULTILIB MULTILIB_${_target_str}_SUFFIX_Qt${_v} ${_v}")
endif()
endforeach()
list(APPEND QT_MULTILIB_LIST ${_target})
endforeach()
list(APPEND QT_MULTILIB_LIST qglview qglengine_core qglengine_widgets) list(APPEND QT_MULTILIB_LIST qglview qglengine_core qglengine_widgets)
foreach(_v ${_QT_VERSIONS_}) foreach(_v ${_QT_VERSIONS_})
find_library(QGLVIEW${_v}_LIBRARY qglview${_v} ${_SEARCH_DIR}) find_library(QGLVIEW${_v}_LIBRARY qglview${_v} ${_SEARCH_DIR})

View File

@@ -94,12 +94,12 @@ e.g. "qt_install(LANG my_QM DESTINATION QtLang)"
qt_install_lang(<name> DESTINATION <dir>) qt_install_lang(<name> DESTINATION <dir> [PATHS <path0> [<path1>] [...] ])
Search Qt translations for all <name> dependencies Search Qt translations for all <name> dependencies
in Qt<?>_LANG_DIR for <name>_LANG languages in Qt<?>_LANG_DIR for <name>_LANG languages
and install them to <dir>. You can you "set_lang()" macro and install them to <dir>. PATH are additional search paths.
before this action You should use "set_lang()" macro before this action
]] ]]
@@ -448,6 +448,14 @@ macro(_qt_split_add_args _P _A)
endmacro() endmacro()
macro(__qt_set_defines _NAME _T)
target_compile_definitions(${_T} PRIVATE "__TARGET_NAME__=\"${_NAME}\"")
target_compile_definitions(${_T} PRIVATE "__TARGET_LABEL__=\"${${_NAME}_LABEL}\"")
target_compile_definitions(${_T} PRIVATE "__TARGET_COMPANY__=\"${${_NAME}_COMPANY}\"")
target_compile_definitions(${_T} PRIVATE "__TARGET_VERSION__=\"${${_NAME}_VERSION}\"")
endmacro()
macro(qt_add_executable _NAME) macro(qt_add_executable _NAME)
foreach(_v ${_QT_VERSIONS_}) foreach(_v ${_QT_VERSIONS_})
if (LOCAL_FOUND${_v}) if (LOCAL_FOUND${_v})
@@ -457,13 +465,14 @@ macro(qt_add_executable _NAME)
set(CMAKE_INSTALL_NAME_DIR "@rpath") set(CMAKE_INSTALL_NAME_DIR "@rpath")
else() else()
if(NOT WIN32) if(NOT WIN32)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/lib") set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib")
endif() endif()
endif() endif()
set(_TARGET ${_NAME}${TARGET_SUFFIX_Qt${_v}}) set(_TARGET ${_NAME}${TARGET_SUFFIX_Qt${_v}})
add_executable(${_TARGET} ${_PREF} ${_ARGS}) add_executable(${_TARGET} ${_PREF} ${_ARGS})
set(_${_NAME}_is_qt 1) set(_${_NAME}_is_qt 1)
target_include_directories(${_TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/qt${_v} ${Qt${_v}_INCLUDES}) target_include_directories(${_TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/qt${_v} ${Qt${_v}_INCLUDES})
__qt_set_defines(${_NAME} ${_TARGET})
if(APPLE) if(APPLE)
set(CMAKE_INSTALL_NAME_DIR "${_PREV_CIND}") set(CMAKE_INSTALL_NAME_DIR "${_PREV_CIND}")
@@ -495,13 +504,14 @@ macro(qt_add_library _NAME)
set(CMAKE_INSTALL_NAME_DIR "@rpath") set(CMAKE_INSTALL_NAME_DIR "@rpath")
else() else()
if(NOT WIN32) if(NOT WIN32)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/lib") set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib")
endif() endif()
endif() endif()
set(_TARGET ${_NAME}${TARGET_SUFFIX_Qt${_v}}) set(_TARGET ${_NAME}${TARGET_SUFFIX_Qt${_v}})
add_library(${_TARGET} ${_PREF} ${_ARGS}) add_library(${_TARGET} ${_PREF} ${_ARGS})
set(_${_NAME}_is_qt 1) set(_${_NAME}_is_qt 1)
target_include_directories(${_TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/qt${_v} ${Qt${_v}_INCLUDES}) target_include_directories(${_TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/qt${_v} ${Qt${_v}_INCLUDES})
__qt_set_defines(${_NAME} ${_TARGET})
#message("add lib: \"${_TARGET}\"") #message("add lib: \"${_TARGET}\"")
if(APPLE) if(APPLE)
@@ -526,8 +536,9 @@ endmacro()
macro(_qt_multitarget_suffix_ _OUT _IN _v) macro(_qt_multitarget_suffix_ _OUT _IN _v)
if (NOT "x${MULTILIB_${_IN}_SUFFIX_Qt${_v}}" STREQUAL "x") string(REPLACE ":" "_" _in_str "${_IN}")
set(${_OUT} "${MULTILIB_${_IN}_SUFFIX_Qt${_v}}") if (NOT "x${MULTILIB_${_in_str}_SUFFIX_Qt${_v}}" STREQUAL "x")
set(${_OUT} "${MULTILIB_${_in_str}_SUFFIX_Qt${_v}}")
else() else()
set(${_OUT} "${MULTILIB_SUFFIX_Qt${_v}}") set(${_OUT} "${MULTILIB_SUFFIX_Qt${_v}}")
endif() endif()
@@ -544,6 +555,7 @@ macro(qt_target_link_libraries _NAME)
list(FIND QT_MULTILIB_LIST "${_i}" _ind) list(FIND QT_MULTILIB_LIST "${_i}" _ind)
if (_ind GREATER -1) if (_ind GREATER -1)
_qt_multitarget_suffix_(_TS ${_i} ${_v}) _qt_multitarget_suffix_(_TS ${_i} ${_v})
#message(STATUS "${_i} in MULTILIB_LIST, suffix = ${_TS}")
list(APPEND _ARGS ${_i}${_TS}) list(APPEND _ARGS ${_i}${_TS})
else() else()
list(APPEND _ARGS ${_i}) list(APPEND _ARGS ${_i})
@@ -665,9 +677,25 @@ macro(qt_install)
endmacro() endmacro()
macro(qt_install_lang _NAME _dest_tag _DEST) macro(qt_install_lang _NAME)
set(_prev_inst) set(_prev_inst)
#message("command: ${ARGN}") #message("command: ${ARGN}")
set(_PATHS)
set(_DEST)
if(CMAKE_CROSSCOMPILING)
list(APPEND _PATHS "${CMAKE_PREFIX_PATH}/lang")
endif()
set(_cur_arg)
set(__args "DESTINATION;PATHS")
foreach(_i ${ARGN})
if (_i IN_LIST __args)
set(_cur_arg "${_i}")
elseif("${_cur_arg}" STREQUAL "DESTINATION")
set(_DEST "${_i}")
elseif("${_cur_arg}" STREQUAL "PATHS")
list(APPEND _PATHS "${_i}")
endif()
endforeach()
foreach(_v ${_QT_VERSIONS_}) foreach(_v ${_QT_VERSIONS_})
if (LOCAL_FOUND${_v}) if (LOCAL_FOUND${_v})
set(_target) set(_target)
@@ -702,7 +730,8 @@ macro(qt_install_lang _NAME _dest_tag _DEST)
list(APPEND _qt_libs "qtbase") list(APPEND _qt_libs "qtbase")
foreach (_i ${${PROJECT_NAME}_LANG}) foreach (_i ${${PROJECT_NAME}_LANG})
foreach (_l ${_qt_libs}) foreach (_l ${_qt_libs})
set(_qm_path "${Qt${_v}_LANG_DIR}/${_l}_${_i}.qm") unset(_qm_path CACHE)
find_file(_qm_path "${_l}_${_i}.qm" PATHS "${Qt${_v}_LANG_DIR}" ${_PATHS} NO_DEFAULT_PATH)
if (EXISTS "${_qm_path}") if (EXISTS "${_qm_path}")
install(FILES ${_qm_path} DESTINATION "${_DEST}") install(FILES ${_qm_path} DESTINATION "${_DEST}")
#message("qm = \"${_qm_path}\"") #message("qm = \"${_qm_path}\"")

View File

@@ -16,6 +16,12 @@ extern "C" {
# ifndef MKD_TOC # ifndef MKD_TOC
# define MKD_TOC 0x00001000 # define MKD_TOC 0x00001000
# endif # endif
# ifndef MKD_AUTOLINK
# define MKD_AUTOLINK 0x00004000
# endif
# ifndef MKD_GITHUBTAGS
# define MKD_GITHUBTAGS 0x08000000
# endif
#endif #endif
static QString markdown_css = "table { margin: 5px; background-color: #cccccc; }" static QString markdown_css = "table { margin: 5px; background-color: #cccccc; }"
@@ -41,7 +47,7 @@ QString md2html(const QByteArray & src) {
mkd_set_flag_num(flagm, MKD_DLEXTRA); mkd_set_flag_num(flagm, MKD_DLEXTRA);
mkd_set_flag_num(flagm, MKD_FENCEDCODE); mkd_set_flag_num(flagm, MKD_FENCEDCODE);
#else #else
mkd_flag_t flagm = (MKD_DLEXTRA | MKD_FENCEDCODE); mkd_flag_t flagm = (MKD_DLEXTRA | MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK);
#endif #endif
MMIOT MMIOT
#endif #endif

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QAD_MARKDOWN_H #ifndef QAD_MARKDOWN_H
#define QAD_MARKDOWN_H #define QAD_MARKDOWN_H

View File

@@ -5,10 +5,11 @@
#include "ui_graphic_conf.h" #include "ui_graphic_conf.h"
#include <QMetaObject> #include <QMetaObject>
#include <QMessageBox> #include <QMessageBox>
#if QT_VERSION < 0x050000 #include <QTapAndHoldGesture>
# include <QTapAndHoldGesture> #include <QPanGesture>
# include <QPanGesture> #include <QPinchGesture>
# include <QPinchGesture> #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
# include <QRandomGenerator>
#endif #endif
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
# define HAS_GL # define HAS_GL
@@ -25,17 +26,6 @@ __GraphicRegistrator__ __graphic_registrator__;
Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this), line_x_max(this), line_y_min(this), line_y_max(this) { Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this), line_x_max(this), line_y_min(this), line_y_max(this) {
canvas_gl = 0; canvas_gl = 0;
QTranslator * trans = new QTranslator();
trans->load(":/lang/qad_graphic_" + QLocale::system().name().left(2));
if (trans->isEmpty())
trans->load("lang/qad_graphic_" + QLocale::system().name().left(2));
#if QT_VERSION >= 0x050000
if (!qApp->installTranslator(trans))
delete trans;
#else
qApp->installTranslator(trans);
#endif
fullscr_dialog = 0;
gesture_angle = 45.; gesture_angle = 45.;
leg_update = true; leg_update = true;
visible_update = fullscr = need_mouse_pan = false; visible_update = fullscr = need_mouse_pan = false;
@@ -47,10 +37,6 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
#endif #endif
ui = new Ui::Graphic(); ui = new Ui::Graphic();
ui->setupUi(this); ui->setupUi(this);
/*line_x_min.resize(70, 22);
line_x_max.resize(70, 22);
line_y_min.resize(70, 22);
line_y_max.resize(70, 22);*/
line_x_min.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); line_x_min.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
line_x_max.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); line_x_max.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
((QBoxLayout * )ui->widgetLY->layout())->insertWidget(0, &line_y_min); ((QBoxLayout * )ui->widgetLY->layout())->insertWidget(0, &line_y_min);
@@ -59,8 +45,6 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
((QBoxLayout * )ui->widgetLX->layout())->addWidget(&line_x_max); ((QBoxLayout * )ui->widgetLX->layout())->addWidget(&line_x_max);
tm.restart(); tm.restart();
grid_numbers_x = grid_numbers_y = 1; grid_numbers_x = grid_numbers_y = 1;
LN2 = qLn(2.);
LN5 = qLn(5.);
LN10 = qLn(10.); LN10 = qLn(10.);
line_x_min.setClearButtonVisible(true); line_x_min.setClearButtonVisible(true);
line_x_max.setClearButtonVisible(true); line_x_max.setClearButtonVisible(true);
@@ -84,10 +68,9 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
icon_exp_sy = QIcon(":/icons/expand_s_y.png"); icon_exp_sy = QIcon(":/icons/expand_s_y.png");
icon_pause_b = QImage(":/icons/pause-back.png"); icon_pause_b = QImage(":/icons/pause-back.png");
icon_pause_f = QImage(":/icons/pause-front.png"); icon_pause_f = QImage(":/icons/pause-front.png");
aupdate = grid = isFit = isEmpty = navigation = true; aupdate = grid = isFit = navigation = true;
aalias = mupdate = bufferActive = isOGL = cancel = isPrinting = guides = hasLblX = hasLblY = isHover = false; aalias = bufferActive = isOGL = cancel = guides = hasLblX = hasLblY = isHover = false;
pause_ = only_expand_x = only_expand_y = false; pause_ = only_expand_x = only_expand_y = false;
//qDebug() << -DBL_MAX/2. << DBL_MAX/2. << DBL_MIN;
limit_.setCoords(-DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX); limit_.setCoords(-DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX);
eminx = eminy = DBL_MAX; eminx = eminy = DBL_MAX;
emaxx = emaxy = DBL_MIN; emaxx = emaxy = DBL_MIN;
@@ -95,13 +78,9 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
axis_type_x = Numeric; axis_type_x = Numeric;
min_repaint_int = 25; min_repaint_int = 25;
inc_x = 1.; inc_x = 1.;
legy = 0;
buffer = 0; buffer = 0;
gridx = gridy = 1.; gridx = gridy = 1.;
history = 5.; history = 5.;
min_int = 1;
max_int = 200;
mdm = 10.;
visible_time = -1.; visible_time = -1.;
thick = lineThickness(); thick = lineThickness();
pause_phase = 0.; pause_phase = 0.;
@@ -113,8 +92,6 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
selbrush.setColor(QColor(60, 175, 255, 100)); selbrush.setColor(QColor(60, 175, 255, 100));
text_color = palette().color(QPalette::WindowText); text_color = palette().color(QPalette::WindowText);
grid_pen = QPen(palette().color(QPalette::Disabled, QPalette::WindowText), 0., Qt::DotLine); grid_pen = QPen(palette().color(QPalette::Disabled, QPalette::WindowText), 0., Qt::DotLine);
//graph_pen = QPen(Qt::red);
//graph_pen.setCosmetic(true);
graphics.append(GraphicType()); graphics.append(GraphicType());
curGraphic = 0; curGraphic = 0;
selpen = palette().color(QPalette::WindowText); selpen = palette().color(QPalette::WindowText);
@@ -140,11 +117,11 @@ Graphic::~Graphic() {
void Graphic::changeEvent(QEvent * e) { void Graphic::changeEvent(QEvent * e) {
QFrame::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this); ui->retranslateUi(this);
return; return;
} }
QFrame::changeEvent(e);
} }
@@ -162,7 +139,6 @@ void Graphic::timerEvent(QTimerEvent * ) {
bool Graphic::eventFilter(QObject * o, QEvent * e) { bool Graphic::eventFilter(QObject * o, QEvent * e) {
//qDebug() << "event" << o << e;
if (o == canvas) { if (o == canvas) {
switch (e->type()) { switch (e->type()) {
case QEvent::Gesture: case QEvent::Gesture:
@@ -192,25 +168,7 @@ bool Graphic::eventFilter(QObject * o, QEvent * e) {
} break; } break;
default: break; default: break;
} }
} /*else { }
if (fullscr) {
switch (e->type()) {
case QEvent::KeyPress:
if ((((QKeyEvent*)e)->key() != Qt::Key_Back) || !fullscr)
break;
case QEvent::Close:
leaveFullscreen();
return true;
case QEvent::OrientationChange:
case QEvent::Resize: {
QWidget * rw = canvas->parentWidget();
if (rw)
canvas->setGeometry(0, 0, rw->width(), rw->height());
} break;
default: break;
}
}
}*/
return QFrame::eventFilter(o, e); return QFrame::eventFilter(o, e);
} }
@@ -223,7 +181,6 @@ void Graphic::prepareCanvas(QWidget * w) {
connect(w, SIGNAL(wheelEvent(QWheelEvent * )), this, SLOT(canvasWheelEvent(QWheelEvent * ))); connect(w, SIGNAL(wheelEvent(QWheelEvent * )), this, SLOT(canvasWheelEvent(QWheelEvent * )));
connect(w, SIGNAL(leaveEvent(QEvent * )), this, SLOT(canvasLeaveEvent(QEvent * ))); connect(w, SIGNAL(leaveEvent(QEvent * )), this, SLOT(canvasLeaveEvent(QEvent * )));
connect(w, SIGNAL(keyPressEvent(QKeyEvent * )), this, SLOT(canvasKeyPressEvent(QKeyEvent * ))); connect(w, SIGNAL(keyPressEvent(QKeyEvent * )), this, SLOT(canvasKeyPressEvent(QKeyEvent * )));
//w->grabGesture(Qt::TapGesture);
w->grabGesture(Qt::TapAndHoldGesture); w->grabGesture(Qt::TapAndHoldGesture);
w->grabGesture(Qt::PanGesture); w->grabGesture(Qt::PanGesture);
w->grabGesture(Qt::PinchGesture); w->grabGesture(Qt::PinchGesture);
@@ -246,7 +203,6 @@ void Graphic::procGesture(QGesture * g) {
} break; } break;
case Qt::PinchGesture: { case Qt::PinchGesture: {
QPinchGesture * pg = (QPinchGesture*)g; QPinchGesture * pg = (QPinchGesture*)g;
//qDebug() << pg->totalRotationAngle();
Qt::KeyboardModifiers km = Qt::NoModifier; Qt::KeyboardModifiers km = Qt::NoModifier;
if (gesture_angle <= 20.) km = Qt::ControlModifier; if (gesture_angle <= 20.) km = Qt::ControlModifier;
if (gesture_angle >= 70.) km = Qt::ShiftModifier; if (gesture_angle >= 70.) km = Qt::ShiftModifier;
@@ -261,10 +217,8 @@ void Graphic::procGesture(QGesture * g) {
QMetaObject::invokeMethod(this, "enterFullscreen", Qt::QueuedConnection); QMetaObject::invokeMethod(this, "enterFullscreen", Qt::QueuedConnection);
} break; } break;
default: default:
qDebug() << g;
break; break;
} }
//qDebug() << g;
} }
@@ -295,8 +249,6 @@ void Graphic::totalUpdate() {
void Graphic::canvasPaintEvent() { void Graphic::canvasPaintEvent() {
if (is_lines_update) return; if (is_lines_update) return;
//QMutexLocker ml(&mutex_);
//static int pwid = 0, phei = 0;
int wid = canvas->width(), hei = canvas->height(); int wid = canvas->width(), hei = canvas->height();
if (canvas->isHidden() || wid <= 1 || hei <= 1) return; if (canvas->isHidden() || wid <= 1 || hei <= 1) return;
lastw = wid; lastw = wid;
@@ -320,19 +272,6 @@ void Graphic::canvasPaintEvent() {
drawGuides(); drawGuides();
return; return;
} }
//if (!aupdate && !mupdate && pwid == wid && phei == hei) return;
/*if (pwid != wid || phei != hei) {
line_x_min.move(0, hei - 35);
line_x_max.move(0, 0);
line_y_min.move(70, hei - line_x_min.height());
line_y_max.move(wid - line_y_max.width(), hei - line_x_min.height());
}
line_x_min.setVisible(grid);
line_x_max.setVisible(grid);
line_y_min.setVisible(grid);
line_y_max.setVisible(grid);*/
//pwid = wid;
//phei = hei;
QPainter p; QPainter p;
#ifdef HAS_GL #ifdef HAS_GL
if (isOGL) { if (isOGL) {
@@ -364,7 +303,6 @@ void Graphic::canvasPaintEvent() {
else glDisable(GL_MULTISAMPLE); else glDisable(GL_MULTISAMPLE);
} }
#endif #endif
//p.setRenderHint(QPainter::HighQualityAntialiasing, aalias);
fp_size.clear(); fp_size.clear();
if (!aalias) p.translate(-0.5, -0.5); if (!aalias) p.translate(-0.5, -0.5);
drawGraphics(); drawGraphics();
@@ -418,7 +356,7 @@ void Graphic::canvasMouseMoveEvent(QMouseEvent * e) {
case gaMove: case gaMove:
dp = e->pos() - prevpos; dp = e->pos() - prevpos;
dp.rx() *= selrect.width() / double(gridborder.x() + 5 - lastw); dp.rx() *= selrect.width() / double(gridborder.x() + 5 - lastw);
dp.ry() *= selrect.height() / double(lasth - legy - gridborder.y() - 5); dp.ry() *= selrect.height() / double(lasth - gridborder.y() - 5);
if (e->modifiers() == Qt::ControlModifier) if (e->modifiers() == Qt::ControlModifier)
dp.setY(0.); dp.setY(0.);
if (e->modifiers() == Qt::ShiftModifier) if (e->modifiers() == Qt::ShiftModifier)
@@ -433,7 +371,7 @@ void Graphic::canvasMouseMoveEvent(QMouseEvent * e) {
void Graphic::canvasMousePressEvent(QMouseEvent * e) { void Graphic::canvasMousePressEvent(QMouseEvent * e) {
emit graphicMousePressEvent(canvas2real(QPointF(e->pos())), e->buttons()); emit graphicMousePressEvent(canvas2real(QPointF(e->pos())), e->button());
if (!navigation) return; if (!navigation) return;
if (gestures && !need_mouse_pan) return; if (gestures && !need_mouse_pan) return;
#ifdef HAS_GL #ifdef HAS_GL
@@ -477,7 +415,7 @@ void Graphic::canvasMousePressEvent(QMouseEvent * e) {
void Graphic::canvasMouseReleaseEvent(QMouseEvent * e) { void Graphic::canvasMouseReleaseEvent(QMouseEvent * e) {
emit graphicMouseReleaseEvent(canvas2real(QPointF(e->pos())), e->buttons()); emit graphicMouseReleaseEvent(canvas2real(QPointF(e->pos())), e->button());
if (gestures) return; if (gestures) return;
need_mouse_pan = false; need_mouse_pan = false;
if (!navigation) return; if (!navigation) return;
@@ -533,11 +471,18 @@ void Graphic::canvasMouseDoubleClickEvent(QMouseEvent * ) {
void Graphic::canvasWheelEvent(QWheelEvent * e) { void Graphic::canvasWheelEvent(QWheelEvent * e) {
//if (curaction != gaMove) return; #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
emit graphicWheelEvent(canvas2real(e->position()), e->delta()/* TODO: test use angleDelta()*/);
#else
emit graphicWheelEvent(canvas2real(QPointF(e->pos())), e->delta()); emit graphicWheelEvent(canvas2real(QPointF(e->pos())), e->delta());
#endif
if (gestures) return; if (gestures) return;
if (!navigation) return; if (!navigation) return;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
procZoom(e->position(), e->delta(), e->modifiers());
#else
procZoom(e->pos(), e->delta(), e->modifiers()); procZoom(e->pos(), e->delta(), e->modifiers());
#endif
totalUpdate(); totalUpdate();
} }
@@ -577,7 +522,6 @@ void Graphic::canvasKeyPressEvent(QKeyEvent * e) {
void Graphic::clear() { void Graphic::clear() {
//cout << "clear" << endl;
for (int i = 0; i < graphics.size(); ++i) { for (int i = 0; i < graphics.size(); ++i) {
graphics[i].polyline.clear(); graphics[i].polyline.clear();
graphics[i].polyline_pause.clear(); graphics[i].polyline_pause.clear();
@@ -591,9 +535,6 @@ void Graphic::clear() {
void Graphic::setAntialiasing(bool enabled) { void Graphic::setAntialiasing(bool enabled) {
if (aalias == enabled) return; if (aalias == enabled) return;
aalias = enabled; aalias = enabled;
/*QGLFormat f = canvas_gl->format();
f.setSampleBuffers(enabled);
canvas_gl->setFormat(f);*/
update(); update();
} }
@@ -630,7 +571,6 @@ void Graphic::setHistorySize(double val) {
x = pol.back().x() - history; x = pol.back().x() - history;
for (int j = pol.size() - 2; j >= 0 ; --j) for (int j = pol.size() - 2; j >= 0 ; --j)
if (pol[j].x() < x) { if (pol[j].x() < x) {
//qDebug() << pol.size() << j;
pol.erase(pol.begin(), pol.begin() + j); pol.erase(pol.begin(), pol.begin() + j);
break; break;
} }
@@ -747,8 +687,6 @@ void Graphic::addPoint(const QPointF & p, int graphic, bool update_) {
if (graphic >= graphics.size() || graphic < 0) return; if (graphic >= graphics.size() || graphic < 0) return;
GraphicType & t(graphics[graphic]); GraphicType & t(graphics[graphic]);
if (!t.cvrect.isNull() && !pause_) { if (!t.cvrect.isNull() && !pause_) {
// if (graphics[graphic].cvrect.contains(p))
// graphics[graphic].cvrect = QRectF();
if (t.cvrect.top() < p.y()) t.cvrect.setTop(p.y()); if (t.cvrect.top() < p.y()) t.cvrect.setTop(p.y());
if (t.cvrect.bottom() > p.y()) t.cvrect.setBottom(p.y()); if (t.cvrect.bottom() > p.y()) t.cvrect.setBottom(p.y());
if (t.cvrect.right() < p.x()) t.cvrect.setRight(p.x()); if (t.cvrect.right() < p.x()) t.cvrect.setRight(p.x());
@@ -815,9 +753,7 @@ void Graphic::saveImage() {
if (str == "") return; if (str == "") return;
ppath = str; ppath = str;
QPixmap im(canvas->size()); QPixmap im(canvas->size());
mupdate = true;
canvas->render(&im); canvas->render(&im);
mupdate = false;
im.save(ppath); im.save(ppath);
update(true); update(true);
} }
@@ -840,29 +776,24 @@ void Graphic::setOpenGL(bool on) {
ui->canvas_raster->show(); ui->canvas_raster->show();
canvas = ui->canvas_raster; canvas = ui->canvas_raster;
#endif #endif
/*line_x_min.setParent(canvas);
line_x_max.setParent(canvas);
line_y_min.setParent(canvas);
line_y_max.setParent(canvas);
line_x_min.show();
line_x_max.show();
line_y_min.show();
line_y_max.show();*/
update(); update();
} }
void Graphic::update(bool force) { void Graphic::update(bool force) {
mupdate = true;
repaintCanvas(force); repaintCanvas(force);
mupdate = false;
} }
void Graphic::setGraphicsCount(int arg, bool update) { void Graphic::setGraphicsCount(int arg, bool update) {
if (arg < 0) return; if (arg < 0) return;
while (graphics.size() < arg) while (graphics.size() < arg) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
graphics.append(GraphicType(tr("y(x)"), QColor::fromHsv((graphics.size() * 55) % 360, 255, 255 - QRandomGenerator::global()->generate() % 115)));
#else
graphics.append(GraphicType(tr("y(x)"), QColor::fromHsv((graphics.size() * 55) % 360, 255, 255 - qrand() % 115))); graphics.append(GraphicType(tr("y(x)"), QColor::fromHsv((graphics.size() * 55) % 360, 255, 255 - qrand() % 115)));
#endif
}
while (graphics.size() > arg) { while (graphics.size() > arg) {
delete graphics.back().pb; delete graphics.back().pb;
graphics.pop_back(); graphics.pop_back();
@@ -879,76 +810,11 @@ void Graphic::removeGraphic(int arg, bool update) {
} }
/*void Graphic::setHistogramData(const QVector<float> & g, int graphic) {
graphics[graphic].polyline.clear();
if (g.isEmpty()) {
return;
}
QVector<float> data = g;
QVector<int> hist;
int ic = max_int, ci;
double md, cd, min, max, range, cx;
qSort(data);
md = DBL_MAX;
min = max = data[0];
for (int i = 1; i < data.size(); ++i) {
if (min > data[i]) min = data[i];
if (max < data[i]) max = data[i];
cd = qAbs<float>(data[i] - data[i - 1]);
if (md > cd && cd != 0.) md = cd;
}
range = max - min;
md = mdm;
//qDebug() << md << range << ic;
if (md != 0.)
ic = qRound(qMax<double>(qMin<double>(double(ic), range / md), double(min_int)));
md = range / ic;
hist.resize(ic);
foreach (const float & i, data) {
ci = qRound((i - min) / range * double(ic - 1));
//if (ci < 0) ci = 0;
//if (ci >= ic) ci = ic - 1;
hist[ci]++;
}
QPolygonF & cpol(graphics[graphic].polyline);
if (hist.size() == 1 || range == 0.) {
cpol << QPointF(min - 0.5, 0.) << QPointF(min - 0.25, 0.);
cpol << QPointF(min - 0.25, hist[0]) << QPointF(min + 0.25, hist[0]);
cpol << QPointF(min + 0.25, 0.) << QPointF(min + 0.5, 0.);
} else {
cpol << QPointF(min, 0.);
for (int i = 0; i < hist.size(); ++i) {
cx = i * range / ic + min;
cpol << QPointF(cx, hist[i]) << QPointF(cx + md, hist[i]);
}
cpol << QPointF(range + min, 0.);
}
updateGraphics();
}*/
void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, double end_y) { void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, double end_y) {
double cx, cy, maxX, minX, maxY, minY, vx; double cx, cy, maxX, minX, maxY, minY, vx;
bool isRangeX = (start_x != end_x), isRangeY = (start_y != end_y); bool isRangeX = (start_x != end_x), isRangeY = (start_y != end_y);
// bool isEmpty = true;
//bool fast = true;
bool can_fast = (start_x == 0 && end_x == 0 && start_y == 0 && end_y == 0); bool can_fast = (start_x == 0 && end_x == 0 && start_y == 0 && end_y == 0);
bool anyVisible = false, isTimeLimit = (visible_time > 0.) && !(isRangeX || isRangeY); bool anyVisible = false, isTimeLimit = (visible_time > 0.) && !(isRangeX || isRangeY);
//bool force_find = (visible_time > 0.) && (history > 0.) && (visible_time < history);
//if (force_find) can_fast = false;
// foreach (const GraphicType & t, graphics) {
// const QPolygonF & pol(pause_ ? t.polyline_pause : t.polyline);
// if (!pol.isEmpty()) {
// isEmpty = false;
// break;
// }
// }
// if (isEmpty) {
// grect = def_rect;
// setRectToLines();
// return;
// }
// can_fast = false;
vx = -DBL_MAX; vx = -DBL_MAX;
minY = minX = DBL_MAX; minY = minX = DBL_MAX;
maxY = maxX = -DBL_MAX; maxY = maxX = -DBL_MAX;
@@ -957,14 +823,12 @@ void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, dou
if (vx < (pause_ ? t.max_x_pause : t.max_x)) vx = (pause_ ? t.max_x_pause : t.max_x); if (vx < (pause_ ? t.max_x_pause : t.max_x)) vx = (pause_ ? t.max_x_pause : t.max_x);
} }
vx -= visible_time; vx -= visible_time;
//qDebug() << "[Graphic]" << "can_fast" << can_fast;
for (int g = 0; g < graphics.size(); g++) { for (int g = 0; g < graphics.size(); g++) {
GraphicType & t(graphics[g]); GraphicType & t(graphics[g]);
if (!t.visible) continue; if (!t.visible) continue;
const QPolygonF & pol(pause_ ? t.polyline_pause : t.polyline); const QPolygonF & pol(pause_ ? t.polyline_pause : t.polyline);
if (pol.isEmpty()) continue; if (pol.isEmpty()) continue;
bool f = true; bool f = true;
//qDebug() << "[Graphic]" << "cvrect:" << t.cvrect << t.cvrect.isNull();
if (t.cvrect.isNull() || !can_fast) { if (t.cvrect.isNull() || !can_fast) {
for (int i = 0; i < pol.size(); i++) { for (int i = 0; i < pol.size(); i++) {
cx = pol[i].x(); cx = pol[i].x();
@@ -981,10 +845,8 @@ void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, dou
if (t.cvrect.right() < cx) t.cvrect.setRight(cx); if (t.cvrect.right() < cx) t.cvrect.setRight(cx);
if (t.cvrect.left() > cx) t.cvrect.setLeft(cx); if (t.cvrect.left() > cx) t.cvrect.setLeft(cx);
} }
//fast = false;
} }
if (f) continue; if (f) continue;
//qDebug() << "[Graphic]" << "2 cvrect:" << t.cvrect;
} }
anyVisible = true; anyVisible = true;
if (maxY < t.cvrect.top()) maxY = t.cvrect.top(); if (maxY < t.cvrect.top()) maxY = t.cvrect.top();
@@ -994,13 +856,10 @@ void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, dou
if (!can_fast) t.cvrect = QRectF(); if (!can_fast) t.cvrect = QRectF();
} }
if (!anyVisible) { if (!anyVisible) {
//qDebug() << "[Graphic]" << "empty autofit";
grect = def_rect; grect = def_rect;
setRectToLines(); setRectToLines();
return; return;
} }
// if (fast) qDebug() << "[Graphic]" << "FAST autofit";
// else qDebug() << "[Graphic]" << "autofit";
if (maxX > limit_.right()) maxX = limit_.right(); if (maxX > limit_.right()) maxX = limit_.right();
if (minX > limit_.right()) minX = limit_.right(); if (minX > limit_.right()) minX = limit_.right();
if (minX < limit_.left()) minX = limit_.left(); if (minX < limit_.left()) minX = limit_.left();
@@ -1027,7 +886,7 @@ void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, dou
else if (isRangeY) selrect.setRect(minX, start_y, maxX - minX, end_y - start_y); else if (isRangeY) selrect.setRect(minX, start_y, maxX - minX, end_y - start_y);
else grect.setRect(minX, minY, maxX - minX, maxY - minY); else grect.setRect(minX, minY, maxX - minX, maxY - minY);
grect = grect.normalized(); grect = grect.normalized();
if (isFit)/* || isRangeX || isRangeY)*/ { if (isFit) {
if (visible_time > 0.) { if (visible_time > 0.) {
if (grect.width() > visible_time) if (grect.width() > visible_time)
grect.setLeft(grect.right() - visible_time); grect.setLeft(grect.right() - visible_time);
@@ -1039,7 +898,6 @@ void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, dou
void Graphic::drawAction() { void Graphic::drawAction() {
//qDebug() << "draw action";
int wid = canvas->width(), hei = canvas->height() - gridborder.y(), sx = startpos.x(), sy = startpos.y(), cx = curpos.x(), cy = curpos.y(); int wid = canvas->width(), hei = canvas->height() - gridborder.y(), sx = startpos.x(), sy = startpos.y(), cx = curpos.x(), cy = curpos.y();
painter->setPen(selpen); painter->setPen(selpen);
painter->setBrush(selbrush); painter->setBrush(selbrush);
@@ -1067,7 +925,7 @@ void Graphic::drawAction() {
void Graphic::drawGrid() { void Graphic::drawGrid() {
int gbx = gridborder.x(), gby = gridborder.y(), cwid = canvas->width(), chei = canvas->height() - legy; int gbx = gridborder.x(), gby = gridborder.y(), cwid = canvas->width(), chei = canvas->height();
double px, py, range, step, start; double px, py, range, step, start;
int wid = cwid - gbx - 5, hei = chei - gby - 5, cx, cy, cnt; int wid = cwid - gbx - 5, hei = chei - gby - 5, cx, cy, cnt;
QRect rect; QRect rect;
@@ -1075,7 +933,7 @@ void Graphic::drawGrid() {
range = selrect.bottom() - selrect.top(); range = selrect.bottom() - selrect.top();
if (grad_y == Graphic::Auto) step = splitRange(range, hei / gridy / font_sz.height() / 1.4); if (grad_y == Graphic::Auto) step = splitRange(range, hei / gridy / font_sz.height() / 1.4);
else step = gridy;//range / hei * gridy; else step = gridy;
start = roundTo(canvas2realY(-hei), step) - step; start = roundTo(canvas2realY(-hei), step) - step;
py = start + step; py = start + step;
cy = 0; cy = 0;
@@ -1132,7 +990,7 @@ void Graphic::drawGrid() {
QString df; QString df;
if (axis_type_x == Graphic::Numeric) { if (axis_type_x == Graphic::Numeric) {
if (grad_x == Graphic::Auto) step = splitRange(range, wid / gridx / font_sz.width() * 1.4); if (grad_x == Graphic::Auto) step = splitRange(range, wid / gridx / font_sz.width() * 1.4);
else step = gridx;//range / wid * gridx; else step = gridx;
start = roundTo(canvas2realX(wid), step) + step; start = roundTo(canvas2realX(wid), step) + step;
px = start + step; px = start + step;
if (step > 0.) { if (step > 0.) {
@@ -1172,21 +1030,15 @@ void Graphic::drawGrid() {
start = roundTo(canvas2realX(wid), step) + step; start = roundTo(canvas2realX(wid), step) + step;
px = start + step; px = start + step;
QDateTime cd = QDateTime::fromMSecsSinceEpoch(px * grid_numbers_x); QDateTime cd = QDateTime::fromMSecsSinceEpoch(px * grid_numbers_x);
//qDebug() << "*** start" << cd << step;
roundDateTime(cd, cur_scl); roundDateTime(cd, cur_scl);
//qDebug() << "*** round" << cd;
addDateTime(cd, cur_scl); addDateTime(cd, cur_scl);
//qDebug() << "*** add" << cd;
//qDebug() << "*** cur" << cur_scl[0] << cur_scl[1] << cur_scl[2] << cur_scl[3] << cur_scl[4] << cur_scl[5] << cur_scl[6];
if (step > 0.) { if (step > 0.) {
cnt = 1000; cnt = 1000;
while (cnt-- > 0) { while (cnt-- > 0) {
addDateTime(cd, cur_scl, -1); addDateTime(cd, cur_scl, -1);
//roundDateTime(cd, cur_scl);
//qDebug() << "next" << cd;
cx = real2canvasX(cd.toMSecsSinceEpoch() / grid_numbers_x); cx = real2canvasX(cd.toMSecsSinceEpoch() / grid_numbers_x);
if (cx > cwid) continue; if (cx > cwid) continue;
if (cx < gbx) {/*qDebug() << cx << "<" << gbx;*/ break;} if (cx < gbx) break;
painter->setPen(grid_pen); painter->setPen(grid_pen);
painter->drawLine(cx, hei + 5, cx, 0); painter->drawLine(cx, hei + 5, cx, 0);
painter->setPen(text_color); painter->setPen(text_color);
@@ -1230,13 +1082,12 @@ void Graphic::drawGraphics() {
if (isHover) if (isHover)
ui->status->setText(tr("Cursor: ") + pointCoords(canvas2real(QPointF(curpos)))); ui->status->setText(tr("Cursor: ") + pointCoords(canvas2real(QPointF(curpos))));
QPointF srp = -selrect.topLeft(); QPointF srp = -selrect.topLeft();
double sclx, scly, wid = canvas->width(), hei = canvas->height() - legy; double sclx, scly, wid = canvas->width(), hei = canvas->height();
sclx = (wid - gridborder.x() - margins_.left() - margins_.width()) / selrect.width(); sclx = (wid - gridborder.x() - margins_.left() - margins_.width()) / selrect.width();
scly = (hei - gridborder.y() - margins_.top() - margins_.height()) / selrect.height(); scly = (hei - gridborder.y() - margins_.top() - margins_.height()) / selrect.height();
painter->setClipping(true); painter->setClipping(true);
painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y())); painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y()));
painter->translate(gridborder.x() + margins_.left(), hei - gridborder.y() - margins_.top()); painter->translate(gridborder.x() + margins_.left(), hei - gridborder.y() - margins_.top());
//if (isOGL && aalias) pen.setWidthF(1.5f);
painter->scale(sclx, -scly); painter->scale(sclx, -scly);
painter->translate(srp); painter->translate(srp);
QTransform mat = painter->transform(); QTransform mat = painter->transform();
@@ -1257,8 +1108,6 @@ void Graphic::drawGraphics() {
if (t.fill) { if (t.fill) {
cpol = rpol; cpol = rpol;
painter->setBrush(t.fill_color); painter->setBrush(t.fill_color);
//cpol.push_front(QPointF(cpol.front().x(), 0.));
//cpol.push_back(QPointF(cpol.back().x(), 0.));
painter->drawPolygon(mat.map(cpol)); painter->drawPolygon(mat.map(cpol));
} else } else
painter->drawPolyline(mat.map(rpol)); painter->drawPolyline(mat.map(rpol));
@@ -1350,7 +1199,6 @@ double Graphic::splitRange(double range, int count) {
double Graphic::splitRangeDate(double range, int count, QString * format, int step[7]) { double Graphic::splitRangeDate(double range, int count, QString * format, int step[7]) {
double ret = splitRange(range, count); double ret = splitRange(range, count);
//qDebug() << "ret =" << ret << getScaleX();
if (ret < 1000. * 1) {*format = "ss.zzz"; step[0] = ret;} if (ret < 1000. * 1) {*format = "ss.zzz"; step[0] = ret;}
else if (ret < 1000. * 60) {*format = "h:m:ss"; step[1] = qRound(ret / 1000);} else if (ret < 1000. * 60) {*format = "h:m:ss"; step[1] = qRound(ret / 1000);}
else if (ret < 1000. * 60 * 60) {*format = "h:mm"; step[2] = qRound(ret / 1000 / 60);} else if (ret < 1000. * 60 * 60) {*format = "h:mm"; step[2] = qRound(ret / 1000 / 60);}
@@ -1370,7 +1218,6 @@ double Graphic::roundTo(double value, double round_to) {
void Graphic::roundDateTime(QDateTime & dt, int c[7]) { void Graphic::roundDateTime(QDateTime & dt, int c[7]) {
QDate d(dt.date()); QTime t(dt.time()); QDate d(dt.date()); QTime t(dt.time());
//if (c[0] != 0) t.setHMS(t.hour(), t.minute(), t.second(), 0);
if (c[1] != 0) t.setHMS(t.hour(), t.minute(), t.second()); if (c[1] != 0) t.setHMS(t.hour(), t.minute(), t.second());
if (c[2] != 0) t.setHMS(t.hour(), t.minute(), 0); if (c[2] != 0) t.setHMS(t.hour(), t.minute(), 0);
if (c[3] != 0) t.setHMS(t.hour(), 0, 0); if (c[3] != 0) t.setHMS(t.hour(), 0, 0);
@@ -1400,7 +1247,7 @@ double Graphic::canvas2realX(double px) const {
double Graphic::canvas2realY(double py) const { double Graphic::canvas2realY(double py) const {
int gby = gridborder.y() + margins_.top(), chei = lasth - legy, hei = chei - gby - margins_.height(); int gby = gridborder.y() + margins_.top(), chei = lasth, hei = chei - gby - margins_.height();
double cy = chei - py - gby, scly = selrect.height() / (double)hei; double cy = chei - py - gby, scly = selrect.height() / (double)hei;
return cy * scly + selrect.y(); return cy * scly + selrect.y();
} }
@@ -1414,7 +1261,7 @@ double Graphic::real2canvasX(double px) const {
double Graphic::real2canvasY(double py) const { double Graphic::real2canvasY(double py) const {
int gby = gridborder.y() + margins_.top(), chei = lasth - legy, hei = chei - gby - margins_.height(); int gby = gridborder.y() + margins_.top(), chei = lasth, hei = chei - gby - margins_.height();
double scly = selrect.height() / (double)hei; double scly = selrect.height() / (double)hei;
return chei - gby - (py - selrect.y()) / scly; return chei - gby - (py - selrect.y()) / scly;
} }
@@ -1469,7 +1316,6 @@ void Graphic::setCanvasCursor(QCursor cursor) {
void Graphic::swapToBuffer() { void Graphic::swapToBuffer() {
QImage timg; QImage timg;
//qDebug() << "render start";
#ifdef HAS_GL #ifdef HAS_GL
if (isOGL) { if (isOGL) {
timg = canvas_gl->grabFrameBuffer(); timg = canvas_gl->grabFrameBuffer();
@@ -1478,16 +1324,12 @@ void Graphic::swapToBuffer() {
p.end(); p.end();
} }
#endif #endif
//qDebug() << "render finish";
bufferActive = true; bufferActive = true;
} }
void Graphic::setRectToLines() { void Graphic::setRectToLines() {
is_lines_update = true; is_lines_update = true;
//line_x_min.is_auto = line_x_max.is_auto = line_y_min.is_auto = line_y_max.is_auto = true;
//qDebug() << "set to lines" << selrect;
//line_x_min.is_reset = line_x_max.is_reset = line_y_min.is_reset = line_y_max.is_reset = isFit;
if (line_x_min.isVisible() && line_x_max.isVisible() && line_y_min.isVisible() && line_y_max.isVisible()) { if (line_x_min.isVisible() && line_x_max.isVisible() && line_y_min.isVisible() && line_y_max.isVisible()) {
line_x_min.blockSignals(true); line_x_max.blockSignals(true); line_y_min.blockSignals(true); line_y_max.blockSignals(true); line_x_min.blockSignals(true); line_x_max.blockSignals(true); line_y_min.blockSignals(true); line_y_max.blockSignals(true);
if (!line_x_min.hasFocus()) { if (!line_x_min.hasFocus()) {
@@ -1511,12 +1353,7 @@ void Graphic::setRectToLines() {
line_y_min.setDefaultText(QString::number(grect.bottom()).toUpper()); line_y_min.setDefaultText(QString::number(grect.bottom()).toUpper());
line_y_max.setDefaultText(QString::number(grect.top()).toUpper()); line_y_max.setDefaultText(QString::number(grect.top()).toUpper());
line_x_min.blockSignals(false); line_x_max.blockSignals(false); line_y_min.blockSignals(false); line_y_max.blockSignals(false); line_x_min.blockSignals(false); line_x_max.blockSignals(false); line_y_min.blockSignals(false); line_y_max.blockSignals(false);
// if(isFit) {
// line_y_min.setValue(grect.left());
// line_y_max.setValue(grect.left());
// }
} }
//line_x_min.is_auto = line_x_max.is_auto = line_y_min.is_auto = line_y_max.is_auto = false;
is_lines_update = false; is_lines_update = false;
} }
@@ -1529,7 +1366,6 @@ void Graphic::checkLines() {
void Graphic::tick(int index, bool slide, bool update_) { void Graphic::tick(int index, bool slide, bool update_) {
if (slide) { if (slide) {
///mutex.lock();
GraphicType & t(graphics[index]); GraphicType & t(graphics[index]);
if (history > 0.) if (history > 0.)
while (t.polyline.size() > 1) { while (t.polyline.size() > 1) {
@@ -1549,17 +1385,13 @@ void Graphic::tick(int index, bool slide, bool update_) {
} }
if (!update_) { if (!update_) {
if (isFit) findGraphicsRect(); if (isFit) findGraphicsRect();
///mutex.unlock();
return; return;
} }
//polyline.push_back(QPointF(brick->time_, brick->output(port)));
//cout << polyline.size() << endl;
if (isFit) findGraphicsRect(); if (isFit) findGraphicsRect();
if (!slide) { if (!slide) {
if (aupdate) update(); if (aupdate) update();
return; return;
} }
///mutex.unlock();
if (aupdate) update(); if (aupdate) update();
} }
@@ -1650,10 +1482,8 @@ void Graphic::updateLegend(bool es) {
} }
if (!ui->widgetLegend->isVisibleTo(this)) { if (!ui->widgetLegend->isVisibleTo(this)) {
if (es) emit graphicSettingsChanged(); if (es) emit graphicSettingsChanged();
// qDebug() << "skip updateLegend";
return; return;
} }
// qDebug() << "updateLegend" << graphics.size();
leg_update = false; leg_update = false;
int ps = 100; int ps = 100;
for (int r = 0; r < ui->layoutLegend->rowCount(); ++r) for (int r = 0; r < ui->layoutLegend->rowCount(); ++r)
@@ -1669,12 +1499,10 @@ void Graphic::updateLegend(bool es) {
for (int i = 0; i < graphics.size(); i++) { for (int i = 0; i < graphics.size(); i++) {
graphics[i].pb = new QCheckBox(graphics[i].name); graphics[i].pb = new QCheckBox(graphics[i].name);
graphics[i].pb->setIconSize(pix.size()); graphics[i].pb->setIconSize(pix.size());
//graphics[i].pb->setFlat(true);
graphics[i].pb->setIcon(graphics[i].icon); graphics[i].pb->setIcon(graphics[i].icon);
graphics[i].pb->setChecked(graphics[i].visible); graphics[i].pb->setChecked(graphics[i].visible);
graphics[i].pb->setProperty("graphic_num", i); graphics[i].pb->setProperty("graphic_num", i);
graphics[i].pb->setContextMenuPolicy(Qt::ActionsContextMenu); graphics[i].pb->setContextMenuPolicy(Qt::ActionsContextMenu);
//qDebug() << graphics[i].pb->actions();
QAction * act = new QAction(tr("Check all"), 0); QAction * act = new QAction(tr("Check all"), 0);
act->setCheckable(true); act->setCheckable(true);
act->setChecked(true); act->setChecked(true);
@@ -1719,7 +1547,6 @@ void Graphic::graphicVisibleChange(bool checked) {
if (isFit) on_buttonAutofit_clicked(); if (isFit) on_buttonAutofit_clicked();
else update(); else update();
emit graphicSettingsChanged(); emit graphicSettingsChanged();
//update();
} }
@@ -1738,7 +1565,6 @@ void Graphic::graphicAllVisibleChange(bool checked) {
void Graphic::enterFullscreen() { void Graphic::enterFullscreen() {
if (fullscr) return; if (fullscr) return;
//QMessageBox::information(0, "", "enter");
fullscr = true; fullscr = true;
canvas->hide(); canvas->hide();
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID
@@ -1750,7 +1576,6 @@ void Graphic::enterFullscreen() {
QPushButton * btn = new QPushButton("Leave fullscreen"); QPushButton * btn = new QPushButton("Leave fullscreen");
dlg.layout()->addWidget(btn); dlg.layout()->addWidget(btn);
connect(btn, SIGNAL(clicked(bool)), this, SLOT(leaveFullscreen())); connect(btn, SIGNAL(clicked(bool)), this, SLOT(leaveFullscreen()));
//connect(fullscr_dialog, SIGNAL(finished(int)), this, SLOT(leaveFullscreen()));
canvas->show(); canvas->show();
dlg.showFullScreen(); dlg.showFullScreen();
dlg.exec(); dlg.exec();
@@ -1771,9 +1596,7 @@ void Graphic::leaveFullscreen() {
if (tm_fscr.elapsed() < 100) return; if (tm_fscr.elapsed() < 100) return;
#endif #endif
if (!fullscr) return; if (!fullscr) return;
//QMessageBox::information(0, "", "leave");
fullscr = false; fullscr = false;
//canvas->hide();
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
canvas->showNormal(); canvas->showNormal();
canvas->hide(); canvas->hide();
@@ -1817,6 +1640,10 @@ QByteArray Graphic::save() {
cs.add(9, gridPen()).add(10, graduationX()).add(11, graduationY()).add(12, graduationStepX()).add(13, graduationStepY()); cs.add(9, gridPen()).add(10, graduationX()).add(11, graduationY()).add(12, graduationStepX()).add(13, graduationStepY());
cs.add(14, graphics); cs.add(14, graphics);
cs.add(15, isFit).add(16, visualRect()); cs.add(15, isFit).add(16, visualRect());
if (backgroundColor() == palette().color(QPalette::Base) &&
textColor() == palette().color(QPalette::WindowText) &&
gridColor() == palette().color(QPalette::Disabled, QPalette::WindowText))
cs.add(17, true);
return cs.data().prepend('2'); return cs.data().prepend('2');
} }
@@ -1824,12 +1651,12 @@ QByteArray Graphic::save() {
void Graphic::load(QByteArray ba) { void Graphic::load(QByteArray ba) {
if (ba.isEmpty()) return; if (ba.isEmpty()) return;
char ver = ba[0]; char ver = ba[0];
//qDebug() << "load" << (int)ver;
switch(ver) { switch(ver) {
case '2': {// version '2': case '2': {// version '2':
ba.remove(0, 1); ba.remove(0, 1);
QRectF vrect; QRectF vrect;
ChunkStream cs(ba); ChunkStream cs(ba);
bool def_colors = false;
while (!cs.atEnd()) { while (!cs.atEnd()) {
switch (cs.read()) { switch (cs.read()) {
case 1: setAntialiasing(cs.getData<bool>()); break; case 1: setAntialiasing(cs.getData<bool>()); break;
@@ -1837,10 +1664,10 @@ void Graphic::load(QByteArray ba) {
case 3: setBorderInputsVisible(cs.getData<bool>()); break; case 3: setBorderInputsVisible(cs.getData<bool>()); break;
case 4: setStatusVisible(cs.getData<bool>()); break; case 4: setStatusVisible(cs.getData<bool>()); break;
case 5: setLegendVisible(cs.getData<bool>()); break; case 5: setLegendVisible(cs.getData<bool>()); break;
case 6: setBackgroundColor(cs.getData<QColor>()); break; case 6: if (!def_colors) setBackgroundColor(cs.getData<QColor>()); break;
case 7: setTextColor(cs.getData<QColor>()); break; case 7: if (!def_colors) setTextColor(cs.getData<QColor>()); break;
case 8: setMargins(cs.getData<QRect>()); break; case 8: setMargins(cs.getData<QRect>()); break;
case 9: setGridPen(cs.getData<QPen>()); break; case 9: if (!def_colors) setGridPen(cs.getData<QPen>()); break;
case 10: setGraduationX(cs.getData<Graduation>()); break; case 10: setGraduationX(cs.getData<Graduation>()); break;
case 11: setGraduationY(cs.getData<Graduation>()); break; case 11: setGraduationY(cs.getData<Graduation>()); break;
case 12: setGraduationStepX(cs.getData<double>()); break; case 12: setGraduationStepX(cs.getData<double>()); break;
@@ -1848,6 +1675,12 @@ void Graphic::load(QByteArray ba) {
case 14: graphics = cs.getData<QVector<GraphicType> >(); break; case 14: graphics = cs.getData<QVector<GraphicType> >(); break;
case 15: isFit = cs.getData<bool>(); break; case 15: isFit = cs.getData<bool>(); break;
case 16: vrect = cs.getData<QRectF>(); break; case 16: vrect = cs.getData<QRectF>(); break;
case 17: if(cs.getData<bool>()) {
setTextColor(palette().color(QPalette::WindowText));
setGridPen(QPen(palette().color(QPalette::Disabled, QPalette::WindowText), 0., Qt::DotLine));
setBackgroundColor(palette().color(QPalette::Base));
def_colors = true;
} break;
default: break; default: break;
} }
} }

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRAPHIC_H #ifndef GRAPHIC_H
#define GRAPHIC_H #define GRAPHIC_H
@@ -9,7 +28,7 @@
#include <QDebug> #include <QDebug>
#include <QGridLayout> #include <QGridLayout>
#include <QFileDialog> #include <QFileDialog>
#include <QTime> #include <QElapsedTimer>
#include <QTranslator> #include <QTranslator>
#include <QGestureEvent> #include <QGestureEvent>
#include <qmath.h> #include <qmath.h>
@@ -94,16 +113,12 @@ class QAD_EXPORT Graphic: public QFrame
Q_PROPERTY(double graduationStepY READ graduationStepY WRITE setGraduationStepY) Q_PROPERTY(double graduationStepY READ graduationStepY WRITE setGraduationStepY)
Q_PROPERTY(AxisType axisType READ axisType WRITE setAxisType) Q_PROPERTY(AxisType axisType READ axisType WRITE setAxisType)
Q_PROPERTY(int histogramMinIntervals READ histogramMinIntervals WRITE setHistogramMinIntervals)
Q_PROPERTY(int histogramMaxIntervals READ histogramMaxIntervals WRITE setHistogramMaxIntervals)
Q_PROPERTY(double histogramMinDeltaMultiplier READ histogramMinDeltaMultiplier WRITE setHistogramMinDeltaMultiplier)
Q_PROPERTY(Graphic::GraphicsData graphicsData READ graphicsData WRITE setGraphicsData) Q_PROPERTY(Graphic::GraphicsData graphicsData READ graphicsData WRITE setGraphicsData)
Q_PROPERTY(QByteArray graphicsDataRaw READ graphicsDataRaw WRITE setGraphicsDataRaw) Q_PROPERTY(QByteArray graphicsDataRaw READ graphicsDataRaw WRITE setGraphicsDataRaw)
public: public:
Graphic(QWidget * parent = 0); Graphic(QWidget * parent = 0);
~Graphic(); virtual ~Graphic();
typedef QVector<QVector<QPointF> > GraphicsData; typedef QVector<QVector<QPointF> > GraphicsData;
enum GraphicAction {gaNone, gaZoomInRect, gaZoomRangeX, gaZoomRangeY, gaMove}; enum GraphicAction {gaNone, gaZoomInRect, gaZoomRangeX, gaZoomRangeY, gaMove};
@@ -177,9 +192,6 @@ public:
QRectF limit() const {return limit_;} QRectF limit() const {return limit_;}
QRect margins() const {return margins_;} QRect margins() const {return margins_;}
int minimumRepaintInterval() const {return min_repaint_int;} int minimumRepaintInterval() const {return min_repaint_int;}
int histogramMinIntervals() const {return min_int;}
int histogramMaxIntervals() const {return max_int;}
double histogramMinDeltaMultiplier() const {return mdm;}
double gridNumbersMultiplierX() const {return grid_numbers_x;} double gridNumbersMultiplierX() const {return grid_numbers_x;}
double gridNumbersMultiplierY() const {return grid_numbers_y;} double gridNumbersMultiplierY() const {return grid_numbers_y;}
Graduation graduationX() const {return grad_x;} Graduation graduationX() const {return grad_x;}
@@ -193,17 +205,10 @@ public:
QWidget * viewport() const {return canvas;} QWidget * viewport() const {return canvas;}
QByteArray save(); QByteArray save();
void load(QByteArray ba); void load(QByteArray ba);
///void lock() {mutex_.lock();}
///void unlock() {mutex_.unlock();}
///void reset() {mutex.lock(); clear(); mutex.unlock();}
void reset() {clear();}
GraphicType graphic(int arg) {if (arg < 0 || arg >= graphics.size()) return GraphicType(); return graphics[arg];} GraphicType graphic(int arg) {if (arg < 0 || arg >= graphics.size()) return GraphicType(); return graphics[arg];}
const QVector<GraphicType> & allGraphics() const {return graphics;} const QVector<GraphicType> & allGraphics() const {return graphics;}
void setAllGraphics(const QVector<GraphicType> & g, bool update = true) {graphics = g; if (update) updateLegend();} void setAllGraphics(const QVector<GraphicType> & g, bool update = true) {graphics = g; if (update) updateLegend();}
// void setHistogramData(const QVector<float> & g, int graphic);
// void setHistogramData(const QVector<float> & g) {setHistogramData(g, curGraphic);}
double canvas2realX(double px) const; double canvas2realX(double px) const;
double canvas2realY(double py) const; double canvas2realY(double py) const;
@@ -229,7 +234,8 @@ public slots:
void setGraphicColor(const QColor & color) {setGraphicColor(color, curGraphic);} void setGraphicColor(const QColor & color) {setGraphicColor(color, curGraphic);}
void setGridColor(const QColor & color) {grid_pen.setColor(color); if (aupdate) update();} void setGridColor(const QColor & color) {grid_pen.setColor(color); if (aupdate) update();}
void setSelectionColor(const QColor & color) {selpen.setColor(color);} void setSelectionColor(const QColor & color) {selpen.setColor(color);}
void setGraphicStyle(const Qt::PenStyle & style) {graphics[curGraphic].pen.setStyle(style); updateLegend(); if (aupdate) update();} void setGraphicStyle(const Qt::PenStyle & style, int index) {graphics[index].pen.setStyle(style); updateLegend(); if (aupdate) update();}
void setGraphicStyle(const Qt::PenStyle & style) {setGraphicStyle(style, curGraphic);}
void setGridStyle(const Qt::PenStyle & style) {grid_pen.setStyle(style); if (aupdate) update();} void setGridStyle(const Qt::PenStyle & style) {grid_pen.setStyle(style); if (aupdate) update();}
void setSelectionStyle(const Qt::PenStyle & style) {selpen.setStyle(style);} void setSelectionStyle(const Qt::PenStyle & style) {selpen.setStyle(style);}
void setGraphicVisible(bool visible, int index) {graphics[index].visible = visible; updateLegendChecks(); if (aupdate) update();} void setGraphicVisible(bool visible, int index) {graphics[index].visible = visible; updateLegendChecks(); if (aupdate) update();}
@@ -276,9 +282,6 @@ public slots:
void setOnlyExpandY(bool yes); void setOnlyExpandY(bool yes);
void setOnlyExpandX(bool yes); void setOnlyExpandX(bool yes);
void setGesturesNavigation(bool yes); void setGesturesNavigation(bool yes);
void setHistogramMinIntervals(int value) {min_int = value; updateGraphics();}
void setHistogramMaxIntervals(int value) {max_int = value; updateGraphics();}
void setHistogramMinDeltaMultiplier(double value) {mdm = value; updateGraphics();}
void setGraphicsData(const GraphicsData & gd); void setGraphicsData(const GraphicsData & gd);
void setGraphicsDataRaw(const QByteArray & ba); void setGraphicsDataRaw(const QByteArray & ba);
@@ -357,8 +360,6 @@ protected:
Ui::Graphic * ui; Ui::Graphic * ui;
UGLWidget * canvas_gl; UGLWidget * canvas_gl;
///QMutex mutex, mutex_;
QDialog * fullscr_dialog;
QWidget * canvas; QWidget * canvas;
QImage * buffer; QImage * buffer;
QPainter * painter; QPainter * painter;
@@ -368,7 +369,7 @@ protected:
QVector<GraphicType> graphics; QVector<GraphicType> graphics;
int curGraphic; int curGraphic;
GraphicAction curaction, prevaction; GraphicAction curaction, prevaction;
QRectF grect, rrect, selrect, limit_, def_rect; QRectF grect, selrect, limit_, def_rect;
QRect margins_; QRect margins_;
QSize font_sz; QSize font_sz;
QPoint startpos, curpos, prevpos, gridborder; QPoint startpos, curpos, prevpos, gridborder;
@@ -378,15 +379,18 @@ protected:
Graphic::Alignment align; Graphic::Alignment align;
GraphicConf * conf; GraphicConf * conf;
EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max; EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max;
QTime tm, tm_fscr; QElapsedTimer tm;
#ifdef Q_OS_ANDROID
QElapsedTimer tm_fscr;
#endif
QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy; QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy;
QImage icon_pause_b, icon_pause_f; QImage icon_pause_b, icon_pause_f;
Graduation grad_x, grad_y; Graduation grad_x, grad_y;
AxisType axis_type_x; AxisType axis_type_x;
double gridx, gridy, history, visible_time, inc_x, mdm, grid_numbers_x, grid_numbers_y, LN2, LN5, LN10; double gridx, gridy, history, visible_time, inc_x, grid_numbers_x, grid_numbers_y, LN10;
double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle; double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle;
int legy, lastw, lasth, min_repaint_int, min_int, max_int, timer_pause, thick; int lastw, lasth, min_repaint_int, timer_pause, thick;
bool aalias, aupdate, mupdate, grid, guides, isFit, isEmpty, isOGL, isHover, bufferActive, cancel, pause_, isPrinting, gestures; bool aalias, aupdate, grid, guides, isFit, isOGL, isHover, bufferActive, cancel, pause_, gestures;
bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr, need_mouse_pan; bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr, need_mouse_pan;
protected slots: protected slots:
@@ -405,7 +409,7 @@ protected slots:
void lineYMinChanged(double value) {selrect.setBottom(value); checkLines();} void lineYMinChanged(double value) {selrect.setBottom(value); checkLines();}
void lineYMaxChanged(double value) {selrect.setTop(value); checkLines();} void lineYMaxChanged(double value) {selrect.setTop(value); checkLines();}
void on_buttonClose_clicked() {emit closeRequest(this);} void on_buttonClose_clicked() {emit closeRequest(this);}
void on_buttonClear_clicked() {reset(); emit cleared();} void on_buttonClear_clicked() {clear(); emit cleared();}
void on_buttonAutofit_clicked(); void on_buttonAutofit_clicked();
void on_buttonConfigure_clicked(); void on_buttonConfigure_clicked();
void on_buttonFullscreen_clicked() {fullscreen();} void on_buttonFullscreen_clicked() {fullscreen();}

View File

@@ -29,11 +29,11 @@ GraphicConf::GraphicConf(QVector<GraphicType> & graphics_, QWidget * parent): QD
void GraphicConf::changeEvent(QEvent * e) { void GraphicConf::changeEvent(QEvent * e) {
QDialog::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this); ui->retranslateUi(this);
return; return;
} }
QDialog::changeEvent(e);
} }

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRAPHIC_CONF_H #ifndef GRAPHIC_CONF_H
#define GRAPHIC_CONF_H #define GRAPHIC_CONF_H

View File

@@ -0,0 +1,387 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>Graphic</name>
<message>
<location filename="../graphic.ui" line="53"/>
<source>Autofit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="64"/>
<source>Grid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="81"/>
<source>Cursor axis</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="95"/>
<source>Only expand Y</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="109"/>
<source>Only expand X</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="123"/>
<source>Fullscreen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="134"/>
<source>Border inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="151"/>
<source>Legend</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="168"/>
<source>Pause</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="182"/>
<source>Configure ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="193"/>
<source>Save image ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="220"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="231"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.ui" line="396"/>
<source>Cursor: ( ; )</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="387"/>
<location filename="../graphic.cpp" line="1231"/>
<source>Cursor: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="402"/>
<source>Selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="403"/>
<source>Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="407"/>
<location filename="../graphic.cpp" line="413"/>
<source>Range</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="408"/>
<location filename="../graphic.cpp" line="414"/>
<source>Length</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="525"/>
<location filename="../graphic.cpp" line="566"/>
<source>Cursor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="814"/>
<source>Save Image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="865"/>
<source>y(x)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic.cpp" line="1678"/>
<source>Check all</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GraphicConf</name>
<message>
<location filename="../graphic_conf.ui" line="17"/>
<source>Graphic parameters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="26"/>
<source>Appearance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="34"/>
<source>Border inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="41"/>
<source>Antialiasing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="48"/>
<source>Status bar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="55"/>
<source>OpenGL</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="62"/>
<source>Legend</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="82"/>
<source>Background color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="102"/>
<source>Text color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="121"/>
<source>Graphics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="140"/>
<location filename="../graphic_conf.ui" line="236"/>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="154"/>
<location filename="../graphic_conf.ui" line="250"/>
<source>Style:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="164"/>
<source>Lines width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="184"/>
<source>Points width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="207"/>
<source>Fill:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="227"/>
<source>Grid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="260"/>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="274"/>
<source>Step X:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="281"/>
<source>Step Y:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="288"/>
<source>Auto X</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="298"/>
<source>Auto Y</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="308"/>
<location filename="../graphic_conf.ui" line="311"/>
<source>30</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="321"/>
<location filename="../graphic_conf.ui" line="324"/>
<source>50</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="357"/>
<source>Margins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="363"/>
<location filename="../graphic_conf.ui" line="373"/>
<location filename="../graphic_conf.ui" line="393"/>
<location filename="../graphic_conf.ui" line="433"/>
<location filename="../graphic_conf.ui" line="453"/>
<source> px</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="383"/>
<source>All:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="403"/>
<source>Right:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="413"/>
<source>Left:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="423"/>
<source>Bottom:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="443"/>
<source>Top:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="13"/>
<source>NoPen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="13"/>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="13"/>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="14"/>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="14"/>
<source>Dash-Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="14"/>
<source>Dash-Dot-Dot</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="14"/>
<source>QPICalculator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="29"/>
<source>Calculator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="60"/>
<source>Expression</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="65"/>
<source>Result</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="76"/>
<source>Correct</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="83"/>
<location filename="../qpicalculator/mainwindow.ui" line="100"/>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="111"/>
<source>Variables</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="139"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="144"/>
<source>Value</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="169"/>
<location filename="../qpicalculator/mainwindow.ui" line="290"/>
<source>Del</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="219"/>
<source>Graphics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="260"/>
<source>On</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="265"/>
<source>Function</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -4,129 +4,121 @@
<context> <context>
<name>Graphic</name> <name>Graphic</name>
<message> <message>
<location filename="../graphic.ui" line="44"/> <location filename="../graphic.ui" line="53"/>
<location filename="../ui_graphic.h" line="320"/>
<source>Autofit</source> <source>Autofit</source>
<translation>Автомасштаб</translation> <translation>Автомасштаб</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="61"/> <location filename="../graphic.ui" line="64"/>
<location filename="../ui_graphic.h" line="323"/>
<source>Grid</source> <source>Grid</source>
<translation>Сетка</translation> <translation>Сетка</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="84"/> <location filename="../graphic.ui" line="81"/>
<location filename="../ui_graphic.h" line="326"/>
<source>Cursor axis</source> <source>Cursor axis</source>
<translation>Плавающие оси</translation> <translation>Плавающие оси</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="104"/> <location filename="../graphic.ui" line="95"/>
<location filename="../ui_graphic.h" line="329"/>
<source>Only expand Y</source> <source>Only expand Y</source>
<translation>Только расширять Y</translation> <translation>Только расширять Y</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="124"/> <location filename="../graphic.ui" line="109"/>
<location filename="../ui_graphic.h" line="332"/>
<source>Only expand X</source> <source>Only expand X</source>
<translation>Только расширять X</translation> <translation>Только расширять X</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="144"/> <location filename="../graphic.ui" line="123"/>
<location filename="../ui_graphic.h" line="335"/>
<source>Fullscreen</source> <source>Fullscreen</source>
<translation>Во весь экран</translation> <translation>Во весь экран</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="161"/> <location filename="../graphic.ui" line="134"/>
<location filename="../ui_graphic.h" line="338"/>
<source>Border inputs</source> <source>Border inputs</source>
<translation>Граничные поля ввода</translation> <translation>Граничные поля ввода</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="184"/> <location filename="../graphic.ui" line="151"/>
<location filename="../ui_graphic.h" line="341"/>
<source>Legend</source> <source>Legend</source>
<translation>Легенда</translation> <translation>Легенда</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="207"/> <location filename="../graphic.ui" line="168"/>
<location filename="../ui_graphic.h" line="344"/> <source>Pause</source>
<translation>Пауза</translation>
</message>
<message>
<location filename="../graphic.ui" line="182"/>
<source>Configure ...</source> <source>Configure ...</source>
<translation>Настроить ...</translation> <translation>Настроить ...</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="224"/> <location filename="../graphic.ui" line="193"/>
<location filename="../ui_graphic.h" line="347"/>
<source>Save image ...</source> <source>Save image ...</source>
<translation>Сохранить изображение ...</translation> <translation>Сохранить изображение ...</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="257"/> <location filename="../graphic.ui" line="220"/>
<location filename="../ui_graphic.h" line="350"/>
<source>Clear</source> <source>Clear</source>
<translation>Очистить</translation> <translation>Очистить</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="274"/> <location filename="../graphic.ui" line="231"/>
<location filename="../ui_graphic.h" line="353"/>
<source>Close</source> <source>Close</source>
<translation>Закрыть</translation> <translation>Закрыть</translation>
</message> </message>
<message> <message>
<location filename="../graphic.ui" line="425"/> <location filename="../graphic.ui" line="396"/>
<location filename="../ui_graphic.h" line="355"/>
<source>Cursor: ( ; )</source> <source>Cursor: ( ; )</source>
<translation>Курсор: ( ; )</translation> <translation>Курсор: ( ; )</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="205"/> <location filename="../graphic.cpp" line="387"/>
<location filename="../graphic.cpp" line="809"/> <location filename="../graphic.cpp" line="1231"/>
<source>Cursor: </source> <source>Cursor: </source>
<translation>Курсор: </translation> <translation>Курсор: </translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="216"/> <location filename="../graphic.cpp" line="402"/>
<source>Selection</source> <source>Selection</source>
<translation>Выделение</translation> <translation>Выделение</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="217"/> <location filename="../graphic.cpp" line="403"/>
<source>Size</source> <source>Size</source>
<translation>Размер</translation> <translation>Размер</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="221"/> <location filename="../graphic.cpp" line="407"/>
<location filename="../graphic.cpp" line="227"/> <location filename="../graphic.cpp" line="413"/>
<source>Range</source> <source>Range</source>
<translation>Диапазон</translation> <translation>Диапазон</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="222"/> <location filename="../graphic.cpp" line="408"/>
<location filename="../graphic.cpp" line="228"/> <location filename="../graphic.cpp" line="414"/>
<source>Length</source> <source>Length</source>
<translation>Длина</translation> <translation>Длина</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="329"/> <location filename="../graphic.cpp" line="525"/>
<location filename="../graphic.cpp" line="380"/> <location filename="../graphic.cpp" line="566"/>
<source>Cursor</source> <source>Cursor</source>
<translation>Курсор</translation> <translation>Курсор</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="531"/> <location filename="../graphic.cpp" line="814"/>
<source>Save Image</source> <source>Save Image</source>
<translation>Сохранить изображение</translation> <translation>Сохранить изображение</translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="576"/> <location filename="../graphic.cpp" line="865"/>
<source>y(x)</source> <source>y(x)</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../graphic.cpp" line="1124"/> <location filename="../graphic.cpp" line="1678"/>
<source>Check all</source> <source>Check all</source>
<translation>Выбрать все</translation> <translation>Выбрать все</translation>
</message> </message>
@@ -135,217 +127,265 @@
<name>GraphicConf</name> <name>GraphicConf</name>
<message> <message>
<location filename="../graphic_conf.ui" line="17"/> <location filename="../graphic_conf.ui" line="17"/>
<location filename="../ui_graphic_conf.h" line="450"/>
<source>Graphic parameters</source> <source>Graphic parameters</source>
<translation>Параметры графика</translation> <translation>Параметры графика</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="32"/> <location filename="../graphic_conf.ui" line="26"/>
<location filename="../ui_graphic_conf.h" line="451"/>
<source>Appearance</source> <source>Appearance</source>
<translation>Внешний вид</translation> <translation>Внешний вид</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="46"/> <location filename="../graphic_conf.ui" line="34"/>
<location filename="../ui_graphic_conf.h" line="452"/>
<source>Border inputs</source> <source>Border inputs</source>
<translation>Граничные поля ввода</translation> <translation>Граничные поля ввода</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="53"/> <location filename="../graphic_conf.ui" line="41"/>
<location filename="../ui_graphic_conf.h" line="453"/>
<source>Antialiasing</source> <source>Antialiasing</source>
<translation>Сглаживание</translation> <translation>Сглаживание</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="60"/> <location filename="../graphic_conf.ui" line="48"/>
<location filename="../ui_graphic_conf.h" line="454"/>
<source>Status bar</source> <source>Status bar</source>
<translation>Панель статуса</translation> <translation>Панель статуса</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="67"/> <location filename="../graphic_conf.ui" line="55"/>
<location filename="../ui_graphic_conf.h" line="455"/>
<source>OpenGL</source> <source>OpenGL</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="74"/> <location filename="../graphic_conf.ui" line="62"/>
<location filename="../ui_graphic_conf.h" line="456"/>
<source>Legend</source> <source>Legend</source>
<translation>Легенда</translation> <translation>Легенда</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="94"/> <location filename="../graphic_conf.ui" line="82"/>
<location filename="../ui_graphic_conf.h" line="457"/>
<source>Background color:</source> <source>Background color:</source>
<translation>Цвет фона:</translation> <translation>Цвет фона:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="114"/> <location filename="../graphic_conf.ui" line="102"/>
<location filename="../ui_graphic_conf.h" line="458"/>
<source>Text color:</source> <source>Text color:</source>
<translation>Цвет текста:</translation> <translation>Цвет текста:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="133"/> <location filename="../graphic_conf.ui" line="121"/>
<location filename="../ui_graphic_conf.h" line="459"/>
<source>Graphics</source> <source>Graphics</source>
<translation>Графики</translation> <translation>Графики</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="161"/> <location filename="../graphic_conf.ui" line="140"/>
<location filename="../graphic_conf.ui" line="263"/> <location filename="../graphic_conf.ui" line="236"/>
<location filename="../ui_graphic_conf.h" line="460"/>
<location filename="../ui_graphic_conf.h" line="466"/>
<source>Color:</source> <source>Color:</source>
<translation>Цвет:</translation> <translation>Цвет:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="175"/> <location filename="../graphic_conf.ui" line="154"/>
<location filename="../graphic_conf.ui" line="277"/> <location filename="../graphic_conf.ui" line="250"/>
<location filename="../ui_graphic_conf.h" line="461"/>
<location filename="../ui_graphic_conf.h" line="467"/>
<source>Style:</source> <source>Style:</source>
<translation>Стиль:</translation> <translation>Стиль:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="185"/> <location filename="../graphic_conf.ui" line="164"/>
<location filename="../ui_graphic_conf.h" line="462"/>
<source>Lines width:</source> <source>Lines width:</source>
<translation>Толщина линий:</translation> <translation>Толщина линий:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="205"/> <location filename="../graphic_conf.ui" line="184"/>
<location filename="../ui_graphic_conf.h" line="463"/>
<source>Points width:</source> <source>Points width:</source>
<translation>Толщина точек:</translation> <translation>Толщина точек:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="225"/> <location filename="../graphic_conf.ui" line="207"/>
<location filename="../ui_graphic_conf.h" line="464"/>
<source>Fill:</source> <source>Fill:</source>
<translation>Заливка:</translation> <translation>Заливка:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="245"/> <location filename="../graphic_conf.ui" line="227"/>
<location filename="../ui_graphic_conf.h" line="465"/>
<source>Grid</source> <source>Grid</source>
<translation>Сетка</translation> <translation>Сетка</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="287"/> <location filename="../graphic_conf.ui" line="260"/>
<location filename="../ui_graphic_conf.h" line="468"/>
<source>Width:</source> <source>Width:</source>
<translation>Толщина:</translation> <translation>Толщина:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="317"/> <location filename="../graphic_conf.ui" line="274"/>
<location filename="../ui_graphic_conf.h" line="469"/>
<source>Step X:</source> <source>Step X:</source>
<translation>Шаг X:</translation> <translation>Шаг X:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="324"/> <location filename="../graphic_conf.ui" line="281"/>
<location filename="../ui_graphic_conf.h" line="470"/>
<source>Step Y:</source> <source>Step Y:</source>
<translation>Шаг Y:</translation> <translation>Шаг Y:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="347"/> <location filename="../graphic_conf.ui" line="288"/>
<location filename="../ui_graphic_conf.h" line="471"/>
<source>Auto X</source> <source>Auto X</source>
<translation>Авто X</translation> <translation>Авто X</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="357"/> <location filename="../graphic_conf.ui" line="298"/>
<location filename="../ui_graphic_conf.h" line="472"/>
<source>Auto Y</source> <source>Auto Y</source>
<translation>Авто Y</translation> <translation>Авто Y</translation>
</message> </message>
<message>
<location filename="../graphic_conf.ui" line="308"/>
<location filename="../graphic_conf.ui" line="311"/>
<source>30</source>
<translation></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="321"/>
<location filename="../graphic_conf.ui" line="324"/>
<source>50</source>
<translation></translation>
</message>
<message> <message>
<source>Auto step</source> <source>Auto step</source>
<translation type="obsolete">Автоматический шаг</translation> <translation type="obsolete">Автоматический шаг</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="390"/> <location filename="../graphic_conf.ui" line="357"/>
<location filename="../ui_graphic_conf.h" line="473"/>
<source>Margins</source> <source>Margins</source>
<translation>Поля</translation> <translation>Поля</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="402"/> <location filename="../graphic_conf.ui" line="363"/>
<location filename="../graphic_conf.ui" line="412"/> <location filename="../graphic_conf.ui" line="373"/>
<location filename="../graphic_conf.ui" line="432"/> <location filename="../graphic_conf.ui" line="393"/>
<location filename="../graphic_conf.ui" line="472"/> <location filename="../graphic_conf.ui" line="433"/>
<location filename="../graphic_conf.ui" line="492"/> <location filename="../graphic_conf.ui" line="453"/>
<location filename="../ui_graphic_conf.h" line="474"/>
<location filename="../ui_graphic_conf.h" line="475"/>
<location filename="../ui_graphic_conf.h" line="477"/>
<location filename="../ui_graphic_conf.h" line="481"/>
<location filename="../ui_graphic_conf.h" line="483"/>
<source> px</source> <source> px</source>
<translation> пикс</translation> <translation> пикс</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="422"/> <location filename="../graphic_conf.ui" line="383"/>
<location filename="../ui_graphic_conf.h" line="476"/>
<source>All:</source> <source>All:</source>
<translation>Все:</translation> <translation>Все:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="442"/> <location filename="../graphic_conf.ui" line="403"/>
<location filename="../ui_graphic_conf.h" line="478"/>
<source>Right:</source> <source>Right:</source>
<translation>Правое:</translation> <translation>Правое:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="452"/> <location filename="../graphic_conf.ui" line="413"/>
<location filename="../ui_graphic_conf.h" line="479"/>
<source>Left:</source> <source>Left:</source>
<translation>Левое:</translation> <translation>Левое:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="462"/> <location filename="../graphic_conf.ui" line="423"/>
<location filename="../ui_graphic_conf.h" line="480"/>
<source>Bottom:</source> <source>Bottom:</source>
<translation>Нижнее:</translation> <translation>Нижнее:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.ui" line="482"/> <location filename="../graphic_conf.ui" line="443"/>
<location filename="../ui_graphic_conf.h" line="482"/>
<source>Top:</source> <source>Top:</source>
<translation>Верхнее:</translation> <translation>Верхнее:</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.cpp" line="7"/> <location filename="../graphic_conf.cpp" line="13"/>
<source>NoPen</source> <source>NoPen</source>
<translation>НетЛинии</translation> <translation>НетЛинии</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.cpp" line="7"/> <location filename="../graphic_conf.cpp" line="13"/>
<source>Solid</source> <source>Solid</source>
<translation>Сплошная</translation> <translation>Сплошная</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.cpp" line="7"/> <location filename="../graphic_conf.cpp" line="13"/>
<source>Dash</source> <source>Dash</source>
<translation>Штриховая</translation> <translation>Штриховая</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.cpp" line="8"/> <location filename="../graphic_conf.cpp" line="14"/>
<source>Dot</source> <source>Dot</source>
<translation>Пунктирная</translation> <translation>Пунктирная</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.cpp" line="8"/> <location filename="../graphic_conf.cpp" line="14"/>
<source>Dash-Dot</source> <source>Dash-Dot</source>
<translation>ШтрихПунктирная</translation> <translation>ШтрихПунктирная</translation>
</message> </message>
<message> <message>
<location filename="../graphic_conf.cpp" line="8"/> <location filename="../graphic_conf.cpp" line="14"/>
<source>Dash-Dot-Dot</source> <source>Dash-Dot-Dot</source>
<translation>ШтрихПунктирПунктирная</translation> <translation>ШтрихПунктирПунктирная</translation>
</message> </message>
</context> </context>
<context>
<name>MainWindow</name>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="14"/>
<source>QPICalculator</source>
<translation>Калькулятор</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="29"/>
<source>Calculator</source>
<translation>Калькулятор</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="60"/>
<source>Expression</source>
<translation>Выражение</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="65"/>
<source>Result</source>
<translation>Результат</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="76"/>
<source>Correct</source>
<translation>Корректно</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="83"/>
<location filename="../qpicalculator/mainwindow.ui" line="100"/>
<source>0</source>
<translation></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="111"/>
<source>Variables</source>
<translation>Переменные</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="139"/>
<source>Name</source>
<translation>Имя</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="144"/>
<source>Value</source>
<translation>Значение</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="169"/>
<location filename="../qpicalculator/mainwindow.ui" line="290"/>
<source>Del</source>
<translation></translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="219"/>
<source>Graphics</source>
<translation>Графики</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="260"/>
<source>On</source>
<translation>Вкл</translation>
</message>
<message>
<location filename="../qpicalculator/mainwindow.ui" line="265"/>
<source>Function</source>
<translation>Функция</translation>
</message>
</context>
</TS> </TS>

View File

@@ -0,0 +1,2 @@
lupdate ../ -ts qad_graphic_ru.ts
lupdate ../ -ts qad_graphic_en.ts

View File

@@ -129,7 +129,7 @@ void MainWindow::saving(QPIConfig & conf) {
vc = treeGraphics->topLevelItemCount(); vc = treeGraphics->topLevelItemCount();
for (int i = 0; i < vc; ++i) { for (int i = 0; i < vc; ++i) {
QTreeWidgetItem * ti = treeGraphics->topLevelItem(i); QTreeWidgetItem * ti = treeGraphics->topLevelItem(i);
vars << QString::number(ti->backgroundColor(1).rgb()) << ti->text(2); vars << QString::number(ti->background(1).color().rgb()) << ti->text(2);
} }
QByteArray ba; QDataStream s(&ba, QIODevice::WriteOnly); QByteArray ba; QDataStream s(&ba, QIODevice::WriteOnly);
s << graphic->allGraphics(); s << graphic->allGraphics();

BIN
qad/icons/logview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

BIN
qad/icons/select-all.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
qad/icons/select-none.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -3,7 +3,7 @@
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#ifdef QAD_STATIC_DEFINE #if defined(QAD_STATIC_DEFINE) || defined(DOXYGEN)
# define QAD_EXPORT # define QAD_EXPORT
#else #else
# ifdef QAD_SHARED_DEFINE # ifdef QAD_SHARED_DEFINE

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>SQLTableWidget</name>
<message>
<location filename="../sql_table_widget.ui" line="14"/>
<source>SQLTableWidget</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.ui" line="51"/>
<source>Table doesn`t exists!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.ui" line="182"/>
<source>Add record</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.ui" line="295"/>
<source>Configure filters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.ui" line="339"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.ui" line="347"/>
<location filename="../sql_table_widget.ui" line="350"/>
<source>Operator AND</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.ui" line="358"/>
<location filename="../sql_table_widget.ui" line="361"/>
<source>Operator OR</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.cpp" line="358"/>
<source>Remove selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sql_table_widget.cpp" line="447"/>
<source>Table &quot;%1&quot; doesn`t exists!</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -1,25 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="ru_RU"> <TS version="2.1" language="ru_RU">
<context>
<name>SQLFilterEdit</name>
<message utf8="true">
<source></source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<source></source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<source></source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
<source></source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>SQLTableWidget</name> <name>SQLTableWidget</name>
<message> <message>
@@ -54,5 +35,9 @@
<source>Table &quot;%1&quot; doesn`t exists!</source> <source>Table &quot;%1&quot; doesn`t exists!</source>
<translation>Таблица &quot;%1&quot; не существует!</translation> <translation>Таблица &quot;%1&quot; не существует!</translation>
</message> </message>
<message>
<source>SQLTableWidget</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@@ -0,0 +1,2 @@
lupdate ../ -ts qad_sql_table_ru.ts
lupdate ../ -ts qad_sql_table_en.ts

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SQL_RECORD_WIDGET_H #ifndef SQL_RECORD_WIDGET_H
#define SQL_RECORD_WIDGET_H #define SQL_RECORD_WIDGET_H

View File

@@ -443,6 +443,19 @@ void SQLTableWidget::timerEvent(QTimerEvent * ) {
} }
void SQLTableWidget::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
action_del->setText(tr("Remove selected"));
break;
default:
break;
}
}
void SQLTableWidget::setTableName(const QString & t) { void SQLTableWidget::setTableName(const QString & t) {
ui->labelEmpty->setText(tr("Table \"%1\" doesn`t exists!").arg(t)); ui->labelEmpty->setText(tr("Table \"%1\" doesn`t exists!").arg(t));
stopTimer(); stopTimer();

View File

@@ -1,3 +1,22 @@
/*
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MYSQLTABLE_H #ifndef MYSQLTABLE_H
#define MYSQLTABLE_H #define MYSQLTABLE_H
@@ -263,6 +282,7 @@ private:
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void timerEvent(QTimerEvent * ); void timerEvent(QTimerEvent * );
void changeEvent(QEvent * e);
void stopTimer() {if (timer != 0) killTimer(timer); timer = 0;} void stopTimer() {if (timer != 0) killTimer(timer); timer = 0;}
bool checkTable(); bool checkTable();
QStringList getTableColumns(const QString & t); QStringList getTableColumns(const QString & t);

Some files were not shown because too many files have changed in this diff Show More