diff --git a/.appveyor.yml b/.appveyor.yml index 06cce7c6..178ef834 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,11 +1,9 @@ install: - - set QTDIR=C:\Qt\5.10\mingw53_32 - - choco install -y InnoSetup - - set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw730_32\bin;%PATH%;"C:\Program Files (x86)\Inno Setup 5" + - set QTDIR=C:\Qt\5.13.0\mingw73_32 + - set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw730_32\bin;%PATH% - git submodule update --init build_script: - - lrelease.exe Qv2ray.pro - mkdir build && cd build - - qmake ..\Qv2ray.pro "QV2RAY_LRELEASE=true" + - qmake ..\Qv2ray.pro - mingw32-make diff --git a/.travis.yml b/.travis.yml index a41ef3ad..67f93f0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,28 +3,28 @@ language: cpp matrix: include: - os: linux - dist: xenial + dist: bionic sudo: required env: BADGE=linux - os: osx env: BADGE=osx before_install: - - if [ "$BADGE" = "linux" ]; then sudo add-apt-repository -y ppa:beineri/opt-qt-5.11.1-xenial; fi - if [ "$BADGE" = "linux" ]; then sudo apt-get update; fi install: - - if [ "$BADGE" = "linux" ]; then sudo apt-get install qtchooser libgl-dev qt511-meta-minimal; fi + - if [ "$BADGE" = "linux" ]; then sudo apt-get install qtchooser libgl-dev qt5-default qttools5-dev-tools; fi - if [ "$BADGE" = "osx" ]; then brew install cppcheck https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/qt.rb; fi - if [ "$BADGE" = "osx" ]; then brew link --force qt; fi before_script: - if [ "$BADGE" = "osx" ]; then export PATH="/usr/local/opt/qt/bin:$PATH"; fi + - if [ "$BADGE" = "linux" ]; then sudo cp ./libs/lrelease.prf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/; fi script: - git submodule update --init - - lrelease ./Qv2ray.pro - - mkdir build && cd ./build - - if [ "$BADGE" = "linux" ]; then /opt/qt511/bin/qmake ../ "QV2RAY_LRELEASE=true"; fi - - if [ "$BADGE" = "osx" ]; then qmake "QV2RAY_LRELEASE=true" ../; fi - - make + - mkdir build && cd ./build + - qmake ../ + - if [ "$BADGE" = "linux" ]; then make compiler_lrelease_make_all; fi + - if [ "$BADGE" = "linux" ]; then ls -lah --color=always --recursive; fi + - make -j8 diff --git a/Qv2ray.pro b/Qv2ray.pro index f09b1ab2..795e5394 100644 --- a/Qv2ray.pro +++ b/Qv2ray.pro @@ -9,7 +9,7 @@ QT += core gui widgets network TARGET = Qv2ray TEMPLATE = app DEFINES += QT_DEPRECATED_WARNINGS -CONFIG += c++11 openssl-linked lrelease embed_translations +CONFIG += c++11 openssl openssl-linked lrelease embed_translations win32: QMAKE_TARGET_DESCRIPTION = "Qv2ray, a cross-platform v2ray GUI client." win32: QMAKE_TARGET_PRODUCT = "Qv2ray" @@ -98,3 +98,11 @@ win32: QMAKE_CXXFLAGS += "-Wno-missing-field-initializers" qnx: target.path = /tmp/$${TARGET}/bin unix: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target + +desktop.files += ./icons/Qv2ray.desktop +desktop.path = /opt/$${TARGET}/share/applications/ +icon.files += ./icons/Qv2ray.png +icon.path = /opt/$${TARGET}/share/icons/hicolor/256x256/apps/ + +INSTALLS += desktop +INSTALLS += icon diff --git a/crowdin.yml b/crowdin.yml index 5bac8fa0..94101460 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,3 @@ files: - - source: /translations/source.ts + - source: /translations/en-US.ts translation: /translations/%locale%.ts diff --git a/icons/AppImage-AppRun b/icons/AppImage-AppRun deleted file mode 100755 index c9eb4e9f..00000000 --- a/icons/AppImage-AppRun +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -e - -if [ ! -z "$DEBUG" ] ; then - env - set -x -fi - -THIS="$0" -# http://stackoverflow.com/questions/3190818/ -args=("$@") -NUMBER_OF_ARGS="$#" - -if [ -z $APPDIR ] ; then - # Find the AppDir. It is the directory that contains AppRun. - # This assumes that this script resides inside the AppDir or a subdirectory. - # If this script is run inside an AppImage, then the AppImage runtime likely has already set $APPDIR - path="$(dirname "$(readlink -f "${THIS}")")" - while [[ "$path" != "" && ! -e "$path/$1" ]]; do - path=${path%/*} - done - APPDIR="$path" -fi - -echo Application is located at: $APPDIR -exec $APPDIR/opt/Qv2ray/bin/Qv2ray diff --git a/icons/AppImage-Qv2ray.desktop b/icons/AppImage-Qv2ray.desktop deleted file mode 100755 index ae8a7692..00000000 --- a/icons/AppImage-Qv2ray.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Application -Keywords=Internet;VPN;Proxy;v2ray;Qt -Categories=Network;Qt; -Icon=Qv2ray -Exec=AppRun -Name=Qv2ray -Comment=Cross-platform v2ray GUI Client in Qt. diff --git a/icons/Qv2ray.desktop b/icons/Qv2ray.desktop index 9fbd993d..9099a414 100755 --- a/icons/Qv2ray.desktop +++ b/icons/Qv2ray.desktop @@ -1,9 +1,8 @@ [Desktop Entry] -Encoding=UTF-8 Type=Application -Keywords=Internet;VPN;Proxy;v2ray;Qt +Keywords=Internet;VPN;Proxy;v2ray;Qt; Categories=Network;Qt; Icon=Qv2ray -Exec=/opt/Qv2ray/Qv2ray +Exec=/opt/Qv2ray/bin/Qv2ray Name=Qv2ray Comment=Cross-platform v2ray GUI Client in Qt. diff --git a/libs/lrelease.prf b/libs/lrelease.prf new file mode 100644 index 00000000..1e828b64 --- /dev/null +++ b/libs/lrelease.prf @@ -0,0 +1,41 @@ +# Automatically generate .qm files out of .ts files in TRANSLATIONS and +# EXTRA_TRANSLATIONS. +# +# If embed_translations is enabled, the generated .qm files are made available +# in the resource system under :/i18n/. +# +# Otherwise, the .qm files are available in the build directory in LRELEASE_DIR. +# They can also be automatically installed by setting QM_FILES_INSTALL_PATH. + +qtPrepareTool(QMAKE_LRELEASE, lrelease) + +isEmpty(LRELEASE_DIR): LRELEASE_DIR = .qm +isEmpty(QM_FILES_RESOURCE_PREFIX): QM_FILES_RESOURCE_PREFIX = i18n + +lrelease.name = lrelease +lrelease.input = TRANSLATIONS EXTRA_TRANSLATIONS +lrelease.output = $$LRELEASE_DIR/${QMAKE_FILE_IN_BASE}.qm +lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} $$QMAKE_LRELEASE_FLAGS -qm ${QMAKE_FILE_OUT} +silent: lrelease.commands = @echo lrelease ${QMAKE_FILE_IN} && $$lrelease.commands +lrelease.CONFIG = no_link +QMAKE_EXTRA_COMPILERS += lrelease + +all_translations = $$TRANSLATIONS $$EXTRA_TRANSLATIONS +for (translation, all_translations) { + # mirrors $$LRELEASE_DIR/${QMAKE_FILE_IN_BASE}.qm above + translation = $$basename(translation) + QM_FILES += $$OUT_PWD/$$LRELEASE_DIR/$$replace(translation, \\..*$, .qm) +} +embed_translations { + qmake_qm_files.files = $$QM_FILES + qmake_qm_files.base = $$OUT_PWD/$$LRELEASE_DIR + qmake_qm_files.prefix = $$QM_FILES_RESOURCE_PREFIX + RESOURCES += qmake_qm_files +} else { + !isEmpty(QM_FILES_INSTALL_PATH) { + qm_files.files = $$QM_FILES + qm_files.path = $$QM_FILES_INSTALL_PATH + INSTALLS += qm_files + } + lrelease.CONFIG += target_predeps no_clean +} diff --git a/translations/en-US.ts b/translations/en-US.ts index caf5bac1..b5f0e590 100644 --- a/translations/en-US.ts +++ b/translations/en-US.ts @@ -596,8 +596,8 @@ PrefrencesWindow - - + + Prefrences @@ -821,22 +821,22 @@ - + PortNumbersCannotBeSame - + RunAsRootNotOnWindows - + #OpenVCoreFile - + OpenVAssetsDir @@ -864,17 +864,17 @@ - + DependencyMissing - + osslDependMissing,PleaseReDownload - + #AnotherInstanceRunning