Compare commits

...

115 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
95 changed files with 3811 additions and 846 deletions

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)
@@ -99,7 +102,7 @@ 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))
@@ -153,6 +156,7 @@ else()
add_subdirectory(qad) add_subdirectory(qad)
set(_DIRS piqt piqt_utils qcd_utils) set(_DIRS piqt piqt_utils qcd_utils)
if (Qt5) if (Qt5)
list(APPEND _DIRS)
if (QGLVIEW) if (QGLVIEW)
list(APPEND _DIRS qglview) list(APPEND _DIRS qglview)
endif() endif()

View File

@@ -1,49 +0,0 @@
ARG DOCKER_PREFIX=wapmobil/
FROM ${DOCKER_PREFIX}android
ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4
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
WORKDIR /soft/build_libs_linux
RUN cmake -DICU=0 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs/ \
&& make install -j${JOBS_COUNT} && rm -rf * \
&& 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 *
ENV _ANDROID_TOOLCHAIN=/usr/lib/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake
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/ \
&& make install -j${JOBS_COUNT} && rm -rf *
ENV _CUR_ABI=arm64-v8a
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/ \
&& make install -j${JOBS_COUNT} && rm -rf *
ENV _CUR_ABI=x86
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/ \
&& make install -j${JOBS_COUNT} && rm -rf *
ENV _CUR_ABI=x86_64
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/ \
&& make install -j${JOBS_COUNT} && rm -rf *
WORKDIR /soft/src
# examples
# docker build --no-cache -t libs .
# cd <your_project_dir>
# docker run --rm -it -v $(pwd):/soft/src libs bash

38
Jenkinsfile vendored
View File

@@ -3,17 +3,22 @@ def build_docker(name) {
echo "Build image ${image}" echo "Build image ${image}"
def pref = "" def pref = ""
if (env.DOCKER_PREFIX) { if (env.DOCKER_PREFIX) {
pref = "${env.DOCKER_PREFIX}/" pref = "--build-arg DOCKER_PREFIX=${env.DOCKER_PREFIX}/"
} }
def args = "--build-arg DOCKER_PREFIX=${pref} --build-arg LIBS_BUILD_NUMBER=${env.BUILD_NUMBER} --build-arg JOBS_COUNT=4" 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}") { dir ("docker/${image}") {
//echo "build ${image} ${args}"
sh "docker build ${args} --no-cache -t ${image} ." sh "docker build ${args} --no-cache -t ${image} ."
} }
return "\n - ${image}" return "\n - ${image}"
} }
node { node {
stage("checkout") {
checkout scm checkout scm
}
def _envmap = [:] def _envmap = [:]
def _env = sh(script: "env", returnStdout: true).trim().split("\n") def _env = sh(script: "env", returnStdout: true).trim().split("\n")
_env.each{ l -> _env.each{ l ->
@@ -22,15 +27,36 @@ node {
def _v = l.substring(_ind + 1); def _v = l.substring(_ind + 1);
_envmap["${_n}"] = "${_v}"; _envmap["${_n}"] = "${_v}";
} }
//println "done!"
//println "${_envmap}"
def _msg = "Built images:" def _msg = "Built images:"
def platforms = ['debian', 'osx', 'windows', 'android', 'pi'] def platforms = ['debian', 'osx', 'windows', 'android', 'pi']
for (int i = 0; i < platforms.size(); ++i) { for (int i = 0; i < platforms.size(); ++i) {
//echo "check BUILD_${platforms[i]} -> ${_v}"
if (_envmap["BUILD_${platforms[i]}"] == "1") { if (_envmap["BUILD_${platforms[i]}"] == "1") {
stage("${platforms[i]}-libs") {
_msg += build_docker("${platforms[i]}") _msg += build_docker("${platforms[i]}")
} }
} }
}
sh "docker system prune -f"
echo "${_msg}" 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'
}
}
}
}

2
pip

Submodule pip updated: 25ddc832af...5df43a45f2

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)

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,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}"

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

@@ -34,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

@@ -92,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

@@ -49,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

@@ -65,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

@@ -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

@@ -54,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

@@ -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

@@ -71,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

@@ -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

@@ -72,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)
@@ -92,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);
@@ -150,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

@@ -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})
@@ -464,6 +472,7 @@ macro(qt_add_executable _NAME)
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}")
@@ -502,6 +511,7 @@ macro(qt_add_library _NAME)
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})

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

@@ -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

@@ -28,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>
@@ -113,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};
@@ -196,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;}
@@ -212,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;
@@ -248,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();}
@@ -295,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);
@@ -376,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;
@@ -387,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;
@@ -397,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:
@@ -424,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

@@ -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

@@ -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

@@ -282,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);

131
qad/utils/qad_locations.cpp Normal file
View File

@@ -0,0 +1,131 @@
#include "qad_locations.h"
#include <QDir>
#include <QDirIterator>
#include <QTranslator>
#include <QApplication>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
# include <QStandardPaths>
#else
# include <QDesktopServices>
#endif
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
# define MOBILE_VIEW
#endif
class __QADTranslators__ {
public:
static QList<QTranslator * > translators;
private:
};
QList<QTranslator * > __QADTranslators__::translators = QList<QTranslator * >();
QString QAD::userPath(QAD::LocationType loc, QString name) {
QString dir, ext;
switch (loc) {
case ltConfig: ext = ".conf"; break;
case ltCache : ext = ".cache"; break;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QStandardPaths::StandardLocation l = QStandardPaths::AppConfigLocation;
switch (loc) {
case ltConfig: l = QStandardPaths::AppConfigLocation; break;
case ltCache : l = QStandardPaths::CacheLocation; break;
}
dir = QStandardPaths::writableLocation(l);
#else
QDesktopServices::StandardLocation l = QDesktopServices::DataLocation;
switch (loc) {
case ltConfig: l = QDesktopServices::DataLocation; break;
case ltCache : l = QDesktopServices::CacheLocation; break;
}
dir = QDesktopServices::storageLocation(l);
#endif
if (!QDir(dir).exists())
QDir().mkpath(dir);
return dir + "/" + name + ext;
}
QStringList QAD::resourcePaths(QString type) {
QStringList ret;
ret << (QApplication::applicationDirPath() + "/" + type);
#ifdef MOBILE_VIEW
ret << (":/" + type);
#elif defined(Q_OS_MACOS)
ret << (QApplication::applicationDirPath() + "/../Resources/" + type);
#elif defined(Q_OS_WINDOWS)
#else
ret << QString("/usr/share/%1/%2/%3").arg(QApplication::organizationName(), QApplication::applicationName(), type);
ret << QString("/usr/share/%1/%2").arg(QApplication::organizationName(), type);
#endif
return ret;
}
void QAD::loadTranslations(QString lang) {
foreach (QTranslator * t, __QADTranslators__::translators) {
qApp->removeTranslator(t);
delete t;
}
__QADTranslators__::translators.clear();
if (lang.isEmpty())
lang = QLocale().bcp47Name();
QString short_lang = lang.left(2);
QStringList dirs = resourcePaths("lang");
foreach (const QString & d, dirs) {
QDirIterator dit(d);
while (dit.hasNext()) {
dit.next();
if (!dit.filePath().endsWith(".qm")) continue;
if (!dit.fileInfo().baseName().endsWith(lang) &&
!dit.fileInfo().baseName().endsWith(short_lang)) continue;
QTranslator * tr = new QTranslator();
if (tr->load(dit.filePath())) {
qApp->installTranslator(tr);
__QADTranslators__::translators << tr;
qDebug() << "Add tr" << dit.fileName();
} else {
qDebug() << "Can`t load translation" << dit.fileName();
delete tr;
}
}
}
}
QStringList QAD::availableTranslations() {
QSet<QString> ret;
QStringList dirs = resourcePaths("lang");
foreach (const QString & d, dirs) {
QDirIterator dit(d);
while (dit.hasNext()) {
dit.next();
if (!dit.filePath().endsWith(".qm")) continue;
QTranslator * tr = new QTranslator();
if (tr->load(dit.filePath())) {
QString fn = dit.fileInfo().baseName(), lang[2];
if (fn.contains("_")) {
lang[0] = fn.right(fn.size() - fn.lastIndexOf("_") - 1);
fn.chop(lang[0].size() + 1);
if (fn.contains("_")) {
lang[1] = fn.right(fn.size() - fn.lastIndexOf("_") - 1);
fn.chop(lang[1].size() + 1);
lang[1].append("_" + lang[0]);
}
}
for (int i = 0; i < 2; ++i) {
QLocale loc(lang[i]);
if (loc.language() != QLocale::C)
ret << lang[i];
}
}
delete tr;
}
}
return ret.values();
}

59
qad/utils/qad_locations.h Normal file
View File

@@ -0,0 +1,59 @@
/*
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_LOCATIONS_H
#define QAD_LOCATIONS_H
#include "qad_export.h"
#include <QDebug>
namespace QAD {
enum QAD_EXPORT LocationType {
ltConfig,
ltCache,
};
//! Create QStandardPaths::writableLocation(<loc>) directory
//! and returns file name "<name>.<ext>".
//! Extension is selected by "loc":
//! * ltConfig - "conf"
//! * ltCache - "cache"
QAD_EXPORT QString userPath(LocationType loc, QString name = QString());
//! Returns search directories for resource "type"
//! * <applicationDirPath>/<type> presents on all platforms
//! * :/<type> on mobile platforms
//! * <.app>/Resources/<type> on MacOS
//! * /usr/share/[organizationName/]<applicationName>/<type> on Linux
QAD_EXPORT QStringList resourcePaths(QString type);
QAD_EXPORT void loadTranslations(QString lang = QString());
QAD_EXPORT QStringList availableTranslations();
}
#endif // QAD_LOCATIONS_H

View File

@@ -22,7 +22,14 @@
#include "propertystorage.h" #include "propertystorage.h"
#include "qad_export.h" #include "qad_export.h"
#include <QCoreApplication>
//! Set QCoreApplication properties from CMake "deploy_properties"
//! Affect applicationName, organizationName and applicationVersion
#define QAD_SETUP_APPLICATION \
QCoreApplication::setApplicationName(__TARGET_NAME__); \
QCoreApplication::setOrganizationName(__TARGET_COMPANY__); \
QCoreApplication::setApplicationVersion(__TARGET_VERSION__);
class QMetaEnum; class QMetaEnum;

View File

@@ -243,6 +243,7 @@ QPIConfig::QPIConfig(const QString & path, QIODevice::OpenMode mode, QPIConfig::
type = type_; type = type_;
if (!path.isEmpty()) { if (!path.isEmpty()) {
open(mode); open(mode);
incdirs << QFileInfo(path).absoluteDir().path();
parse(); parse();
} }
} }
@@ -253,6 +254,7 @@ QPIConfig::QPIConfig(const QString & path, QIODevice::OpenMode mode): QFile(path
type = Config; type = Config;
if (!path.isEmpty()) { if (!path.isEmpty()) {
open(mode); open(mode);
incdirs << QFileInfo(path).absoluteDir().path();
parse(); parse();
} }
} }
@@ -263,6 +265,7 @@ QPIConfig::QPIConfig(const QString & path, QPIConfig::FileType type_): QFile(pat
type = type_; type = type_;
if (!path.isEmpty()) { if (!path.isEmpty()) {
open(QIODevice::ReadWrite); open(QIODevice::ReadWrite);
incdirs << QFileInfo(path).absoluteDir().path();
parse(); parse();
} }
} }
@@ -748,9 +751,9 @@ void QPIConfig::parse(QString content) {
root.clear(); root.clear();
QString src, str, tab, comm, all, name, type, prefix, tprefix; QString src, str, tab, comm, all, name, type, prefix, tprefix;
QStringList tree; QStringList tree;
Entry * entry, * te, * ce; Entry * entry = 0, * te = 0, * ce = 0;
int ind, sind; int ind, sind;
bool isNew, isPrefix; bool isNew = false, isPrefix = false, wasMultiline = false, isMultiline = false;
foreach (QPIConfig * c, inc_devs) foreach (QPIConfig * c, inc_devs)
delete c; delete c;
inc_devs.clear(); inc_devs.clear();
@@ -781,22 +784,43 @@ void QPIConfig::parse(QString content) {
tab = str.left(str.indexOf(str.trimmed().left(1))); tab = str.left(str.indexOf(str.trimmed().left(1)));
str = str.trimmed(); str = str.trimmed();
all = str; all = str;
ind = str.indexOf('=');
if ((ind > 0) && !(str[0] == '#')) {
sind = str.indexOf('#'); sind = str.indexOf('#');
if (sind > 0) { if (sind > 0) {
comm = str.right(str.length() - sind - 1).trimmed(); comm = str.mid(sind + 1).trimmed();
if (comm.length() > 0) type = comm[0]; if (comm.length() > 0) {
else type = "s"; type = comm[0];
comm = comm.right(comm.length() - 1).trimmed(); comm = comm.mid(1).trimmed();
str = str.left(sind); } else type = "s";
str = str.left(sind).trimmed();
} else { } else {
type = "s"; type = "s";
comm = ""; comm = "";
} }
if (str.endsWith(" \\")) {
isMultiline = true;
str.chop(2);
str = str.trimmed();
} else
isMultiline = false;
if (wasMultiline) {
wasMultiline = false;
if (ce) {
ce->_value += str;
ce->_all += " \\\n" + all;
}
str.clear();
} else
ce = 0;
wasMultiline = isMultiline;
ind = str.indexOf('=');
if ((ind > 0) && !(str[0] == '#')) {
tree = (prefix + str.left(ind).trimmed()).split(delim); tree = (prefix + str.left(ind).trimmed()).split(delim);
if (tree.front() == "include") { if (tree.front() == "include") {
name = str.right(str.length() - ind - 1).trimmed(); name = str.mid(ind + 1).trimmed();
QPIConfig * iconf = new QPIConfig(name, incdirs); QPIConfig * iconf = new QPIConfig(name, incdirs);
if (!iconf->dev) { if (!iconf->dev) {
delete iconf; delete iconf;
@@ -832,7 +856,7 @@ void QPIConfig::parse(QString content) {
ce->delim = delim; ce->delim = delim;
ce->_tab = tab; ce->_tab = tab;
ce->_name = name; ce->_name = name;
ce->_value = str.right(str.length() - ind - 1).trimmed(); ce->_value = str.mid(ind + 1).trimmed();
ce->_type = type; ce->_type = type;
ce->_comment = comm; ce->_comment = comm;
ce->_line = lines; ce->_line = lines;

View File

@@ -48,6 +48,7 @@ void CharDialog::setCharFont(const QFont & f) {
void CharDialog::changeEvent(QEvent * e) { void CharDialog::changeEvent(QEvent * e) {
QDialog::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this); ui->retranslateUi(this);
QStringList cat; QStringList cat;
@@ -65,7 +66,6 @@ void CharDialog::changeEvent(QEvent * e) {
ui->comboCategory->setCurrentIndex(pi); ui->comboCategory->setCurrentIndex(pi);
return; return;
} }
QDialog::changeEvent(e);
} }

View File

@@ -40,11 +40,11 @@ void CLineEdit::resizeEvent(QResizeEvent * e) {
void CLineEdit::changeEvent(QEvent * e) { void CLineEdit::changeEvent(QEvent * e) {
QLineEdit::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
cw->setToolTip(tr("Clear")); cw->setToolTip(tr("Clear"));
return; return;
} }
QLineEdit::changeEvent(e);
} }

View File

@@ -17,10 +17,10 @@ ColorButton::ColorButton(QWidget * parent): QPushButton(parent) {
label->setFrameStyle(QFrame::Panel | QFrame::Sunken); label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
label->show(); label->show();
pal = label->palette(); pal = label->palette();
menu.addAction(QIcon(":/icons/edit-copy.png"), tr("Copy"), this, SLOT(copy())); a_copy = menu.addAction(QIcon(":/icons/edit-copy.png"), tr("Copy"), this, SLOT(copy()));
menu.addAction(QIcon(":/icons/edit-paste.png"), tr("Paste"), this, SLOT(paste())); a_paste = menu.addAction(QIcon(":/icons/edit-paste.png"), tr("Paste"), this, SLOT(paste()));
menu.addSeparator(); menu.addSeparator();
menu.addAction(tr("Mix with clipboard"), this, SLOT(mix())); a_mix = menu.addAction(tr("Mix with clipboard"), this, SLOT(mix()));
setAcceptDrops(true); setAcceptDrops(true);
connect(this, SIGNAL(clicked(bool)), this, SLOT(clicked())); connect(this, SIGNAL(clicked(bool)), this, SLOT(clicked()));
} }
@@ -86,6 +86,20 @@ void ColorButton::dropEvent(QDropEvent * e) {
} }
void ColorButton::changeEvent(QEvent * e) {
QPushButton::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
a_copy->setText(tr("Copy"));
a_paste->setText(tr("Paste"));
a_mix->setText(tr("Mix with clipboard"));
break;
default:
break;
}
}
void ColorButton::clicked() { void ColorButton::clicked() {
QColor ret = QColorDialog::getColor(color(), this, tr("Choose color"), options); QColor ret = QColorDialog::getColor(color(), this, tr("Choose color"), options);
if (!ret.isValid()) return; if (!ret.isValid()) return;

View File

@@ -60,9 +60,11 @@ private:
void resizeEvent(QResizeEvent * ); void resizeEvent(QResizeEvent * );
void dragEnterEvent(QDragEnterEvent * e); void dragEnterEvent(QDragEnterEvent * e);
void dropEvent(QDropEvent * e); void dropEvent(QDropEvent * e);
void changeEvent(QEvent *e);
QFrame * label; QFrame * label;
QWidget * back; QWidget * back;
QAction * a_copy, * a_paste, * a_mix;
QPalette pal; QPalette pal;
QPoint pp; QPoint pp;
QMenu menu; QMenu menu;

View File

@@ -72,6 +72,20 @@ void EComboBox::showPopup() {
} }
void EComboBox::changeEvent(QEvent * e) {
QComboBox::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
#if QT_VERSION >= 0x040700
filter.setPlaceholderText(tr("Filter"));
#endif
break;
default:
break;
}
}
void EComboBox::filterChanged(const QString & text, bool first) { void EComboBox::filterChanged(const QString & text, bool first) {
if (filter.text().isEmpty()) filter.setFont(ifont); if (filter.text().isEmpty()) filter.setFont(ifont);
else filter.setFont(nfont); else filter.setFont(nfont);

View File

@@ -39,6 +39,8 @@ public slots:
virtual void showPopup(); virtual void showPopup();
private: private:
void changeEvent(QEvent *e);
QTreeView iv; QTreeView iv;
QWidget header; QWidget header;
QLabel icon; QLabel icon;

View File

@@ -88,11 +88,11 @@ void EvalSpinBox::resizeEvent(QResizeEvent * e) {
void EvalSpinBox::changeEvent(QEvent * e) { void EvalSpinBox::changeEvent(QEvent * e) {
QAbstractSpinBox::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
cw->setToolTip(tr("Clear")); cw->setToolTip(tr("Clear"));
return; return;
} }
QAbstractSpinBox::changeEvent(e);
} }

View File

@@ -1,6 +1,7 @@
#include "iconedlabel.h" #include "iconedlabel.h"
#include "qad_types.h" #include "qad_types.h"
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QStyle>
#include <QEvent> #include <QEvent>
@@ -8,13 +9,23 @@ IconedLabel::IconedLabel(QWidget * parent): QFrame(parent) {
label_.setAlignment(Qt::AlignCenter); label_.setAlignment(Qt::AlignCenter);
icon_.setAlignment(Qt::AlignCenter); icon_.setAlignment(Qt::AlignCenter);
icon_.setScaledContents(true); icon_.setScaledContents(true);
icon_.setHidden(true);
setIconSize(QSize()); setIconSize(QSize());
setDirection(RightToLeft); setDirection(RightToLeft);
} }
QString IconedLabel::text() const {
return label_.text();
}
QIcon IconedLabel::icon() const { QIcon IconedLabel::icon() const {
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
return icon_.pixmap(Qt::ReturnByValue).isNull() ? QIcon() : QIcon(icon_.pixmap(Qt::ReturnByValue));
#else
return icon_.pixmap() == 0 ? QIcon() : QIcon(*icon_.pixmap()); return icon_.pixmap() == 0 ? QIcon() : QIcon(*icon_.pixmap());
#endif
} }
@@ -25,14 +36,36 @@ bool IconedLabel::event(QEvent * e) {
} }
void IconedLabel::checkSpacing() {
label_.setHidden(label_.text().isEmpty());
if (!layout()) return;
if (label_.isHidden() || icon_.isHidden()) {
layout()->setSpacing(0);
} else {
QStyle * s = style();
if (s)
layout()->setSpacing(s->layoutSpacing(QSizePolicy::Label, QSizePolicy::Label,
dir_ <= Direction::RightToLeft ? Qt::Horizontal : Qt::Vertical));
}
}
QSize IconedLabel::realIconSize() const { QSize IconedLabel::realIconSize() const {
return size_.isValid() ? size_ : preferredIconSize(1.f, this); return size_.isValid() ? size_ : preferredIconSize(1.f, this);
} }
void IconedLabel::setText(const QString & t) {
label_.setText(t);
checkSpacing();
}
void IconedLabel::setIcon(const QIcon & i) { void IconedLabel::setIcon(const QIcon & i) {
sicon_ = i; sicon_ = i;
setIconSize(iconSize()); setIconSize(iconSize());
icon_.setHidden(icon().isNull());
checkSpacing();
} }
@@ -55,5 +88,6 @@ void IconedLabel::setDirection(IconedLabel::Direction d) {
lay->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding)); lay->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding));
lay->setContentsMargins(0, 0, 0, 0); lay->setContentsMargins(0, 0, 0, 0);
setLayout(lay); setLayout(lay);
checkSpacing();
update(); update();
} }

View File

@@ -38,13 +38,16 @@ public:
explicit IconedLabel(QWidget * parent = 0); explicit IconedLabel(QWidget * parent = 0);
QString text() const {return label_.text();} QString text() const;
QIcon icon() const; QIcon icon() const;
QSize iconSize() const {return size_;} QSize iconSize() const {return size_;}
Direction direction() const {return dir_;} Direction direction() const {return dir_;}
QLabel * textLabel() {return &label_;}
protected: protected:
virtual bool event(QEvent * e); virtual bool event(QEvent * e);
void checkSpacing();
QSize realIconSize() const; QSize realIconSize() const;
QLabel label_, icon_; QLabel label_, icon_;
@@ -53,7 +56,7 @@ protected:
Direction dir_; Direction dir_;
public slots: public slots:
void setText(const QString & t) {label_.setText(t);} void setText(const QString & t);
void setIcon(const QIcon & i); void setIcon(const QIcon & i);
void setIconSize(const QSize & s); void setIconSize(const QSize & s);
void setDirection(Direction d); void setDirection(Direction d);

View File

@@ -0,0 +1,677 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>CLineEdit</name>
<message>
<location filename="../clineedit.cpp" line="9"/>
<location filename="../clineedit.cpp" line="45"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CharDialog</name>
<message>
<location filename="../chardialog.ui" line="14"/>
<source>Choose symbol</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="55"/>
<source>No Category</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="55"/>
<source>Mark NonSpacing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="55"/>
<source>Mark SpacingCombining</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="55"/>
<source>Mark Enclosing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="56"/>
<source>Number DecimalDigit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="56"/>
<source>Number Letter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="56"/>
<source>Number Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="56"/>
<source>Separator Space</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="57"/>
<source>Separator Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="57"/>
<source>Separator Paragraph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="57"/>
<source>Other Control</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="57"/>
<source>Other Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="58"/>
<source>Other Surrogate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="58"/>
<source>Other PrivateUse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="58"/>
<source>Other NotAssigned</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="58"/>
<source>Letter Uppercase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="59"/>
<source>Letter Lowercase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="59"/>
<source>Letter Titlecase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="59"/>
<source>Letter Modifier</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="59"/>
<source>Letter Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Connector</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="61"/>
<source>Punctuation InitialQuote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="61"/>
<source>Punctuation FinalQuote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="61"/>
<source>Punctuation Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="61"/>
<source>Symbol Math</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="30"/>
<location filename="../chardialog.cpp" line="62"/>
<source>Symbol Currency</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="30"/>
<location filename="../chardialog.cpp" line="62"/>
<source>Symbol Modifier</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../chardialog.cpp" line="30"/>
<location filename="../chardialog.cpp" line="62"/>
<source>Symbol Other</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ColorButton</name>
<message>
<location filename="../colorbutton.cpp" line="20"/>
<location filename="../colorbutton.cpp" line="93"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../colorbutton.cpp" line="21"/>
<location filename="../colorbutton.cpp" line="94"/>
<source>Paste</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../colorbutton.cpp" line="23"/>
<location filename="../colorbutton.cpp" line="95"/>
<source>Mix with clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../colorbutton.cpp" line="104"/>
<source>Choose color</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EComboBox</name>
<message>
<location filename="../ecombobox.cpp" line="44"/>
<location filename="../ecombobox.cpp" line="80"/>
<source>Filter</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EvalSpinBox</name>
<message>
<location filename="../evalspinbox.cpp" line="28"/>
<location filename="../evalspinbox.cpp" line="93"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MatrixEdit</name>
<message>
<location filename="../matrixedit.ui" line="33"/>
<source>Cols:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../matrixedit.ui" line="47"/>
<source>Rows:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../matrixedit.ui" line="76"/>
<source>Null</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../matrixedit.ui" line="79"/>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../matrixedit.ui" line="86"/>
<source>Identity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../matrixedit.ui" line="89"/>
<source>I</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PathEdit</name>
<message>
<location filename="../qvariantedit.cpp" line="105"/>
<source>All files(*)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qvariantedit.cpp" line="112"/>
<location filename="../qvariantedit.cpp" line="125"/>
<source>Choose</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qvariantedit.cpp" line="139"/>
<source>Select directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qvariantedit.cpp" line="140"/>
<source>Select file</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QCodeEdit</name>
<message>
<location filename="../qcodeedit.ui" line="122"/>
<source>Search:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="140"/>
<source>Case sensitive</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="143"/>
<source>Aa</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="159"/>
<source>Whole words</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="162"/>
<source>W</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="178"/>
<source>Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="195"/>
<source>Next</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="208"/>
<source>Replace:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="226"/>
<source>Replace</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="229"/>
<source>R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="242"/>
<source>Replace and search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="245"/>
<source>Rs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="258"/>
<source>Replace all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="261"/>
<source>Ra</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.cpp" line="53"/>
<location filename="../qcodeedit.cpp" line="570"/>
<source>Press F1 for details</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QPIConfigNewDialog</name>
<message>
<location filename="../qpiconfignewdialog.ui" line="20"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="26"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="32"/>
<source>string</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="38"/>
<source>s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="45"/>
<source>integer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="48"/>
<source>n</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="55"/>
<source>float</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="58"/>
<source>f</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="65"/>
<source>string list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="68"/>
<source>l</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="75"/>
<source>boolean</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="78"/>
<source>b</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="85"/>
<source>color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="88"/>
<source>c</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="95"/>
<source>rectangle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="98"/>
<source>r</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="105"/>
<source>area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="108"/>
<source>a</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="115"/>
<source>point</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="118"/>
<source>p</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="125"/>
<source>vector</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="128"/>
<source>v</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="135"/>
<source>ip</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="138"/>
<source>i</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="148"/>
<source>Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="181"/>
<source>Comment:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfignewdialog.ui" line="191"/>
<source>Value:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QPIConfigWidget</name>
<message>
<location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Value</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Comment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="354"/>
<source>Add item ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="355"/>
<source>Add node ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="356"/>
<source>Convert to item</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="357"/>
<source>Convert to node</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="358"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="359"/>
<source>Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="360"/>
<source>Collapse all</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QPointEdit</name>
<message>
<location filename="../qpointedit.cpp" line="12"/>
<location filename="../qpointedit.cpp" line="30"/>
<source>X</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpointedit.cpp" line="13"/>
<location filename="../qpointedit.cpp" line="31"/>
<source>Y</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QRectEdit</name>
<message>
<location filename="../qrectedit.cpp" line="18"/>
<location filename="../qrectedit.cpp" line="50"/>
<source>X</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrectedit.cpp" line="19"/>
<location filename="../qrectedit.cpp" line="51"/>
<source>Y</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrectedit.cpp" line="20"/>
<location filename="../qrectedit.cpp" line="52"/>
<source>Height</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrectedit.cpp" line="21"/>
<location filename="../qrectedit.cpp" line="53"/>
<source>Width</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QVariantEdit</name>
<message>
<location filename="../qvariantedit.cpp" line="186"/>
<source>Invalid value</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ScrollSpinBox</name>
<message>
<location filename="../scroll_spin_box.ui" line="51"/>
<source>Grab and scroll</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Shortcuts</name>
<message>
<location filename="../shortcuts.cpp" line="38"/>
<location filename="../shortcuts.cpp" line="55"/>
<source>Command</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../shortcuts.cpp" line="38"/>
<location filename="../shortcuts.cpp" line="55"/>
<source>Shortcut</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StringListEdit</name>
<message>
<location filename="../qvariantedit.cpp" line="67"/>
<location filename="../qvariantedit.cpp" line="86"/>
<source>Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qvariantedit.cpp" line="68"/>
<location filename="../qvariantedit.cpp" line="87"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qvariantedit.cpp" line="69"/>
<location filename="../qvariantedit.cpp" line="88"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -4,8 +4,8 @@
<context> <context>
<name>CLineEdit</name> <name>CLineEdit</name>
<message> <message>
<location filename="../clineedit.cpp" line="8"/> <location filename="../clineedit.cpp" line="9"/>
<location filename="../clineedit.cpp" line="35"/> <location filename="../clineedit.cpp" line="45"/>
<source>Clear</source> <source>Clear</source>
<translation>Сбросить</translation> <translation>Сбросить</translation>
</message> </message>
@@ -19,187 +19,187 @@
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="23"/> <location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="54"/> <location filename="../chardialog.cpp" line="55"/>
<source>No Category</source> <source>No Category</source>
<translation>Вне категории</translation> <translation>Вне категории</translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="23"/> <location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="54"/> <location filename="../chardialog.cpp" line="55"/>
<source>Mark NonSpacing</source> <source>Mark NonSpacing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="23"/> <location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="54"/> <location filename="../chardialog.cpp" line="55"/>
<source>Mark SpacingCombining</source> <source>Mark SpacingCombining</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="23"/> <location filename="../chardialog.cpp" line="23"/>
<location filename="../chardialog.cpp" line="54"/> <location filename="../chardialog.cpp" line="55"/>
<source>Mark Enclosing</source> <source>Mark Enclosing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="24"/> <location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="55"/> <location filename="../chardialog.cpp" line="56"/>
<source>Number DecimalDigit</source> <source>Number DecimalDigit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="24"/> <location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="55"/> <location filename="../chardialog.cpp" line="56"/>
<source>Number Letter</source> <source>Number Letter</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="24"/> <location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="55"/> <location filename="../chardialog.cpp" line="56"/>
<source>Number Other</source> <source>Number Other</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="24"/> <location filename="../chardialog.cpp" line="24"/>
<location filename="../chardialog.cpp" line="55"/> <location filename="../chardialog.cpp" line="56"/>
<source>Separator Space</source> <source>Separator Space</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="25"/> <location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="56"/> <location filename="../chardialog.cpp" line="57"/>
<source>Separator Line</source> <source>Separator Line</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="25"/> <location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="56"/> <location filename="../chardialog.cpp" line="57"/>
<source>Separator Paragraph</source> <source>Separator Paragraph</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="25"/> <location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="56"/> <location filename="../chardialog.cpp" line="57"/>
<source>Other Control</source> <source>Other Control</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="25"/> <location filename="../chardialog.cpp" line="25"/>
<location filename="../chardialog.cpp" line="56"/> <location filename="../chardialog.cpp" line="57"/>
<source>Other Format</source> <source>Other Format</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="26"/> <location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="57"/> <location filename="../chardialog.cpp" line="58"/>
<source>Other Surrogate</source> <source>Other Surrogate</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="26"/> <location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="57"/> <location filename="../chardialog.cpp" line="58"/>
<source>Other PrivateUse</source> <source>Other PrivateUse</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="26"/> <location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="57"/> <location filename="../chardialog.cpp" line="58"/>
<source>Other NotAssigned</source> <source>Other NotAssigned</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="26"/> <location filename="../chardialog.cpp" line="26"/>
<location filename="../chardialog.cpp" line="57"/> <location filename="../chardialog.cpp" line="58"/>
<source>Letter Uppercase</source> <source>Letter Uppercase</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="27"/> <location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="58"/> <location filename="../chardialog.cpp" line="59"/>
<source>Letter Lowercase</source> <source>Letter Lowercase</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="27"/> <location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="58"/> <location filename="../chardialog.cpp" line="59"/>
<source>Letter Titlecase</source> <source>Letter Titlecase</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="27"/> <location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="58"/> <location filename="../chardialog.cpp" line="59"/>
<source>Letter Modifier</source> <source>Letter Modifier</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="27"/> <location filename="../chardialog.cpp" line="27"/>
<location filename="../chardialog.cpp" line="58"/> <location filename="../chardialog.cpp" line="59"/>
<source>Letter Other</source> <source>Letter Other</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="28"/> <location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="59"/> <location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Connector</source> <source>Punctuation Connector</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="28"/> <location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="59"/> <location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Dash</source> <source>Punctuation Dash</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="28"/> <location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="59"/> <location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Open</source> <source>Punctuation Open</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="28"/> <location filename="../chardialog.cpp" line="28"/>
<location filename="../chardialog.cpp" line="59"/> <location filename="../chardialog.cpp" line="60"/>
<source>Punctuation Close</source> <source>Punctuation Close</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="29"/> <location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="60"/> <location filename="../chardialog.cpp" line="61"/>
<source>Punctuation InitialQuote</source> <source>Punctuation InitialQuote</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="29"/> <location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="60"/> <location filename="../chardialog.cpp" line="61"/>
<source>Punctuation FinalQuote</source> <source>Punctuation FinalQuote</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="29"/> <location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="60"/> <location filename="../chardialog.cpp" line="61"/>
<source>Punctuation Other</source> <source>Punctuation Other</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="29"/> <location filename="../chardialog.cpp" line="29"/>
<location filename="../chardialog.cpp" line="60"/> <location filename="../chardialog.cpp" line="61"/>
<source>Symbol Math</source> <source>Symbol Math</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="30"/> <location filename="../chardialog.cpp" line="30"/>
<location filename="../chardialog.cpp" line="61"/> <location filename="../chardialog.cpp" line="62"/>
<source>Symbol Currency</source> <source>Symbol Currency</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="30"/> <location filename="../chardialog.cpp" line="30"/>
<location filename="../chardialog.cpp" line="61"/> <location filename="../chardialog.cpp" line="62"/>
<source>Symbol Modifier</source> <source>Symbol Modifier</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../chardialog.cpp" line="30"/> <location filename="../chardialog.cpp" line="30"/>
<location filename="../chardialog.cpp" line="61"/> <location filename="../chardialog.cpp" line="62"/>
<source>Symbol Other</source> <source>Symbol Other</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@@ -208,21 +208,24 @@
<name>ColorButton</name> <name>ColorButton</name>
<message> <message>
<location filename="../colorbutton.cpp" line="20"/> <location filename="../colorbutton.cpp" line="20"/>
<location filename="../colorbutton.cpp" line="93"/>
<source>Copy</source> <source>Copy</source>
<translation>Копировать</translation> <translation>Копировать</translation>
</message> </message>
<message> <message>
<location filename="../colorbutton.cpp" line="21"/> <location filename="../colorbutton.cpp" line="21"/>
<location filename="../colorbutton.cpp" line="94"/>
<source>Paste</source> <source>Paste</source>
<translation>Вставить</translation> <translation>Вставить</translation>
</message> </message>
<message> <message>
<location filename="../colorbutton.cpp" line="23"/> <location filename="../colorbutton.cpp" line="23"/>
<location filename="../colorbutton.cpp" line="95"/>
<source>Mix with clipboard</source> <source>Mix with clipboard</source>
<translation>Смешать со скопированным</translation> <translation>Смешать со скопированным</translation>
</message> </message>
<message> <message>
<location filename="../colorbutton.cpp" line="90"/> <location filename="../colorbutton.cpp" line="104"/>
<source>Choose color</source> <source>Choose color</source>
<translation>Выбрать цвет</translation> <translation>Выбрать цвет</translation>
</message> </message>
@@ -230,11 +233,54 @@
<context> <context>
<name>EComboBox</name> <name>EComboBox</name>
<message> <message>
<location filename="../ecombobox.cpp" line="42"/> <location filename="../ecombobox.cpp" line="44"/>
<location filename="../ecombobox.cpp" line="80"/>
<source>Filter</source> <source>Filter</source>
<translation>Фильтр</translation> <translation>Фильтр</translation>
</message> </message>
</context> </context>
<context>
<name>EvalSpinBox</name>
<message>
<location filename="../evalspinbox.cpp" line="28"/>
<location filename="../evalspinbox.cpp" line="93"/>
<source>Clear</source>
<translation>Очистить</translation>
</message>
</context>
<context>
<name>MatrixEdit</name>
<message>
<location filename="../matrixedit.ui" line="33"/>
<source>Cols:</source>
<translation>Колонки:</translation>
</message>
<message>
<location filename="../matrixedit.ui" line="47"/>
<source>Rows:</source>
<translation>Строки:</translation>
</message>
<message>
<location filename="../matrixedit.ui" line="76"/>
<source>Null</source>
<translation>Обнулить</translation>
</message>
<message>
<location filename="../matrixedit.ui" line="79"/>
<source>0</source>
<translation></translation>
</message>
<message>
<location filename="../matrixedit.ui" line="86"/>
<source>Identity</source>
<translation>Единичная</translation>
</message>
<message>
<location filename="../matrixedit.ui" line="89"/>
<source>I</source>
<translation></translation>
</message>
</context>
<context> <context>
<name>PathEdit</name> <name>PathEdit</name>
<message> <message>
@@ -243,18 +289,18 @@
<translation>Все файлы(*)</translation> <translation>Все файлы(*)</translation>
</message> </message>
<message> <message>
<location filename="../qvariantedit.cpp" line="111"/> <location filename="../qvariantedit.cpp" line="112"/>
<location filename="../qvariantedit.cpp" line="123"/> <location filename="../qvariantedit.cpp" line="125"/>
<source>Choose</source> <source>Choose</source>
<translation>Выберите</translation> <translation>Выберите</translation>
</message> </message>
<message> <message>
<location filename="../qvariantedit.cpp" line="132"/> <location filename="../qvariantedit.cpp" line="139"/>
<source>Select directory</source> <source>Select directory</source>
<translation>Выберите директорию</translation> <translation>Выберите директорию</translation>
</message> </message>
<message> <message>
<location filename="../qvariantedit.cpp" line="133"/> <location filename="../qvariantedit.cpp" line="140"/>
<source>Select file</source> <source>Select file</source>
<translation>Выберите файл</translation> <translation>Выберите файл</translation>
</message> </message>
@@ -262,10 +308,81 @@
<context> <context>
<name>QCodeEdit</name> <name>QCodeEdit</name>
<message> <message>
<location filename="../qcodeedit.cpp" line="40"/> <location filename="../qcodeedit.cpp" line="53"/>
<location filename="../qcodeedit.cpp" line="570"/>
<source>Press F1 for details</source> <source>Press F1 for details</source>
<translation>Нажмите F1 для справочной информации</translation> <translation>Нажмите F1 для справочной информации</translation>
</message> </message>
<message>
<location filename="../qcodeedit.ui" line="122"/>
<source>Search:</source>
<translation>Поиск:</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="140"/>
<source>Case sensitive</source>
<translation>Учитывать регистр</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="143"/>
<source>Aa</source>
<translation>Аа</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="159"/>
<source>Whole words</source>
<translation>Слова целиком</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="162"/>
<source>W</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="178"/>
<source>Previous</source>
<translation>Предыдущее</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="195"/>
<source>Next</source>
<translation>Следующее</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="208"/>
<source>Replace:</source>
<translation>Заменить:</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="226"/>
<source>Replace</source>
<translation>Заменить</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="229"/>
<source>R</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="242"/>
<source>Replace and search</source>
<translation>Заменить и продолжить поиск</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="245"/>
<source>Rs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="258"/>
<source>Replace all</source>
<translation>Заменить всё</translation>
</message>
<message>
<location filename="../qcodeedit.ui" line="261"/>
<source>Ra</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>QPIConfigNewDialog</name> <name>QPIConfigNewDialog</name>
@@ -277,7 +394,7 @@
<message> <message>
<location filename="../qpiconfignewdialog.ui" line="26"/> <location filename="../qpiconfignewdialog.ui" line="26"/>
<source>Type</source> <source>Type</source>
<translation type="unfinished"></translation> <translation>Тип</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfignewdialog.ui" line="32"/> <location filename="../qpiconfignewdialog.ui" line="32"/>
@@ -392,128 +509,73 @@
<message> <message>
<location filename="../qpiconfignewdialog.ui" line="148"/> <location filename="../qpiconfignewdialog.ui" line="148"/>
<source>Name:</source> <source>Name:</source>
<translation type="unfinished"></translation> <translation>Имя:</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfignewdialog.ui" line="181"/> <location filename="../qpiconfignewdialog.ui" line="181"/>
<source>Comment:</source> <source>Comment:</source>
<translation type="unfinished"></translation> <translation>Комментарий:</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfignewdialog.ui" line="191"/> <location filename="../qpiconfignewdialog.ui" line="191"/>
<source>Value:</source> <source>Value:</source>
<translation type="unfinished"></translation> <translation>Значение:</translation>
</message> </message>
</context> </context>
<context> <context>
<name>QPIConfigWidget</name> <name>QPIConfigWidget</name>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="341"/> <location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Name</source> <source>Name</source>
<translation>Имя</translation> <translation>Имя</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="341"/> <location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Value</source> <source>Value</source>
<translation>Значение</translation> <translation>Значение</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="341"/> <location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Type</source> <source>Type</source>
<translation>Тип</translation> <translation>Тип</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="341"/> <location filename="../qpiconfigwidget.cpp" line="339"/>
<source>Comment</source> <source>Comment</source>
<translation>Описание</translation> <translation>Описание</translation>
</message> </message>
<message>
<location filename="../qpiconfigwidget.cpp" line="345"/>
<source>string</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="346"/>
<source>string list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="347"/>
<source>integer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="348"/>
<source>float</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="349"/>
<source>boolean</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="350"/>
<source>color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="351"/>
<source>rectangle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="352"/>
<source>area</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="353"/>
<source>point</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="354"/> <location filename="../qpiconfigwidget.cpp" line="354"/>
<source>vector</source> <source>Add item ...</source>
<translation type="unfinished"></translation> <translation>Добавить поле ...</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="355"/> <location filename="../qpiconfigwidget.cpp" line="355"/>
<source>ip</source> <source>Add node ...</source>
<translation type="unfinished"></translation> <translation>Добавить секцию ...</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="356"/> <location filename="../qpiconfigwidget.cpp" line="356"/>
<source>Add item ...</source> <source>Convert to item</source>
<translation type="unfinished"></translation> <translation>Преобразовать в значение</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="357"/> <location filename="../qpiconfigwidget.cpp" line="357"/>
<source>Add node ...</source> <source>Convert to node</source>
<translation type="unfinished"></translation> <translation>Преобразовать в секцию</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="358"/> <location filename="../qpiconfigwidget.cpp" line="358"/>
<source>Convert to item</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="359"/>
<source>Convert to node</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qpiconfigwidget.cpp" line="360"/>
<source>Remove</source> <source>Remove</source>
<translation>Удалить</translation> <translation>Удалить</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="361"/> <location filename="../qpiconfigwidget.cpp" line="359"/>
<source>Expand all</source> <source>Expand all</source>
<translation>Свернуть все</translation> <translation>Свернуть все</translation>
</message> </message>
<message> <message>
<location filename="../qpiconfigwidget.cpp" line="362"/> <location filename="../qpiconfigwidget.cpp" line="360"/>
<source>Collapse all</source> <source>Collapse all</source>
<translation>Развернуть все</translation> <translation>Развернуть все</translation>
</message> </message>
@@ -522,13 +584,13 @@
<name>QPointEdit</name> <name>QPointEdit</name>
<message> <message>
<location filename="../qpointedit.cpp" line="12"/> <location filename="../qpointedit.cpp" line="12"/>
<location filename="../qpointedit.cpp" line="29"/> <location filename="../qpointedit.cpp" line="30"/>
<source>X</source> <source>X</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qpointedit.cpp" line="13"/> <location filename="../qpointedit.cpp" line="13"/>
<location filename="../qpointedit.cpp" line="30"/> <location filename="../qpointedit.cpp" line="31"/>
<source>Y</source> <source>Y</source>
<translation></translation> <translation></translation>
</message> </message>
@@ -537,25 +599,25 @@
<name>QRectEdit</name> <name>QRectEdit</name>
<message> <message>
<location filename="../qrectedit.cpp" line="18"/> <location filename="../qrectedit.cpp" line="18"/>
<location filename="../qrectedit.cpp" line="49"/> <location filename="../qrectedit.cpp" line="50"/>
<source>X</source> <source>X</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qrectedit.cpp" line="19"/> <location filename="../qrectedit.cpp" line="19"/>
<location filename="../qrectedit.cpp" line="50"/> <location filename="../qrectedit.cpp" line="51"/>
<source>Y</source> <source>Y</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../qrectedit.cpp" line="20"/> <location filename="../qrectedit.cpp" line="20"/>
<location filename="../qrectedit.cpp" line="51"/> <location filename="../qrectedit.cpp" line="52"/>
<source>Height</source> <source>Height</source>
<translation>Высота</translation> <translation>Высота</translation>
</message> </message>
<message> <message>
<location filename="../qrectedit.cpp" line="21"/> <location filename="../qrectedit.cpp" line="21"/>
<location filename="../qrectedit.cpp" line="52"/> <location filename="../qrectedit.cpp" line="53"/>
<source>Width</source> <source>Width</source>
<translation>Ширина</translation> <translation>Ширина</translation>
</message> </message>
@@ -563,22 +625,30 @@
<context> <context>
<name>QVariantEdit</name> <name>QVariantEdit</name>
<message> <message>
<location filename="../qvariantedit.cpp" line="176"/> <location filename="../qvariantedit.cpp" line="186"/>
<source>Invalid value</source> <source>Invalid value</source>
<translation>Неверное значение</translation> <translation>Неверное значение</translation>
</message> </message>
</context> </context>
<context>
<name>ScrollSpinBox</name>
<message>
<location filename="../scroll_spin_box.ui" line="51"/>
<source>Grab and scroll</source>
<translation>Зажать и крутить</translation>
</message>
</context>
<context> <context>
<name>Shortcuts</name> <name>Shortcuts</name>
<message> <message>
<location filename="../shortcuts.cpp" line="38"/> <location filename="../shortcuts.cpp" line="38"/>
<location filename="../shortcuts.cpp" line="54"/> <location filename="../shortcuts.cpp" line="55"/>
<source>Command</source> <source>Command</source>
<translation>Команда</translation> <translation>Команда</translation>
</message> </message>
<message> <message>
<location filename="../shortcuts.cpp" line="38"/> <location filename="../shortcuts.cpp" line="38"/>
<location filename="../shortcuts.cpp" line="54"/> <location filename="../shortcuts.cpp" line="55"/>
<source>Shortcut</source> <source>Shortcut</source>
<translation>Горячая клавиша</translation> <translation>Горячая клавиша</translation>
</message> </message>
@@ -587,19 +657,19 @@
<name>StringListEdit</name> <name>StringListEdit</name>
<message> <message>
<location filename="../qvariantedit.cpp" line="67"/> <location filename="../qvariantedit.cpp" line="67"/>
<location filename="../qvariantedit.cpp" line="85"/> <location filename="../qvariantedit.cpp" line="86"/>
<source>Add</source> <source>Add</source>
<translation>Добавить</translation> <translation>Добавить</translation>
</message> </message>
<message> <message>
<location filename="../qvariantedit.cpp" line="68"/> <location filename="../qvariantedit.cpp" line="68"/>
<location filename="../qvariantedit.cpp" line="86"/> <location filename="../qvariantedit.cpp" line="87"/>
<source>Remove</source> <source>Remove</source>
<translation>Удалить</translation> <translation>Удалить</translation>
</message> </message>
<message> <message>
<location filename="../qvariantedit.cpp" line="69"/> <location filename="../qvariantedit.cpp" line="69"/>
<location filename="../qvariantedit.cpp" line="87"/> <location filename="../qvariantedit.cpp" line="88"/>
<source>Clear</source> <source>Clear</source>
<translation>Очистить</translation> <translation>Очистить</translation>
</message> </message>

View File

@@ -0,0 +1,2 @@
lupdate ../ -ts qad_widgets_ru.ts
lupdate ../ -ts qad_widgets_en.ts

View File

@@ -6,6 +6,9 @@
MatrixEdit::MatrixEdit(QWidget * parent): QWidget(parent) { MatrixEdit::MatrixEdit(QWidget * parent): QWidget(parent) {
ui = new Ui::MatrixEdit(); ui = new Ui::MatrixEdit();
ui->setupUi(this); ui->setupUi(this);
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
ui->table->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
#endif
connect(ui->table, SIGNAL(cellChanged(int,int)), this, SIGNAL(changed())); connect(ui->table, SIGNAL(cellChanged(int,int)), this, SIGNAL(changed()));
ro = false; ro = false;
} }
@@ -52,6 +55,18 @@ void MatrixEdit::clear(bool ident) {
} }
void MatrixEdit::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
QVector<double> MatrixEdit::vector() const { QVector<double> MatrixEdit::vector() const {
QVector<double> ret; QVector<double> ret;
if (ui->table->columnCount() < 1) return ret; if (ui->table->columnCount() < 1) return ret;

View File

@@ -46,6 +46,7 @@ public:
private: private:
void setVectorMode(bool yes); void setVectorMode(bool yes);
void clear(bool ident = false); void clear(bool ident = false);
void changeEvent(QEvent * e);
Ui::MatrixEdit * ui; Ui::MatrixEdit * ui;
bool ro; bool ro;

View File

@@ -10,6 +10,12 @@
<height>264</height> <height>264</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>

View File

@@ -562,6 +562,19 @@ void QCodeEdit::leaveEvent(QEvent * e) {
} }
void QCodeEdit::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
lbl_help[1]->setText(tr("Press F1 for details"));
break;
default:
break;
}
}
char antiBracket(char c) { char antiBracket(char c) {
switch (c) { switch (c) {
case '(': return ')'; case '(': return ')';

View File

@@ -115,6 +115,7 @@ private:
void showEvent(QShowEvent * ); void showEvent(QShowEvent * );
void timerEvent(QTimerEvent * ); void timerEvent(QTimerEvent * );
void leaveEvent(QEvent * ); void leaveEvent(QEvent * );
void changeEvent(QEvent * e);
void highlightBrackets(); void highlightBrackets();
void applyExtraSelection(); void applyExtraSelection();
void nextCompletition(); void nextCompletition();

View File

@@ -46,13 +46,11 @@ QPIConfigWidget::QPIConfigWidget(QWidget * parent, QPIConfig * c, bool on): QTre
void QPIConfigWidget::changeEvent(QEvent * e) { void QPIConfigWidget::changeEvent(QEvent * e) {
QTreeWidget::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
translate(); translate();
return; return;
} }
//for (int i = 0; i < 4; ++i)
// setColumnHidden(i, c_hidden[i]);
QTreeWidget::changeEvent(e);
} }
@@ -342,17 +340,17 @@ void QPIConfigWidget::translate() {
if (active) setHeaderLabels(l); if (active) setHeaderLabels(l);
types.clear(); types.clear();
s_types.clear(); s_types.clear();
addTrEntry("s", tr("string")); addTrEntry("s", "string");
addTrEntry("l", tr("string list")); addTrEntry("l", "string list");
addTrEntry("n", tr("integer")); addTrEntry("n", "integer");
addTrEntry("f", tr("float")); addTrEntry("f", "float");
addTrEntry("b", tr("boolean")); addTrEntry("b", "boolean");
addTrEntry("c", tr("color")); addTrEntry("c", "color");
addTrEntry("r", tr("rectangle")); addTrEntry("r", "rectangle");
addTrEntry("a", tr("area")); addTrEntry("a", "area");
addTrEntry("p", tr("point")); addTrEntry("p", "point");
addTrEntry("v", tr("vector")); addTrEntry("v", "vector");
addTrEntry("i", tr("ip")); addTrEntry("i", "ip");
actionAddItem.setText(tr("Add item ...")); actionAddItem.setText(tr("Add item ..."));
actionAddNode.setText(tr("Add node ...")); actionAddNode.setText(tr("Add node ..."));
actionToItem.setText(tr("Convert to item")); actionToItem.setText(tr("Convert to item"));

View File

@@ -25,10 +25,10 @@ QPointEdit::QPointEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftT
void QPointEdit::changeEvent(QEvent * e) { void QPointEdit::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
s_x->setToolTip(tr("X")); s_x->setToolTip(tr("X"));
s_y->setToolTip(tr("Y")); s_y->setToolTip(tr("Y"));
return; return;
} }
QWidget::changeEvent(e);
} }

View File

@@ -45,6 +45,7 @@ QRectEdit::QRectEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftToR
void QRectEdit::changeEvent(QEvent * e) { void QRectEdit::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
s_x->setToolTip(tr("X")); s_x->setToolTip(tr("X"));
s_y->setToolTip(tr("Y")); s_y->setToolTip(tr("Y"));
@@ -52,5 +53,4 @@ void QRectEdit::changeEvent(QEvent * e) {
s_h->setToolTip(tr("Width")); s_h->setToolTip(tr("Width"));
return; return;
} }
QWidget::changeEvent(e);
} }

View File

@@ -81,13 +81,13 @@ StringListEdit::StringListEdit(QWidget * parent): QWidget(parent), lay(QBoxLayou
void StringListEdit::changeEvent(QEvent * e) { void StringListEdit::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
butt_add->setToolTip(tr("Add")); butt_add->setToolTip(tr("Add"));
butt_del->setToolTip(tr("Remove")); butt_del->setToolTip(tr("Remove"));
butt_clear->setToolTip(tr("Clear")); butt_clear->setToolTip(tr("Clear"));
return; return;
} }
QWidget::changeEvent(e);
} }
@@ -120,11 +120,11 @@ PathEdit::PathEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftToRig
void PathEdit::changeEvent(QEvent * e) { void PathEdit::changeEvent(QEvent * e) {
QWidget::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
butt_select->setToolTip(tr("Choose") + " ..."); butt_select->setToolTip(tr("Choose") + " ...");
return; return;
} }
QWidget::changeEvent(e);
} }

View File

@@ -7,6 +7,15 @@
# include <QScreen> # include <QScreen>
#endif #endif
#include "session_manager.h" #include "session_manager.h"
#include "qad_locations.h"
SessionManager::SessionManager(QString file) {
if (file.isEmpty() && !QCoreApplication::applicationName().isEmpty()) {
file = QAD::userPath(QAD::ltConfig, "session");
}
setFile(file);
}
void SessionManager::setFile(const QString & file) { void SessionManager::setFile(const QString & file) {
@@ -34,7 +43,10 @@ void SessionManager::removeMainWidget(QWidget * e) {
void SessionManager::save() { void SessionManager::save() {
if (file_.isEmpty()) return; if (file_.isEmpty()) {
qDebug() << "[SessionManager] filename is empty";
return;
}
QPIConfig sr(file_); QPIConfig sr(file_);
QObjectList tsc; QObjectList tsc;
for (int i = 0; i < mwindows.size(); ++i) { for (int i = 0; i < mwindows.size(); ++i) {
@@ -137,19 +149,14 @@ void restoreWindowState(QWidget * w, QPIConfig & sr, QString name) {
srect.y() + (srect.height() - w->height()) / 2, srect.y() + (srect.height() - w->height()) / 2,
w->width(), w->height()); w->width(), w->height());
} }
/*if (w->windowState().testFlag(Qt::WindowMaximized)) {
foreach (QScreen * s, sl) {
if (s->geometry().contains(w->geometry())) {
//w->setGeometry(s->availableGeometry());
break;
}
}
}*/
} }
void SessionManager::load(bool onlyMainwindow) { void SessionManager::load(bool onlyMainwindow) {
if (file_.isEmpty()) return; if (file_.isEmpty()) {
qDebug() << "[SessionManager] filename is empty";
return;
}
QPIConfig sr(file_); QPIConfig sr(file_);
QObjectList tsc; QObjectList tsc;
for (int i = 0; i < mwindows.size(); ++i) { for (int i = 0; i < mwindows.size(); ++i) {

View File

@@ -47,8 +47,7 @@ class QAD_EXPORT SessionManager: public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
SessionManager(const QString & file = QString()) {setFile(file);} SessionManager(QString file = QString());
~SessionManager() {;}
void setFile(const QString & file); void setFile(const QString & file);

View File

@@ -49,10 +49,12 @@ Shortcuts::~Shortcuts() {
void Shortcuts::changeEvent(QEvent * e) { void Shortcuts::changeEvent(QEvent * e) {
QTreeWidget::changeEvent(e);
if (e->type() == QEvent::LanguageChange) { if (e->type() == QEvent::LanguageChange) {
QStringList l; QStringList l;
l << tr("Command") << tr("Shortcut"); l << tr("Command") << tr("Shortcut");
setHeaderLabels(l); setHeaderLabels(l);
return;
} }
} }

View File

@@ -25,8 +25,8 @@ set_version(${PROJECT_NAME}
MAJOR ${_QCD_MAJOR} MAJOR ${_QCD_MAJOR}
MINOR ${_QCD_MINOR} MINOR ${_QCD_MINOR}
REVISION ${_QCD_REVISION} REVISION ${_QCD_REVISION}
BUILD ${BUILD_NUMBER} BUILD "${BUILD_NUMBER}"
SUFFIX ${_QCD_SUFFIX}) SUFFIX "${_QCD_SUFFIX}")
find_package(QAD REQUIRED) find_package(QAD REQUIRED)
list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME}) list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME})

View File

@@ -1,16 +1,15 @@
project(cd_pult) project(cd_pult)
set_version(${PROJECT_NAME} import_version(${PROJECT_NAME} qcd_utils)
MAJOR ${_QCD_MAJOR}
MINOR ${_QCD_MINOR}
REVISION ${_QCD_REVISION}
BUILD ${BUILD_NUMBER}
SUFFIX ${_QCD_SUFFIX})
find_qt(${QtVersions} Core Gui OpenGL) find_qt(${QtVersions} Core Gui OpenGL)
set_deploy_property(${PROJECT_NAME} set_deploy_property(${PROJECT_NAME}
LABEL ${PROJECT_NAME} LABEL ${PROJECT_NAME}
FULLNAME "${_QCD_DOMAIN}.${PROJECT_NAME}" FULLNAME "${_QCD_DOMAIN}.${PROJECT_NAME}"
COMPANY ${_QCD_COMPANY} COMPANY ${_QCD_COMPANY}
INFO "CD Pult") INFO "CD Pult")
if (Qt5_FOUND)
import_version(${PROJECT_NAME}5 ${PROJECT_NAME})
import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME})
endif()
make_rc(${PROJECT_NAME} out_RC) make_rc(${PROJECT_NAME} out_RC)
qt_sources(SRC) qt_sources(SRC)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
@@ -33,7 +32,5 @@ else()
qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin)
endif() endif()
if (Qt5_FOUND) if (Qt5_FOUND)
import_version(${PROJECT_NAME}5 ${PROJECT_NAME})
import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME})
deploy_target(${PROJECT_NAME}5 VERBOSE DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../release) deploy_target(${PROJECT_NAME}5 VERBOSE DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../release)
endif() endif()

View File

@@ -302,6 +302,7 @@ protected:
uint qHash(const PIString & v, uint seed = 0) {return piHash(v);} uint qHash(const PIString & v, uint seed = 0) {return piHash(v);}
#include "logview.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
QApplication a(argc, argv); QApplication a(argc, argv);
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
@@ -342,6 +343,28 @@ int main(int argc, char *argv[]) {
return 0;*/ return 0;*/
//################################ //################################
//1245hghgfhfdgshrgnhdsgfhjshdszdgsdgnjedghrbnlcvleabjmbassfdggfhbnsjkgnfdvfdsdfojbwasv213443gr2t4sfth
/*LogView lw;
lw.setLogFont(QFont("dejavu sans mono", 9));
lw.registerCategory("Warning", "Warning", QImage(":/icons/flame.png"), Qt::darkYellow);
lw.registerCategory("Error", "Error", QImage(":/icons/dialog-cancel.png"), Qt::darkRed, true);
//lw.setLinesLimit(12);
lw.show();
piForTimes(100)
lw.addText(QString("row %1").arg(_i100));
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h");
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h");
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/view_editor.h");
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/material_map_editor.h\n"
"-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/materials_editor\n"
"-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/object_editor.h");
lw.addText("[Warning] sdfkjhdfgj");
lw.addText("[Error] gbflknwed");
QLineEdit * le = new QLineEdit();
QObject::connect(le, &QLineEdit::returnPressed, [&](){lw.addText(le->text());});
le->show();
return a.exec();*/
CDPultWindow w; CDPultWindow w;
w.show(); w.show();
if (a.arguments().size() > 1) if (a.arguments().size() > 1)

View File

@@ -1,6 +1,6 @@
/* /*
QGLView QGLView
Copyright (C) 2020 Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@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 Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,14 +1,18 @@
if (DESIGNER_PLUGINS) if (DESIGNER_PLUGINS)
if (NOT Qt5)
message(WARNING "Building ${PROJECT_NAME} available only on Qt5!")
else()
project(qglengine_plugin) project(qglengine_plugin)
include_directories("..") include_directories("..")
add_definitions(-DQT_PLUGIN) add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_NO_DEBUG) add_definitions(-DQT_NO_DEBUG)
add_definitions(-DQT_SHARED) add_definitions(-DQT_SHARED)
add_definitions(-DQDESIGNER_EXPORT_WIDGETS) add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
find_qt(${QtVersions} Core Designer Gui Widgets OpenGL) find_qt(Qt5 Core Designer Gui Widgets OpenGL)
qt_sources(SRC) qt_sources(SRC)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM) qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} SHARED out_CPP) qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qglengine) qt_target_link_libraries(${PROJECT_NAME} qglengine)
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer) qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
endif()
endif() endif()

View File

@@ -17,16 +17,19 @@ endif()
find_package(QAD REQUIRED) find_package(QAD REQUIRED)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
include_directories(${QAD_INCLUDES}) include_directories(${QAD_INCLUDES})
find_qt(${QtVersions} Core Gui OpenGL Xml) find_qt(Qt5 Core Gui OpenGL Xml)
qt_sources(SRC) if (NOT Qt5)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) message(WARNING "Building ${PROJECT_NAME} available only on Qt5!")
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets ${OPENGL_LIBRARIES})
qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "Building ${PROJECT_NAME}")
if (LIBPROJECT)
sdk_install("qad" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}")
else() else()
qt_sources(SRC)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets ${OPENGL_LIBRARIES})
qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "Building ${PROJECT_NAME}")
if (LIBPROJECT)
sdk_install("qad" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}")
else()
if (LIB) if (LIB)
if (WIN32) if (WIN32)
qt_install(FILES ${H} DESTINATION ${MINGW_INCLUDE}/qad) qt_install(FILES ${H} DESTINATION ${MINGW_INCLUDE}/qad)
@@ -48,19 +51,20 @@ else()
qt_install(FILES ${H} DESTINATION include/qad) qt_install(FILES ${H} DESTINATION include/qad)
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"") message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
endif() endif()
endif() endif()
foreach(_v ${_QT_VERSIONS_}) foreach(_v ${_QT_VERSIONS_})
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v}) set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v})
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE) set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
endforeach() endforeach()
list(APPEND QT_MULTILIB_LIST qglview) list(APPEND QT_MULTILIB_LIST qglview)
if (NOT DEFINED ANDROID_PLATFORM) if (NOT DEFINED ANDROID_PLATFORM)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin") if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin")
add_subdirectory(plugin) add_subdirectory(plugin)
endif() endif()
endif() endif()
qt_sources(test_SRC DIR "qglview_test") qt_sources(test_SRC DIR "qglview_test")
qt_wrap(${test_SRC} CPPS test_CPP) qt_wrap(${test_SRC} CPPS test_CPP)
qt_add_executable(qglview_test test_CPP) qt_add_executable(qglview_test test_CPP)
qt_target_link_libraries(qglview_test ${PROJECT_NAME}) qt_target_link_libraries(qglview_test ${PROJECT_NAME})
endif()

View File

@@ -35,7 +35,6 @@ GLObjectEditor::GLObjectEditor(QWidget * parent): QWidget(parent) {
void GLObjectEditor::changeEvent(QEvent * e) { void GLObjectEditor::changeEvent(QEvent * e) {
return;
QWidget::changeEvent(e); QWidget::changeEvent(e);
switch (e->type()) { switch (e->type()) {
case QEvent::LanguageChange: case QEvent::LanguageChange:

View File

@@ -29,7 +29,6 @@ MaterialEditor::MaterialEditor(QWidget * parent): QWidget(parent) {
void MaterialEditor::changeEvent(QEvent * e) { void MaterialEditor::changeEvent(QEvent * e) {
return;
QWidget::changeEvent(e); QWidget::changeEvent(e);
switch (e->type()) { switch (e->type()) {
case QEvent::LanguageChange: case QEvent::LanguageChange:

View File

@@ -28,7 +28,6 @@ MaterialMapEditor::MaterialMapEditor(QWidget * parent): QWidget(parent) {
void MaterialMapEditor::changeEvent(QEvent * e) { void MaterialMapEditor::changeEvent(QEvent * e) {
return;
QWidget::changeEvent(e); QWidget::changeEvent(e);
switch (e->type()) { switch (e->type()) {
case QEvent::LanguageChange: case QEvent::LanguageChange:

View File

@@ -1,14 +1,18 @@
if (DESIGNER_PLUGINS) if (DESIGNER_PLUGINS)
if (NOT Qt5)
message(WARNING "Building ${PROJECT_NAME} available only on Qt5!")
else()
project(qglview_plugin) project(qglview_plugin)
include_directories("..") include_directories("..")
add_definitions(-DQT_PLUGIN) add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_NO_DEBUG) add_definitions(-DQT_NO_DEBUG)
add_definitions(-DQT_SHARED) add_definitions(-DQT_SHARED)
add_definitions(-DQDESIGNER_EXPORT_WIDGETS) add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
find_qt(${QtVersions} Core Designer Gui Widgets OpenGL) find_qt(Qt5 Core Designer Gui Widgets OpenGL)
qt_sources(SRC) qt_sources(SRC)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM) qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} SHARED out_CPP) qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qglview) qt_target_link_libraries(${PROJECT_NAME} qglview)
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer) qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
endif()
endif() endif()