Compare commits
52 commits
Author | SHA1 | Date | |
---|---|---|---|
|
fcbe264d63 | ||
|
f8049c8178 | ||
|
d0899623ad | ||
|
547922329a | ||
|
1fbe4d9e67 | ||
|
678425a7c5 | ||
|
f9129f8364 | ||
|
4e5592566a | ||
|
39436a6dbf | ||
|
15dfc2c84b | ||
|
57c32eea58 | ||
|
90744ced60 | ||
|
90846e6fb6 | ||
|
2735325f4c | ||
|
8b8e22c958 | ||
|
91ccdca77a | ||
|
ae0c7c2905 | ||
|
4a026640e3 | ||
|
8be9fd6d5e | ||
|
8295e38ab4 | ||
|
24cd9a16f9 | ||
|
aa142c9ec9 | ||
|
4c42f06b39 | ||
|
94fb78c59a | ||
|
3f910c16b0 | ||
|
bbf7f08980 | ||
|
ec93fa8ce0 | ||
|
d37fbdf055 | ||
|
1c00871e80 | ||
|
a74e7847b2 | ||
|
e41d4946f8 | ||
|
28fedfdd0b | ||
|
a882738735 | ||
|
23245a3324 | ||
|
af86e70f4b | ||
|
2bf6bb5630 | ||
|
6b2b18ed16 | ||
|
c936fed2f8 | ||
|
cb8793f3b3 | ||
|
1038f000f7 | ||
|
3c124f9f27 | ||
|
27075778c6 | ||
|
2b0455e2ff | ||
|
ab248413ea | ||
|
279cd5ac3b | ||
|
1f62f6fe48 | ||
|
c8a955e8de | ||
|
5250bad4b6 | ||
|
9121987142 | ||
|
cabd44f066 | ||
|
01fb80fdd1 | ||
|
f63645a1fb |
33
.ci/app.rc
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
IDI_ICON1 ICON DISCARDABLE "5sync.ico"
|
||||||
|
#define RT_MANIFEST 24
|
||||||
|
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
|
||||||
|
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gta5view.exe.manifest"
|
||||||
|
#include <windows.h>
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION MAJOR_VER, MINOR_VER, PATCH_VER, INT_BUILD_VER
|
||||||
|
PRODUCTVERSION MAJOR_VER, MINOR_VER, PATCH_VER, INT_BUILD_VER
|
||||||
|
FILEFLAGSMASK 0x3fL
|
||||||
|
FILEFLAGS 0
|
||||||
|
FILEOS VOS_NT_WINDOWS32
|
||||||
|
FILETYPE VFT_APP
|
||||||
|
FILESUBTYPE VFT2_UNKNOWN
|
||||||
|
BEGIN
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x0809, 1200
|
||||||
|
END
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "CompanyName", "Syping"
|
||||||
|
VALUE "FileDescription", "gta5view"
|
||||||
|
VALUE "FileVersion", "MAJOR_VER.MINOR_VER.PATCH_VERSTR_BUILD_VER"
|
||||||
|
VALUE "InternalName", "gta5view"
|
||||||
|
VALUE "LegalCopyright", "Copyright © 2016-2020 Syping"
|
||||||
|
VALUE "OriginalFilename", "gta5view.exe"
|
||||||
|
VALUE "ProductName", "gta5view"
|
||||||
|
VALUE "ProductVersion", "MAJOR_VER.MINOR_VER.PATCH_VERSTR_BUILD_VER"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
END
|
30
.ci/ci.sh
|
@ -9,33 +9,61 @@ export PACKAGE_VERSION=$(grep -oE '^[^\-]*' <<< $APPLICATION_VERSION)
|
||||||
export PACKAGE_BUILD=$(grep -oP '\-\K.+' <<< $APPLICATION_VERSION)
|
export PACKAGE_BUILD=$(grep -oP '\-\K.+' <<< $APPLICATION_VERSION)
|
||||||
export EXECUTABLE_VERSION=${PACKAGE_VERSION}${PACKAGE_BUILD}${EXECUTABLE_TAG}
|
export EXECUTABLE_VERSION=${PACKAGE_VERSION}${PACKAGE_BUILD}${EXECUTABLE_TAG}
|
||||||
|
|
||||||
|
export APPLICATION_MAJOR_VERSION=$(cut -d. -f1 <<< $APPLICATION_VERSION)
|
||||||
|
export APPLICATION_MINOR_VERSION=$(cut -d. -f2 <<< $APPLICATION_VERSION)
|
||||||
|
export APPLICATION_PATCH_VERSION=$(cut -d. -f3 <<< $APPLICATION_VERSION)
|
||||||
|
|
||||||
if [ "${PACKAGE_BUILD}" == "" ]; then
|
if [ "${PACKAGE_BUILD}" == "" ]; then
|
||||||
export PACKAGE_BUILD=1;
|
export PACKAGE_BUILD=1
|
||||||
|
else
|
||||||
|
export APPLICATION_BUILD_INT_VERSION=$(grep -oE "[1-9]*$" <<< $PACKAGE_BUILD)
|
||||||
|
export APPLICATION_BUILD_STR_VERSION=-${PACKAGE_BUILD}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat ".ci/app.rc" | sed \
|
||||||
|
-e "s/MAJOR_VER/$APPLICATION_MAJOR_VERSION/g" \
|
||||||
|
-e "s/MINOR_VER/$APPLICATION_MINOR_VERSION/g" \
|
||||||
|
-e "s/PATCH_VER/$APPLICATION_PATCH_VERSION/g" \
|
||||||
|
-e "s/INT_BUILD_VER/0/g" \
|
||||||
|
-e "s/STR_BUILD_VER/$APPLICATION_BUILD_STR_VERSION/g" \
|
||||||
|
-e "s/STR_BUILD_VER/$APPLICATION_BUILD_STR_VERSION/g" \
|
||||||
|
> "res/app.rc"
|
||||||
|
|
||||||
if [ "${BUILD_TYPE}" == "ALPHA" ]; then
|
if [ "${BUILD_TYPE}" == "ALPHA" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_ALPHA=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_ALPHA"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_ALPHA"
|
||||||
elif [ "${BUILD_TYPE}" == "Alpha" ]; then
|
elif [ "${BUILD_TYPE}" == "Alpha" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_ALPHA=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_ALPHA"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_ALPHA"
|
||||||
elif [ "${BUILD_TYPE}" == "BETA" ]; then
|
elif [ "${BUILD_TYPE}" == "BETA" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_BETA=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_BETA"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_BETA"
|
||||||
elif [ "${BUILD_TYPE}" == "Beta" ]; then
|
elif [ "${BUILD_TYPE}" == "Beta" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_BETA=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_BETA"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_BETA"
|
||||||
elif [ "${BUILD_TYPE}" == "DEV" ]; then
|
elif [ "${BUILD_TYPE}" == "DEV" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_DEV=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DEV"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DEV"
|
||||||
elif [ "${BUILD_TYPE}" == "Development" ]; then
|
elif [ "${BUILD_TYPE}" == "Development" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_DEV=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DEV"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DEV"
|
||||||
elif [ "${BUILD_TYPE}" == "DAILY" ]; then
|
elif [ "${BUILD_TYPE}" == "DAILY" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_DAILY=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DAILY"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DAILY"
|
||||||
elif [ "${BUILD_TYPE}" == "Daily" ]; then
|
elif [ "${BUILD_TYPE}" == "Daily" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_DAILY=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DAILY"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_DAILY"
|
||||||
elif [ "${BUILD_TYPE}" == "RC" ]; then
|
elif [ "${BUILD_TYPE}" == "RC" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_RC=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_RC"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_RC"
|
||||||
elif [ "${BUILD_TYPE}" == "Release Candidate" ]; then
|
elif [ "${BUILD_TYPE}" == "Release Candidate" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_RC=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_RC"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_RC"
|
||||||
elif [ "${BUILD_TYPE}" == "REL" ]; then
|
elif [ "${BUILD_TYPE}" == "REL" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_REL=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_REL"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_REL"
|
||||||
elif [ "${BUILD_TYPE}" == "Release" ]; then
|
elif [ "${BUILD_TYPE}" == "Release" ]; then
|
||||||
|
export CMAKE_BUILD_TYPE="-DGTA5VIEW_BUILDTYPE_REL=TRUE"
|
||||||
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_REL"
|
export QMAKE_BUILD_TYPE="DEFINES+=GTA5SYNC_BUILDTYPE_REL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ cd ${PROJECT_DIR} && \
|
||||||
echo "gta5view build version is ${APPLICATION_VERSION}" && \
|
echo "gta5view build version is ${APPLICATION_VERSION}" && \
|
||||||
mkdir -p build && \
|
mkdir -p build && \
|
||||||
mkdir -p assets && \
|
mkdir -p assets && \
|
||||||
chmod -x res/gta5sync_*.qm res/gta5view.desktop res/gta5view.png && \
|
chmod -x res/gta5sync_*.qm res/*.desktop res/*gta5view*.png && \
|
||||||
cd build && \
|
cd build && \
|
||||||
mkdir -p qt4 && \
|
mkdir -p qt4 && \
|
||||||
cd qt4 && \
|
cd qt4 && \
|
||||||
|
@ -16,18 +16,29 @@ cd qt5 && \
|
||||||
echo "Grand Theft Auto V Snapmatic and Savegame viewer/editor" > ./description-pak && \
|
echo "Grand Theft Auto V Snapmatic and Savegame viewer/editor" > ./description-pak && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
|
|
||||||
|
# Set compiler
|
||||||
|
export CC=clang && \
|
||||||
|
export CXX=clang++ && \
|
||||||
|
|
||||||
# Prepare checkinstall step
|
# Prepare checkinstall step
|
||||||
mkdir -p /usr/share/gta5view && \
|
mkdir -p /usr/share/gta5view && \
|
||||||
|
|
||||||
# Starting build
|
# Starting build
|
||||||
cd qt5 && \
|
cd qt5 && \
|
||||||
qmake -qt=5 -spec linux-clang GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=gnu++11 ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_DONATION "DEFINES+=GTA5SYNC_DONATION_EMAIL=\\\\\\\"paypal/at/syping.de\\\\\\\"" ../../gta5view.pro && \
|
cmake \
|
||||||
make depend && \
|
"-DCMAKE_INSTALL_PREFIX=/usr" \
|
||||||
|
${CMAKE_BUILD_TYPE} \
|
||||||
|
"-DGTA5VIEW_BUILDCODE=${PACKAGE_CODE}" \
|
||||||
|
"-DGTA5VIEW_APPVER=${APPLICATION_VERSION}" \
|
||||||
|
"-DGTA5VIEW_COMMIT=${APPLICATION_COMMIT}" \
|
||||||
|
"-DWITH_TELEMETRY=ON" \
|
||||||
|
"-DTELEMETRY_WEBURL=https://dev.syping.de/gta5view-userstats/" \
|
||||||
|
"-DQCONF_BUILD=ON" \
|
||||||
|
../../ && \
|
||||||
make -j 4 && \
|
make -j 4 && \
|
||||||
checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=${PACKAGE_VERSION} --pkgrelease=${PACKAGE_BUILD} --pkggroup=utility --maintainer="Syping \<dpkg@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5svg5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=${PROJECT_DIR}/assets && \
|
checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=${PACKAGE_VERSION} --pkgrelease=${PACKAGE_BUILD} --pkggroup=utility --maintainer="Syping \<dpkg@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5svg5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=${PROJECT_DIR}/assets && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
cd qt4 && \
|
cd qt4 && \
|
||||||
qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=gnu++11 ${QMAKE_FLAGS_QT4} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro && \
|
qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=gnu++11 ${QMAKE_FLAGS_QT4} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro && \
|
||||||
make depend && \
|
|
||||||
make -j 4 && \
|
make -j 4 && \
|
||||||
checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=${PACKAGE_VERSION} --pkgrelease=${PACKAGE_BUILD} --pkggroup=utility --maintainer="Syping \<dpkg@syping.de\>" --requires=libqtcore4,libqtgui4,libqt4-network,libqt4-svg,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=${PROJECT_DIR}/assets
|
checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=${PACKAGE_VERSION} --pkgrelease=${PACKAGE_BUILD} --pkggroup=utility --maintainer="Syping \<dpkg@syping.de\>" --requires=libqtcore4,libqtgui4,libqt4-network,libqt4-svg,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=${PROJECT_DIR}/assets
|
||||||
|
|
|
@ -12,4 +12,4 @@ docker pull ${DOCKER_IMAGE} && \
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
|
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
|
||||||
${DOCKER_IMAGE} \
|
${DOCKER_IMAGE} \
|
||||||
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh"
|
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh"
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
apt-get update -qq && \
|
apt-get update -qq && \
|
||||||
apt-get install -qq ${APT_INSTALL} checkinstall dpkg-dev fakeroot g++ gcc qtbase5-dev qt5-qmake qttranslations5-l10n libqt4-dev libqt5svg5-dev
|
apt-get install -qq ${APT_INSTALL} checkinstall cmake dpkg-dev fakeroot g++ gcc qtbase5-dev qt5-qmake qttranslations5-l10n libqt4-dev libqt5svg5-dev
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
!define APP_NAME "gta5view"
|
!define APP_NAME "gta5view"
|
||||||
!define COMP_NAME "Syping"
|
!define COMP_NAME "Syping"
|
||||||
!define WEB_SITE "https://gta5view.syping.de/"
|
!define WEB_SITE "https://gta5view.syping.de/"
|
||||||
!define VERSION "1.7.1.0"
|
!define VERSION "1.8.0.0"
|
||||||
!define COPYRIGHT "Copyright © 2016-2019 Syping"
|
!define COPYRIGHT "Copyright © 2016-2020 Syping"
|
||||||
!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor"
|
!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor"
|
||||||
!define INSTALLER_NAME "gta5view_setup.exe"
|
!define INSTALLER_NAME "gta5view_setup.exe"
|
||||||
!define MAIN_APP_EXE "gta5view.exe"
|
!define MAIN_APP_EXE "gta5view.exe"
|
||||||
|
@ -103,27 +103,26 @@ Section -MainProgram
|
||||||
${INSTALL_TYPE}
|
${INSTALL_TYPE}
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
File "../build/release/gta5view.exe"
|
File "../build/gta5view.exe"
|
||||||
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libgcc_s_seh-1.dll"
|
File "/opt/llvm-mingw/x86_64-w64-mingw32/bin/libc++.dll"
|
||||||
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libstdc++-6.dll"
|
File "/opt/llvm-mingw/x86_64-w64-mingw32/bin/libunwind.dll"
|
||||||
File "/opt/windev/openssl-latest_qt64d/bin/libcrypto-1_1-x64.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/openssl/bin/libcrypto-1_1-x64.dll"
|
||||||
File "/opt/windev/openssl-latest_qt64d/bin/libssl-1_1-x64.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/openssl/bin/libssl-1_1-x64.dll"
|
||||||
File "/opt/windev/libjpeg-turbo-latest_qt64d/bin/libjpeg-62.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Core.dll"
|
||||||
File "/opt/windev/qt64d-latest/bin/Qt5Core.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Gui.dll"
|
||||||
File "/opt/windev/qt64d-latest/bin/Qt5Gui.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Network.dll"
|
||||||
File "/opt/windev/qt64d-latest/bin/Qt5Network.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Svg.dll"
|
||||||
File "/opt/windev/qt64d-latest/bin/Qt5Svg.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Widgets.dll"
|
||||||
File "/opt/windev/qt64d-latest/bin/Qt5Widgets.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5WinExtras.dll"
|
||||||
File "/opt/windev/qt64d-latest/bin/Qt5WinExtras.dll"
|
|
||||||
SetOutPath "$INSTDIR\lang"
|
SetOutPath "$INSTDIR\lang"
|
||||||
File "../res/gta5sync_en_US.qm"
|
File "../build/gta5sync_en_US.qm"
|
||||||
File "../res/gta5sync_de.qm"
|
File "../build/gta5sync_de.qm"
|
||||||
File "../res/gta5sync_fr.qm"
|
File "../build/gta5sync_fr.qm"
|
||||||
File "../res/gta5sync_ko.qm"
|
File "../build/gta5sync_ko.qm"
|
||||||
File "../res/gta5sync_ru.qm"
|
File "../build/gta5sync_ru.qm"
|
||||||
File "../res/gta5sync_uk.qm"
|
File "../build/gta5sync_uk.qm"
|
||||||
File "../res/gta5sync_zh_TW.qm"
|
File "../build/gta5sync_zh_TW.qm"
|
||||||
File "../res/qtbase_en_GB.qm"
|
File "../build/qtbase_en_GB.qm"
|
||||||
File "../res/qtbase_de.qm"
|
File "../res/qtbase_de.qm"
|
||||||
File "../res/qtbase_fr.qm"
|
File "../res/qtbase_fr.qm"
|
||||||
File "../res/qtbase_ko.qm"
|
File "../res/qtbase_ko.qm"
|
||||||
|
@ -131,21 +130,21 @@ File "../res/qtbase_ru.qm"
|
||||||
File "../res/qtbase_uk.qm"
|
File "../res/qtbase_uk.qm"
|
||||||
File "../res/qtbase_zh_TW.qm"
|
File "../res/qtbase_zh_TW.qm"
|
||||||
SetOutPath "$INSTDIR\imageformats"
|
SetOutPath "$INSTDIR\imageformats"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qgif.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qgif.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qicns.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qicns.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qico.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qico.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qjpeg.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qjpeg.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qsvg.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qsvg.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qtga.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qtga.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qtiff.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qtiff.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qwbmp.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qwbmp.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/imageformats/qwebp.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qwebp.dll"
|
||||||
SetOutPath "$INSTDIR\platforms"
|
SetOutPath "$INSTDIR\platforms"
|
||||||
File "/opt/windev/qt64d-latest/plugins/platforms/qwindows.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/platforms/qwindows.dll"
|
||||||
SetOutPath "$INSTDIR\styles"
|
SetOutPath "$INSTDIR\styles"
|
||||||
File "/opt/windev/qt64d-latest/plugins/styles/qcleanlooksstyle.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/styles/qcleanlooksstyle.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/styles/qplastiquestyle.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/styles/qplastiquestyle.dll"
|
||||||
File "/opt/windev/qt64d-latest/plugins/styles/qwindowsvistastyle.dll"
|
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/styles/qwindowsvistastyle.dll"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@ -195,11 +194,10 @@ SectionEnd
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
${INSTALL_TYPE}
|
${INSTALL_TYPE}
|
||||||
Delete "$INSTDIR\gta5view.exe"
|
Delete "$INSTDIR\gta5view.exe"
|
||||||
Delete "$INSTDIR\libgcc_s_seh-1.dll"
|
Delete "$INSTDIR\libc++.dll"
|
||||||
Delete "$INSTDIR\libstdc++-6.dll"
|
Delete "$INSTDIR\libunwind.dll"
|
||||||
Delete "$INSTDIR\libcrypto-1_1-x64.dll"
|
Delete "$INSTDIR\libcrypto-1_1-x64.dll"
|
||||||
Delete "$INSTDIR\libssl-1_1-x64.dll"
|
Delete "$INSTDIR\libssl-1_1-x64.dll"
|
||||||
Delete "$INSTDIR\libjpeg-62.dll"
|
|
||||||
Delete "$INSTDIR\Qt5Core.dll"
|
Delete "$INSTDIR\Qt5Core.dll"
|
||||||
Delete "$INSTDIR\Qt5Gui.dll"
|
Delete "$INSTDIR\Qt5Gui.dll"
|
||||||
Delete "$INSTDIR\Qt5Network.dll"
|
Delete "$INSTDIR\Qt5Network.dll"
|
||||||
|
|
|
@ -9,7 +9,6 @@ mkdir -p assets && \
|
||||||
cd build && \
|
cd build && \
|
||||||
|
|
||||||
/usr/local/opt/qt/bin/qmake ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" ../gta5view.pro && \
|
/usr/local/opt/qt/bin/qmake ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" ../gta5view.pro && \
|
||||||
make depend && \
|
|
||||||
make -j 4 && \
|
make -j 4 && \
|
||||||
/usr/local/opt/qt/bin/macdeployqt gta5view.app -dmg && \
|
/usr/local/opt/qt/bin/macdeployqt gta5view.app -dmg && \
|
||||||
cp -Rf gta5view.dmg ../assets/gta5view-osx_${APPLICATION_VERSION}.dmg
|
cp -Rf gta5view.dmg ../assets/gta5view-osx_${APPLICATION_VERSION}.dmg
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
brew install qt
|
brew upgrade qt
|
||||||
|
|
|
@ -12,8 +12,15 @@ mkdir -p assets && \
|
||||||
|
|
||||||
# Starting build
|
# Starting build
|
||||||
cd build && \
|
cd build && \
|
||||||
qmake-static ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_DONATION "DEFINES+=GTA5SYNC_DONATION_EMAIL=\\\\\\\"paypal/at/syping.de\\\\\\\"" ../gta5view.pro && \
|
mingw64-qt-cmake \
|
||||||
make depend && \
|
${CMAKE_BUILD_TYPE} \
|
||||||
|
"-DGTA5VIEW_BUILDCODE=${PACKAGE_CODE}" \
|
||||||
|
"-DGTA5VIEW_APPVER=${APPLICATION_VERSION}" \
|
||||||
|
"-DGTA5VIEW_COMMIT=${APPLICATION_COMMIT}" \
|
||||||
|
"-DWITH_TELEMETRY=ON" \
|
||||||
|
"-DTELEMETRY_WEBURL=https://dev.syping.de/gta5view-userstats/" \
|
||||||
|
.. && \
|
||||||
make -j 4 && \
|
make -j 4 && \
|
||||||
cp -Rf release/*.exe ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} && \
|
x86_64-w64-mingw32-strip -s gta5view.exe && \
|
||||||
|
cp -Rf *.exe ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} && \
|
||||||
cd ${PROJECT_DIR}/assets
|
cd ${PROJECT_DIR}/assets
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOCKER_IMAGE=sypingauto/gta5view-build:1.7-static
|
DOCKER_IMAGE=sypingauto/gta5view-build:1.8-static
|
||||||
PROJECT_DIR_DOCKER=/gta5view
|
PROJECT_DIR_DOCKER=/gta5view
|
||||||
|
|
||||||
cd ${PROJECT_DIR} && \
|
cd ${PROJECT_DIR} && \
|
||||||
|
@ -8,7 +8,7 @@ docker pull ${DOCKER_IMAGE} && \
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
|
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
|
||||||
${DOCKER_IMAGE} \
|
${DOCKER_IMAGE} \
|
||||||
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \
|
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \
|
||||||
|
|
||||||
# Prepare environment variable
|
# Prepare environment variable
|
||||||
export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \
|
export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \
|
||||||
|
@ -18,4 +18,8 @@ if [ "${PACKAGE_CODE}" == "gta5-mods" ]; then
|
||||||
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION}
|
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION}
|
||||||
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
|
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
|
||||||
rm -rf ${GTA5VIEW_EXECUTABLE}
|
rm -rf ${GTA5VIEW_EXECUTABLE}
|
||||||
|
elif [ "${PACKAGE_CODE}" == "gtainside" ]; then
|
||||||
|
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gtainside/${PACKAGE_VERSION}
|
||||||
|
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gtainside/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
|
||||||
|
rm -rf ${GTA5VIEW_EXECUTABLE}
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Install nsis
|
|
||||||
apt-get update -qq && \
|
|
||||||
apt-get install -qq nsis && \
|
|
||||||
|
|
||||||
# Creating folders
|
# Creating folders
|
||||||
cd ${PROJECT_DIR} && \
|
cd ${PROJECT_DIR} && \
|
||||||
echo "gta5view build version is ${APPLICATION_VERSION}" && \
|
echo "gta5view build version is ${APPLICATION_VERSION}" && \
|
||||||
|
@ -12,9 +8,20 @@ mkdir -p assets && \
|
||||||
|
|
||||||
# Starting build
|
# Starting build
|
||||||
cd build && \
|
cd build && \
|
||||||
qmake ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_DONATION "DEFINES+=GTA5SYNC_DONATION_EMAIL=\\\\\\\"paypal/at/syping.de\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_INLANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_LANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_PLUG='\\\"RUNDIR:SEPARATOR:plugins\\\"' "LIBS+=-ljpeg" ../gta5view.pro && \
|
mingw64-qt-cmake \
|
||||||
make depend && \
|
${CMAKE_BUILD_TYPE} \
|
||||||
|
"-DGTA5VIEW_BUILDCODE=${PACKAGE_CODE}" \
|
||||||
|
"-DGTA5VIEW_APPVER=${APPLICATION_VERSION}" \
|
||||||
|
"-DGTA5VIEW_COMMIT=${APPLICATION_COMMIT}" \
|
||||||
|
"-DWITH_TELEMETRY=ON" \
|
||||||
|
"-DTELEMETRY_WEBURL=https://dev.syping.de/gta5view-userstats/" \
|
||||||
|
"-DQCONF_BUILD=ON" \
|
||||||
|
"-DGTA5VIEW_INLANG=RUNDIR:SEPARATOR:lang" \
|
||||||
|
"-DGTA5VIEW_LANG=RUNDIR:SEPARATOR:lang" \
|
||||||
|
"-DGTA5VIEW_PLUG=RUNDIR:SEPARATOR:plugins" \
|
||||||
|
.. && \
|
||||||
make -j 4 && \
|
make -j 4 && \
|
||||||
|
x86_64-w64-mingw32-strip -s gta5view.exe && \
|
||||||
cd ${PROJECT_DIR}/assets && \
|
cd ${PROJECT_DIR}/assets && \
|
||||||
makensis -NOCD ${PROJECT_DIR}/.ci/gta5view.nsi && \
|
makensis -NOCD ${PROJECT_DIR}/.ci/gta5view.nsi && \
|
||||||
mv -f gta5view_setup.exe gta5view-${EXECUTABLE_VERSION}_setup.exe
|
mv -f gta5view_setup.exe gta5view-${EXECUTABLE_VERSION}_setup.exe
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOCKER_IMAGE=sypingauto/gta5view-build:1.7-shared
|
DOCKER_IMAGE=sypingauto/gta5view-build:1.8-shared
|
||||||
PROJECT_DIR_DOCKER=/gta5view
|
PROJECT_DIR_DOCKER=/gta5view
|
||||||
|
|
||||||
cd ${PROJECT_DIR} && \
|
cd ${PROJECT_DIR} && \
|
||||||
|
@ -8,4 +8,4 @@ docker pull ${DOCKER_IMAGE} && \
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
|
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
|
||||||
${DOCKER_IMAGE} \
|
${DOCKER_IMAGE} \
|
||||||
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh"
|
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh"
|
||||||
|
|
36
.drone.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
environment:
|
||||||
|
BUILD_TYPE: "REL"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Windows Installer
|
||||||
|
image: sypingauto/gta5view-build:1.8-shared
|
||||||
|
environment:
|
||||||
|
BUILD_SCRIPT: "wininstall_build.sh"
|
||||||
|
QT_SELECT: "qt5-x86_64-w64-mingw32"
|
||||||
|
TCA_PASS:
|
||||||
|
from_secret: tca_pass
|
||||||
|
commands:
|
||||||
|
- .drone/drone.sh
|
||||||
|
volumes:
|
||||||
|
- name: gta5view
|
||||||
|
path: /srv/gta5view
|
||||||
|
- name: Windows Portable
|
||||||
|
image: sypingauto/gta5view-build:1.8-static
|
||||||
|
environment:
|
||||||
|
BUILD_SCRIPT: "windows_build.sh"
|
||||||
|
QT_SELECT: "qt5-x86_64-w64-mingw32"
|
||||||
|
TCA_PASS:
|
||||||
|
from_secret: tca_pass
|
||||||
|
commands:
|
||||||
|
- .drone/drone.sh
|
||||||
|
volumes:
|
||||||
|
- name: gta5view
|
||||||
|
path: /srv/gta5view
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: gta5view
|
||||||
|
host:
|
||||||
|
path: /srv/gta5view
|
BIN
.drone/TelemetryClassAuthenticator.cpp.enc
Normal file
33
.drone/drone.sh
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Cleanup previous Drone build
|
||||||
|
if [ -d "assets" ]; then
|
||||||
|
rm -rf assets
|
||||||
|
fi
|
||||||
|
if [ -d "build" ]; then
|
||||||
|
rm -rf build
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Decrypt Telemetry Authenticator
|
||||||
|
rm -rf tmext/TelemetryClassAuthenticator.cpp && \
|
||||||
|
openssl aes-256-cbc -k ${TCA_PASS} -in .drone/TelemetryClassAuthenticator.cpp.enc -out tmext/TelemetryClassAuthenticator.cpp -d -pbkdf2
|
||||||
|
|
||||||
|
# Check if build is not tagged
|
||||||
|
if [ "${DRONE_TAG}" == "" ]; then
|
||||||
|
export EXECUTABLE_TAG=-$(git rev-parse --short HEAD)
|
||||||
|
else
|
||||||
|
export EXECUTABLE_TAG=
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if package code is not set
|
||||||
|
if [ "${PACKAGE_CODE}" == "" ]; then
|
||||||
|
export PACKAGE_CODE=Drone
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Init Application Commit Hash
|
||||||
|
export APPLICATION_COMMIT=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
# Start CI script and copying assets into gta5view directory
|
||||||
|
.ci/ci.sh && \
|
||||||
|
mkdir -p /srv/gta5view/${APPLICATION_COMMIT} && \
|
||||||
|
cp -Rf assets/* /srv/gta5view/${APPLICATION_COMMIT}/
|
20
.flatpak/de.syping.gta5view.yaml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
app-id: de.syping.gta5view
|
||||||
|
runtime: org.kde.Platform
|
||||||
|
runtime-version: '5.15'
|
||||||
|
sdk: org.kde.Sdk
|
||||||
|
command: gta5view
|
||||||
|
finish-args:
|
||||||
|
- --share=network
|
||||||
|
- --share=ipc
|
||||||
|
- --socket=fallback-x11
|
||||||
|
- --socket=wayland
|
||||||
|
- --device=dri
|
||||||
|
modules:
|
||||||
|
- name: gta5view
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DFLATPAK_BUILD=ON
|
||||||
|
- -DQCONF_BUILD=ON
|
||||||
|
sources:
|
||||||
|
- type: dir
|
||||||
|
path: ../
|
|
@ -6,7 +6,7 @@ variables:
|
||||||
|
|
||||||
Windows Installer:
|
Windows Installer:
|
||||||
stage: build
|
stage: build
|
||||||
image: sypingauto/gta5view-build:1.7-shared
|
image: sypingauto/gta5view-build:1.8-shared
|
||||||
variables:
|
variables:
|
||||||
BUILD_SCRIPT: "wininstall_build.sh"
|
BUILD_SCRIPT: "wininstall_build.sh"
|
||||||
QT_SELECT: "qt5-x86_64-w64-mingw32"
|
QT_SELECT: "qt5-x86_64-w64-mingw32"
|
||||||
|
@ -19,7 +19,7 @@ Windows Installer:
|
||||||
|
|
||||||
Windows Portable:
|
Windows Portable:
|
||||||
stage: build
|
stage: build
|
||||||
image: sypingauto/gta5view-build:1.7-static
|
image: sypingauto/gta5view-build:1.8-static
|
||||||
variables:
|
variables:
|
||||||
BUILD_SCRIPT: "windows_build.sh"
|
BUILD_SCRIPT: "windows_build.sh"
|
||||||
QT_SELECT: "qt5-x86_64-w64-mingw32"
|
QT_SELECT: "qt5-x86_64-w64-mingw32"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Decrypt Telemetry Authenticator
|
# Decrypt Telemetry Authenticator
|
||||||
rm -rf tmext/TelemetryClassAuthenticator.cpp && \
|
rm -rf tmext/TelemetryClassAuthenticator.cpp && \
|
||||||
openssl aes-256-cbc -k $tca_pass -in .gitlab/TelemetryClassAuthenticator.cpp.enc -out tmext/TelemetryClassAuthenticator.cpp -d
|
openssl aes-256-cbc -k ${tca_pass} -in .gitlab/TelemetryClassAuthenticator.cpp.enc -out tmext/TelemetryClassAuthenticator.cpp -d
|
||||||
|
|
||||||
# Check if build is not tagged
|
# Check if build is not tagged
|
||||||
if [ "${CI_COMMIT_TAG}" == "" ]; then
|
if [ "${CI_COMMIT_TAG}" == "" ]; then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
dist: trusty
|
dist: bionic
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
|
@ -27,6 +27,11 @@ matrix:
|
||||||
- QT_SELECT=qt5-x86_64-w64-mingw32
|
- QT_SELECT=qt5-x86_64-w64-mingw32
|
||||||
- RELEASE_LABEL="Windows 64-Bit Portable for gta5-mods"
|
- RELEASE_LABEL="Windows 64-Bit Portable for gta5-mods"
|
||||||
- PACKAGE_CODE=gta5-mods
|
- PACKAGE_CODE=gta5-mods
|
||||||
|
- env:
|
||||||
|
- BUILD_SCRIPT=windows_docker.sh
|
||||||
|
- QT_SELECT=qt5-x86_64-w64-mingw32
|
||||||
|
- RELEASE_LABEL="Windows 64-Bit Portable for gtainside"
|
||||||
|
- PACKAGE_CODE=gtainside
|
||||||
- env:
|
- env:
|
||||||
- BUILD_SCRIPT=wininstall_docker.sh
|
- BUILD_SCRIPT=wininstall_docker.sh
|
||||||
- QT_SELECT=qt5-x86_64-w64-mingw32
|
- QT_SELECT=qt5-x86_64-w64-mingw32
|
||||||
|
|
26
AppEnv.cpp
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2017 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,13 +22,17 @@
|
||||||
#include "StandardPaths.h"
|
#include "StandardPaths.h"
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -153,7 +157,7 @@ QString AppEnv::getPluginsFolder()
|
||||||
QByteArray AppEnv::getUserAgent()
|
QByteArray AppEnv::getUserAgent()
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050400
|
#if QT_VERSION >= 0x050400
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString kernelVersion = QSysInfo::kernelVersion();
|
QString kernelVersion = QSysInfo::kernelVersion();
|
||||||
const QStringList &kernelVersionList = kernelVersion.split(".");
|
const QStringList &kernelVersionList = kernelVersion.split(".");
|
||||||
if (kernelVersionList.length() > 2)
|
if (kernelVersionList.length() > 2)
|
||||||
|
@ -210,7 +214,7 @@ QUrl AppEnv::getPlayerFetchingUrl(QString crewID, int pageNumber)
|
||||||
|
|
||||||
GameVersion AppEnv::getGameVersion()
|
GameVersion AppEnv::getGameVersion()
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString argumentValue;
|
QString argumentValue;
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
argumentValue = "\\WOW6432Node";
|
argumentValue = "\\WOW6432Node";
|
||||||
|
@ -268,7 +272,7 @@ GameLanguage AppEnv::getGameLanguage(GameVersion gameVersion)
|
||||||
{
|
{
|
||||||
if (gameVersion == GameVersion::SocialClubVersion)
|
if (gameVersion == GameVersion::SocialClubVersion)
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString argumentValue;
|
QString argumentValue;
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
argumentValue = "\\WOW6432Node";
|
argumentValue = "\\WOW6432Node";
|
||||||
|
@ -282,7 +286,7 @@ GameLanguage AppEnv::getGameLanguage(GameVersion gameVersion)
|
||||||
}
|
}
|
||||||
else if (gameVersion == GameVersion::SteamVersion)
|
else if (gameVersion == GameVersion::SteamVersion)
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString argumentValue;
|
QString argumentValue;
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
argumentValue = "\\WOW6432Node";
|
argumentValue = "\\WOW6432Node";
|
||||||
|
@ -443,7 +447,7 @@ bool AppEnv::setGameLanguage(GameVersion gameVersion, GameLanguage gameLanguage)
|
||||||
}
|
}
|
||||||
if (socialClubVersion)
|
if (socialClubVersion)
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString argumentValue;
|
QString argumentValue;
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
argumentValue = "\\WOW6432Node";
|
argumentValue = "\\WOW6432Node";
|
||||||
|
@ -468,7 +472,7 @@ bool AppEnv::setGameLanguage(GameVersion gameVersion, GameLanguage gameLanguage)
|
||||||
}
|
}
|
||||||
if (steamVersion)
|
if (steamVersion)
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString argumentValue;
|
QString argumentValue;
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
argumentValue = "\\WOW6432Node";
|
argumentValue = "\\WOW6432Node";
|
||||||
|
@ -499,9 +503,9 @@ bool AppEnv::setGameLanguage(GameVersion gameVersion, GameLanguage gameLanguage)
|
||||||
qreal AppEnv::screenRatio()
|
qreal AppEnv::screenRatio()
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
qreal dpi = QGuiApplication::primaryScreen()->logicalDotsPerInch();
|
qreal dpi = QApplication::primaryScreen()->logicalDotsPerInch();
|
||||||
#else
|
#else
|
||||||
qreal dpi = qApp->desktop()->logicalDpiX();
|
qreal dpi = QApplication::desktop()->logicalDpiX();
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
return (dpi / 72);
|
return (dpi / 72);
|
||||||
|
@ -513,7 +517,7 @@ qreal AppEnv::screenRatio()
|
||||||
qreal AppEnv::screenRatioPR()
|
qreal AppEnv::screenRatioPR()
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
return QGuiApplication::primaryScreen()->devicePixelRatio();
|
return QApplication::primaryScreen()->devicePixelRatio();
|
||||||
#else
|
#else
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
356
CMakeLists.txt
Normal file
|
@ -0,0 +1,356 @@
|
||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
project(gta5view LANGUAGES C CXX)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
find_package(Qt5 COMPONENTS Network Svg Widgets REQUIRED)
|
||||||
|
find_package(Qt5 COMPONENTS LinguistTools QUIET)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
find_package(Qt5 COMPONENTS WinExtras REQUIRED)
|
||||||
|
list(APPEND GTA5VIEW_LIBS
|
||||||
|
Qt5::WinExtras
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DUNICODE
|
||||||
|
-D_UNICODE
|
||||||
|
-DWIN32
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_RESOURCES
|
||||||
|
res/app.rc
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_CMAKE
|
||||||
|
-DGTA5SYNC_PROJECT
|
||||||
|
-DSNAPMATIC_NODEFAULT
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GTA5VIEW_SOURCES
|
||||||
|
main.cpp
|
||||||
|
AboutDialog.cpp
|
||||||
|
AppEnv.cpp
|
||||||
|
CrewDatabase.cpp
|
||||||
|
DatabaseThread.cpp
|
||||||
|
ExportDialog.cpp
|
||||||
|
ExportThread.cpp
|
||||||
|
GlobalString.cpp
|
||||||
|
IconLoader.cpp
|
||||||
|
ImportDialog.cpp
|
||||||
|
JsonEditorDialog.cpp
|
||||||
|
MapLocationDialog.cpp
|
||||||
|
OptionsDialog.cpp
|
||||||
|
PictureDialog.cpp
|
||||||
|
PictureExport.cpp
|
||||||
|
PictureWidget.cpp
|
||||||
|
PlayerListDialog.cpp
|
||||||
|
ProfileDatabase.cpp
|
||||||
|
ProfileInterface.cpp
|
||||||
|
ProfileLoader.cpp
|
||||||
|
ProfileWidget.cpp
|
||||||
|
SavegameCopy.cpp
|
||||||
|
SavegameData.cpp
|
||||||
|
SavegameDialog.cpp
|
||||||
|
SavegameWidget.cpp
|
||||||
|
SidebarGenerator.cpp
|
||||||
|
SnapmaticEditor.cpp
|
||||||
|
SnapmaticPicture.cpp
|
||||||
|
SnapmaticWidget.cpp
|
||||||
|
StandardPaths.cpp
|
||||||
|
StringParser.cpp
|
||||||
|
TranslationClass.cpp
|
||||||
|
UserInterface.cpp
|
||||||
|
anpro/imagecropper.cpp
|
||||||
|
pcg/pcg_basic.c
|
||||||
|
uimod/JSHighlighter.cpp
|
||||||
|
uimod/UiModLabel.cpp
|
||||||
|
uimod/UiModWidget.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GTA5VIEW_HEADERS
|
||||||
|
config.h
|
||||||
|
AboutDialog.h
|
||||||
|
AppEnv.h
|
||||||
|
CrewDatabase.h
|
||||||
|
DatabaseThread.h
|
||||||
|
ExportDialog.h
|
||||||
|
ExportThread.h
|
||||||
|
GlobalString.h
|
||||||
|
IconLoader.h
|
||||||
|
ImportDialog.h
|
||||||
|
JsonEditorDialog.h
|
||||||
|
MapLocationDialog.h
|
||||||
|
OptionsDialog.h
|
||||||
|
PictureDialog.h
|
||||||
|
PictureExport.h
|
||||||
|
PictureWidget.h
|
||||||
|
PlayerListDialog.h
|
||||||
|
ProfileDatabase.h
|
||||||
|
ProfileInterface.h
|
||||||
|
ProfileLoader.h
|
||||||
|
ProfileWidget.h
|
||||||
|
SavegameCopy.h
|
||||||
|
SavegameData.h
|
||||||
|
SavegameDialog.h
|
||||||
|
SavegameWidget.h
|
||||||
|
SidebarGenerator.h
|
||||||
|
SnapmaticEditor.h
|
||||||
|
SnapmaticPicture.h
|
||||||
|
SnapmaticWidget.h
|
||||||
|
StandardPaths.h
|
||||||
|
StringParser.h
|
||||||
|
TranslationClass.h
|
||||||
|
UserInterface.h
|
||||||
|
anpro/imagecropper.h
|
||||||
|
pcg/pcg_basic.h
|
||||||
|
uimod/JSHighlighter.h
|
||||||
|
uimod/UiModLabel.h
|
||||||
|
uimod/UiModWidget.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GTA5VIEW_INCLUDEDIR
|
||||||
|
anpro
|
||||||
|
pcg
|
||||||
|
uimod
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GTA5VIEW_FORMS
|
||||||
|
AboutDialog.ui
|
||||||
|
ExportDialog.ui
|
||||||
|
ImportDialog.ui
|
||||||
|
JsonEditorDialog.ui
|
||||||
|
MapLocationDialog.ui
|
||||||
|
OptionsDialog.ui
|
||||||
|
PictureDialog.ui
|
||||||
|
PlayerListDialog.ui
|
||||||
|
ProfileInterface.ui
|
||||||
|
SavegameDialog.ui
|
||||||
|
SavegameWidget.ui
|
||||||
|
SnapmaticEditor.ui
|
||||||
|
SnapmaticWidget.ui
|
||||||
|
UserInterface.ui
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND GTA5VIEW_RESOURCES
|
||||||
|
res/app.qrc
|
||||||
|
res/global.qrc
|
||||||
|
)
|
||||||
|
set_property(SOURCE res/global.qrc PROPERTY AUTORCC_OPTIONS "-threshold;0;-compress;9")
|
||||||
|
|
||||||
|
if(Qt5LinguistTools_FOUND)
|
||||||
|
qt5_add_translation(GTA5VIEW_TRANSLATIONS
|
||||||
|
res/gta5sync_de.ts
|
||||||
|
res/gta5sync_en_US.ts
|
||||||
|
res/gta5sync_fr.ts
|
||||||
|
res/gta5sync_ko.ts
|
||||||
|
res/gta5sync_ru.ts
|
||||||
|
res/gta5sync_uk.ts
|
||||||
|
res/gta5sync_zh_TW.ts
|
||||||
|
res/qtbase_en_GB.ts
|
||||||
|
)
|
||||||
|
add_custom_target(translations DEPENDS ${GTA5VIEW_TRANSLATIONS})
|
||||||
|
else()
|
||||||
|
set(GTA5VIEW_TRANSLATIONS
|
||||||
|
res/gta5sync_de.qm
|
||||||
|
res/gta5sync_en_US.qm
|
||||||
|
res/gta5sync_fr.qm
|
||||||
|
res/gta5sync_ko.qm
|
||||||
|
res/gta5sync_ru.qm
|
||||||
|
res/gta5sync_uk.qm
|
||||||
|
res/gta5sync_zh_TW.qm
|
||||||
|
res/qtbase_en_GB.qm
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(QCONF_BUILD "System installation intended Qconf build" OFF)
|
||||||
|
if(QCONF_BUILD)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_QCONF
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
list(APPEND GTA5VIEW_RESOURCES
|
||||||
|
res/tr_g5p.qrc
|
||||||
|
res/tr_qt5.qrc
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(FLATPAK_BUILD "Flatpak modifications and identifications" OFF)
|
||||||
|
if(FLATPAK_BUILD)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_BUILDCODE=\"Flatpak\""
|
||||||
|
"-DGTA5SYNC_BUILDTYPE=\"Flatpak\""
|
||||||
|
-DGTA5SYNC_FLATPAK
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(WITH_MOTD "Developer message system directed to users" OFF)
|
||||||
|
if(WITH_MOTD)
|
||||||
|
list(APPEND GTA5VIEW_HEADERS
|
||||||
|
MessageThread.h
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_SOURCES
|
||||||
|
MessageThread.cpp
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_MOTD
|
||||||
|
)
|
||||||
|
if(MOTD_WEBURL)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_MOTD_WEBURL=\"${MOTD_WEBURL}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(WITH_TELEMETRY "Hardware survey and basic telemetry system" OFF)
|
||||||
|
if(WITH_TELEMETRY)
|
||||||
|
list(APPEND GTA5VIEW_HEADERS
|
||||||
|
TelemetryClass.h
|
||||||
|
tmext/TelemetryClassAuthenticator.h
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_SOURCES
|
||||||
|
TelemetryClass.cpp
|
||||||
|
tmext/TelemetryClassAuthenticator.cpp
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_INCLUDEDIR
|
||||||
|
tmext
|
||||||
|
)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_TELEMETRY
|
||||||
|
)
|
||||||
|
if(TELEMETRY_AUTHID AND TELEMETRY_AUTHPW AND TELEMETRY_PUSHURL AND TELEMETRY_REGURL)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_TELEMETRY_AUTHID=\"${TELEMETRY_AUTHID}\""
|
||||||
|
"-DGTA5SYNC_TELEMETRY_AUTHPW=\"${TELEMETRY_AUTHPW}\""
|
||||||
|
"-DGTA5SYNC_TELEMETRY_PUSHURL=\"${TELEMETRY_PUSHURL}\""
|
||||||
|
"-DGTA5SYNC_TELEMETRY_REGURL=\"${TELEMETRY_REGURL}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(TELEMETRY_WEBURL)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_TELEMETRY_WEBURL=\"${TELEMETRY_WEBURL}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND GTA5VIEW_LIBS
|
||||||
|
d3d9
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(GTA5VIEW_APPVER)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_APPVER=\"${GTA5VIEW_APPVER}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDCODE)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_BUILDCODE=\"${GTA5VIEW_BUILDCODE}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDTYPE)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_BUILDTYPE=\"${GTA5VIEW_BUILDTYPE}\""
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
if(GTA5VIEW_BUILDTYPE_ALPHA)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_BUILDTYPE_ALPHA
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDTYPE_BETA)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_BUILDTYPE_BETA
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDTYPE_DEV)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_BUILDTYPE_DEV
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDTYPE_DAILY)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_BUILDTYPE_DAILY
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDTYPE_RC)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_BUILDTYPE_RC
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_BUILDTYPE_REL)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
-DGTA5SYNC_BUILDTYPE_REL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_COMMIT)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_COMMIT=\"${GTA5VIEW_COMMIT}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(GTA5VIEW_INLANG)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_INLANG=\"${GTA5VIEW_INLANG}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_LANG)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_LANG=\"${GTA5VIEW_LANG}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GTA5VIEW_PLUG)
|
||||||
|
list(APPEND GTA5VIEW_DEFINES
|
||||||
|
"-DGTA5SYNC_PLUG=\"${GTA5VIEW_PLUG}\""
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(gta5view
|
||||||
|
WIN32 MACOSX_BUNDLE
|
||||||
|
${GTA5VIEW_HEADERS}
|
||||||
|
${GTA5VIEW_SOURCES}
|
||||||
|
${GTA5VIEW_FORMS}
|
||||||
|
${GTA5VIEW_RESOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(Qt5LinguistTools_FOUND AND QCONF_BUILD)
|
||||||
|
add_dependencies(gta5view translations)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16.0")
|
||||||
|
target_precompile_headers(gta5view PRIVATE config.h)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(Qt5Core_VERSION VERSION_GREATER_EQUAL "5.14.0")
|
||||||
|
qt5_import_plugins(gta5view INCLUDE Qt5::QSvgPlugin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_compile_definitions(gta5view PRIVATE ${GTA5VIEW_DEFINES})
|
||||||
|
target_include_directories(gta5view PRIVATE ${GTA5VIEW_INCLUDEDIR})
|
||||||
|
target_link_libraries(gta5view PRIVATE Qt5::Network Qt5::Svg Qt5::Widgets ${GTA5VIEW_LIBS})
|
||||||
|
|
||||||
|
install(TARGETS gta5view DESTINATION bin)
|
||||||
|
install(FILES res/de.syping.gta5view.desktop DESTINATION share/applications)
|
||||||
|
install(FILES res/de.syping.gta5view.metainfo.xml DESTINATION share/metainfo)
|
||||||
|
install(FILES res/gta5view-16.png DESTINATION share/icons/hicolor/16x16/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-24.png DESTINATION share/icons/hicolor/24x24/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-32.png DESTINATION share/icons/hicolor/32x32/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-48.png DESTINATION share/icons/hicolor/48x48/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-64.png DESTINATION share/icons/hicolor/64x64/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-96.png DESTINATION share/icons/hicolor/96x96/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-128.png DESTINATION share/icons/hicolor/128x128/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-256.png DESTINATION share/icons/hicolor/256x256/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/gta5view-512.png DESTINATION share/icons/hicolor/512x512/apps RENAME de.syping.gta5view.png)
|
||||||
|
install(FILES res/de.syping.gta5view.png DESTINATION share/pixmaps)
|
||||||
|
if(QCONF_BUILD)
|
||||||
|
install(FILES ${GTA5VIEW_TRANSLATIONS} DESTINATION share/gta5view/translations)
|
||||||
|
endif()
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2017 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -48,11 +48,8 @@ void DatabaseThread::run()
|
||||||
|
|
||||||
while (threadRunning)
|
while (threadRunning)
|
||||||
{
|
{
|
||||||
if (threadRunning)
|
QTimer::singleShot(300000, &threadLoop, SLOT(quit()));
|
||||||
{
|
threadLoop.exec();
|
||||||
QTimer::singleShot(300000, &threadLoop, SLOT(quit()));
|
|
||||||
threadLoop.exec();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +62,9 @@ void DatabaseThread::scanCrewReference(const QStringList &crewList, const int &r
|
||||||
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
||||||
QNetworkRequest netRequest(AppEnv::getCrewFetchingUrl(crewID));
|
QNetworkRequest netRequest(AppEnv::getCrewFetchingUrl(crewID));
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
||||||
netRequest.setRawHeader("Accept", "text/html");
|
netRequest.setRawHeader("Accept", "text/html");
|
||||||
|
@ -138,7 +137,9 @@ void DatabaseThread::scanCrewMembersList(const QStringList &crewList, const int
|
||||||
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
||||||
QNetworkRequest netRequest(AppEnv::getPlayerFetchingUrl(crewID, currentPage));
|
QNetworkRequest netRequest(AppEnv::getPlayerFetchingUrl(crewID, currentPage));
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
||||||
netRequest.setRawHeader("Accept", "application/json");
|
netRequest.setRawHeader("Accept", "application/json");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2017 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,14 +22,19 @@
|
||||||
#include "ProfileWidget.h"
|
#include "ProfileWidget.h"
|
||||||
#include "ExportThread.h"
|
#include "ExportThread.h"
|
||||||
#include "SavegameData.h"
|
#include "SavegameData.h"
|
||||||
|
#include "AppEnv.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDebug>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <QScreen>
|
||||||
|
#else
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
ExportThread::ExportThread(QMap<ProfileWidget*,QString> profileMap, QString exportDirectory, bool pictureCopyEnabled, bool pictureExportEnabled, int exportCount, QObject *parent) : QThread(parent),
|
ExportThread::ExportThread(QMap<ProfileWidget*,QString> profileMap, QString exportDirectory, bool pictureCopyEnabled, bool pictureExportEnabled, int exportCount, QObject *parent) : QThread(parent),
|
||||||
profileMap(profileMap), exportDirectory(exportDirectory), pictureCopyEnabled(pictureCopyEnabled), pictureExportEnabled(pictureExportEnabled), exportCount(exportCount)
|
profileMap(profileMap), exportDirectory(exportDirectory), pictureCopyEnabled(pictureCopyEnabled), pictureExportEnabled(pictureExportEnabled), exportCount(exportCount)
|
||||||
{
|
{
|
||||||
|
@ -101,8 +106,17 @@ void ExportThread::run()
|
||||||
QImage exportPicture = picture->getImage();
|
QImage exportPicture = picture->getImage();
|
||||||
if (sizeMode == "Desktop")
|
if (sizeMode == "Desktop")
|
||||||
{
|
{
|
||||||
QRect desktopResolution = qApp->desktop()->screenGeometry();
|
#if QT_VERSION >= 0x050000
|
||||||
exportPicture = exportPicture.scaled(desktopResolution.width(), desktopResolution.height(), aspectRatio, Qt::SmoothTransformation);
|
qreal screenRatioPR = AppEnv::screenRatioPR();
|
||||||
|
QRect desktopResolution = QApplication::primaryScreen()->geometry();
|
||||||
|
int desktopSizeWidth = qRound((double)desktopResolution.width() * screenRatioPR);
|
||||||
|
int desktopSizeHeight = qRound((double)desktopResolution.height() * screenRatioPR);
|
||||||
|
#else
|
||||||
|
QRect desktopResolution = QApplication::desktop()->screenGeometry();
|
||||||
|
int desktopSizeWidth = desktopResolution.width();
|
||||||
|
int desktopSizeHeight = desktopResolution.height();
|
||||||
|
#endif
|
||||||
|
exportPicture = exportPicture.scaled(desktopSizeWidth, desktopSizeHeight, aspectRatio, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
else if (sizeMode == "Custom")
|
else if (sizeMode == "Custom")
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2018 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -35,9 +35,11 @@ QMap<QString, QString> GlobalString::getGlobalMap()
|
||||||
{
|
{
|
||||||
QMap<QString, QString> globalMap;
|
QMap<QString, QString> globalMap;
|
||||||
QSettings globalFile(getLanguageFile(), QSettings::IniFormat);
|
QSettings globalFile(getLanguageFile(), QSettings::IniFormat);
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
globalFile.setIniCodec("UTF-8");
|
globalFile.setIniCodec("UTF-8");
|
||||||
|
#endif
|
||||||
globalFile.beginGroup("Global");
|
globalFile.beginGroup("Global");
|
||||||
for (QString globalStr : globalFile.childKeys())
|
for (const QString &globalStr : globalFile.childKeys())
|
||||||
{
|
{
|
||||||
globalMap[globalStr] = globalFile.value(globalStr, globalStr).toString();
|
globalMap[globalStr] = globalFile.value(globalStr, globalStr).toString();
|
||||||
}
|
}
|
||||||
|
@ -49,7 +51,9 @@ QString GlobalString::getString(QString valueStr, bool *ok)
|
||||||
{
|
{
|
||||||
QString globalString = valueStr;
|
QString globalString = valueStr;
|
||||||
QSettings globalFile(getLanguageFile(), QSettings::IniFormat);
|
QSettings globalFile(getLanguageFile(), QSettings::IniFormat);
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
globalFile.setIniCodec("UTF-8");
|
globalFile.setIniCodec("UTF-8");
|
||||||
|
#endif
|
||||||
globalFile.beginGroup("Global");
|
globalFile.beginGroup("Global");
|
||||||
QStringList globalStrList = globalFile.childKeys();
|
QStringList globalStrList = globalFile.childKeys();
|
||||||
if (globalStrList.contains(valueStr))
|
if (globalStrList.contains(valueStr))
|
||||||
|
|
|
@ -27,15 +27,15 @@ IconLoader::IconLoader()
|
||||||
QIcon IconLoader::loadingAppIcon()
|
QIcon IconLoader::loadingAppIcon()
|
||||||
{
|
{
|
||||||
QIcon appIcon;
|
QIcon appIcon;
|
||||||
appIcon.addFile(":/img/5sync-16.png", QSize(16, 16));
|
appIcon.addFile(":/img/gta5view-16.png", QSize(16, 16));
|
||||||
appIcon.addFile(":/img/5sync-24.png", QSize(24, 24));
|
appIcon.addFile(":/img/gta5view-24.png", QSize(24, 24));
|
||||||
appIcon.addFile(":/img/5sync-32.png", QSize(32, 32));
|
appIcon.addFile(":/img/gta5view-32.png", QSize(32, 32));
|
||||||
appIcon.addFile(":/img/5sync-40.png", QSize(40, 40));
|
appIcon.addFile(":/img/gta5view-40.png", QSize(40, 40));
|
||||||
appIcon.addFile(":/img/5sync-48.png", QSize(48, 48));
|
appIcon.addFile(":/img/gta5view-48.png", QSize(48, 48));
|
||||||
appIcon.addFile(":/img/5sync-64.png", QSize(64, 64));
|
appIcon.addFile(":/img/gta5view-64.png", QSize(64, 64));
|
||||||
appIcon.addFile(":/img/5sync-96.png", QSize(96, 96));
|
appIcon.addFile(":/img/gta5view-96.png", QSize(96, 96));
|
||||||
appIcon.addFile(":/img/5sync-128.png", QSize(128, 128));
|
appIcon.addFile(":/img/gta5view-128.png", QSize(128, 128));
|
||||||
appIcon.addFile(":/img/5sync-256.png", QSize(256, 256));
|
appIcon.addFile(":/img/gta5view-256.png", QSize(256, 256));
|
||||||
return appIcon;
|
return appIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,205 +0,0 @@
|
||||||
/*****************************************************************************
|
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
|
||||||
* Copyright (C) 2017-2018 Syping
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* 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 General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
#include "ImageEditorDialog.h"
|
|
||||||
#include "ui_ImageEditorDialog.h"
|
|
||||||
#include "ProfileInterface.h"
|
|
||||||
#include "SidebarGenerator.h"
|
|
||||||
#include "StandardPaths.h"
|
|
||||||
#include "ImportDialog.h"
|
|
||||||
#include "AppEnv.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include <QStringBuilder>
|
|
||||||
#include <QImageReader>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
ImageEditorDialog::ImageEditorDialog(SnapmaticPicture *picture, QString profileName, QWidget *parent) :
|
|
||||||
QDialog(parent), smpic(picture), profileName(profileName),
|
|
||||||
ui(new Ui::ImageEditorDialog)
|
|
||||||
{
|
|
||||||
// Set Window Flags
|
|
||||||
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->cmdClose->setDefault(true);
|
|
||||||
ui->cmdClose->setFocus();
|
|
||||||
|
|
||||||
// Set Icon for Close Button
|
|
||||||
if (QIcon::hasThemeIcon("dialog-close"))
|
|
||||||
{
|
|
||||||
ui->cmdClose->setIcon(QIcon::fromTheme("dialog-close"));
|
|
||||||
}
|
|
||||||
else if (QIcon::hasThemeIcon("gtk-close"))
|
|
||||||
{
|
|
||||||
ui->cmdClose->setIcon(QIcon::fromTheme("gtk-close"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set Icon for Import Button
|
|
||||||
if (QIcon::hasThemeIcon("document-import"))
|
|
||||||
{
|
|
||||||
ui->cmdReplace->setIcon(QIcon::fromTheme("document-import"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set Icon for Overwrite Button
|
|
||||||
if (QIcon::hasThemeIcon("document-save"))
|
|
||||||
{
|
|
||||||
ui->cmdSave->setIcon(QIcon::fromTheme("document-save"));
|
|
||||||
}
|
|
||||||
else if (QIcon::hasThemeIcon("gtk-save"))
|
|
||||||
{
|
|
||||||
ui->cmdSave->setIcon(QIcon::fromTheme("gtk-save"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// DPI calculation
|
|
||||||
qreal screenRatio = AppEnv::screenRatio();
|
|
||||||
|
|
||||||
snapmaticResolutionLW = 516 * screenRatio; // 430
|
|
||||||
snapmaticResolutionLH = 288 * screenRatio; // 240
|
|
||||||
ui->labPicture->setMinimumSize(snapmaticResolutionLW, snapmaticResolutionLH);
|
|
||||||
|
|
||||||
imageIsChanged = false;
|
|
||||||
pictureCache = picture->getImage();
|
|
||||||
ui->labPicture->setPixmap(QPixmap::fromImage(pictureCache).scaled(snapmaticResolutionLW, snapmaticResolutionLH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
|
||||||
|
|
||||||
setMaximumSize(sizeHint());
|
|
||||||
setMinimumSize(sizeHint());
|
|
||||||
setFixedSize(sizeHint());
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageEditorDialog::~ImageEditorDialog()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageEditorDialog::on_cmdClose_clicked()
|
|
||||||
{
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageEditorDialog::on_cmdReplace_clicked()
|
|
||||||
{
|
|
||||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
|
||||||
settings.beginGroup("FileDialogs");
|
|
||||||
bool dontUseNativeDialog = settings.value("DontUseNativeDialog", false).toBool();
|
|
||||||
settings.beginGroup("ImportReplace");
|
|
||||||
|
|
||||||
fileDialogPreOpen: //Work?
|
|
||||||
QFileDialog fileDialog(this);
|
|
||||||
fileDialog.setFileMode(QFileDialog::ExistingFile);
|
|
||||||
fileDialog.setViewMode(QFileDialog::Detail);
|
|
||||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
|
||||||
fileDialog.setOption(QFileDialog::DontUseNativeDialog, dontUseNativeDialog);
|
|
||||||
fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint);
|
|
||||||
fileDialog.setWindowTitle(ProfileInterface::tr("Import..."));
|
|
||||||
fileDialog.setLabelText(QFileDialog::Accept, ProfileInterface::tr("Import"));
|
|
||||||
|
|
||||||
// Getting readable Image formats
|
|
||||||
QString imageFormatsStr = " ";
|
|
||||||
for (QByteArray imageFormat : QImageReader::supportedImageFormats())
|
|
||||||
{
|
|
||||||
imageFormatsStr += QString("*.") % QString::fromUtf8(imageFormat).toLower() % " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList filters;
|
|
||||||
filters << ProfileInterface::tr("All image files (%1)").arg(imageFormatsStr.trimmed());
|
|
||||||
filters << ProfileInterface::tr("All files (**)");
|
|
||||||
fileDialog.setNameFilters(filters);
|
|
||||||
|
|
||||||
QList<QUrl> sidebarUrls = SidebarGenerator::generateSidebarUrls(fileDialog.sidebarUrls());
|
|
||||||
|
|
||||||
fileDialog.setSidebarUrls(sidebarUrls);
|
|
||||||
fileDialog.setDirectory(settings.value(profileName % "+Directory", StandardPaths::documentsLocation()).toString());
|
|
||||||
fileDialog.restoreGeometry(settings.value(profileName % "+Geometry", "").toByteArray());
|
|
||||||
|
|
||||||
if (fileDialog.exec())
|
|
||||||
{
|
|
||||||
QStringList selectedFiles = fileDialog.selectedFiles();
|
|
||||||
if (selectedFiles.length() == 1)
|
|
||||||
{
|
|
||||||
QString selectedFile = selectedFiles.at(0);
|
|
||||||
QString selectedFileName = QFileInfo(selectedFile).fileName();
|
|
||||||
|
|
||||||
QFile snapmaticFile(selectedFile);
|
|
||||||
if (!snapmaticFile.open(QFile::ReadOnly))
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, ProfileInterface::tr("Import"), ProfileInterface::tr("Can't import %1 because file can't be open").arg("\""+selectedFileName+"\""));
|
|
||||||
goto fileDialogPreOpen;
|
|
||||||
}
|
|
||||||
QImage *importImage = new QImage();
|
|
||||||
QImageReader snapmaticImageReader;
|
|
||||||
snapmaticImageReader.setDecideFormatFromContent(true);
|
|
||||||
snapmaticImageReader.setDevice(&snapmaticFile);
|
|
||||||
if (!snapmaticImageReader.read(importImage))
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, ProfileInterface::tr("Import"), ProfileInterface::tr("Can't import %1 because file can't be parsed properly").arg("\""+selectedFileName+"\""));
|
|
||||||
delete importImage;
|
|
||||||
goto fileDialogPreOpen;
|
|
||||||
}
|
|
||||||
ImportDialog *importDialog = new ImportDialog(profileName, this);
|
|
||||||
importDialog->setImage(importImage);
|
|
||||||
importDialog->setModal(true);
|
|
||||||
importDialog->show();
|
|
||||||
importDialog->exec();
|
|
||||||
if (importDialog->isImportAgreed())
|
|
||||||
{
|
|
||||||
pictureCache = importDialog->image();
|
|
||||||
ui->labPicture->setPixmap(QPixmap::fromImage(pictureCache).scaled(snapmaticResolutionLW, snapmaticResolutionLH, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
|
||||||
imageIsChanged = true;
|
|
||||||
}
|
|
||||||
delete importDialog;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
settings.setValue(profileName % "+Geometry", fileDialog.saveGeometry());
|
|
||||||
settings.setValue(profileName % "+Directory", fileDialog.directory().absolutePath());
|
|
||||||
settings.endGroup();
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageEditorDialog::on_cmdSave_clicked()
|
|
||||||
{
|
|
||||||
if (imageIsChanged)
|
|
||||||
{
|
|
||||||
const QByteArray previousPicture = smpic->getPictureStream();
|
|
||||||
bool success = smpic->setImage(pictureCache);
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
QString currentFilePath = smpic->getPictureFilePath();
|
|
||||||
QString originalFilePath = smpic->getOriginalPictureFilePath();
|
|
||||||
QString backupFileName = originalFilePath % ".bak";
|
|
||||||
if (!QFile::exists(backupFileName))
|
|
||||||
{
|
|
||||||
QFile::copy(currentFilePath, backupFileName);
|
|
||||||
}
|
|
||||||
if (!smpic->exportPicture(currentFilePath))
|
|
||||||
{
|
|
||||||
smpic->setPictureStream(previousPicture);
|
|
||||||
QMessageBox::warning(this, tr("Snapmatic Image Editor"), tr("Patching of Snapmatic Image failed because of I/O Error"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
smpic->emitCustomSignal("PictureUpdated");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("Snapmatic Image Editor"), tr("Patching of Snapmatic Image failed because of Image Error"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close();
|
|
||||||
}
|
|
|
@ -1,108 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ImageEditorDialog</class>
|
|
||||||
<widget class="QDialog" name="ImageEditorDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>516</width>
|
|
||||||
<height>337</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Overwrite Image...</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="vlInterface">
|
|
||||||
<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="QLabel" name="labPicture">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>516</width>
|
|
||||||
<height>288</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="buttomFrame">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="vlButtons">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="hlButtons">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="cmdReplace">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Import picture</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Import...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="hsButtons">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="cmdSave">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Apply changes</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Overwrite</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="cmdClose">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Discard changes</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Close</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2017-2019 Syping
|
* Copyright (C) 2017-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -374,7 +374,7 @@ void ImportDialog::cropPicture()
|
||||||
#endif
|
#endif
|
||||||
imageCropper.setBackgroundColor(Qt::black);
|
imageCropper.setBackgroundColor(Qt::black);
|
||||||
imageCropper.setCroppingRectBorderColor(QColor(255, 255, 255, 127));
|
imageCropper.setCroppingRectBorderColor(QColor(255, 255, 255, 127));
|
||||||
imageCropper.setImage(QPixmap::fromImage(workImage, Qt::AutoColor));
|
imageCropper.setImage(QPixmap::fromImage(origImage, Qt::AutoColor));
|
||||||
imageCropper.setProportion(QSize(1, 1));
|
imageCropper.setProportion(QSize(1, 1));
|
||||||
imageCropper.setFixedSize(workImage.size());
|
imageCropper.setFixedSize(workImage.size());
|
||||||
cropLayout.addWidget(&imageCropper);
|
cropLayout.addWidget(&imageCropper);
|
||||||
|
@ -575,6 +575,7 @@ QImage ImportDialog::image()
|
||||||
|
|
||||||
void ImportDialog::setImage(QImage *image_)
|
void ImportDialog::setImage(QImage *image_)
|
||||||
{
|
{
|
||||||
|
origImage = *image_;
|
||||||
workImage = QImage();
|
workImage = QImage();
|
||||||
if (image_->width() == image_->height())
|
if (image_->width() == image_->height())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2017 Syping
|
* Copyright (C) 2017-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -67,6 +67,7 @@ private:
|
||||||
QString imageTitle;
|
QString imageTitle;
|
||||||
QImage backImage;
|
QImage backImage;
|
||||||
QImage workImage;
|
QImage workImage;
|
||||||
|
QImage origImage;
|
||||||
QImage newImage;
|
QImage newImage;
|
||||||
QColor selectedColour;
|
QColor selectedColour;
|
||||||
QMenu *optionsMenu;
|
QMenu *optionsMenu;
|
||||||
|
|
|
@ -70,9 +70,18 @@ JsonEditorDialog::JsonEditorDialog(SnapmaticPicture *picture, QWidget *parent) :
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
ui->txtJSON->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
ui->txtJSON->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||||
|
#else
|
||||||
|
QFont jsonFont = ui->txtJSON->font();
|
||||||
|
jsonFont.setStyleHint(QFont::Monospace);
|
||||||
|
jsonFont.setFixedPitch(true);
|
||||||
|
ui->txtJSON->setFont(jsonFont);
|
||||||
#endif
|
#endif
|
||||||
QFontMetrics fontMetrics(ui->txtJSON->font());
|
QFontMetrics fontMetrics(ui->txtJSON->font());
|
||||||
|
#if QT_VERSION >= 0x050B00
|
||||||
|
ui->txtJSON->setTabStopDistance(fontMetrics.horizontalAdvance(" "));
|
||||||
|
#else
|
||||||
ui->txtJSON->setTabStopWidth(fontMetrics.width(" "));
|
ui->txtJSON->setTabStopWidth(fontMetrics.width(" "));
|
||||||
|
#endif
|
||||||
|
|
||||||
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonCode.toUtf8());
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonCode.toUtf8());
|
||||||
ui->txtJSON->setStyleSheet("QPlainTextEdit{background-color: rgb(46, 47, 48); color: rgb(238, 231, 172);}");
|
ui->txtJSON->setStyleSheet("QPlainTextEdit{background-color: rgb(46, 47, 48); color: rgb(238, 231, 172);}");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2017-2019 Syping
|
* Copyright (C) 2017-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -60,40 +60,10 @@ MapLocationDialog::~MapLocationDialog()
|
||||||
|
|
||||||
void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d)
|
void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d)
|
||||||
{
|
{
|
||||||
qreal screenRatio = AppEnv::screenRatio();
|
ui->labPos->setText(tr("X: %1\nY: %2", "X and Y position").arg(QString::number(xpos_d), QString::number(ypos_d)));
|
||||||
qreal screenRatioPR = AppEnv::screenRatioPR();
|
|
||||||
int pointMakerSize = 8 * screenRatio * screenRatioPR;
|
|
||||||
QPixmap pointMakerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMakerSize, pointMakerSize));
|
|
||||||
QSize mapPixelSize = QSize(width() * screenRatioPR, height() * screenRatioPR);
|
|
||||||
|
|
||||||
int pointMakerHalfSize = pointMakerSize / 2;
|
|
||||||
long xpos_ms = qRound(xpos_d);
|
|
||||||
long ypos_ms = qRound(ypos_d);
|
|
||||||
double xpos_ma = xpos_ms + 4000;
|
|
||||||
double ypos_ma = ypos_ms + 4000;
|
|
||||||
double xrat = (double)mapPixelSize.width() / 10000;
|
|
||||||
double yrat = (double)mapPixelSize.height() / 12000;
|
|
||||||
long xpos_mp = qRound(xpos_ma * xrat);
|
|
||||||
long ypos_mp = qRound(ypos_ma * yrat);
|
|
||||||
long xpos_pr = xpos_mp - pointMakerHalfSize;
|
|
||||||
long ypos_pr = ypos_mp + pointMakerHalfSize;
|
|
||||||
|
|
||||||
QPixmap mapPixmap(mapPixelSize);
|
|
||||||
QPainter mapPainter(&mapPixmap);
|
|
||||||
mapPainter.drawPixmap(0, 0, mapPixelSize.width(), mapPixelSize.height(), QPixmap(":/img/mappreview.jpg").scaled(mapPixelSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
|
||||||
mapPainter.drawPixmap(xpos_pr, mapPixelSize.height() - ypos_pr, pointMakerSize, pointMakerSize, pointMakerPixmap);
|
|
||||||
mapPainter.end();
|
|
||||||
#if QT_VERSION >= 0x050600
|
|
||||||
mapPixmap.setDevicePixelRatio(screenRatioPR);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QPalette backgroundPalette;
|
|
||||||
backgroundPalette.setBrush(backgroundRole(), QBrush(mapPixmap));
|
|
||||||
setPalette(backgroundPalette);
|
|
||||||
|
|
||||||
xpos_new = xpos_d;
|
xpos_new = xpos_d;
|
||||||
ypos_new = ypos_d;
|
ypos_new = ypos_d;
|
||||||
ui->labPos->setText(tr("X: %1\nY: %2", "X and Y position").arg(QString::number(xpos_d), QString::number(ypos_d)));
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapLocationDialog::on_cmdChange_clicked()
|
void MapLocationDialog::on_cmdChange_clicked()
|
||||||
|
@ -125,6 +95,21 @@ void MapLocationDialog::on_cmdDone_clicked()
|
||||||
changeMode = false;
|
changeMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
void MapLocationDialog::updatePosFromEvent(double x, double y)
|
||||||
|
{
|
||||||
|
QSize mapPixelSize = size();
|
||||||
|
double xpos_ad = x;
|
||||||
|
double ypos_ad = mapPixelSize.height() - y;
|
||||||
|
double xrat = 10000 / (double)mapPixelSize.width();
|
||||||
|
double yrat = 12000 / (double)mapPixelSize.height();
|
||||||
|
double xpos_rv = xrat * xpos_ad;
|
||||||
|
double ypos_rv = yrat * ypos_ad;
|
||||||
|
double xpos_fp = xpos_rv - 4000;
|
||||||
|
double ypos_fp = ypos_rv - 4000;
|
||||||
|
drawPointOnMap(xpos_fp, ypos_fp);
|
||||||
|
}
|
||||||
|
#else
|
||||||
void MapLocationDialog::updatePosFromEvent(int x, int y)
|
void MapLocationDialog::updatePosFromEvent(int x, int y)
|
||||||
{
|
{
|
||||||
QSize mapPixelSize = size();
|
QSize mapPixelSize = size();
|
||||||
|
@ -138,13 +123,60 @@ void MapLocationDialog::updatePosFromEvent(int x, int y)
|
||||||
double ypos_fp = ypos_rv - 4000;
|
double ypos_fp = ypos_rv - 4000;
|
||||||
drawPointOnMap(xpos_fp, ypos_fp);
|
drawPointOnMap(xpos_fp, ypos_fp);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void MapLocationDialog::paintEvent(QPaintEvent *ev)
|
||||||
|
{
|
||||||
|
QPainter painter(this);
|
||||||
|
qreal screenRatio = AppEnv::screenRatio();
|
||||||
|
qreal screenRatioPR = AppEnv::screenRatioPR();
|
||||||
|
|
||||||
|
// Paint Map
|
||||||
|
QSize mapPixelSize = QSize(width() * screenRatioPR, height() * screenRatioPR);
|
||||||
|
painter.drawPixmap(0, 0, width(), height(), QPixmap(":/img/mappreview.jpg").scaled(mapPixelSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||||
|
|
||||||
|
// Paint Marker
|
||||||
|
int pointMarkerSize = 8 * screenRatio;
|
||||||
|
int pointMarkerHalfSize = pointMarkerSize / 2;
|
||||||
|
long xpos_ms = qRound(xpos_new);
|
||||||
|
long ypos_ms = qRound(ypos_new);
|
||||||
|
double xpos_ma = xpos_ms + 4000;
|
||||||
|
double ypos_ma = ypos_ms + 4000;
|
||||||
|
double xrat = (double)width() / 10000;
|
||||||
|
double yrat = (double)height() / 12000;
|
||||||
|
long xpos_mp = qRound(xpos_ma * xrat);
|
||||||
|
long ypos_mp = qRound(ypos_ma * yrat);
|
||||||
|
long xpos_pr;
|
||||||
|
long ypos_pr;
|
||||||
|
if (screenRatioPR != 1) {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
xpos_pr = xpos_mp - pointMarkerHalfSize;
|
||||||
|
ypos_pr = ypos_mp + pointMarkerHalfSize;
|
||||||
|
#else
|
||||||
|
xpos_pr = xpos_mp - pointMarkerHalfSize + screenRatioPR;
|
||||||
|
ypos_pr = ypos_mp + pointMarkerHalfSize - screenRatioPR;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xpos_pr = xpos_mp - pointMarkerHalfSize;
|
||||||
|
ypos_pr = ypos_mp + pointMarkerHalfSize;
|
||||||
|
}
|
||||||
|
QPixmap mapMarkerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMarkerSize, pointMarkerSize));
|
||||||
|
painter.drawPixmap(xpos_pr, height() - ypos_pr, pointMarkerSize, pointMarkerSize, mapMarkerPixmap);
|
||||||
|
|
||||||
|
QDialog::paintEvent(ev);
|
||||||
|
}
|
||||||
|
|
||||||
void MapLocationDialog::mouseMoveEvent(QMouseEvent *ev)
|
void MapLocationDialog::mouseMoveEvent(QMouseEvent *ev)
|
||||||
{
|
{
|
||||||
if (!changeMode) { ev->ignore(); }
|
if (!changeMode) { ev->ignore(); }
|
||||||
else if (ev->buttons() & Qt::LeftButton)
|
else if (ev->buttons() & Qt::LeftButton)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
updatePosFromEvent(ev->position().x(), ev->position().y());
|
||||||
|
#else
|
||||||
updatePosFromEvent(ev->x(), ev->y());
|
updatePosFromEvent(ev->x(), ev->y());
|
||||||
|
#endif
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -158,7 +190,11 @@ void MapLocationDialog::mouseReleaseEvent(QMouseEvent *ev)
|
||||||
if (!changeMode) { ev->ignore(); }
|
if (!changeMode) { ev->ignore(); }
|
||||||
else if (ev->button() == Qt::LeftButton)
|
else if (ev->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
updatePosFromEvent(ev->position().x(), ev->position().y());
|
||||||
|
#else
|
||||||
updatePosFromEvent(ev->x(), ev->y());
|
updatePosFromEvent(ev->x(), ev->y());
|
||||||
|
#endif
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
~MapLocationDialog();
|
~MapLocationDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void paintEvent(QPaintEvent *ev);
|
||||||
void mouseMoveEvent(QMouseEvent *ev);
|
void mouseMoveEvent(QMouseEvent *ev);
|
||||||
void mouseReleaseEvent(QMouseEvent *ev);
|
void mouseReleaseEvent(QMouseEvent *ev);
|
||||||
|
|
||||||
|
@ -47,7 +48,11 @@ private slots:
|
||||||
void on_cmdApply_clicked();
|
void on_cmdApply_clicked();
|
||||||
void on_cmdChange_clicked();
|
void on_cmdChange_clicked();
|
||||||
void on_cmdRevert_clicked();
|
void on_cmdRevert_clicked();
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
void updatePosFromEvent(double x, double y);
|
||||||
|
#else
|
||||||
void updatePosFromEvent(int x, int y);
|
void updatePosFromEvent(int x, int y);
|
||||||
|
#endif
|
||||||
void on_cmdClose_clicked();
|
void on_cmdClose_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -25,6 +25,11 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Snapmatic Map Viewer</string>
|
<string>Snapmatic Map Viewer</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QDialog#MapLocationDialog {
|
||||||
|
background-color: transparent;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="vlMapPreview">
|
<layout class="QVBoxLayout" name="vlMapPreview">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
|
111
MessageThread.cpp
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
/*****************************************************************************
|
||||||
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
|
* Copyright (C) 2020 Syping
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include "TranslationClass.h"
|
||||||
|
#include "MessageThread.h"
|
||||||
|
#include "AppEnv.h"
|
||||||
|
#include "config.h"
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QEventLoop>
|
||||||
|
#include <QUrlQuery>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
MessageThread::MessageThread(uint cacheId, QObject *parent) : QThread(parent), cacheId(cacheId)
|
||||||
|
{
|
||||||
|
threadRunning = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageThread::run()
|
||||||
|
{
|
||||||
|
QEventLoop threadLoop;
|
||||||
|
|
||||||
|
QObject::connect(this, SIGNAL(threadTerminated()), &threadLoop, SLOT(quit()));
|
||||||
|
|
||||||
|
while (threadRunning) {
|
||||||
|
{
|
||||||
|
#ifdef GTA5SYNC_MOTD_WEBURL
|
||||||
|
QUrl motdWebUrl = QUrl(GTA5SYNC_MOTD_WEBURL);
|
||||||
|
#else
|
||||||
|
QUrl motdWebUrl = QUrl("https://motd.syping.de/gta5view-dev/");
|
||||||
|
#endif
|
||||||
|
QUrlQuery urlQuery(motdWebUrl);
|
||||||
|
urlQuery.addQueryItem("code", GTA5SYNC_BUILDCODE);
|
||||||
|
urlQuery.addQueryItem("cacheid", QString::number(cacheId));
|
||||||
|
urlQuery.addQueryItem("lang", Translator->getCurrentLanguage());
|
||||||
|
urlQuery.addQueryItem("version", GTA5SYNC_APPVER);
|
||||||
|
motdWebUrl.setQuery(urlQuery);
|
||||||
|
|
||||||
|
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
||||||
|
QNetworkRequest netRequest(motdWebUrl);
|
||||||
|
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
||||||
|
QNetworkReply *netReply = netManager->get(netRequest);
|
||||||
|
|
||||||
|
QEventLoop downloadLoop;
|
||||||
|
QObject::connect(netManager, SIGNAL(finished(QNetworkReply*)), &downloadLoop, SLOT(quit()));
|
||||||
|
QObject::connect(this, SIGNAL(threadTerminated()), &threadLoop, SLOT(quit()));
|
||||||
|
QTimer::singleShot(60000, &downloadLoop, SLOT(quit()));
|
||||||
|
downloadLoop.exec();
|
||||||
|
|
||||||
|
if (netReply->isFinished()) {
|
||||||
|
QByteArray jsonContent = netReply->readAll();
|
||||||
|
QString headerData = QString::fromUtf8(netReply->rawHeader("gta5view"));
|
||||||
|
if (!headerData.isEmpty()) {
|
||||||
|
QMap<QString,QString> headerMap;
|
||||||
|
const QStringList headerVarList = headerData.split(';');
|
||||||
|
for (QString headerVar : headerVarList) {
|
||||||
|
QStringList varValueList = headerVar.split('=');
|
||||||
|
if (varValueList.length() >= 2) {
|
||||||
|
const QString variable = varValueList.at(0).trimmed();
|
||||||
|
varValueList.removeFirst();
|
||||||
|
const QString value = varValueList.join('=');
|
||||||
|
headerMap.insert(variable, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (headerMap.value("update", "false") == "true") {
|
||||||
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonContent);
|
||||||
|
emit messagesArrived(jsonDocument.object());
|
||||||
|
}
|
||||||
|
if (headerMap.contains("cache")) {
|
||||||
|
bool uintOk;
|
||||||
|
uint cacheVal = headerMap.value("cache").toUInt(&uintOk);
|
||||||
|
if (uintOk) {
|
||||||
|
cacheId = cacheVal;
|
||||||
|
emit updateCacheId(cacheId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete netReply;
|
||||||
|
delete netManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTimer::singleShot(300000, &threadLoop, SLOT(quit()));
|
||||||
|
threadLoop.exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageThread::terminateThread()
|
||||||
|
{
|
||||||
|
threadRunning = false;
|
||||||
|
emit threadTerminated();
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2017 Syping
|
* Copyright (C) 2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,37 +16,33 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef IMAGEEDITORDIALOG_H
|
#ifndef MESSAGETHREAD_H
|
||||||
#define IMAGEEDITORDIALOG_H
|
#define MESSAGETHREAD_H
|
||||||
|
|
||||||
#include "SnapmaticPicture.h"
|
#include <QJsonObject>
|
||||||
#include <QDialog>
|
#include <QObject>
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
namespace Ui {
|
class MessageThread : public QThread
|
||||||
class ImageEditorDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ImageEditorDialog : public QDialog
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ImageEditorDialog(SnapmaticPicture *picture, QString profileName, QWidget *parent = 0);
|
explicit MessageThread(uint cacheId, QObject *parent = 0);
|
||||||
~ImageEditorDialog();
|
|
||||||
|
|
||||||
private slots:
|
public slots:
|
||||||
void on_cmdClose_clicked();
|
void terminateThread();
|
||||||
void on_cmdReplace_clicked();
|
|
||||||
void on_cmdSave_clicked();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SnapmaticPicture *smpic;
|
bool threadRunning;
|
||||||
QString profileName;
|
uint cacheId;
|
||||||
Ui::ImageEditorDialog *ui;
|
|
||||||
int snapmaticResolutionLW;
|
protected:
|
||||||
int snapmaticResolutionLH;
|
void run();
|
||||||
bool imageIsChanged;
|
|
||||||
QImage pictureCache;
|
signals:
|
||||||
|
void messagesArrived(const QJsonObject &messageObject);
|
||||||
|
void updateCacheId(uint cacheId);
|
||||||
|
void threadTerminated();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // IMAGEEDITORDIALOG_H
|
#endif // MESSAGETHREAD_H
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2018 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,7 +24,6 @@
|
||||||
#include "AppEnv.h"
|
#include "AppEnv.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
@ -40,6 +39,12 @@
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <QScreen>
|
||||||
|
#else
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GTA5SYNC_TELEMETRY
|
#ifdef GTA5SYNC_TELEMETRY
|
||||||
#include "TelemetryClass.h"
|
#include "TelemetryClass.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,9 +63,16 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) :
|
||||||
ui->cmdCancel->setDefault(true);
|
ui->cmdCancel->setDefault(true);
|
||||||
ui->cmdCancel->setFocus();
|
ui->cmdCancel->setFocus();
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
qreal screenRatioPR = AppEnv::screenRatioPR();
|
||||||
|
QRect desktopResolution = QApplication::primaryScreen()->geometry();
|
||||||
|
int desktopSizeWidth = qRound((double)desktopResolution.width() * screenRatioPR);
|
||||||
|
int desktopSizeHeight = qRound((double)desktopResolution.height() * screenRatioPR);
|
||||||
|
#else
|
||||||
QRect desktopResolution = QApplication::desktop()->screenGeometry(this);
|
QRect desktopResolution = QApplication::desktop()->screenGeometry(this);
|
||||||
int desktopSizeWidth = desktopResolution.width();
|
int desktopSizeWidth = desktopResolution.width();
|
||||||
int desktopSizeHeight = desktopResolution.height();
|
int desktopSizeHeight = desktopResolution.height();
|
||||||
|
#endif
|
||||||
aspectRatio = Qt::KeepAspectRatio;
|
aspectRatio = Qt::KeepAspectRatio;
|
||||||
defExportSize = QSize(960, 536);
|
defExportSize = QSize(960, 536);
|
||||||
cusExportSize = defExportSize;
|
cusExportSize = defExportSize;
|
||||||
|
@ -124,24 +136,33 @@ OptionsDialog::~OptionsDialog()
|
||||||
|
|
||||||
void OptionsDialog::setupTreeWidget()
|
void OptionsDialog::setupTreeWidget()
|
||||||
{
|
{
|
||||||
for (QString playerIDStr : profileDB->getPlayers())
|
const QStringList players = profileDB->getPlayers();
|
||||||
{
|
if (players.length() != 0) {
|
||||||
bool ok;
|
QStringList::const_iterator it = players.constBegin();
|
||||||
int playerID = playerIDStr.toInt(&ok);
|
QStringList::const_iterator end = players.constEnd();
|
||||||
if (ok)
|
while (it != end)
|
||||||
{
|
{
|
||||||
QString playerName = profileDB->getPlayerName(playerID);
|
bool ok;
|
||||||
|
int playerID = it->toInt(&ok);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
QString playerName = profileDB->getPlayerName(playerID);
|
||||||
|
|
||||||
QStringList playerTreeViewList;
|
QStringList playerTreeViewList;
|
||||||
playerTreeViewList += playerIDStr;
|
playerTreeViewList += *it;
|
||||||
playerTreeViewList += playerName;
|
playerTreeViewList += playerName;
|
||||||
|
|
||||||
QTreeWidgetItem *playerItem = new QTreeWidgetItem(playerTreeViewList);
|
QTreeWidgetItem *playerItem = new QTreeWidgetItem(playerTreeViewList);
|
||||||
ui->twPlayers->addTopLevelItem(playerItem);
|
ui->twPlayers->addTopLevelItem(playerItem);
|
||||||
playerItems += playerItem;
|
playerItems += playerItem;
|
||||||
|
}
|
||||||
|
it++;
|
||||||
}
|
}
|
||||||
|
ui->twPlayers->sortItems(1, Qt::AscendingOrder);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabPlayers));
|
||||||
}
|
}
|
||||||
ui->twPlayers->sortItems(1, Qt::AscendingOrder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::setupLanguageBox()
|
void OptionsDialog::setupLanguageBox()
|
||||||
|
@ -153,7 +174,7 @@ void OptionsDialog::setupLanguageBox()
|
||||||
|
|
||||||
QString cbSysStr = tr("%1 (Language priority)", "First language a person can talk with a different person/application. \"Native\" or \"Not Native\".").arg(tr("System",
|
QString cbSysStr = tr("%1 (Language priority)", "First language a person can talk with a different person/application. \"Native\" or \"Not Native\".").arg(tr("System",
|
||||||
"System in context of System default"));
|
"System in context of System default"));
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString cbAutoStr;
|
QString cbAutoStr;
|
||||||
if (AppEnv::getGameLanguage(AppEnv::getGameVersion()) != GameLanguage::Undefined)
|
if (AppEnv::getGameLanguage(AppEnv::getGameVersion()) != GameLanguage::Undefined)
|
||||||
{
|
{
|
||||||
|
@ -280,7 +301,7 @@ void OptionsDialog::setupInterfaceSettings()
|
||||||
settings->beginGroup("Startup");
|
settings->beginGroup("Startup");
|
||||||
bool alwaysUseMessageFont = settings->value("AlwaysUseMessageFont", false).toBool();
|
bool alwaysUseMessageFont = settings->value("AlwaysUseMessageFont", false).toBool();
|
||||||
ui->cbAlwaysUseMessageFont->setChecked(alwaysUseMessageFont);
|
ui->cbAlwaysUseMessageFont->setChecked(alwaysUseMessageFont);
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (QSysInfo::windowsVersion() >= 0x0080)
|
if (QSysInfo::windowsVersion() >= 0x0080)
|
||||||
{
|
{
|
||||||
ui->gbFont->setVisible(false);
|
ui->gbFont->setVisible(false);
|
||||||
|
@ -346,10 +367,12 @@ void OptionsDialog::applySettings()
|
||||||
settings->setValue("Language", ui->cbLanguage->itemData(ui->cbLanguage->currentIndex()));
|
settings->setValue("Language", ui->cbLanguage->itemData(ui->cbLanguage->currentIndex()));
|
||||||
settings->setValue("AreaLanguage", ui->cbAreaLanguage->itemData(ui->cbAreaLanguage->currentIndex()));
|
settings->setValue("AreaLanguage", ui->cbAreaLanguage->itemData(ui->cbAreaLanguage->currentIndex()));
|
||||||
#endif
|
#endif
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
settings->setValue("NavigationBar", ui->cbSnapmaticNavigationBar->isChecked());
|
settings->setValue("NavigationBar", ui->cbSnapmaticNavigationBar->isChecked());
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
settings->setValue("NavigationBar", ui->cbSnapmaticNavigationBar->isChecked());
|
||||||
#endif
|
#endif
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
|
@ -603,7 +626,7 @@ void OptionsDialog::setupWindowsGameSettings()
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_GAME
|
#ifdef GTA5SYNC_GAME
|
||||||
GameVersion gameVersion = AppEnv::getGameVersion();
|
GameVersion gameVersion = AppEnv::getGameVersion();
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (gameVersion != GameVersion::NoVersion)
|
if (gameVersion != GameVersion::NoVersion)
|
||||||
{
|
{
|
||||||
if (gameVersion == GameVersion::SocialClubVersion)
|
if (gameVersion == GameVersion::SocialClubVersion)
|
||||||
|
@ -700,7 +723,7 @@ void OptionsDialog::setupCustomGTAFolder()
|
||||||
|
|
||||||
void OptionsDialog::setupSnapmaticPictureViewer()
|
void OptionsDialog::setupSnapmaticPictureViewer()
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
settings->beginGroup("Interface");
|
settings->beginGroup("Interface");
|
||||||
ui->cbSnapmaticNavigationBar->setChecked(settings->value("NavigationBar", true).toBool());
|
ui->cbSnapmaticNavigationBar->setChecked(settings->value("NavigationBar", true).toBool());
|
||||||
|
@ -710,8 +733,9 @@ void OptionsDialog::setupSnapmaticPictureViewer()
|
||||||
ui->gbSnapmaticPictureViewer->setVisible(false);
|
ui->gbSnapmaticPictureViewer->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
ui->cbSnapmaticNavigationBar->setVisible(false);
|
settings->beginGroup("Interface");
|
||||||
ui->gbSnapmaticPictureViewer->setVisible(false);
|
ui->cbSnapmaticNavigationBar->setChecked(settings->value("NavigationBar", true).toBool());
|
||||||
|
settings->endGroup();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2018 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,6 @@
|
||||||
#include "ui_PictureDialog.h"
|
#include "ui_PictureDialog.h"
|
||||||
#include "SidebarGenerator.h"
|
#include "SidebarGenerator.h"
|
||||||
#include "MapLocationDialog.h"
|
#include "MapLocationDialog.h"
|
||||||
#include "ImageEditorDialog.h"
|
|
||||||
#include "JsonEditorDialog.h"
|
#include "JsonEditorDialog.h"
|
||||||
#include "SnapmaticEditor.h"
|
#include "SnapmaticEditor.h"
|
||||||
#include "StandardPaths.h"
|
#include "StandardPaths.h"
|
||||||
|
@ -34,7 +33,11 @@
|
||||||
#include "AppEnv.h"
|
#include "AppEnv.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WIN
|
#if QT_VERSION < 0x060000
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
#include <QtWinExtras/QtWin>
|
#include <QtWinExtras/QtWin>
|
||||||
#include <QtWinExtras/QWinEvent>
|
#include <QtWinExtras/QWinEvent>
|
||||||
|
@ -42,7 +45,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
|
@ -82,7 +84,11 @@
|
||||||
#define picPath picture->getPictureFilePath()
|
#define picPath picture->getPictureFilePath()
|
||||||
#define picTitl StringParser::escapeString(picture->getPictureTitle())
|
#define picTitl StringParser::escapeString(picture->getPictureTitle())
|
||||||
#define plyrsList picture->getSnapmaticProperties().playersList
|
#define plyrsList picture->getSnapmaticProperties().playersList
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
#define created QLocale().toString(picture->getSnapmaticProperties().createdDateTime, QLocale::ShortFormat)
|
||||||
|
#else
|
||||||
#define created picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate)
|
#define created picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate)
|
||||||
|
#endif
|
||||||
|
|
||||||
PictureDialog::PictureDialog(ProfileDatabase *profileDB, CrewDatabase *crewDB, QWidget *parent) :
|
PictureDialog::PictureDialog(ProfileDatabase *profileDB, CrewDatabase *crewDB, QWidget *parent) :
|
||||||
QDialog(parent), profileDB(profileDB), crewDB(crewDB),
|
QDialog(parent), profileDB(profileDB), crewDB(crewDB),
|
||||||
|
@ -136,12 +142,15 @@ void PictureDialog::setupPictureDialog()
|
||||||
smpic = nullptr;
|
smpic = nullptr;
|
||||||
crewStr = "";
|
crewStr = "";
|
||||||
|
|
||||||
|
// Get Snapmatic Resolution
|
||||||
|
QSize snapmaticResolution = SnapmaticPicture::getSnapmaticResolution();
|
||||||
|
|
||||||
// Avatar area
|
// Avatar area
|
||||||
qreal screenRatio = AppEnv::screenRatio();
|
qreal screenRatio = AppEnv::screenRatio();
|
||||||
qreal screenRatioPR = AppEnv::screenRatioPR();
|
qreal screenRatioPR = AppEnv::screenRatioPR();
|
||||||
if (screenRatio != 1 || screenRatioPR != 1)
|
if (screenRatio != 1 || screenRatioPR != 1)
|
||||||
{
|
{
|
||||||
avatarAreaPicture = QImage(":/img/avatararea.png").scaledToHeight(536 * screenRatio * screenRatioPR, Qt::FastTransformation);
|
avatarAreaPicture = QImage(":/img/avatararea.png").scaledToHeight(snapmaticResolution.height() * screenRatio * screenRatioPR, Qt::FastTransformation);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -152,7 +161,7 @@ void PictureDialog::setupPictureDialog()
|
||||||
avatarSize = 470;
|
avatarSize = 470;
|
||||||
|
|
||||||
// DPI calculation (picture)
|
// DPI calculation (picture)
|
||||||
ui->labPicture->setFixedSize(960 * screenRatio, 536 * screenRatio);
|
ui->labPicture->setFixedSize(snapmaticResolution.width() * screenRatio, snapmaticResolution.height() * screenRatio);
|
||||||
ui->labPicture->setFocusPolicy(Qt::StrongFocus);
|
ui->labPicture->setFocusPolicy(Qt::StrongFocus);
|
||||||
ui->labPicture->setScaledContents(true);
|
ui->labPicture->setScaledContents(true);
|
||||||
|
|
||||||
|
@ -199,13 +208,13 @@ void PictureDialog::setupPictureDialog()
|
||||||
ui->jsonLayout->setContentsMargins(4 * screenRatio, 10 * screenRatio, 4 * screenRatio, 4 * screenRatio);
|
ui->jsonLayout->setContentsMargins(4 * screenRatio, 10 * screenRatio, 4 * screenRatio, 4 * screenRatio);
|
||||||
|
|
||||||
// Pre-adapt window for DPI
|
// Pre-adapt window for DPI
|
||||||
setFixedWidth(960 * screenRatio);
|
setFixedWidth(snapmaticResolution.width() * screenRatio);
|
||||||
setFixedHeight(536 * screenRatio);
|
setFixedHeight(snapmaticResolution.height() * screenRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
PictureDialog::~PictureDialog()
|
PictureDialog::~PictureDialog()
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
if (naviEnabled)
|
if (naviEnabled)
|
||||||
{
|
{
|
||||||
|
@ -216,6 +225,15 @@ PictureDialog::~PictureDialog()
|
||||||
delete layout()->menuBar();
|
delete layout()->menuBar();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
if (naviEnabled)
|
||||||
|
{
|
||||||
|
for (QObject *obj : layout()->menuBar()->children())
|
||||||
|
{
|
||||||
|
delete obj;
|
||||||
|
}
|
||||||
|
delete layout()->menuBar();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
for (QObject *obj : manageMenu->children())
|
for (QObject *obj : manageMenu->children())
|
||||||
{
|
{
|
||||||
|
@ -236,139 +254,42 @@ void PictureDialog::closeEvent(QCloseEvent *ev)
|
||||||
|
|
||||||
void PictureDialog::addPreviousNextButtons()
|
void PictureDialog::addPreviousNextButtons()
|
||||||
{
|
{
|
||||||
// Windows Vista additions
|
#ifdef Q_OS_WIN
|
||||||
#ifdef GTA5SYNC_WIN
|
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
QToolBar *uiToolbar = new QToolBar("Picture Toolbar", this);
|
QToolBar *uiToolbar = new QToolBar("Picture Toolbar", this);
|
||||||
uiToolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
uiToolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
uiToolbar->setObjectName("uiToolbar");
|
uiToolbar->setObjectName("UiToolbar");
|
||||||
uiToolbar->addAction(QIcon(":/img/back.svgz"), "", this, SLOT(previousPictureRequestedSlot()));
|
uiToolbar->addAction(QIcon(":/img/back.svgz"), "", this, SLOT(previousPictureRequestedSlot()));
|
||||||
uiToolbar->addAction(QIcon(":/img/next.svgz"), "", this, SLOT(nextPictureRequestedSlot()));
|
uiToolbar->addAction(QIcon(":/img/next.svgz"), "", this, SLOT(nextPictureRequestedSlot()));
|
||||||
layout()->setMenuBar(uiToolbar);
|
layout()->setMenuBar(uiToolbar);
|
||||||
|
|
||||||
naviEnabled = true;
|
naviEnabled = true;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WIN
|
|
||||||
#if QT_VERSION >= 0x050200
|
|
||||||
#ifdef GTA5SYNC_APV
|
|
||||||
bool PictureDialog::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
|
||||||
{
|
|
||||||
*result = 0;
|
|
||||||
MSG *msg = static_cast<MSG*>(message);
|
|
||||||
LRESULT lRet = 0;
|
|
||||||
|
|
||||||
if (naviEnabled && QtWin::isCompositionEnabled())
|
|
||||||
{
|
|
||||||
if (msg->message == WM_NCCALCSIZE && msg->wParam == TRUE)
|
|
||||||
{
|
|
||||||
NCCALCSIZE_PARAMS *pncsp = reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
|
|
||||||
|
|
||||||
int sideBorderSize = ((frameSize().width() - size().width()) / 2);
|
|
||||||
#ifdef GTA5SYNC_APV_SIDE
|
|
||||||
int buttomBorderSize = sideBorderSize;
|
|
||||||
#else
|
#else
|
||||||
int buttomBorderSize = (frameSize().height() - size().height());
|
QToolBar *uiToolbar = new QToolBar("Picture Toolbar", this);
|
||||||
|
#if QT_VERSION < 0x050600
|
||||||
|
qreal screenRatio = AppEnv::screenRatio();
|
||||||
|
if (screenRatio != 1) {
|
||||||
|
QSize iconSize = uiToolbar->iconSize();
|
||||||
|
uiToolbar->setIconSize(QSize(iconSize.width() * screenRatio, iconSize.height() * screenRatio));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
uiToolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
|
uiToolbar->setObjectName("UiToolbar");
|
||||||
|
uiToolbar->addAction(QIcon(":/img/back.svgz"), "", this, SLOT(previousPictureRequestedSlot()));
|
||||||
|
uiToolbar->addAction(QIcon(":/img/next.svgz"), "", this, SLOT(nextPictureRequestedSlot()));
|
||||||
|
layout()->setMenuBar(uiToolbar);
|
||||||
|
naviEnabled = true;
|
||||||
#endif
|
#endif
|
||||||
pncsp->rgrc[0].left += sideBorderSize;
|
|
||||||
pncsp->rgrc[0].right -= sideBorderSize;
|
|
||||||
pncsp->rgrc[0].bottom -= buttomBorderSize;
|
|
||||||
}
|
|
||||||
else if (msg->message == WM_NCHITTEST)
|
|
||||||
{
|
|
||||||
int CLOSE_BUTTON_ID = 20;
|
|
||||||
lRet = HitTestNCA(msg->hwnd, msg->lParam);
|
|
||||||
DwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lRet);
|
|
||||||
*result = lRet;
|
|
||||||
if (lRet != CLOSE_BUTTON_ID) { return QWidget::nativeEvent(eventType, message, result); }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return QWidget::nativeEvent(eventType, message, result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return QWidget::nativeEvent(eventType, message, result);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT PictureDialog::HitTestNCA(HWND hWnd, LPARAM lParam)
|
|
||||||
{
|
|
||||||
int LEFTEXTENDWIDTH = 0;
|
|
||||||
int RIGHTEXTENDWIDTH = 0;
|
|
||||||
int BOTTOMEXTENDWIDTH = 0;
|
|
||||||
int TOPEXTENDWIDTH = layout()->menuBar()->height();
|
|
||||||
|
|
||||||
POINT ptMouse = {(int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)};
|
|
||||||
|
|
||||||
RECT rcWindow;
|
|
||||||
GetWindowRect(hWnd, &rcWindow);
|
|
||||||
|
|
||||||
RECT rcFrame = {};
|
|
||||||
AdjustWindowRectEx(&rcFrame, WS_OVERLAPPEDWINDOW & ~WS_CAPTION, FALSE, NULL);
|
|
||||||
|
|
||||||
USHORT uRow = 1;
|
|
||||||
USHORT uCol = 1;
|
|
||||||
bool fOnResizeBorder = false;
|
|
||||||
|
|
||||||
if (ptMouse.y >= rcWindow.top && ptMouse.y < rcWindow.top + TOPEXTENDWIDTH)
|
|
||||||
{
|
|
||||||
fOnResizeBorder = (ptMouse.y < (rcWindow.top - rcFrame.top));
|
|
||||||
uRow = 0;
|
|
||||||
}
|
|
||||||
else if (ptMouse.y < rcWindow.bottom && ptMouse.y >= rcWindow.bottom - BOTTOMEXTENDWIDTH)
|
|
||||||
{
|
|
||||||
uRow = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ptMouse.x >= rcWindow.left && ptMouse.x < rcWindow.left + LEFTEXTENDWIDTH)
|
|
||||||
{
|
|
||||||
uCol = 0;
|
|
||||||
}
|
|
||||||
else if (ptMouse.x < rcWindow.right && ptMouse.x >= rcWindow.right - RIGHTEXTENDWIDTH)
|
|
||||||
{
|
|
||||||
uCol = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT hitTests[3][3] =
|
|
||||||
{
|
|
||||||
{ HTTOPLEFT, fOnResizeBorder ? HTTOP : HTCAPTION, HTTOPRIGHT },
|
|
||||||
{ HTLEFT, HTNOWHERE, HTRIGHT },
|
|
||||||
{ HTBOTTOMLEFT, HTBOTTOM, HTBOTTOMRIGHT },
|
|
||||||
};
|
|
||||||
|
|
||||||
return hitTests[uRow][uCol];
|
|
||||||
}
|
|
||||||
|
|
||||||
void PictureDialog::resizeEvent(QResizeEvent *event)
|
|
||||||
{
|
|
||||||
Q_UNUSED(event)
|
|
||||||
// int newDialogHeight = (ui->labPicture->pixmap()->height() / AppEnv::screenRatioPR());
|
|
||||||
// newDialogHeight = newDialogHeight + ui->jsonFrame->height();
|
|
||||||
// if (naviEnabled) newDialogHeight = newDialogHeight + layout()->menuBar()->height();
|
|
||||||
// int buttomBorderSize = (frameSize().height() - size().height());
|
|
||||||
// int sideBorderSize = ((frameSize().width() - size().width()) / 2);
|
|
||||||
// int brokenDialogHeight = newDialogHeight + (buttomBorderSize - sideBorderSize);
|
|
||||||
// if (event->size().height() == brokenDialogHeight)
|
|
||||||
// {
|
|
||||||
// qDebug() << "BROKEN 1";
|
|
||||||
// setGeometry(geometry().x(), geometry().y(), width(), newDialogHeight);
|
|
||||||
// qDebug() << "BROKEN 2";
|
|
||||||
// event->ignore();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void PictureDialog::adaptNewDialogSize(QSize newLabelSize)
|
void PictureDialog::adaptNewDialogSize(QSize newLabelSize)
|
||||||
{
|
{
|
||||||
Q_UNUSED(newLabelSize)
|
Q_UNUSED(newLabelSize)
|
||||||
|
#if QT_VERSION >= 0x050F00
|
||||||
|
int newDialogHeight = SnapmaticPicture::getSnapmaticResolution().height();
|
||||||
|
#else
|
||||||
int newDialogHeight = (ui->labPicture->pixmap()->height() / AppEnv::screenRatioPR());
|
int newDialogHeight = (ui->labPicture->pixmap()->height() / AppEnv::screenRatioPR());
|
||||||
|
#endif
|
||||||
newDialogHeight = newDialogHeight + ui->jsonFrame->height();
|
newDialogHeight = newDialogHeight + ui->jsonFrame->height();
|
||||||
if (naviEnabled) newDialogHeight = newDialogHeight + layout()->menuBar()->height();
|
if (naviEnabled) newDialogHeight = newDialogHeight + layout()->menuBar()->height();
|
||||||
setMaximumSize(width(), newDialogHeight);
|
setMaximumSize(width(), newDialogHeight);
|
||||||
|
@ -381,7 +302,7 @@ void PictureDialog::adaptNewDialogSize(QSize newLabelSize)
|
||||||
|
|
||||||
void PictureDialog::styliseDialog()
|
void PictureDialog::styliseDialog()
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
if (QtWin::isCompositionEnabled())
|
if (QtWin::isCompositionEnabled())
|
||||||
{
|
{
|
||||||
|
@ -403,7 +324,7 @@ void PictureDialog::styliseDialog()
|
||||||
|
|
||||||
bool PictureDialog::event(QEvent *event)
|
bool PictureDialog::event(QEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
if (naviEnabled)
|
if (naviEnabled)
|
||||||
{
|
{
|
||||||
|
@ -488,7 +409,7 @@ bool PictureDialog::eventFilter(QObject *obj, QEvent *ev)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
if (obj != ui->labPicture && naviEnabled)
|
if (obj != ui->labPicture && naviEnabled)
|
||||||
{
|
{
|
||||||
|
@ -694,10 +615,11 @@ void PictureDialog::renderPicture()
|
||||||
{
|
{
|
||||||
if (overlayEnabled)
|
if (overlayEnabled)
|
||||||
{
|
{
|
||||||
QPixmap shownImagePixmap(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR);
|
QSize snapmaticResolution = SnapmaticPicture::getSnapmaticResolution();
|
||||||
|
QPixmap shownImagePixmap(snapmaticResolution.width() * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR);
|
||||||
shownImagePixmap.fill(Qt::transparent);
|
shownImagePixmap.fill(Qt::transparent);
|
||||||
QPainter shownImagePainter(&shownImagePixmap);
|
QPainter shownImagePainter(&shownImagePixmap);
|
||||||
shownImagePainter.drawImage(0, 0, snapmaticPicture.scaled(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
shownImagePainter.drawImage(0, 0, snapmaticPicture.scaled(snapmaticResolution.width() * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||||
shownImagePainter.drawImage(3 * screenRatio * screenRatioPR, 3 * screenRatio * screenRatioPR, overlayTempImage);
|
shownImagePainter.drawImage(3 * screenRatio * screenRatioPR, 3 * screenRatio * screenRatioPR, overlayTempImage);
|
||||||
shownImagePainter.end();
|
shownImagePainter.end();
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
|
@ -707,10 +629,11 @@ void PictureDialog::renderPicture()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QPixmap shownImagePixmap(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR);
|
QSize snapmaticResolution = SnapmaticPicture::getSnapmaticResolution();
|
||||||
|
QPixmap shownImagePixmap(snapmaticResolution.width() * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR);
|
||||||
shownImagePixmap.fill(Qt::transparent);
|
shownImagePixmap.fill(Qt::transparent);
|
||||||
QPainter shownImagePainter(&shownImagePixmap);
|
QPainter shownImagePainter(&shownImagePixmap);
|
||||||
shownImagePainter.drawImage(0, 0, snapmaticPicture.scaled(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
shownImagePainter.drawImage(0, 0, snapmaticPicture.scaled(snapmaticResolution.width() * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||||
shownImagePainter.end();
|
shownImagePainter.end();
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
shownImagePixmap.setDevicePixelRatio(screenRatioPR);
|
shownImagePixmap.setDevicePixelRatio(screenRatioPR);
|
||||||
|
@ -721,15 +644,16 @@ void PictureDialog::renderPicture()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Generating Avatar Preview
|
// Generating Avatar Preview
|
||||||
QPixmap avatarPixmap(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR);
|
QSize snapmaticResolution = SnapmaticPicture::getSnapmaticResolution();
|
||||||
|
QPixmap avatarPixmap(snapmaticResolution.width() * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR);
|
||||||
QPainter snapPainter(&avatarPixmap);
|
QPainter snapPainter(&avatarPixmap);
|
||||||
QFont snapPainterFont;
|
QFont snapPainterFont;
|
||||||
snapPainterFont.setPixelSize(12 * screenRatio * screenRatioPR);
|
snapPainterFont.setPixelSize(12 * screenRatio * screenRatioPR);
|
||||||
snapPainter.drawImage(0, 0, snapmaticPicture.scaled(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
snapPainter.drawImage(0, 0, snapmaticPicture.scaled(snapmaticResolution.width() * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||||
snapPainter.drawImage(0, 0, avatarAreaPicture);
|
snapPainter.drawImage(0, 0, avatarAreaPicture);
|
||||||
snapPainter.setPen(QColor::fromRgb(255, 255, 255, 255));
|
snapPainter.setPen(QColor::fromRgb(255, 255, 255, 255));
|
||||||
snapPainter.setFont(snapPainterFont);
|
snapPainter.setFont(snapPainterFont);
|
||||||
snapPainter.drawText(QRect(3 * screenRatio * screenRatioPR, 3 * screenRatio * screenRatioPR, 140 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR), Qt::AlignLeft | Qt::TextWordWrap, tr("Avatar Preview Mode\nPress 1 for Default View"));
|
snapPainter.drawText(QRect(3 * screenRatio * screenRatioPR, 3 * screenRatio * screenRatioPR, 140 * screenRatio * screenRatioPR, snapmaticResolution.height() * screenRatio * screenRatioPR), Qt::AlignLeft | Qt::TextWordWrap, tr("Avatar Preview Mode\nPress 1 for Default View"));
|
||||||
snapPainter.end();
|
snapPainter.end();
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
avatarPixmap.setDevicePixelRatio(screenRatioPR);
|
avatarPixmap.setDevicePixelRatio(screenRatioPR);
|
||||||
|
@ -781,7 +705,7 @@ QString PictureDialog::generatePlayersString()
|
||||||
QString plyrsStr;
|
QString plyrsStr;
|
||||||
if (playersList.length() >= 1)
|
if (playersList.length() >= 1)
|
||||||
{
|
{
|
||||||
for (const QString player : playersList)
|
for (const QString &player : playersList)
|
||||||
{
|
{
|
||||||
const QString playerName = profileDB->getPlayerName(player);
|
const QString playerName = profileDB->getPlayerName(player);
|
||||||
if (player != playerName) {
|
if (player != playerName) {
|
||||||
|
@ -828,13 +752,17 @@ void PictureDialog::on_labPicture_mouseDoubleClicked(Qt::MouseButton button)
|
||||||
{
|
{
|
||||||
if (button == Qt::LeftButton)
|
if (button == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
QRect desktopRect = QApplication::screenAt(pos())->geometry();
|
||||||
|
#else
|
||||||
QRect desktopRect = QApplication::desktop()->screenGeometry(this);
|
QRect desktopRect = QApplication::desktop()->screenGeometry(this);
|
||||||
|
#endif
|
||||||
PictureWidget *pictureWidget = new PictureWidget(this); // Work!
|
PictureWidget *pictureWidget = new PictureWidget(this); // Work!
|
||||||
pictureWidget->setObjectName("PictureWidget");
|
pictureWidget->setObjectName("PictureWidget");
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::WindowStaysOnTopHint^Qt::MaximizeUsingFullscreenGeometryHint);
|
pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::MaximizeUsingFullscreenGeometryHint);
|
||||||
#else
|
#else
|
||||||
pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::WindowStaysOnTopHint);
|
pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint);
|
||||||
#endif
|
#endif
|
||||||
pictureWidget->setWindowTitle(windowTitle());
|
pictureWidget->setWindowTitle(windowTitle());
|
||||||
pictureWidget->setStyleSheet("QLabel#pictureLabel{background-color: black;}");
|
pictureWidget->setStyleSheet("QLabel#pictureLabel{background-color: black;}");
|
||||||
|
@ -848,7 +776,7 @@ void PictureDialog::on_labPicture_mouseDoubleClicked(Qt::MouseButton button)
|
||||||
|
|
||||||
pictureWidget->move(desktopRect.x(), desktopRect.y());
|
pictureWidget->move(desktopRect.x(), desktopRect.y());
|
||||||
pictureWidget->resize(desktopRect.width(), desktopRect.height());
|
pictureWidget->resize(desktopRect.width(), desktopRect.height());
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
QtWin::markFullscreenWindow(pictureWidget, true);
|
QtWin::markFullscreenWindow(pictureWidget, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,14 +29,6 @@
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WIN
|
|
||||||
#if QT_VERSION >= 0x050200
|
|
||||||
#ifdef GTA5SYNC_APV
|
|
||||||
#include <dwmapi.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PictureDialog;
|
class PictureDialog;
|
||||||
}
|
}
|
||||||
|
@ -98,15 +90,6 @@ protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
void mousePressEvent(QMouseEvent *ev);
|
void mousePressEvent(QMouseEvent *ev);
|
||||||
bool event(QEvent *event);
|
bool event(QEvent *event);
|
||||||
#ifdef GTA5SYNC_WIN
|
|
||||||
#if QT_VERSION >= 0x050200
|
|
||||||
#ifdef GTA5SYNC_APV
|
|
||||||
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
|
|
||||||
LRESULT HitTestNCA(HWND hWnd, LPARAM lParam);
|
|
||||||
void resizeEvent(QResizeEvent *event);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString generateCrewString();
|
QString generateCrewString();
|
||||||
|
@ -136,7 +119,7 @@ private:
|
||||||
int avatarLocY;
|
int avatarLocY;
|
||||||
int avatarSize;
|
int avatarSize;
|
||||||
QMenu *manageMenu;
|
QMenu *manageMenu;
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
QPoint dragPosition;
|
QPoint dragPosition;
|
||||||
bool dragStart;
|
bool dragStart;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2017 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,21 +17,25 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "AppEnv.h"
|
||||||
#include "PictureExport.h"
|
#include "PictureExport.h"
|
||||||
#include "PictureDialog.h"
|
#include "PictureDialog.h"
|
||||||
#include "StandardPaths.h"
|
#include "StandardPaths.h"
|
||||||
#include "SidebarGenerator.h"
|
#include "SidebarGenerator.h"
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QRegExp>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
#include <QSaveFile>
|
#include <QSaveFile>
|
||||||
|
#include <QScreen>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PictureExport::PictureExport()
|
PictureExport::PictureExport()
|
||||||
|
@ -157,8 +161,17 @@ fileDialogPreSave: //Work?
|
||||||
QImage exportPicture = picture->getImage();
|
QImage exportPicture = picture->getImage();
|
||||||
if (sizeMode == "Desktop")
|
if (sizeMode == "Desktop")
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
qreal screenRatioPR = AppEnv::screenRatioPR();
|
||||||
|
QRect desktopResolution = QApplication::primaryScreen()->geometry();
|
||||||
|
int desktopSizeWidth = qRound((double)desktopResolution.width() * screenRatioPR);
|
||||||
|
int desktopSizeHeight = qRound((double)desktopResolution.height() * screenRatioPR);
|
||||||
|
#else
|
||||||
QRect desktopResolution = QApplication::desktop()->screenGeometry();
|
QRect desktopResolution = QApplication::desktop()->screenGeometry();
|
||||||
exportPicture = exportPicture.scaled(desktopResolution.width(), desktopResolution.height(), aspectRatio, Qt::SmoothTransformation);
|
int desktopSizeWidth = desktopResolution.width();
|
||||||
|
int desktopSizeHeight = desktopResolution.height();
|
||||||
|
#endif
|
||||||
|
exportPicture = exportPicture.scaled(desktopSizeWidth, desktopSizeHeight, aspectRatio, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
else if (sizeMode == "Custom")
|
else if (sizeMode == "Custom")
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "PictureDialog.h"
|
#include "PictureDialog.h"
|
||||||
#include "PictureWidget.h"
|
#include "PictureWidget.h"
|
||||||
#include "UiModLabel.h"
|
#include "UiModLabel.h"
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
@ -27,6 +26,10 @@
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
PictureWidget::PictureWidget(QWidget *parent) : QDialog(parent)
|
PictureWidget::PictureWidget(QWidget *parent) : QDialog(parent)
|
||||||
{
|
{
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
|
@ -44,7 +47,9 @@ PictureWidget::PictureWidget(QWidget *parent) : QDialog(parent)
|
||||||
|
|
||||||
QObject::connect(pictureLabel, SIGNAL(mouseDoubleClicked(Qt::MouseButton)), this, SLOT(pictureDoubleClicked(Qt::MouseButton)));
|
QObject::connect(pictureLabel, SIGNAL(mouseDoubleClicked(Qt::MouseButton)), this, SLOT(pictureDoubleClicked(Qt::MouseButton)));
|
||||||
QObject::connect(pictureLabel, SIGNAL(customContextMenuRequested(QPoint)), parent, SLOT(exportCustomContextMenuRequested(QPoint)));
|
QObject::connect(pictureLabel, SIGNAL(customContextMenuRequested(QPoint)), parent, SLOT(exportCustomContextMenuRequested(QPoint)));
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
QObject::connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(updateWindowSize(int)));
|
QObject::connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(updateWindowSize(int)));
|
||||||
|
#endif
|
||||||
|
|
||||||
setLayout(widgetLayout);
|
setLayout(widgetLayout);
|
||||||
}
|
}
|
||||||
|
@ -98,12 +103,21 @@ void PictureWidget::setImage(QImage image_)
|
||||||
|
|
||||||
void PictureWidget::updateWindowSize(int screenID)
|
void PictureWidget::updateWindowSize(int screenID)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
Q_UNUSED(screenID)
|
||||||
|
QRect desktopRect = QApplication::screenAt(pos())->geometry();
|
||||||
|
move(desktopRect.x(), desktopRect.y());
|
||||||
|
resize(desktopRect.width(), desktopRect.height());
|
||||||
|
showFullScreen();
|
||||||
|
pictureLabel->setPixmap(QPixmap::fromImage(image.scaled(desktopRect.width(), desktopRect.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation)));
|
||||||
|
#else
|
||||||
if (screenID == QApplication::desktop()->screenNumber(this))
|
if (screenID == QApplication::desktop()->screenNumber(this))
|
||||||
{
|
{
|
||||||
QRect desktopRect = QApplication::desktop()->screenGeometry(this);
|
QRect desktopRect = QApplication::desktop()->screenGeometry(this);
|
||||||
this->move(desktopRect.x(), desktopRect.y());
|
move(desktopRect.x(), desktopRect.y());
|
||||||
this->resize(desktopRect.width(), desktopRect.height());
|
resize(desktopRect.width(), desktopRect.height());
|
||||||
this->showFullScreen();
|
showFullScreen();
|
||||||
pictureLabel->setPixmap(QPixmap::fromImage(image.scaled(desktopRect.width(), desktopRect.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation)));
|
pictureLabel->setPixmap(QPixmap::fromImage(image.scaled(desktopRect.width(), desktopRect.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation)));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2018 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -73,12 +73,32 @@ PlayerListDialog::PlayerListDialog(QStringList players, ProfileDatabase *profile
|
||||||
// Set Icon for Manage Buttons
|
// Set Icon for Manage Buttons
|
||||||
if (QIcon::hasThemeIcon("go-previous") && QIcon::hasThemeIcon("go-next") && QIcon::hasThemeIcon("list-add"))
|
if (QIcon::hasThemeIcon("go-previous") && QIcon::hasThemeIcon("go-next") && QIcon::hasThemeIcon("list-add"))
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < 0x050600
|
||||||
|
qreal screenRatio = AppEnv::screenRatio();
|
||||||
|
if (screenRatio != 1) {
|
||||||
|
QSize iconSize = ui->cmdMakeAv->iconSize();
|
||||||
|
iconSize = QSize(iconSize.width() * screenRatio, iconSize.height() * screenRatio);
|
||||||
|
ui->cmdMakeAv->setIconSize(iconSize);
|
||||||
|
ui->cmdMakeSe->setIconSize(iconSize);
|
||||||
|
ui->cmdMakeAd->setIconSize(iconSize);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
ui->cmdMakeAv->setIcon(QIcon::fromTheme("go-previous"));
|
ui->cmdMakeAv->setIcon(QIcon::fromTheme("go-previous"));
|
||||||
ui->cmdMakeSe->setIcon(QIcon::fromTheme("go-next"));
|
ui->cmdMakeSe->setIcon(QIcon::fromTheme("go-next"));
|
||||||
ui->cmdMakeAd->setIcon(QIcon::fromTheme("list-add"));
|
ui->cmdMakeAd->setIcon(QIcon::fromTheme("list-add"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < 0x050600
|
||||||
|
qreal screenRatio = AppEnv::screenRatio();
|
||||||
|
if (screenRatio != 1) {
|
||||||
|
QSize iconSize = ui->cmdMakeAv->iconSize();
|
||||||
|
iconSize = QSize(iconSize.width() * screenRatio, iconSize.height() * screenRatio);
|
||||||
|
ui->cmdMakeAv->setIconSize(iconSize);
|
||||||
|
ui->cmdMakeSe->setIconSize(iconSize);
|
||||||
|
ui->cmdMakeAd->setIconSize(iconSize);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
ui->cmdMakeAv->setIcon(QIcon(":/img/back.svgz"));
|
ui->cmdMakeAv->setIcon(QIcon(":/img/back.svgz"));
|
||||||
ui->cmdMakeSe->setIcon(QIcon(":/img/next.svgz"));
|
ui->cmdMakeSe->setIcon(QIcon(":/img/next.svgz"));
|
||||||
ui->cmdMakeAd->setIcon(QIcon(":/img/add.svgz"));
|
ui->cmdMakeAd->setIcon(QIcon(":/img/add.svgz"));
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QRegExp>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
@ -264,14 +263,14 @@ void ProfileInterface::insertSnapmaticIPI(QWidget *widget)
|
||||||
QStringList widgetsKeyList = widgets.values();
|
QStringList widgetsKeyList = widgets.values();
|
||||||
QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive);
|
QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive);
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
qSort(pictureKeyList.rbegin(), pictureKeyList.rend());
|
std::sort(pictureKeyList.rbegin(), pictureKeyList.rend());
|
||||||
#else
|
#else
|
||||||
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>());
|
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>());
|
||||||
#endif
|
#endif
|
||||||
int picIndex = pictureKeyList.indexOf(QRegExp(widgetKey));
|
int picIndex = pictureKeyList.indexOf(widgetKey);
|
||||||
ui->vlSnapmatic->insertWidget(picIndex, proWidget);
|
ui->vlSnapmatic->insertWidget(picIndex, proWidget);
|
||||||
|
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
ui->saProfile->ensureWidgetVisible(proWidget, 0, 0);
|
ui->saProfile->ensureWidgetVisible(proWidget, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,11 +283,15 @@ void ProfileInterface::insertSavegameIPI(QWidget *widget)
|
||||||
QString widgetKey = widgets[proWidget];
|
QString widgetKey = widgets[proWidget];
|
||||||
QStringList widgetsKeyList = widgets.values();
|
QStringList widgetsKeyList = widgets.values();
|
||||||
QStringList savegameKeyList = widgetsKeyList.filter("SGD", Qt::CaseSensitive);
|
QStringList savegameKeyList = widgetsKeyList.filter("SGD", Qt::CaseSensitive);
|
||||||
|
#if QT_VERSION >= 0x050600
|
||||||
|
std::sort(savegameKeyList.begin(), savegameKeyList.end());
|
||||||
|
#else
|
||||||
qSort(savegameKeyList.begin(), savegameKeyList.end());
|
qSort(savegameKeyList.begin(), savegameKeyList.end());
|
||||||
int sgdIndex = savegameKeyList.indexOf(QRegExp(widgetKey));
|
#endif
|
||||||
|
int sgdIndex = savegameKeyList.indexOf(widgetKey);
|
||||||
ui->vlSavegame->insertWidget(sgdIndex, proWidget);
|
ui->vlSavegame->insertWidget(sgdIndex, proWidget);
|
||||||
|
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
ui->saProfile->ensureWidgetVisible(proWidget, 0, 0);
|
ui->saProfile->ensureWidgetVisible(proWidget, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,7 +306,7 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog)
|
||||||
QStringList widgetsKeyList = widgets.values();
|
QStringList widgetsKeyList = widgets.values();
|
||||||
QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive);
|
QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive);
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
qSort(pictureKeyList.rbegin(), pictureKeyList.rend());
|
std::sort(pictureKeyList.rbegin(), pictureKeyList.rend());
|
||||||
#else
|
#else
|
||||||
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>());
|
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>());
|
||||||
#endif
|
#endif
|
||||||
|
@ -314,7 +317,7 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
picIndex = pictureKeyList.indexOf(QRegExp(widgetKey));
|
picIndex = pictureKeyList.indexOf(widgetKey);
|
||||||
}
|
}
|
||||||
picIndex++;
|
picIndex++;
|
||||||
if (pictureKeyList.length() > picIndex)
|
if (pictureKeyList.length() > picIndex)
|
||||||
|
@ -338,7 +341,7 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog)
|
||||||
QStringList widgetsKeyList = widgets.values();
|
QStringList widgetsKeyList = widgets.values();
|
||||||
QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive);
|
QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive);
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
qSort(pictureKeyList.rbegin(), pictureKeyList.rend());
|
std::sort(pictureKeyList.rbegin(), pictureKeyList.rend());
|
||||||
#else
|
#else
|
||||||
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>());
|
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>());
|
||||||
#endif
|
#endif
|
||||||
|
@ -349,7 +352,7 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
picIndex = pictureKeyList.indexOf(QRegExp(widgetKey));
|
picIndex = pictureKeyList.indexOf(widgetKey);
|
||||||
}
|
}
|
||||||
if (picIndex > 0)
|
if (picIndex > 0)
|
||||||
{
|
{
|
||||||
|
@ -369,7 +372,12 @@ void ProfileInterface::sortingProfileInterface()
|
||||||
ui->vlSnapmatic->setEnabled(false);
|
ui->vlSnapmatic->setEnabled(false);
|
||||||
|
|
||||||
QStringList widgetsKeyList = widgets.values();
|
QStringList widgetsKeyList = widgets.values();
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050600
|
||||||
|
std::sort(widgetsKeyList.begin(), widgetsKeyList.end());
|
||||||
|
#else
|
||||||
qSort(widgetsKeyList.begin(), widgetsKeyList.end());
|
qSort(widgetsKeyList.begin(), widgetsKeyList.end());
|
||||||
|
#endif
|
||||||
|
|
||||||
for (QString widgetKey : widgetsKeyList)
|
for (QString widgetKey : widgetsKeyList)
|
||||||
{
|
{
|
||||||
|
@ -387,7 +395,7 @@ void ProfileInterface::sortingProfileInterface()
|
||||||
ui->vlSavegame->setEnabled(true);
|
ui->vlSavegame->setEnabled(true);
|
||||||
ui->vlSnapmatic->setEnabled(true);
|
ui->vlSnapmatic->setEnabled(true);
|
||||||
|
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileInterface::profileLoaded_p()
|
void ProfileInterface::profileLoaded_p()
|
||||||
|
@ -751,7 +759,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
|
||||||
cEnough++;
|
cEnough++;
|
||||||
}
|
}
|
||||||
spJson.createdDateTime = importDateTime;
|
spJson.createdDateTime = importDateTime;
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt();
|
||||||
|
#else
|
||||||
spJson.createdTimestamp = spJson.createdDateTime.toTime_t();
|
spJson.createdTimestamp = spJson.createdDateTime.toTime_t();
|
||||||
|
#endif
|
||||||
picture->setSnapmaticProperties(spJson);
|
picture->setSnapmaticProperties(spJson);
|
||||||
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid)));
|
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid)));
|
||||||
picture->setPictureTitle(customImageTitle);
|
picture->setPictureTitle(customImageTitle);
|
||||||
|
@ -805,7 +817,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
|
||||||
cEnough++;
|
cEnough++;
|
||||||
}
|
}
|
||||||
spJson.createdDateTime = importDateTime;
|
spJson.createdDateTime = importDateTime;
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt();
|
||||||
|
#else
|
||||||
spJson.createdTimestamp = spJson.createdDateTime.toTime_t();
|
spJson.createdTimestamp = spJson.createdDateTime.toTime_t();
|
||||||
|
#endif
|
||||||
picture->setSnapmaticProperties(spJson);
|
picture->setSnapmaticProperties(spJson);
|
||||||
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid)));
|
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid)));
|
||||||
picture->setPictureTitle(importDialog->getImageTitle());
|
picture->setPictureTitle(importDialog->getImageTitle());
|
||||||
|
@ -1050,7 +1066,11 @@ bool ProfileInterface::importImage(QImage *snapmaticImage, QDateTime importDateT
|
||||||
cEnough++;
|
cEnough++;
|
||||||
}
|
}
|
||||||
spJson.createdDateTime = importDateTime;
|
spJson.createdDateTime = importDateTime;
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt();
|
||||||
|
#else
|
||||||
spJson.createdTimestamp = spJson.createdDateTime.toTime_t();
|
spJson.createdTimestamp = spJson.createdDateTime.toTime_t();
|
||||||
|
#endif
|
||||||
picture->setSnapmaticProperties(spJson);
|
picture->setSnapmaticProperties(spJson);
|
||||||
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid)));
|
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid)));
|
||||||
picture->setPictureTitle(importDialog->getImageTitle());
|
picture->setPictureTitle(importDialog->getImageTitle());
|
||||||
|
@ -1094,7 +1114,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa
|
||||||
// Update Snapmatic uid
|
// Update Snapmatic uid
|
||||||
snapmaticProperties.uid = getRandomUid();
|
snapmaticProperties.uid = getRandomUid();
|
||||||
snapmaticProperties.createdDateTime = QDateTime::currentDateTime();
|
snapmaticProperties.createdDateTime = QDateTime::currentDateTime();
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
snapmaticProperties.createdTimestamp = QString::number(snapmaticProperties.createdDateTime.toSecsSinceEpoch()).toUInt();
|
||||||
|
#else
|
||||||
snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t();
|
snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t();
|
||||||
|
#endif
|
||||||
bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid));
|
bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid));
|
||||||
bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak");
|
bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak");
|
||||||
bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden");
|
bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden");
|
||||||
|
@ -1131,7 +1155,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa
|
||||||
// Update Snapmatic uid
|
// Update Snapmatic uid
|
||||||
snapmaticProperties.uid = getRandomUid();
|
snapmaticProperties.uid = getRandomUid();
|
||||||
snapmaticProperties.createdDateTime = QDateTime::currentDateTime();
|
snapmaticProperties.createdDateTime = QDateTime::currentDateTime();
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
snapmaticProperties.createdTimestamp = QString::number(snapmaticProperties.createdDateTime.toSecsSinceEpoch()).toUInt();
|
||||||
|
#else
|
||||||
snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t();
|
snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t();
|
||||||
|
#endif
|
||||||
bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid));
|
bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid));
|
||||||
bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak");
|
bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak");
|
||||||
bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden");
|
bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden");
|
||||||
|
@ -1304,7 +1332,7 @@ void ProfileInterface::exportSelected()
|
||||||
|
|
||||||
QString ExportPreSpan;
|
QString ExportPreSpan;
|
||||||
QString ExportPostSpan;
|
QString ExportPostSpan;
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
ExportPreSpan = "<span style=\"color: #003399; font-size: 12pt\">";
|
ExportPreSpan = "<span style=\"color: #003399; font-size: 12pt\">";
|
||||||
ExportPostSpan = "</span>";
|
ExportPostSpan = "</span>";
|
||||||
#else
|
#else
|
||||||
|
@ -1626,7 +1654,7 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev)
|
||||||
contextMenuOpened = true;
|
contextMenuOpened = true;
|
||||||
contextMenu.exec(ev->globalPos());
|
contextMenu.exec(ev->globalPos());
|
||||||
contextMenuOpened = false;
|
contextMenuOpened = false;
|
||||||
hoverProfileWidgetCheck();
|
QTimer::singleShot(0, this, SLOT(hoverProfileWidgetCheck()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev)
|
void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev)
|
||||||
|
@ -1659,7 +1687,7 @@ void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev)
|
||||||
contextMenuOpened = true;
|
contextMenuOpened = true;
|
||||||
contextMenu.exec(ev->globalPos());
|
contextMenu.exec(ev->globalPos());
|
||||||
contextMenuOpened = false;
|
contextMenuOpened = false;
|
||||||
hoverProfileWidgetCheck();
|
QTimer::singleShot(0, this, SLOT(hoverProfileWidgetCheck()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileInterface::on_saProfileContent_dropped(const QMimeData *mimeData)
|
void ProfileInterface::on_saProfileContent_dropped(const QMimeData *mimeData)
|
||||||
|
@ -1780,19 +1808,23 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease || event->type() == QEvent::WindowActivate)
|
else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease)
|
||||||
{
|
{
|
||||||
if ((watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") && isProfileLoaded)
|
if ((watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") && isProfileLoaded)
|
||||||
{
|
{
|
||||||
ProfileWidget *pWidget = nullptr;
|
ProfileWidget *pWidget = nullptr;
|
||||||
for (ProfileWidget *widget : widgets.keys())
|
QMap<ProfileWidget*, QString>::const_iterator it = widgets.constBegin();
|
||||||
|
QMap<ProfileWidget*, QString>::const_iterator end = widgets.constEnd();
|
||||||
|
while (it != end)
|
||||||
{
|
{
|
||||||
|
ProfileWidget *widget = it.key();
|
||||||
QPoint mousePos = widget->mapFromGlobal(QCursor::pos());
|
QPoint mousePos = widget->mapFromGlobal(QCursor::pos());
|
||||||
if (widget->rect().contains(mousePos))
|
if (widget->rect().contains(mousePos))
|
||||||
{
|
{
|
||||||
pWidget = widget;
|
pWidget = widget;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
it++;
|
||||||
}
|
}
|
||||||
if (pWidget != nullptr)
|
if (pWidget != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -1826,7 +1858,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
|
||||||
}
|
}
|
||||||
else if (event->type() == QEvent::WindowDeactivate && isProfileLoaded)
|
else if (event->type() == QEvent::WindowDeactivate && isProfileLoaded)
|
||||||
{
|
{
|
||||||
if (previousWidget != nullptr)
|
if (previousWidget != nullptr && watched == previousWidget)
|
||||||
{
|
{
|
||||||
previousWidget->setStyleSheet(QLatin1String(""));
|
previousWidget->setStyleSheet(QLatin1String(""));
|
||||||
previousWidget = nullptr;
|
previousWidget = nullptr;
|
||||||
|
@ -1862,13 +1894,17 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
|
||||||
void ProfileInterface::hoverProfileWidgetCheck()
|
void ProfileInterface::hoverProfileWidgetCheck()
|
||||||
{
|
{
|
||||||
ProfileWidget *pWidget = nullptr;
|
ProfileWidget *pWidget = nullptr;
|
||||||
for (ProfileWidget *widget : widgets.keys())
|
QMap<ProfileWidget*, QString>::const_iterator it = widgets.constBegin();
|
||||||
|
QMap<ProfileWidget*, QString>::const_iterator end = widgets.constEnd();
|
||||||
|
while (it != end)
|
||||||
{
|
{
|
||||||
|
ProfileWidget *widget = it.key();
|
||||||
if (widget->underMouse())
|
if (widget->underMouse())
|
||||||
{
|
{
|
||||||
pWidget = widget;
|
pWidget = widget;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
it++;
|
||||||
}
|
}
|
||||||
if (pWidget != nullptr)
|
if (pWidget != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -2017,7 +2053,7 @@ void ProfileInterface::massTool(MassTool tool)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
picture->emitUpdate();
|
picture->emitUpdate();
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbDialog.close();
|
pbDialog.close();
|
||||||
|
@ -2116,7 +2152,7 @@ void ProfileInterface::massTool(MassTool tool)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
picture->emitUpdate();
|
picture->emitUpdate();
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbDialog.close();
|
pbDialog.close();
|
||||||
|
@ -2169,7 +2205,7 @@ preSelectionCrewID:
|
||||||
}
|
}
|
||||||
if (crewList.contains(QString::number(crewID)))
|
if (crewList.contains(QString::number(crewID)))
|
||||||
{
|
{
|
||||||
indexNum = crewList.indexOf(QRegExp(QString::number(crewID)));
|
indexNum = crewList.indexOf(QString::number(crewID));
|
||||||
}
|
}
|
||||||
QString newCrew = QInputDialog::getItem(this, QApplication::translate("SnapmaticEditor", "Snapmatic Crew"), QApplication::translate("SnapmaticEditor", "New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags()^Qt::Dialog^Qt::WindowMinMaxButtonsHint);
|
QString newCrew = QInputDialog::getItem(this, QApplication::translate("SnapmaticEditor", "Snapmatic Crew"), QApplication::translate("SnapmaticEditor", "New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags()^Qt::Dialog^Qt::WindowMinMaxButtonsHint);
|
||||||
if (ok && !newCrew.isEmpty())
|
if (ok && !newCrew.isEmpty())
|
||||||
|
@ -2247,7 +2283,7 @@ preSelectionCrewID:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
picture->emitUpdate();
|
picture->emitUpdate();
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbDialog.close();
|
pbDialog.close();
|
||||||
|
@ -2350,7 +2386,7 @@ preSelectionTitle:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
picture->emitUpdate();
|
picture->emitUpdate();
|
||||||
qApp->processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbDialog.close();
|
pbDialog.close();
|
||||||
|
|
34
README.md
|
@ -4,7 +4,7 @@ Grand Theft Auto V Savegame and Snapmatic viewer/editor
|
||||||
- View Snapmatics with the ability to disable them in-game
|
- View Snapmatics with the ability to disable them in-game
|
||||||
- Edit Snapmatic pictures and properties in multiple ways
|
- Edit Snapmatic pictures and properties in multiple ways
|
||||||
- Import/Export Snapmatics, Savegames and pictures
|
- Import/Export Snapmatics, Savegames and pictures
|
||||||
- Let choose between multiple Social Club accounts as GTA V profiles IDs
|
- Choose between multiple Social Club accounts as GTA V profiles IDs
|
||||||
|
|
||||||
#### Screenshots
|
#### Screenshots
|
||||||
![Snapmatic Picture Viewer](res/src/picture.png)
|
![Snapmatic Picture Viewer](res/src/picture.png)
|
||||||
|
@ -15,39 +15,39 @@ Grand Theft Auto V Savegame and Snapmatic viewer/editor
|
||||||
|
|
||||||
# Note: Install Docker Community Edition and Git before continuing
|
# Note: Install Docker Community Edition and Git before continuing
|
||||||
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
||||||
docker pull syping/qt5-static-mingw
|
docker pull sypingauto/gta5view-build:1.8-static
|
||||||
docker run --rm -v ${PWD}:/gta5view -it syping/qt5-static-mingw
|
docker run --rm -v ${PWD}:/gta5view -it sypingauto/gta5view-build:1.8-static
|
||||||
cd /gta5view && mkdir -p build && cd build
|
cd /gta5view && mkdir -p build && cd build
|
||||||
qmake-static ../gta5view.pro
|
mingw64-qt-cmake ../
|
||||||
make depend
|
|
||||||
make -j $(nproc --all)
|
make -j $(nproc --all)
|
||||||
|
|
||||||
#### Build gta5view for Debian/Ubuntu
|
#### Build gta5view for Debian/Ubuntu
|
||||||
|
|
||||||
sudo apt-get install git gcc g++ qtbase5-dev qttranslations5-l10n qt5-qmake make
|
sudo apt-get install cmake git gcc g++ libqt5svg5-dev make qtbase5-dev qttranslations5-l10n
|
||||||
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
../configure --prefix=/opt/gta5view
|
cmake ../
|
||||||
make depend
|
make -j $(nproc --all)
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
#### Build gta5view for Arch/Manjaro
|
||||||
|
|
||||||
|
sudo pacman -S cmake gcc git make qt5-base qt5-svg qt5-tools qt5-translations
|
||||||
|
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
||||||
|
mkdir -p build && cd build
|
||||||
|
cmake ../
|
||||||
make -j $(nproc --all)
|
make -j $(nproc --all)
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
#### Build gta5view for Fedora
|
#### Build gta5view for Fedora
|
||||||
|
|
||||||
sudo dnf install git gcc gcc-c++ qt5-qtbase-devel qt5-qttranslations make
|
sudo dnf install cmake git gcc gcc-c++ make qt5-qtbase-devel qt5-qtsvg-devel qt5-qttranslations
|
||||||
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
git clone https://gitlab.com/Syping/gta5view && cd gta5view
|
||||||
mkdir -p build && cd build
|
mkdir -p build && cd build
|
||||||
../configure --prefix=/opt/gta5view
|
cmake ../
|
||||||
make depend
|
|
||||||
make -j $(nproc --all)
|
make -j $(nproc --all)
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
#### Build gta5view for Windows (Beginner)
|
|
||||||
|
|
||||||
Download the [Qt Framework](https://www.qt.io/) and install the MinGW version.
|
|
||||||
Download the Source Code over the Repository or with your Git client.
|
|
||||||
Open the gta5view.pro Project file with Qt Creator and build it over Qt Creator.
|
|
||||||
|
|
||||||
#### Download Binary Releases
|
#### Download Binary Releases
|
||||||
|
|
||||||
Go to [gta5view release](https://github.com/SyDevTeam/gta5view/releases) and download the .exe file for Windows, .deb file for Debian/Ubuntu and .dmg file for OS X.
|
Go to [gta5view release](https://github.com/SyDevTeam/gta5view/releases) and download the .exe file for Windows, .deb file for Debian/Ubuntu and .dmg file for OS X.
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include "StringParser.h"
|
#include "StringParser.h"
|
||||||
#include "SavegameData.h"
|
#include "SavegameData.h"
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "StringParser.h"
|
#include "StringParser.h"
|
||||||
#include "AppEnv.h"
|
#include "AppEnv.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <QStringListIterator>
|
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
@ -438,7 +437,7 @@ void SnapmaticEditor::on_labCrew_linkActivated(const QString &link)
|
||||||
}
|
}
|
||||||
if (crewList.contains(QString::number(crewID)))
|
if (crewList.contains(QString::number(crewID)))
|
||||||
{
|
{
|
||||||
indexNum = crewList.indexOf(QRegExp(QString::number(crewID)));
|
indexNum = crewList.indexOf(QString::number(crewID));
|
||||||
}
|
}
|
||||||
QString newCrew = QInputDialog::getItem(this, tr("Snapmatic Crew"), tr("New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags());
|
QString newCrew = QInputDialog::getItem(this, tr("Snapmatic Crew"), tr("New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags());
|
||||||
if (ok && !newCrew.isEmpty())
|
if (ok && !newCrew.isEmpty())
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
@ -33,6 +32,10 @@
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
|
#include <QTextCodec>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
#include <QSaveFile>
|
#include <QSaveFile>
|
||||||
#else
|
#else
|
||||||
|
@ -106,7 +109,7 @@ void SnapmaticPicture::reset()
|
||||||
jsonStr = QString();
|
jsonStr = QString();
|
||||||
|
|
||||||
// SNAPMATIC DEFAULTS
|
// SNAPMATIC DEFAULTS
|
||||||
#ifdef GTA5SYNC_NOASSIST
|
#ifdef SNAPMATIC_NODEFAULT
|
||||||
careSnapDefault = false;
|
careSnapDefault = false;
|
||||||
#else
|
#else
|
||||||
careSnapDefault = true;
|
careSnapDefault = true;
|
||||||
|
@ -433,8 +436,8 @@ QString SnapmaticPicture::getSnapmaticHeaderString(const QByteArray &snapmaticHe
|
||||||
QString SnapmaticPicture::getSnapmaticJSONString(const QByteArray &jsonBytes)
|
QString SnapmaticPicture::getSnapmaticJSONString(const QByteArray &jsonBytes)
|
||||||
{
|
{
|
||||||
QByteArray jsonUsefulBytes = jsonBytes;
|
QByteArray jsonUsefulBytes = jsonBytes;
|
||||||
jsonUsefulBytes.replace('\x00', QString());
|
jsonUsefulBytes.replace('\x00', "");
|
||||||
jsonUsefulBytes.replace('\x0c', QString());
|
jsonUsefulBytes.replace('\x0c', "");
|
||||||
return QString::fromUtf8(jsonUsefulBytes.trimmed());
|
return QString::fromUtf8(jsonUsefulBytes.trimmed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -994,7 +997,11 @@ void SnapmaticPicture::parseJsonContent()
|
||||||
bool timestampOk;
|
bool timestampOk;
|
||||||
QDateTime createdTimestamp;
|
QDateTime createdTimestamp;
|
||||||
localProperties.createdTimestamp = jsonMap["creat"].toUInt(×tampOk);
|
localProperties.createdTimestamp = jsonMap["creat"].toUInt(×tampOk);
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
createdTimestamp.setSecsSinceEpoch(QString::number(localProperties.createdTimestamp).toLongLong());
|
||||||
|
#else
|
||||||
createdTimestamp.setTime_t(localProperties.createdTimestamp);
|
createdTimestamp.setTime_t(localProperties.createdTimestamp);
|
||||||
|
#endif
|
||||||
localProperties.createdDateTime = createdTimestamp;
|
localProperties.createdDateTime = createdTimestamp;
|
||||||
if (!timestampOk) { jsonError = true; }
|
if (!timestampOk) { jsonError = true; }
|
||||||
}
|
}
|
||||||
|
@ -1418,7 +1425,13 @@ bool SnapmaticPicture::verifyTitleChar(const QChar &titleChar)
|
||||||
QString SnapmaticPicture::parseTitleString(const QByteArray &commitBytes, int maxLength)
|
QString SnapmaticPicture::parseTitleString(const QByteArray &commitBytes, int maxLength)
|
||||||
{
|
{
|
||||||
Q_UNUSED(maxLength)
|
Q_UNUSED(maxLength)
|
||||||
|
#if QT_VERSION >= 0x060000
|
||||||
|
QStringDecoder strDecoder = QStringDecoder(QStringDecoder::Utf16LE);
|
||||||
|
QString retStr = strDecoder(commitBytes);
|
||||||
|
retStr = retStr.trimmed();
|
||||||
|
#else
|
||||||
QString retStr = QTextCodec::codecForName("UTF-16LE")->toUnicode(commitBytes).trimmed();
|
QString retStr = QTextCodec::codecForName("UTF-16LE")->toUnicode(commitBytes).trimmed();
|
||||||
|
#endif
|
||||||
retStr.remove(QChar('\x00'));
|
retStr.remove(QChar('\x00'));
|
||||||
return retStr;
|
return retStr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ public:
|
||||||
bool setVisible() { return setPictureVisible(); } // Please use setPictureVisible instead
|
bool setVisible() { return setPictureVisible(); } // Please use setPictureVisible instead
|
||||||
|
|
||||||
// PREDEFINED PROPERTIES
|
// PREDEFINED PROPERTIES
|
||||||
QSize getSnapmaticResolution();
|
static QSize getSnapmaticResolution();
|
||||||
|
|
||||||
// SNAPMATIC DEFAULTS
|
// SNAPMATIC DEFAULTS
|
||||||
bool isSnapmaticDefaultsEnforced();
|
bool isSnapmaticDefaultsEnforced();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2019 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
#include "SnapmaticWidget.h"
|
#include "SnapmaticWidget.h"
|
||||||
#include "ui_SnapmaticWidget.h"
|
#include "ui_SnapmaticWidget.h"
|
||||||
#include "ImageEditorDialog.h"
|
|
||||||
#include "MapLocationDialog.h"
|
#include "MapLocationDialog.h"
|
||||||
#include "JsonEditorDialog.h"
|
#include "JsonEditorDialog.h"
|
||||||
#include "SnapmaticPicture.h"
|
#include "SnapmaticPicture.h"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "StringParser.h"
|
#include "StringParser.h"
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@ -49,12 +48,16 @@ QString StringParser::escapeString(const QString &toEscape)
|
||||||
QString StringParser::convertBuildedString(const QString &buildedStr)
|
QString StringParser::convertBuildedString(const QString &buildedStr)
|
||||||
{
|
{
|
||||||
QString outputStr = buildedStr;
|
QString outputStr = buildedStr;
|
||||||
QByteArray sharePath = GTA5SYNC_SHARE;
|
outputStr.replace("APPNAME:", QString::fromUtf8(GTA5SYNC_APPSTR));
|
||||||
outputStr.replace("APPNAME:", GTA5SYNC_APPSTR);
|
outputStr.replace("SHAREDDIR:", QString::fromUtf8(GTA5SYNC_SHARE));
|
||||||
outputStr.replace("SHAREDDIR:", QString::fromUtf8(sharePath));
|
outputStr.replace("RUNDIR:", QFileInfo(QApplication::applicationFilePath()).canonicalPath());
|
||||||
outputStr.replace("RUNDIR:", QFileInfo(qApp->applicationFilePath()).absoluteDir().absolutePath());
|
#if QT_VERSION >= 0x060000
|
||||||
|
outputStr.replace("QCONFLANG:", QLibraryInfo::path(QLibraryInfo::TranslationsPath));
|
||||||
|
outputStr.replace("QCONFPLUG:", QLibraryInfo::path(QLibraryInfo::PluginsPath));
|
||||||
|
#else
|
||||||
outputStr.replace("QCONFLANG:", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
outputStr.replace("QCONFLANG:", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
outputStr.replace("QCONFPLUG:", QLibraryInfo::location(QLibraryInfo::PluginsPath));
|
outputStr.replace("QCONFPLUG:", QLibraryInfo::location(QLibraryInfo::PluginsPath));
|
||||||
|
#endif
|
||||||
outputStr.replace("SEPARATOR:", QDir::separator());
|
outputStr.replace("SEPARATOR:", QDir::separator());
|
||||||
return outputStr;
|
return outputStr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define GTA5SYNC_TELEMETRY_WEBURL ""
|
#define GTA5SYNC_TELEMETRY_WEBURL ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "intrin.h"
|
#include "intrin.h"
|
||||||
#include "d3d9.h"
|
#include "d3d9.h"
|
||||||
|
@ -228,7 +228,7 @@ QJsonDocument TelemetryClass::getSystemHardware()
|
||||||
{
|
{
|
||||||
QJsonDocument jsonDocument;
|
QJsonDocument jsonDocument;
|
||||||
QJsonObject jsonObject;
|
QJsonObject jsonObject;
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
{
|
{
|
||||||
int CPUInfo[4] = {-1};
|
int CPUInfo[4] = {-1};
|
||||||
unsigned nExIds, ic = 0;
|
unsigned nExIds, ic = 0;
|
||||||
|
|
|
@ -63,7 +63,11 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
#endif
|
||||||
isLangLoaded = true;
|
isLangLoaded = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +151,11 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
#endif
|
||||||
isLangLoaded = true;
|
isLangLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,7 +184,11 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
#endif
|
||||||
isLangLoaded = true;
|
isLangLoaded = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -195,7 +207,11 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
#endif
|
||||||
isLangLoaded = true;
|
isLangLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,7 +235,11 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
#endif
|
||||||
isLangLoaded = true;
|
isLangLoaded = true;
|
||||||
}
|
}
|
||||||
else if (!trLoadSuccess)
|
else if (!trLoadSuccess)
|
||||||
|
@ -236,7 +256,11 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
#endif
|
||||||
isLangLoaded = true;
|
isLangLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,14 +40,21 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QTimer>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, MessageThread *threadMessage, QWidget *parent) :
|
||||||
|
QMainWindow(parent), profileDB(profileDB), crewDB(crewDB), threadDB(threadDB), threadMessage(threadMessage),
|
||||||
|
ui(new Ui::UserInterface)
|
||||||
|
#else
|
||||||
UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent) :
|
UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent) :
|
||||||
QMainWindow(parent), profileDB(profileDB), crewDB(crewDB), threadDB(threadDB),
|
QMainWindow(parent), profileDB(profileDB), crewDB(crewDB), threadDB(threadDB),
|
||||||
ui(new Ui::UserInterface)
|
ui(new Ui::UserInterface)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
contentMode = 0;
|
contentMode = 0;
|
||||||
|
@ -172,7 +179,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
|
||||||
ui->vlUserInterface->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio);
|
ui->vlUserInterface->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInterface::setupDirEnv()
|
void UserInterface::setupDirEnv(bool showFolderDialog)
|
||||||
{
|
{
|
||||||
// settings init
|
// settings init
|
||||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
|
@ -185,20 +192,23 @@ void UserInterface::setupDirEnv()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly);
|
if (showFolderDialog)
|
||||||
if (QFileInfo(GTAV_Folder).exists())
|
|
||||||
{
|
{
|
||||||
folderExists = true;
|
GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly);
|
||||||
QDir::setCurrent(GTAV_Folder);
|
if (QFileInfo(GTAV_Folder).exists())
|
||||||
AppEnv::setGameFolder(GTAV_Folder);
|
|
||||||
|
|
||||||
// First time folder selection save
|
|
||||||
settings.beginGroup("dir");
|
|
||||||
if (settings.value("dir", "").toString().isEmpty())
|
|
||||||
{
|
{
|
||||||
settings.setValue("dir", GTAV_Folder);
|
folderExists = true;
|
||||||
|
QDir::setCurrent(GTAV_Folder);
|
||||||
|
AppEnv::setGameFolder(GTAV_Folder);
|
||||||
|
|
||||||
|
// First time folder selection save
|
||||||
|
settings.beginGroup("dir");
|
||||||
|
if (settings.value("dir", "").toString().isEmpty())
|
||||||
|
{
|
||||||
|
settings.setValue("dir", GTAV_Folder);
|
||||||
|
}
|
||||||
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
settings.endGroup();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +338,11 @@ void UserInterface::closeProfile_p()
|
||||||
void UserInterface::closeEvent(QCloseEvent *ev)
|
void UserInterface::closeEvent(QCloseEvent *ev)
|
||||||
{
|
{
|
||||||
Q_UNUSED(ev)
|
Q_UNUSED(ev)
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
threadMessage->terminateThread();
|
||||||
|
#else
|
||||||
threadDB->terminateThread();
|
threadDB->terminateThread();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
UserInterface::~UserInterface()
|
UserInterface::~UserInterface()
|
||||||
|
@ -603,6 +617,119 @@ void UserInterface::settingsApplied(int _contentMode, bool languageChanged)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
void UserInterface::messagesArrived(const QJsonObject &object)
|
||||||
|
{
|
||||||
|
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
|
settings.beginGroup("Messages");
|
||||||
|
QJsonObject::const_iterator it = object.constBegin();
|
||||||
|
QJsonObject::const_iterator end = object.constEnd();
|
||||||
|
QStringList messages;
|
||||||
|
while (it != end) {
|
||||||
|
const QString key = it.key();
|
||||||
|
const QJsonValue value = it.value();
|
||||||
|
bool uintOk;
|
||||||
|
uint messageId = key.toUInt(&uintOk);
|
||||||
|
if (uintOk && value.isString()) {
|
||||||
|
const QString valueStr = value.toString();
|
||||||
|
settings.setValue(QString::number(messageId), valueStr);
|
||||||
|
messages << valueStr;
|
||||||
|
}
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
settings.endGroup();
|
||||||
|
if (!messages.isEmpty())
|
||||||
|
showMessages(messages);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::showMessages(const QStringList messages)
|
||||||
|
{
|
||||||
|
QDialog *messageDialog = new QDialog(this);
|
||||||
|
messageDialog->setWindowTitle(tr("%1 - Messages").arg(GTA5SYNC_APPSTR));
|
||||||
|
messageDialog->setWindowFlags(messageDialog->windowFlags()^Qt::WindowContextHelpButtonHint);
|
||||||
|
QVBoxLayout *messageLayout = new QVBoxLayout;
|
||||||
|
messageDialog->setLayout(messageLayout);
|
||||||
|
QStackedWidget *stackWidget = new QStackedWidget(messageDialog);
|
||||||
|
for (const QString message : messages) {
|
||||||
|
QLabel *messageLabel = new QLabel(messageDialog);
|
||||||
|
messageLabel->setText(message);
|
||||||
|
messageLabel->setWordWrap(true);
|
||||||
|
stackWidget->addWidget(messageLabel);
|
||||||
|
}
|
||||||
|
messageLayout->addWidget(stackWidget);
|
||||||
|
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||||
|
QPushButton *backButton = new QPushButton(messageDialog);
|
||||||
|
QPushButton *nextButton = new QPushButton(messageDialog);
|
||||||
|
if (QIcon::hasThemeIcon("go-previous") && QIcon::hasThemeIcon("go-next") && QIcon::hasThemeIcon("list-add")) {
|
||||||
|
backButton->setIcon(QIcon::fromTheme("go-previous"));
|
||||||
|
nextButton->setIcon(QIcon::fromTheme("go-next"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
backButton->setIcon(QIcon(":/img/back.svgz"));
|
||||||
|
nextButton->setIcon(QIcon(":/img/next.svgz"));
|
||||||
|
}
|
||||||
|
backButton->setEnabled(false);
|
||||||
|
if (stackWidget->count() <= 1) {
|
||||||
|
nextButton->setEnabled(false);
|
||||||
|
}
|
||||||
|
buttonLayout->addWidget(backButton);
|
||||||
|
buttonLayout->addWidget(nextButton);
|
||||||
|
buttonLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||||
|
QPushButton *closeButton = new QPushButton(messageDialog);
|
||||||
|
closeButton->setText(tr("&Close"));
|
||||||
|
if (QIcon::hasThemeIcon("dialog-close")) {
|
||||||
|
closeButton->setIcon(QIcon::fromTheme("dialog-close"));
|
||||||
|
}
|
||||||
|
else if (QIcon::hasThemeIcon("gtk-close")) {
|
||||||
|
closeButton->setIcon(QIcon::fromTheme("gtk-close"));
|
||||||
|
}
|
||||||
|
buttonLayout->addWidget(closeButton);
|
||||||
|
messageLayout->addLayout(buttonLayout);
|
||||||
|
QObject::connect(backButton, &QPushButton::clicked, [stackWidget,backButton,nextButton,closeButton]() {
|
||||||
|
int index = stackWidget->currentIndex();
|
||||||
|
if (index > 0) {
|
||||||
|
index--;
|
||||||
|
stackWidget->setCurrentIndex(index);
|
||||||
|
nextButton->setEnabled(true);
|
||||||
|
if (index > 0) {
|
||||||
|
backButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
backButton->setEnabled(false);
|
||||||
|
closeButton->setFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
QObject::connect(nextButton, &QPushButton::clicked, [stackWidget,backButton,nextButton,closeButton]() {
|
||||||
|
int index = stackWidget->currentIndex();
|
||||||
|
if (index < stackWidget->count()-1) {
|
||||||
|
index++;
|
||||||
|
stackWidget->setCurrentIndex(index);
|
||||||
|
backButton->setEnabled(true);
|
||||||
|
if (index < stackWidget->count()-1) {
|
||||||
|
nextButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nextButton->setEnabled(false);
|
||||||
|
closeButton->setFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
QObject::connect(closeButton, &QPushButton::clicked, messageDialog, &QDialog::accept);
|
||||||
|
QObject::connect(messageDialog, &QDialog::finished, messageDialog, &QDialog::deleteLater);
|
||||||
|
QTimer::singleShot(0, closeButton, SLOT(setFocus()));
|
||||||
|
messageDialog->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::updateCacheId(uint cacheId)
|
||||||
|
{
|
||||||
|
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
|
settings.beginGroup("Messages");
|
||||||
|
settings.setValue("CacheId", cacheId);
|
||||||
|
settings.endGroup();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void UserInterface::on_actionSelect_GTA_Folder_triggered()
|
void UserInterface::on_actionSelect_GTA_Folder_triggered()
|
||||||
{
|
{
|
||||||
QString GTAV_Folder_Temp = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly);
|
QString GTAV_Folder_Temp = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly);
|
||||||
|
|
|
@ -31,6 +31,10 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
#include "MessageThread.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class UserInterface;
|
class UserInterface;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +43,12 @@ class UserInterface : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, MessageThread *messageThread, QWidget *parent = 0);
|
||||||
|
#else
|
||||||
explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0);
|
explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0);
|
||||||
void setupDirEnv();
|
#endif
|
||||||
|
void setupDirEnv(bool showFolderDialog = true);
|
||||||
~UserInterface();
|
~UserInterface();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -67,6 +75,11 @@ private slots:
|
||||||
void on_actionSet_Crew_triggered();
|
void on_actionSet_Crew_triggered();
|
||||||
void on_actionSet_Title_triggered();
|
void on_actionSet_Title_triggered();
|
||||||
void settingsApplied(int contentMode, bool languageChanged);
|
void settingsApplied(int contentMode, bool languageChanged);
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
void messagesArrived(const QJsonObject &object);
|
||||||
|
void showMessages(const QStringList messages);
|
||||||
|
void updateCacheId(uint cacheId);
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *ev);
|
void closeEvent(QCloseEvent *ev);
|
||||||
|
@ -75,6 +88,9 @@ private:
|
||||||
ProfileDatabase *profileDB;
|
ProfileDatabase *profileDB;
|
||||||
CrewDatabase *crewDB;
|
CrewDatabase *crewDB;
|
||||||
DatabaseThread *threadDB;
|
DatabaseThread *threadDB;
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
MessageThread *threadMessage;
|
||||||
|
#endif
|
||||||
Ui::UserInterface *ui;
|
Ui::UserInterface *ui;
|
||||||
ProfileInterface *profileUI;
|
ProfileInterface *profileUI;
|
||||||
QList<QPushButton*> profileBtns;
|
QList<QPushButton*> profileBtns;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* ImageCropper Qt Widget for cropping images
|
* ImageCropper Qt Widget for cropping images
|
||||||
* Copyright (C) 2013 Dimka Novikov, to@dimkanovikov.pro
|
* Copyright (C) 2013 Dimka Novikov, to@dimkanovikov.pro
|
||||||
|
* Copyright (C) 2020 Syping
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -17,7 +18,9 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "imagecropper.h"
|
#include "imagecropper.h"
|
||||||
|
#include "AppEnv.h"
|
||||||
|
|
||||||
|
#include <QPainterPath>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
@ -112,16 +115,16 @@ const QPixmap ImageCropper::cropImage()
|
||||||
// Получим размер отображаемого изображения
|
// Получим размер отображаемого изображения
|
||||||
QSize scaledImageSize =
|
QSize scaledImageSize =
|
||||||
pimpl->imageForCropping.scaled(
|
pimpl->imageForCropping.scaled(
|
||||||
this->size(), Qt::KeepAspectRatio, Qt::FastTransformation
|
size(), Qt::KeepAspectRatio, Qt::SmoothTransformation
|
||||||
).size();
|
).size();
|
||||||
// Определим расстояние от левого и верхнего краёв
|
// Определим расстояние от левого и верхнего краёв
|
||||||
float leftDelta = 0;
|
float leftDelta = 0;
|
||||||
float topDelta = 0;
|
float topDelta = 0;
|
||||||
const float HALF_COUNT = 2;
|
const float HALF_COUNT = 2;
|
||||||
if (this->size().height() == scaledImageSize.height()) {
|
if (size().height() == scaledImageSize.height()) {
|
||||||
leftDelta = (this->width() - scaledImageSize.width()) / HALF_COUNT;
|
leftDelta = (width() - scaledImageSize.width()) / HALF_COUNT;
|
||||||
} else {
|
} else {
|
||||||
topDelta = (this->height() - scaledImageSize.height()) / HALF_COUNT;
|
topDelta = (height() - scaledImageSize.height()) / HALF_COUNT;
|
||||||
}
|
}
|
||||||
// Определим пропорцию области обрезки по отношению к исходному изображению
|
// Определим пропорцию области обрезки по отношению к исходному изображению
|
||||||
float xScale = (float)pimpl->imageForCropping.width() / scaledImageSize.width();
|
float xScale = (float)pimpl->imageForCropping.width() / scaledImageSize.width();
|
||||||
|
@ -145,39 +148,54 @@ const QPixmap ImageCropper::cropImage()
|
||||||
|
|
||||||
void ImageCropper::paintEvent(QPaintEvent* _event)
|
void ImageCropper::paintEvent(QPaintEvent* _event)
|
||||||
{
|
{
|
||||||
QWidget::paintEvent( _event );
|
QWidget::paintEvent(_event);
|
||||||
//
|
//
|
||||||
QPainter widgetPainter(this);
|
QPainter widgetPainter(this);
|
||||||
// Рисуем изображение по центру виджета
|
// Рисуем изображение по центру виджета
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x050600
|
||||||
|
qreal screenRatioPR = AppEnv::screenRatioPR();
|
||||||
// ... подгоним изображение для отображения по размеру виджета
|
// ... подгоним изображение для отображения по размеру виджета
|
||||||
QPixmap scaledImage =
|
QPixmap scaledImage =
|
||||||
pimpl->imageForCropping.scaled(this->size(), Qt::KeepAspectRatio, Qt::FastTransformation);
|
pimpl->imageForCropping.scaled(qRound((double)width() * screenRatioPR), qRound((double)height() * screenRatioPR), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
scaledImage.setDevicePixelRatio(screenRatioPR);
|
||||||
|
#else
|
||||||
|
QPixmap scaledImage =
|
||||||
|
pimpl->imageForCropping.scaled(size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
#endif
|
||||||
// ... заливаем фон
|
// ... заливаем фон
|
||||||
widgetPainter.fillRect( this->rect(), pimpl->backgroundColor );
|
widgetPainter.fillRect(rect(), pimpl->backgroundColor);
|
||||||
// ... рисуем изображение по центру виджета
|
// ... рисуем изображение по центру виджета
|
||||||
if ( this->size().height() == scaledImage.height() ) {
|
#if QT_VERSION >= 0x050600
|
||||||
widgetPainter.drawPixmap( ( this->width() - scaledImage.width() ) / 2, 0, scaledImage );
|
if (qRound((double)height() * screenRatioPR) == scaledImage.height()) {
|
||||||
|
widgetPainter.drawPixmap( ( qRound((double)width() * screenRatioPR) - scaledImage.width() ) / 2, 0, scaledImage );
|
||||||
} else {
|
} else {
|
||||||
widgetPainter.drawPixmap( 0, ( this->height() - scaledImage.height() ) / 2, scaledImage );
|
widgetPainter.drawPixmap( 0, ( qRound((double)height() * screenRatioPR) - scaledImage.height() ) / 2, scaledImage );
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (height() == scaledImage.height()) {
|
||||||
|
widgetPainter.drawPixmap( ( width()- scaledImage.width() ) / 2, 0, scaledImage );
|
||||||
|
} else {
|
||||||
|
widgetPainter.drawPixmap( 0, ( height() - scaledImage.height() ) / 2, scaledImage );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
// Рисуем область обрезки
|
// Рисуем область обрезки
|
||||||
{
|
{
|
||||||
// ... если это первое отображение после инициилизации, то центруем областо обрезки
|
// ... если это первое отображение после инициилизации, то центруем областо обрезки
|
||||||
if (pimpl->croppingRect.isNull()) {
|
if (pimpl->croppingRect.isNull()) {
|
||||||
const int width = WIDGET_MINIMUM_SIZE.width()/2;
|
const int cwidth = WIDGET_MINIMUM_SIZE.width()/2;
|
||||||
const int height = WIDGET_MINIMUM_SIZE.height()/2;
|
const int cheight = WIDGET_MINIMUM_SIZE.height()/2;
|
||||||
pimpl->croppingRect.setSize(QSize(width, height));
|
pimpl->croppingRect.setSize(QSize(cwidth, cheight));
|
||||||
float x = (this->width() - pimpl->croppingRect.width())/2;
|
float x = (width() - pimpl->croppingRect.width())/2;
|
||||||
float y = (this->height() - pimpl->croppingRect.height())/2;
|
float y = (height() - pimpl->croppingRect.height())/2;
|
||||||
pimpl->croppingRect.moveTo(x, y);
|
pimpl->croppingRect.moveTo(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... рисуем затемненную область
|
// ... рисуем затемненную область
|
||||||
QPainterPath p;
|
QPainterPath p;
|
||||||
p.addRect(pimpl->croppingRect);
|
p.addRect(pimpl->croppingRect);
|
||||||
p.addRect(this->rect());
|
p.addRect(rect());
|
||||||
widgetPainter.setBrush(QBrush(QColor(0,0,0,120)));
|
widgetPainter.setBrush(QBrush(QColor(0,0,0,120)));
|
||||||
widgetPainter.setPen(Qt::transparent);
|
widgetPainter.setPen(Qt::transparent);
|
||||||
widgetPainter.drawPath(p);
|
widgetPainter.drawPath(p);
|
||||||
|
|
14
config.h
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2016-2018 Syping
|
* Copyright (C) 2016-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -40,11 +40,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GTA5SYNC_COPYRIGHT
|
#ifndef GTA5SYNC_COPYRIGHT
|
||||||
#define GTA5SYNC_COPYRIGHT "2016-2019"
|
#define GTA5SYNC_COPYRIGHT "2016-2020"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GTA5SYNC_APPVER
|
#ifndef GTA5SYNC_APPVER
|
||||||
#define GTA5SYNC_APPVER "1.7.1"
|
#define GTA5SYNC_APPVER "1.8.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
|
@ -107,22 +107,16 @@
|
||||||
#define GTA5SYNC_INLANG ":/tr"
|
#define GTA5SYNC_INLANG ":/tr"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#ifndef GTA5SYNC_SHARE
|
#ifndef GTA5SYNC_SHARE
|
||||||
#define GTA5SYNC_SHARE "RUNDIR:"
|
#define GTA5SYNC_SHARE "RUNDIR:"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GTA5SYNC_LANG
|
#ifndef GTA5SYNC_LANG
|
||||||
#define GTA5SYNC_LANG "SHAREDDIR:SEPARATOR:lang"
|
#define GTA5SYNC_LANG "SHAREDDIR:SEPARATOR:lang"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GTA5SYNC_PLUG
|
#ifndef GTA5SYNC_PLUG
|
||||||
#define GTA5SYNC_PLUG "RUNDIR:SEPARATOR:plugins"
|
#define GTA5SYNC_PLUG "RUNDIR:SEPARATOR:plugins"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WINRT
|
|
||||||
#undef GTA5SYNC_WIN
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GTA5SYNC_COMPILER
|
#ifndef GTA5SYNC_COMPILER
|
||||||
|
|
242
configure
vendored
|
@ -1,242 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
#*****************************************************************************
|
|
||||||
# gta5view Grand Theft Auto V Profile Viewer
|
|
||||||
# Copyright (C) 2018 Syping
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# 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 General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#*****************************************************************************
|
|
||||||
|
|
||||||
# Argbash generated code
|
|
||||||
die()
|
|
||||||
{
|
|
||||||
local _ret=$2
|
|
||||||
test -n "$_ret" || _ret=1
|
|
||||||
test "$_PRINT_HELP" = yes && print_help >&2
|
|
||||||
echo "$1" >&2
|
|
||||||
exit ${_ret}
|
|
||||||
}
|
|
||||||
begins_with_short_option()
|
|
||||||
{
|
|
||||||
local first_option all_short_options
|
|
||||||
all_short_options='h'
|
|
||||||
first_option="${1:0:1}"
|
|
||||||
test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0
|
|
||||||
}
|
|
||||||
_arg_prefix=
|
|
||||||
_arg_qmake=
|
|
||||||
_arg_telemetry_authid=
|
|
||||||
_arg_telemetry_authpw=
|
|
||||||
_arg_telemetry_pushurl=
|
|
||||||
_arg_telemetry_regurl=
|
|
||||||
_arg_telemetry_weburl=
|
|
||||||
print_help ()
|
|
||||||
{
|
|
||||||
printf '%s\n' "gta5view Configure Script"
|
|
||||||
printf 'Usage: %s [--prefix <arg>] [--qmake <arg>] [--telemetry-authid <arg>] [--telemetry-authpw <arg>] [--telemetry-pushurl <arg>] [--telemetry-regurl <arg>] [--telemetry-weburl <arg>] [-h|--help]\n' "$0"
|
|
||||||
printf '\t%s\n' "-h,--help: Prints help"
|
|
||||||
}
|
|
||||||
parse_commandline ()
|
|
||||||
{
|
|
||||||
while test $# -gt 0
|
|
||||||
do
|
|
||||||
_key="$1"
|
|
||||||
case "$_key" in
|
|
||||||
--prefix)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_prefix="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--prefix=*)
|
|
||||||
_arg_prefix="${_key##--prefix=}"
|
|
||||||
;;
|
|
||||||
--qmake)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_qmake="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--qmake=*)
|
|
||||||
_arg_qmake="${_key##--qmake=}"
|
|
||||||
;;
|
|
||||||
--telemetry-authid)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_telemetry_authid="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--telemetry-authid=*)
|
|
||||||
_arg_telemetry_authid="${_key##--telemetry-authid=}"
|
|
||||||
;;
|
|
||||||
--telemetry-authpw)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_telemetry_authpw="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--telemetry-authpw=*)
|
|
||||||
_arg_telemetry_authpw="${_key##--telemetry-authpw=}"
|
|
||||||
;;
|
|
||||||
--telemetry-pushurl)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_telemetry_pushurl="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--telemetry-pushurl=*)
|
|
||||||
_arg_telemetry_pushurl="${_key##--telemetry-pushurl=}"
|
|
||||||
;;
|
|
||||||
--telemetry-regurl)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_telemetry_regurl="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--telemetry-regurl=*)
|
|
||||||
_arg_telemetry_regurl="${_key##--telemetry-regurl=}"
|
|
||||||
;;
|
|
||||||
--telemetry-weburl)
|
|
||||||
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
|
|
||||||
_arg_telemetry_weburl="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--telemetry-weburl=*)
|
|
||||||
_arg_telemetry_weburl="${_key##--telemetry-weburl=}"
|
|
||||||
;;
|
|
||||||
-h|--help)
|
|
||||||
print_help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
-h*)
|
|
||||||
print_help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
_PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
parse_commandline "$@"
|
|
||||||
|
|
||||||
# Initialise bash script - Step 1
|
|
||||||
if [ "${_arg_prefix}" != "" ]; then
|
|
||||||
PREFIX=${_arg_prefix}
|
|
||||||
fi
|
|
||||||
if [ "${_arg_qmake}" != "" ]; then
|
|
||||||
QMAKE_PATH=${_arg_qmake}
|
|
||||||
fi
|
|
||||||
if [ "${_arg_telemetry_authid}" != "" ] && [ "${_arg_telemetry_authpw}" != "" ] && [ "${_arg_telemetry_pushurl}" != "" ] && [ "${_arg_telemetry_regurl}" != "" ]; then
|
|
||||||
_telemetry_args="${_telemetry_args} DEFINES+=GTA5SYNC_TELEMETRY"
|
|
||||||
_telemetry_args="${_telemetry_args} DEFINES+=GTA5SYNC_TELEMETRY_AUTHID=\\\\\\\"${_arg_telemetry_authid}\\\\\\\""
|
|
||||||
_telemetry_args="${_telemetry_args} DEFINES+=GTA5SYNC_TELEMETRY_AUTHPW=\\\\\\\"${_arg_telemetry_authpw}\\\\\\\""
|
|
||||||
_telemetry_args="${_telemetry_args} DEFINES+=GTA5SYNC_TELEMETRY_PUSHURL=\\\\\\\"${_arg_telemetry_pushurl}\\\\\\\""
|
|
||||||
_telemetry_args="${_telemetry_args} DEFINES+=GTA5SYNC_TELEMETRY_REGURL=\\\\\\\"${_arg_telemetry_regurl}\\\\\\\""
|
|
||||||
if [ "${_arg_telemetry_weburl}" != "" ]; then
|
|
||||||
_telemetry_args="${_telemetry_args} DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"${_arg_telemetry_weburl}\\\\\\\""
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
_telemetry_args=
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialise bash script - Step 2
|
|
||||||
set +e
|
|
||||||
_extra_args=
|
|
||||||
|
|
||||||
# Find Source Directory
|
|
||||||
SOURCE=${BASH_SOURCE[0]}
|
|
||||||
while [ -h "$SOURCE" ]; do
|
|
||||||
SOURCE_DIR=$(cd -P "$(dirname "$SOURCE")" && pwd)
|
|
||||||
SOURCE=$(readlink "$SOURCE")
|
|
||||||
[[ $SOURCE != /* ]] && SOURCE="${SOURCE_DIR}/${SOURCE}"
|
|
||||||
done
|
|
||||||
SOURCE_DIR=$(cd -P "$(dirname "$SOURCE")" && pwd)
|
|
||||||
|
|
||||||
# Find Qt Installation
|
|
||||||
export QT_SELECT=qt5
|
|
||||||
if [ -x "${QMAKE_PATH}" ]; then
|
|
||||||
QMAKE_PATH=${QMAKE_PATH}
|
|
||||||
QT_VERSION=$(${QMAKE_PATH} -query "QT_VERSION")
|
|
||||||
elif [ -x "$(command -v qmake-qt5)" ]; then
|
|
||||||
QMAKE_PATH=$(command -v qmake-qt5)
|
|
||||||
QT_VERSION=$(${QMAKE_PATH} -query "QT_VERSION")
|
|
||||||
elif [ -x "$(command -v qmake)" ]; then
|
|
||||||
QMAKE_PATH=$(command -v qmake)
|
|
||||||
QT_VERSION=$(${QMAKE_PATH} -query "QT_VERSION")
|
|
||||||
else
|
|
||||||
QMAKE_PATH=$(find /usr/ -executable -name qmake -type f 2> /dev/null | sed -n 1p)
|
|
||||||
if [ "${QMAKE_PATH}" == "" ]; then
|
|
||||||
echo "Qt qmake not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
QT_VERSION=$(${QMAKE_PATH} -query "QT_VERSION")
|
|
||||||
fi
|
|
||||||
echo "Found Qt ${QT_VERSION} with qmake located at ${QMAKE_PATH}"
|
|
||||||
|
|
||||||
# Find Make Installation
|
|
||||||
if [ -x "${MAKE_PATH}" ]; then
|
|
||||||
MAKE_PATH=${MAKE_PATH}
|
|
||||||
elif [ -x "$(command -v make)" ]; then
|
|
||||||
MAKE_PATH=$(command -v make)
|
|
||||||
else
|
|
||||||
MAKE_PATH=$(find /usr/ -executable -name make -type f 2> /dev/null | sed -n 1p)
|
|
||||||
if [ "${MAKE_PATH}" == "" ]; then
|
|
||||||
echo "Make not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clean Makefile
|
|
||||||
if [ "${RUN_MAKE_CLEAN}" != "NO" ]; then
|
|
||||||
if [ -f "Makefile" ]; then
|
|
||||||
echo "${MAKE_PATH} distclean"
|
|
||||||
${MAKE_PATH} distclean
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set qConf
|
|
||||||
if [ "${NO_QCONF}" != "YES" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_QCONF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set Prefix
|
|
||||||
if [ "${PREFIX}" != "" ]; then
|
|
||||||
_extra_args="${_extra_args} GTA5SYNC_PREFIX=${PREFIX}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set Build Type
|
|
||||||
if [ "${BUILDTYPE}" == "Alpha" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_BUILDTYPE_ALPHA"
|
|
||||||
elif [ "${BUILDTYPE}" == "Beta" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_BUILDTYPE_BETA"
|
|
||||||
elif [ "${BUILDTYPE}" == "Developer" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_BUILDTYPE_DEV"
|
|
||||||
elif [ "${BUILDTYPE}" == "Daily Build" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_BUILDTYPE_DAILY"
|
|
||||||
elif [ "${BUILDTYPE}" == "Release Candidate" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_BUILDTYPE_RC"
|
|
||||||
elif [ "${BUILDTYPE}" == "Release" ]; then
|
|
||||||
_extra_args="${_extra_args} DEFINES+=GTA5SYNC_BUILDTYPE_REL"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add Telemetry Args
|
|
||||||
if [ "${_telemetry_args}" != "" ]; then
|
|
||||||
_extra_args="${_extra_args}${_telemetry_args}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generating Makefile
|
|
||||||
echo "${QMAKE_PATH}${_extra_args} ${SOURCE_DIR}/gta5view.pro"
|
|
||||||
${QMAKE_PATH}${_extra_args} ${SOURCE_DIR}/gta5view.pro
|
|
||||||
|
|
||||||
# Make dependencies
|
|
||||||
if [ "${RUN_MAKE_DEPEND}" == "YES" ]; then
|
|
||||||
echo "${MAKE_PATH} depend"
|
|
||||||
${MAKE_PATH} depend
|
|
||||||
fi
|
|
||||||
exit 0
|
|
84
gta5view.pro
|
@ -1,6 +1,6 @@
|
||||||
#/*****************************************************************************
|
#/*****************************************************************************
|
||||||
#* gta5view Grand Theft Auto V Profile Viewer
|
#* gta5view Grand Theft Auto V Profile Viewer
|
||||||
#* Copyright (C) 2015-2019 Syping
|
#* Copyright (C) 2015-2020 Syping
|
||||||
#*
|
#*
|
||||||
#* This program is free software: you can redistribute it and/or modify
|
#* This program is free software: you can redistribute it and/or modify
|
||||||
#* it under the terms of the GNU General Public License as published by
|
#* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
#* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
#* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#*****************************************************************************/
|
#*****************************************************************************/
|
||||||
|
|
||||||
QT += core gui network svg
|
QT += core gui network svg
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): win32: QT += winextras
|
greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): win32: QT += winextras
|
||||||
|
@ -37,10 +37,10 @@ SOURCES += main.cpp \
|
||||||
ExportThread.cpp \
|
ExportThread.cpp \
|
||||||
GlobalString.cpp \
|
GlobalString.cpp \
|
||||||
IconLoader.cpp \
|
IconLoader.cpp \
|
||||||
ImageEditorDialog.cpp \
|
|
||||||
ImportDialog.cpp \
|
ImportDialog.cpp \
|
||||||
JsonEditorDialog.cpp \
|
JsonEditorDialog.cpp \
|
||||||
MapLocationDialog.cpp \
|
MapLocationDialog.cpp \
|
||||||
|
MessageThread.cpp \
|
||||||
OptionsDialog.cpp \
|
OptionsDialog.cpp \
|
||||||
PictureDialog.cpp \
|
PictureDialog.cpp \
|
||||||
PictureExport.cpp \
|
PictureExport.cpp \
|
||||||
|
@ -70,7 +70,7 @@ SOURCES += main.cpp \
|
||||||
uimod/UiModLabel.cpp \
|
uimod/UiModLabel.cpp \
|
||||||
uimod/UiModWidget.cpp
|
uimod/UiModWidget.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
AboutDialog.h \
|
AboutDialog.h \
|
||||||
AppEnv.h \
|
AppEnv.h \
|
||||||
CrewDatabase.h \
|
CrewDatabase.h \
|
||||||
|
@ -79,10 +79,10 @@ HEADERS += \
|
||||||
ExportThread.h \
|
ExportThread.h \
|
||||||
GlobalString.h \
|
GlobalString.h \
|
||||||
IconLoader.h \
|
IconLoader.h \
|
||||||
ImageEditorDialog.h \
|
|
||||||
ImportDialog.h \
|
ImportDialog.h \
|
||||||
JsonEditorDialog.h \
|
JsonEditorDialog.h \
|
||||||
MapLocationDialog.h \
|
MapLocationDialog.h \
|
||||||
|
MessageThread.h \
|
||||||
OptionsDialog.h \
|
OptionsDialog.h \
|
||||||
PictureDialog.h \
|
PictureDialog.h \
|
||||||
PictureExport.h \
|
PictureExport.h \
|
||||||
|
@ -114,10 +114,9 @@ HEADERS += \
|
||||||
uimod/UiModLabel.h \
|
uimod/UiModLabel.h \
|
||||||
uimod/UiModWidget.h
|
uimod/UiModWidget.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
AboutDialog.ui \
|
AboutDialog.ui \
|
||||||
ExportDialog.ui \
|
ExportDialog.ui \
|
||||||
ImageEditorDialog.ui \
|
|
||||||
ImportDialog.ui \
|
ImportDialog.ui \
|
||||||
JsonEditorDialog.ui \
|
JsonEditorDialog.ui \
|
||||||
MapLocationDialog.ui \
|
MapLocationDialog.ui \
|
||||||
|
@ -135,7 +134,6 @@ TRANSLATIONS += \
|
||||||
res/gta5sync.ts \
|
res/gta5sync.ts \
|
||||||
res/gta5sync_de.ts \
|
res/gta5sync_de.ts \
|
||||||
res/gta5sync_en_US.ts \
|
res/gta5sync_en_US.ts \
|
||||||
res/gta5sync_es.ts \
|
|
||||||
res/gta5sync_fr.ts \
|
res/gta5sync_fr.ts \
|
||||||
res/gta5sync_ko.ts \
|
res/gta5sync_ko.ts \
|
||||||
res/gta5sync_ru.ts \
|
res/gta5sync_ru.ts \
|
||||||
|
@ -143,14 +141,25 @@ TRANSLATIONS += \
|
||||||
res/gta5sync_zh_TW.ts
|
res/gta5sync_zh_TW.ts
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
res/tr_g5p.qrc \
|
res/app.qrc \
|
||||||
res/app.qrc
|
res/tr_g5p.qrc
|
||||||
|
|
||||||
DISTFILES += res/app.rc \
|
DISTFILES += \
|
||||||
res/gta5view.desktop \
|
res/gta5view-16.png \
|
||||||
|
res/gta5view-24.png \
|
||||||
|
res/gta5view-32.png \
|
||||||
|
res/gta5view-40.png \
|
||||||
|
res/gta5view-48.png \
|
||||||
|
res/gta5view-64.png \
|
||||||
|
res/gta5view-96.png \
|
||||||
|
res/gta5view-128.png \
|
||||||
|
res/gta5view-256.png \
|
||||||
|
res/gta5view-512.png \
|
||||||
|
res/app.rc \
|
||||||
|
res/de.syping.gta5view.desktop \
|
||||||
|
res/de.syping.gta5view.png \
|
||||||
res/gta5sync_de.ts \
|
res/gta5sync_de.ts \
|
||||||
res/gta5sync_en_US.ts \
|
res/gta5sync_en_US.ts \
|
||||||
res/gta5sync_es.ts \
|
|
||||||
res/gta5sync_fr.ts \
|
res/gta5sync_fr.ts \
|
||||||
res/gta5sync_ko.ts \
|
res/gta5sync_ko.ts \
|
||||||
res/gta5sync_ru.ts \
|
res/gta5sync_ru.ts \
|
||||||
|
@ -164,16 +173,14 @@ INCLUDEPATH += ./anpro ./pcg ./tmext ./uimod
|
||||||
|
|
||||||
# GTA5SYNC/GTA5VIEW ONLY
|
# GTA5SYNC/GTA5VIEW ONLY
|
||||||
|
|
||||||
|
DEFINES += GTA5SYNC_QMAKE # We using qmake do we?
|
||||||
DEFINES += GTA5SYNC_PROJECT # Enable exclusive gta5sync/gta5view functions
|
DEFINES += GTA5SYNC_PROJECT # Enable exclusive gta5sync/gta5view functions
|
||||||
DEFINES += GTA5SYNC_NOASSIST # Not assisting at proper usage of SnapmaticPicture class
|
DEFINES += SNAPMATIC_NODEFAULT # Not assisting at proper usage of SnapmaticPicture class
|
||||||
|
|
||||||
# WINDOWS ONLY
|
# WINDOWS ONLY
|
||||||
|
|
||||||
win32: DEFINES += GTA5SYNC_WIN
|
|
||||||
win32: RC_FILE += res/app.rc
|
win32: RC_FILE += res/app.rc
|
||||||
win32: LIBS += -luser32
|
|
||||||
win32: CONFIG -= embed_manifest_exe
|
win32: CONFIG -= embed_manifest_exe
|
||||||
contains(DEFINES, GTA5SYNC_APV): greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): win32: LIBS += -ldwmapi
|
|
||||||
contains(DEFINES, GTA5SYNC_TELEMETRY): win32: LIBS += -ld3d9 # Required for getting information about GPU
|
contains(DEFINES, GTA5SYNC_TELEMETRY): win32: LIBS += -ld3d9 # Required for getting information about GPU
|
||||||
|
|
||||||
# MAC OS X ONLY
|
# MAC OS X ONLY
|
||||||
|
@ -205,43 +212,66 @@ isEqual(QT_MAJOR_VERSION, 4): GTA5SYNC_RCC = $$[QT_INSTALL_BINS]/rcc
|
||||||
# QT5 ONLY STUFF
|
# QT5 ONLY STUFF
|
||||||
|
|
||||||
isEqual(QT_MAJOR_VERSION, 5): RESOURCES += res/tr_qt5.qrc
|
isEqual(QT_MAJOR_VERSION, 5): RESOURCES += res/tr_qt5.qrc
|
||||||
isEqual(QT_MAJOR_VERSION, 5): GTA5SYNC_RCC = $$[QT_HOST_BINS]/rcc
|
|
||||||
|
# QT5+ ONLY STUFF
|
||||||
|
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4): GTA5SYNC_RCC = $$[QT_HOST_BINS]/rcc
|
||||||
|
|
||||||
# RESOURCE COMPILATION
|
# RESOURCE COMPILATION
|
||||||
|
|
||||||
depend.depends += $$PWD/res/global.qrc
|
system($$GTA5SYNC_RCC -threshold 0 -compress 9 $$PWD/res/global.qrc -o $$OUT_PWD/qrc_global.cpp) {
|
||||||
depend.commands += $$GTA5SYNC_RCC -binary -threshold 0 -compress 9 $$PWD/res/global.qrc -o $$PWD/res/global.rcc
|
SOURCES += $$OUT_PWD/qrc_global.cpp
|
||||||
QMAKE_EXTRA_TARGETS += depend
|
} else {
|
||||||
|
message("Failed to generate qrc_global.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
# PROJECT INSTALLATION
|
# PROJECT INSTALLATION
|
||||||
|
|
||||||
isEmpty(GTA5SYNC_PREFIX): GTA5SYNC_PREFIX = /usr/local
|
isEmpty(GTA5SYNC_PREFIX): GTA5SYNC_PREFIX = /usr/local
|
||||||
|
|
||||||
appfiles.path = $$GTA5SYNC_PREFIX/share/applications
|
appfiles.path = $$GTA5SYNC_PREFIX/share/applications
|
||||||
appfiles.files = $$PWD/res/gta5view.desktop
|
appfiles.files = $$PWD/res/de.syping.gta5view.desktop
|
||||||
pixmaps.path = $$GTA5SYNC_PREFIX/share/pixmaps
|
pixmaps.path = $$GTA5SYNC_PREFIX/share/pixmaps
|
||||||
pixmaps.files = $$PWD/res/gta5view.png
|
pixmaps.files = $$PWD/res/de.syping.gta5view.png
|
||||||
target.path = $$GTA5SYNC_PREFIX/bin
|
target.path = $$GTA5SYNC_PREFIX/bin
|
||||||
INSTALLS += target pixmaps appfiles
|
INSTALLS += target pixmaps appfiles
|
||||||
|
|
||||||
# QCONF BASED BUILD STUFF
|
# QCONF BASED BUILD STUFF
|
||||||
|
|
||||||
contains(DEFINES, GTA5SYNC_QCONF){
|
contains(DEFINES, GTA5SYNC_QCONF) {
|
||||||
isEqual(QT_MAJOR_VERSION, 4): RESOURCES -= res/tr_qt4.qrc
|
isEqual(QT_MAJOR_VERSION, 4): RESOURCES -= res/tr_qt4.qrc
|
||||||
isEqual(QT_MAJOR_VERSION, 5): RESOURCES -= res/tr_qt5.qrc
|
isEqual(QT_MAJOR_VERSION, 5): RESOURCES -= res/tr_qt5.qrc
|
||||||
!contains(DEFINES, GTA5SYNC_QCONF_IN){
|
!contains(DEFINES, GTA5SYNC_QCONF_IN) {
|
||||||
RESOURCES -= res/tr_g5p.qrc
|
RESOURCES -= res/tr_g5p.qrc
|
||||||
langfiles.path = $$GTA5SYNC_PREFIX/share/gta5view/translations
|
langfiles.path = $$GTA5SYNC_PREFIX/share/gta5view/translations
|
||||||
langfiles.files = $$PWD/res/gta5sync_en_US.qm $$PWD/res/gta5sync_de.qm $$PWD/res/gta5sync_fr.qm $$PWD/res/gta5sync_ko.qm $$PWD/res/gta5sync_ru.qm $$PWD/res/gta5sync_uk.qm $$PWD/res/gta5sync_zh_TW.qm $$PWD/res/qtbase_en_GB.qm $$PWD/res/qtbase_zh_TW.qm
|
langfiles.files = $$PWD/res/gta5sync_en_US.qm $$PWD/res/gta5sync_de.qm $$PWD/res/gta5sync_fr.qm $$PWD/res/gta5sync_ko.qm $$PWD/res/gta5sync_ru.qm $$PWD/res/gta5sync_uk.qm $$PWD/res/gta5sync_zh_TW.qm $$PWD/res/qtbase_en_GB.qm
|
||||||
INSTALLS += langfiles
|
INSTALLS += langfiles
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# TELEMETRY BASED STUFF
|
# TELEMETRY BASED STUFF
|
||||||
|
|
||||||
!contains(DEFINES, GTA5SYNC_TELEMETRY){
|
!contains(DEFINES, GTA5SYNC_TELEMETRY) {
|
||||||
SOURCES -= TelemetryClass.cpp \
|
SOURCES -= TelemetryClass.cpp \
|
||||||
tmext/TelemetryClassAuthenticator.cpp
|
tmext/TelemetryClassAuthenticator.cpp
|
||||||
HEADERS -= TelemetryClass.h \
|
HEADERS -= TelemetryClass.h \
|
||||||
tmext/TelemetryClassAuthenticator.h
|
tmext/TelemetryClassAuthenticator.h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
!contains(DEFINES, GTA5SYNC_MOTD) {
|
||||||
|
SOURCES -= MessageThread.cpp
|
||||||
|
HEADERS -= MessageThread.h
|
||||||
|
} else {
|
||||||
|
lessThan(QT_MAJOR_VERSION, 5) {
|
||||||
|
SOURCES -= MessageThread.cpp
|
||||||
|
HEADERS -= MessageThread.h
|
||||||
|
DEFINES -= GTA5SYNC_MOTD
|
||||||
|
message("Messages require Qt5 or newer!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# CMAKE BASED STUFF
|
||||||
|
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
|
message("Building gta5view with QMake is deprecated, please use CMake instead!")
|
||||||
|
}
|
||||||
|
|
59
main.cpp
|
@ -31,7 +31,6 @@
|
||||||
#include "IconLoader.h"
|
#include "IconLoader.h"
|
||||||
#include "AppEnv.h"
|
#include "AppEnv.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
|
@ -54,11 +53,19 @@
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WIN
|
#if QT_VERSION < 0x060000
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
#include "MessageThread.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GTA5SYNC_TELEMETRY
|
#ifdef GTA5SYNC_TELEMETRY
|
||||||
#include "TelemetryClass.h"
|
#include "TelemetryClass.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -66,16 +73,16 @@
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
a.setApplicationName(GTA5SYNC_APPSTR);
|
a.setApplicationName(GTA5SYNC_APPSTR);
|
||||||
a.setApplicationVersion(GTA5SYNC_APPVER);
|
a.setApplicationVersion(GTA5SYNC_APPVER);
|
||||||
a.setQuitOnLastWindowClosed(false);
|
a.setQuitOnLastWindowClosed(false);
|
||||||
|
|
||||||
QResource::registerResource(":/global/global.rcc");
|
|
||||||
|
|
||||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
settings.beginGroup("Startup");
|
settings.beginGroup("Startup");
|
||||||
|
|
||||||
|
@ -99,25 +106,12 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GTA5SYNC_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= 0x050400
|
#if QT_VERSION >= 0x050400
|
||||||
bool alwaysUseMessageFont = settings.value("AlwaysUseMessageFont", false).toBool();
|
bool alwaysUseMessageFont = settings.value("AlwaysUseMessageFont", false).toBool();
|
||||||
if (QSysInfo::windowsVersion() >= 0x0080 || alwaysUseMessageFont)
|
if (QSysInfo::windowsVersion() >= 0x0080 || alwaysUseMessageFont)
|
||||||
{
|
{
|
||||||
// Get Windows Font
|
a.setFont(QApplication::font("QMenu"));
|
||||||
NONCLIENTMETRICS ncm;
|
|
||||||
ncm.cbSize = sizeof(ncm);
|
|
||||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);
|
|
||||||
LOGFONTW uiFont = ncm.lfMessageFont;
|
|
||||||
QString uiFontStr(QString::fromStdWString(std::wstring(uiFont.lfFaceName)));
|
|
||||||
|
|
||||||
#ifdef GTA5SYNC_DEBUG
|
|
||||||
qDebug() << QApplication::tr("Font") << QApplication::tr("Selected Font: %1").arg(uiFontStr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set Application Font
|
|
||||||
QFont appFont(uiFontStr, 9);
|
|
||||||
a.setFont(appFont);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -139,7 +133,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (isFirstStart)
|
if (isFirstStart)
|
||||||
{
|
{
|
||||||
QMessageBox::StandardButton button = QMessageBox::information(a.desktop(), QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("<h4>Welcome to %1!</h4>You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
QMessageBox::StandardButton button = QMessageBox::information(nullptr, QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("<h4>Welcome to %1!</h4>You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
if (button == QMessageBox::Yes)
|
if (button == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
ProfileDatabase profileDB;
|
ProfileDatabase profileDB;
|
||||||
|
@ -260,9 +254,7 @@ int main(int argc, char *argv[])
|
||||||
bool readOk = picture.readingPictureFromFile(arg1);
|
bool readOk = picture.readingPictureFromFile(arg1);
|
||||||
picDialog.setWindowIcon(IconLoader::loadingAppIcon());
|
picDialog.setWindowIcon(IconLoader::loadingAppIcon());
|
||||||
picDialog.setSnapmaticPicture(&picture, readOk);
|
picDialog.setSnapmaticPicture(&picture, readOk);
|
||||||
#ifndef Q_OS_LINUX
|
|
||||||
picDialog.setWindowFlags(picDialog.windowFlags()^Qt::Dialog^Qt::Window);
|
picDialog.setWindowFlags(picDialog.windowFlags()^Qt::Dialog^Qt::Window);
|
||||||
#endif
|
|
||||||
|
|
||||||
int crewID = picture.getSnapmaticProperties().crewID;
|
int crewID = picture.getSnapmaticProperties().crewID;
|
||||||
if (crewID != 0) { crewDB.addCrew(crewID); }
|
if (crewID != 0) { crewDB.addCrew(crewID); }
|
||||||
|
@ -307,9 +299,32 @@ int main(int argc, char *argv[])
|
||||||
QObject::connect(&threadDB, SIGNAL(finished()), &a, SLOT(quit()));
|
QObject::connect(&threadDB, SIGNAL(finished()), &a, SLOT(quit()));
|
||||||
threadDB.start();
|
threadDB.start();
|
||||||
|
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
uint cacheId;
|
||||||
|
{
|
||||||
|
QSettings messageSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
|
messageSettings.beginGroup("Messages");
|
||||||
|
cacheId = messageSettings.value("CacheId", 0).toUInt();
|
||||||
|
messageSettings.endGroup();
|
||||||
|
}
|
||||||
|
MessageThread threadMessage(cacheId);
|
||||||
|
QObject::connect(&threadMessage, SIGNAL(finished()), &threadDB, SLOT(terminateThread()));
|
||||||
|
threadMessage.start();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GTA5SYNC_MOTD
|
||||||
|
UserInterface uiWindow(&profileDB, &crewDB, &threadDB, &threadMessage);
|
||||||
|
QObject::connect(&threadMessage, SIGNAL(messagesArrived(QJsonObject)), &uiWindow, SLOT(messagesArrived(QJsonObject)));
|
||||||
|
QObject::connect(&threadMessage, SIGNAL(updateCacheId(uint)), &uiWindow, SLOT(updateCacheId(uint)));
|
||||||
|
#else
|
||||||
UserInterface uiWindow(&profileDB, &crewDB, &threadDB);
|
UserInterface uiWindow(&profileDB, &crewDB, &threadDB);
|
||||||
|
#endif
|
||||||
uiWindow.setWindowIcon(IconLoader::loadingAppIcon());
|
uiWindow.setWindowIcon(IconLoader::loadingAppIcon());
|
||||||
|
#ifdef GTA5SYNC_FLATPAK
|
||||||
|
uiWindow.setupDirEnv(false);
|
||||||
|
#else
|
||||||
uiWindow.setupDirEnv();
|
uiWindow.setupDirEnv();
|
||||||
|
#endif
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
uiWindow.showMaximized();
|
uiWindow.showMaximized();
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -39,45 +39,45 @@ QJsonDocument::QJsonDocument() : root_(0) {
|
||||||
// Name: QJsonDocument
|
// Name: QJsonDocument
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument::QJsonDocument(const QJsonObject &object) : root_(0) {
|
QJsonDocument::QJsonDocument(const QJsonObject &object) : root_(0) {
|
||||||
setObject(object);
|
setObject(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: QJsonDocument
|
// Name: QJsonDocument
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument::QJsonDocument(const QJsonArray &array) : root_(0) {
|
QJsonDocument::QJsonDocument(const QJsonArray &array) : root_(0) {
|
||||||
setArray(array);
|
setArray(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: QJsonDocument
|
// Name: QJsonDocument
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument::QJsonDocument(const QJsonDocument &other) : root_(0) {
|
QJsonDocument::QJsonDocument(const QJsonDocument &other) : root_(0) {
|
||||||
if(other.root_) {
|
if(other.root_) {
|
||||||
root_ = other.root_->clone();
|
root_ = other.root_->clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: ~QJsonDocument
|
// Name: ~QJsonDocument
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument::~QJsonDocument() {
|
QJsonDocument::~QJsonDocument() {
|
||||||
delete root_;
|
delete root_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: operator=
|
// Name: operator=
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument &QJsonDocument::operator=(const QJsonDocument &other) {
|
QJsonDocument &QJsonDocument::operator=(const QJsonDocument &other) {
|
||||||
QJsonDocument(other).swap(*this);
|
QJsonDocument(other).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: operator!=
|
// Name: operator!=
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool QJsonDocument::operator!=(const QJsonDocument &other) const {
|
bool QJsonDocument::operator!=(const QJsonDocument &other) const {
|
||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -85,30 +85,30 @@ bool QJsonDocument::operator!=(const QJsonDocument &other) const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool QJsonDocument::operator==(const QJsonDocument &other) const {
|
bool QJsonDocument::operator==(const QJsonDocument &other) const {
|
||||||
|
|
||||||
if(isArray() && other.isArray()) {
|
if(isArray() && other.isArray()) {
|
||||||
return array() == other.array();
|
return array() == other.array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isObject() && other.isObject()) {
|
if(isObject() && other.isObject()) {
|
||||||
return object() == other.object();
|
return object() == other.object();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isEmpty() && other.isEmpty()) {
|
if(isEmpty() && other.isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isNull() && other.isNull()) {
|
if(isNull() && other.isNull()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: isArray
|
// Name: isArray
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool QJsonDocument::isArray() const {
|
bool QJsonDocument::isArray() const {
|
||||||
return root_ && root_->toArray();
|
return root_ && root_->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -116,56 +116,56 @@ bool QJsonDocument::isArray() const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool QJsonDocument::isEmpty() const {
|
bool QJsonDocument::isEmpty() const {
|
||||||
|
|
||||||
// TODO(eteran): figure out the rules here that Qt5 uses
|
// TODO(eteran): figure out the rules here that Qt5 uses
|
||||||
// it *looks* like they define empty as being NULL
|
// it *looks* like they define empty as being NULL
|
||||||
// which is obviously different than this
|
// which is obviously different than this
|
||||||
|
|
||||||
return !root_;
|
return !root_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: isNull
|
// Name: isNull
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool QJsonDocument::isNull() const {
|
bool QJsonDocument::isNull() const {
|
||||||
return !root_;
|
return !root_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: isObject
|
// Name: isObject
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool QJsonDocument::isObject() const {
|
bool QJsonDocument::isObject() const {
|
||||||
return root_ && root_->toObject();
|
return root_ && root_->toObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: setArray
|
// Name: setArray
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void QJsonDocument::setArray(const QJsonArray &array) {
|
void QJsonDocument::setArray(const QJsonArray &array) {
|
||||||
setRoot(array);
|
setRoot(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: setObject
|
// Name: setObject
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void QJsonDocument::setObject(const QJsonObject &object) {
|
void QJsonDocument::setObject(const QJsonObject &object) {
|
||||||
setRoot(object);
|
setRoot(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: setRoot
|
// Name: setRoot
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void QJsonDocument::setRoot(const QJsonRoot &root) {
|
void QJsonDocument::setRoot(const QJsonRoot &root) {
|
||||||
delete root_;
|
delete root_;
|
||||||
root_ = root.clone();
|
root_ = root.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: toBinaryData
|
// Name: toBinaryData
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QByteArray QJsonDocument::toBinaryData() const {
|
QByteArray QJsonDocument::toBinaryData() const {
|
||||||
QByteArray r;
|
QByteArray r;
|
||||||
// TODO(eteran): implement this
|
// TODO(eteran): implement this
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -173,100 +173,107 @@ QByteArray QJsonDocument::toBinaryData() const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QString QJsonDocument::escapeString(const QString &s) const {
|
QString QJsonDocument::escapeString(const QString &s) const {
|
||||||
|
|
||||||
QString r;
|
QString r;
|
||||||
|
|
||||||
Q_FOREACH(QChar ch, s) {
|
Q_FOREACH(QChar ch, s) {
|
||||||
switch(ch.toLatin1()) {
|
switch(ch.toLatin1()) {
|
||||||
case '\"': r.append("\\\""); break;
|
case '\"': r.append("\\\""); break;
|
||||||
case '\\': r.append("\\\\"); break;
|
case '\\': r.append("\\\\"); break;
|
||||||
#if 0
|
#if 0
|
||||||
case '/': r.append("\\/"); break;
|
case '/': r.append("\\/"); break;
|
||||||
#endif
|
#endif
|
||||||
case '\b': r.append("\\b"); break;
|
case '\b': r.append("\\b"); break;
|
||||||
case '\f': r.append("\\f"); break;
|
case '\f': r.append("\\f"); break;
|
||||||
case '\n': r.append("\\n"); break;
|
case '\n': r.append("\\n"); break;
|
||||||
case '\r': r.append("\\r"); break;
|
case '\r': r.append("\\r"); break;
|
||||||
case '\t': r.append("\\t"); break;
|
case '\t': r.append("\\t"); break;
|
||||||
default:
|
default:
|
||||||
r += ch;
|
r += ch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: toJson
|
// Name: toJson
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QString QJsonDocument::toJson(const QJsonValue &v, JsonFormat format) const {
|
QString QJsonDocument::toJson(const QJsonValue &v, JsonFormat format, int indent) const {
|
||||||
|
|
||||||
QString b;
|
QString b;
|
||||||
QTextStream ss(&b, QIODevice::WriteOnly | QIODevice::Text);
|
QTextStream ss(&b, QIODevice::WriteOnly | QIODevice::Text);
|
||||||
|
bool compact = (format == JsonFormat::Compact);
|
||||||
|
|
||||||
switch(v.type()) {
|
switch(v.type()) {
|
||||||
case QJsonValue::Null:
|
case QJsonValue::Null:
|
||||||
ss << "null";
|
ss << "null";
|
||||||
break;
|
break;
|
||||||
case QJsonValue::Bool:
|
case QJsonValue::Bool:
|
||||||
ss << (v.toBool() ? "true" : "false");
|
ss << (v.toBool() ? "true" : "false");
|
||||||
break;
|
break;
|
||||||
case QJsonValue::Double:
|
case QJsonValue::Double:
|
||||||
{
|
{
|
||||||
double d = v.toDouble ();
|
double d = v.toDouble ();
|
||||||
if (qIsFinite(d)) {
|
if (qIsFinite(d)) {
|
||||||
// +2 to format to ensure the expected precision
|
// +2 to format to ensure the expected precision
|
||||||
ss << QByteArray::number(d, 'g', 15 + 2); // ::digits10 is 15
|
ss << QByteArray::number(d, 'g', 15 + 2); // ::digits10 is 15
|
||||||
} else {
|
} else {
|
||||||
ss << "null"; // +INF || -INF || NaN (see RFC4627#section2.4)
|
ss << "null"; // +INF || -INF || NaN (see RFC4627#section2.4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QJsonValue::String:
|
case QJsonValue::String:
|
||||||
ss << '"' << escapeString(v.toString()) << '"';
|
ss << '"' << escapeString(v.toString()) << '"';
|
||||||
break;
|
break;
|
||||||
case QJsonValue::Array:
|
case QJsonValue::Array:
|
||||||
{
|
{
|
||||||
const QJsonArray a = v.toArray();
|
const QJsonArray a = v.toArray();
|
||||||
ss << "[";
|
ss << (compact ? "[" : "[\n");
|
||||||
if(!a.empty()) {
|
if(!a.empty()) {
|
||||||
QJsonArray::const_iterator it = a.begin();
|
QJsonArray::const_iterator it = a.begin();
|
||||||
QJsonArray::const_iterator e = a.end();
|
QJsonArray::const_iterator e = a.end();
|
||||||
|
|
||||||
ss << toJson(*it++, format);
|
if (!compact) ss << QByteArray(4*indent, ' ');
|
||||||
|
ss << toJson(*it++, format, indent+1);
|
||||||
|
|
||||||
for(;it != e; ++it) {
|
for(;it != e; ++it) {
|
||||||
ss << ',';
|
ss << (compact ? "," : ",\n");
|
||||||
ss << toJson(*it, format);
|
if (!compact) ss << QByteArray(4*indent, ' ');
|
||||||
}
|
ss << toJson(*it, format, indent+1);
|
||||||
}
|
}
|
||||||
ss << "]";
|
}
|
||||||
}
|
indent--;
|
||||||
break;
|
ss << (compact ? "]" : QString("\n%1]").arg(QString(4*indent, ' ')));
|
||||||
case QJsonValue::Object:
|
}
|
||||||
{
|
break;
|
||||||
const QJsonObject o = v.toObject();
|
case QJsonValue::Object:
|
||||||
ss << "{";
|
{
|
||||||
if(!o.empty()) {
|
const QJsonObject o = v.toObject();
|
||||||
QJsonObject::const_iterator it = o.begin();
|
ss << (compact ? "{" : "{\n");
|
||||||
QJsonObject::const_iterator e = o.end();
|
if(!o.empty()) {
|
||||||
|
QJsonObject::const_iterator it = o.begin();
|
||||||
|
QJsonObject::const_iterator e = o.end();
|
||||||
|
|
||||||
ss << '"' << escapeString(it.key()) << "\": " << toJson(it.value(), format);
|
if (!compact) ss << QByteArray(4*indent, ' ');
|
||||||
++it;
|
ss << '"' << escapeString(it.key()) << (compact ? "\":" : "\": ") << toJson(it.value(), format, indent+1);
|
||||||
for(;it != e; ++it) {
|
++it;
|
||||||
ss << ',';
|
for(;it != e; ++it) {
|
||||||
ss << '"' << escapeString(it.key()) << "\": " << toJson(it.value(), format);
|
ss << (compact ? "," : ",\n");
|
||||||
}
|
if (!compact) ss << QByteArray(4*indent, ' ');
|
||||||
}
|
ss << '"' << escapeString(it.key()) << (compact ? "\":" : "\": ") << toJson(it.value(), format, indent+1);
|
||||||
ss << "}";
|
}
|
||||||
}
|
}
|
||||||
break;
|
indent--;
|
||||||
case QJsonValue::Undefined:
|
ss << (compact ? "}" : QString("\n%1}").arg(QString(4*indent, ' ')));
|
||||||
Q_ASSERT(0);
|
}
|
||||||
break;
|
break;
|
||||||
}
|
case QJsonValue::Undefined:
|
||||||
|
Q_ASSERT(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -274,19 +281,19 @@ QString QJsonDocument::toJson(const QJsonValue &v, JsonFormat format) const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QByteArray QJsonDocument::toJson(JsonFormat format) const {
|
QByteArray QJsonDocument::toJson(JsonFormat format) const {
|
||||||
|
|
||||||
Q_UNUSED(format);
|
Q_UNUSED(format);
|
||||||
|
|
||||||
if(isArray()) {
|
if(isArray()) {
|
||||||
QString s = toJson(array(), format);
|
QString s = toJson(array(), format);
|
||||||
return s.toUtf8();
|
return s.toUtf8();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isObject()) {
|
if(isObject()) {
|
||||||
QString s = toJson(object(), format);
|
QString s = toJson(object(), format);
|
||||||
return s.toUtf8();
|
return s.toUtf8();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -294,17 +301,17 @@ QByteArray QJsonDocument::toJson(JsonFormat format) const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QVariant QJsonDocument::toVariant() const {
|
QVariant QJsonDocument::toVariant() const {
|
||||||
|
|
||||||
if(!isEmpty()) {
|
if(!isEmpty()) {
|
||||||
if(QJsonObject *const object = root_->toObject()) {
|
if(QJsonObject *const object = root_->toObject()) {
|
||||||
return object->toVariantMap();
|
return object->toVariantMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(QJsonArray *const array = root_->toArray()) {
|
if(QJsonArray *const array = root_->toArray()) {
|
||||||
return array->toVariantList();
|
return array->toVariantList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -312,13 +319,13 @@ QVariant QJsonDocument::toVariant() const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonArray QJsonDocument::array() const {
|
QJsonArray QJsonDocument::array() const {
|
||||||
|
|
||||||
if(!isEmpty()) {
|
if(!isEmpty()) {
|
||||||
if(QJsonArray *const array = root_->toArray()) {
|
if(QJsonArray *const array = root_->toArray()) {
|
||||||
return *array;
|
return *array;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QJsonArray();
|
return QJsonArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -326,54 +333,54 @@ QJsonArray QJsonDocument::array() const {
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonObject QJsonDocument::object() const {
|
QJsonObject QJsonDocument::object() const {
|
||||||
|
|
||||||
if(!isEmpty()) {
|
if(!isEmpty()) {
|
||||||
if(QJsonObject *const object = root_->toObject()) {
|
if(QJsonObject *const object = root_->toObject()) {
|
||||||
return *object;
|
return *object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QJsonObject();
|
return QJsonObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: rawData
|
// Name: rawData
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
const char *QJsonDocument::rawData(int *size) const {
|
const char *QJsonDocument::rawData(int *size) const {
|
||||||
Q_UNUSED(size);
|
Q_UNUSED(size);
|
||||||
// TODO(eteran): implement this
|
// TODO(eteran): implement this
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: fromBinaryData
|
// Name: fromBinaryData
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) {
|
QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) {
|
||||||
Q_UNUSED(data);
|
Q_UNUSED(data);
|
||||||
Q_UNUSED(validation);
|
Q_UNUSED(validation);
|
||||||
|
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
// TODO(eteran): implement this
|
// TODO(eteran): implement this
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: fromJson
|
// Name: fromJson
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error) {
|
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error) {
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
|
|
||||||
const char *const begin = json.constData();
|
const char *const begin = json.constData();
|
||||||
const char *const end = begin + json.size();
|
const char *const end = begin + json.size();
|
||||||
|
|
||||||
QJsonParser parser(begin, end);
|
QJsonParser parser(begin, end);
|
||||||
|
|
||||||
doc.root_ = parser.parse();
|
doc.root_ = parser.parse();
|
||||||
|
|
||||||
if(error) {
|
if(error) {
|
||||||
*error = parser.state();
|
*error = parser.state();
|
||||||
}
|
}
|
||||||
|
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -381,10 +388,10 @@ QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *e
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) {
|
QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) {
|
||||||
|
|
||||||
// data has to be aligned to a 4 byte boundary.
|
// data has to be aligned to a 4 byte boundary.
|
||||||
Q_ASSERT(!(reinterpret_cast<quintptr>(data) % 3));
|
Q_ASSERT(!(reinterpret_cast<quintptr>(data) % 3));
|
||||||
|
|
||||||
return fromBinaryData(QByteArray::fromRawData(data, size), validation);
|
return fromBinaryData(QByteArray::fromRawData(data, size), validation);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -392,26 +399,26 @@ QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidat
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
QJsonDocument QJsonDocument::fromVariant(const QVariant &variant) {
|
QJsonDocument QJsonDocument::fromVariant(const QVariant &variant) {
|
||||||
|
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
|
|
||||||
if (variant.type() == QVariant::Map) {
|
if (variant.type() == QVariant::Map) {
|
||||||
doc.setObject(QJsonObject::fromVariantMap(variant.toMap()));
|
doc.setObject(QJsonObject::fromVariantMap(variant.toMap()));
|
||||||
} else if (variant.type() == QVariant::Hash) {
|
} else if (variant.type() == QVariant::Hash) {
|
||||||
doc.setObject(QJsonObject::fromVariantHash(variant.toHash()));
|
doc.setObject(QJsonObject::fromVariantHash(variant.toHash()));
|
||||||
} else if (variant.type() == QVariant::List) {
|
} else if (variant.type() == QVariant::List) {
|
||||||
doc.setArray(QJsonArray::fromVariantList(variant.toList()));
|
doc.setArray(QJsonArray::fromVariantList(variant.toList()));
|
||||||
} else if (variant.type() == QVariant::StringList) {
|
} else if (variant.type() == QVariant::StringList) {
|
||||||
doc.setArray(QJsonArray::fromStringList(variant.toStringList()));
|
doc.setArray(QJsonArray::fromStringList(variant.toStringList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Name: swap
|
// Name: swap
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void QJsonDocument::swap(QJsonDocument &other) {
|
void QJsonDocument::swap(QJsonDocument &other) {
|
||||||
qSwap(root_, other.root_);
|
qSwap(root_, other.root_);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,66 +36,66 @@ class QJsonRoot;
|
||||||
|
|
||||||
class QJsonDocument {
|
class QJsonDocument {
|
||||||
public:
|
public:
|
||||||
enum DataValidation {
|
enum DataValidation {
|
||||||
Validate = 0,
|
Validate = 0,
|
||||||
BypassValidation = 1
|
BypassValidation = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum JsonFormat {
|
enum JsonFormat {
|
||||||
Indented,
|
Indented,
|
||||||
Compact
|
Compact
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QJsonDocument();
|
QJsonDocument();
|
||||||
QJsonDocument(const QJsonObject &object);
|
QJsonDocument(const QJsonObject &object);
|
||||||
QJsonDocument(const QJsonArray &array);
|
QJsonDocument(const QJsonArray &array);
|
||||||
QJsonDocument(const QJsonDocument &other);
|
QJsonDocument(const QJsonDocument &other);
|
||||||
~QJsonDocument();
|
~QJsonDocument();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QJsonDocument &operator=(const QJsonDocument &other);
|
QJsonDocument &operator=(const QJsonDocument &other);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool operator!=(const QJsonDocument &other) const;
|
bool operator!=(const QJsonDocument &other) const;
|
||||||
bool operator==(const QJsonDocument &other) const;
|
bool operator==(const QJsonDocument &other) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool isArray() const;
|
bool isArray() const;
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
bool isNull() const;
|
bool isNull() const;
|
||||||
bool isObject() const;
|
bool isObject() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QByteArray toBinaryData() const;
|
QByteArray toBinaryData() const;
|
||||||
QByteArray toJson(JsonFormat format = Indented) const;
|
QByteArray toJson(JsonFormat format = Indented) const;
|
||||||
QVariant toVariant() const;
|
QVariant toVariant() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QJsonArray array() const;
|
QJsonArray array() const;
|
||||||
QJsonObject object() const;
|
QJsonObject object() const;
|
||||||
const char *rawData(int *size) const;
|
const char *rawData(int *size) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setArray(const QJsonArray &array);
|
void setArray(const QJsonArray &array);
|
||||||
void setObject(const QJsonObject &object);
|
void setObject(const QJsonObject &object);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate);
|
static QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate);
|
||||||
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
|
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
|
||||||
static QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate);
|
static QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate);
|
||||||
static QJsonDocument fromVariant(const QVariant &variant);
|
static QJsonDocument fromVariant(const QVariant &variant);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setRoot(const QJsonRoot &root);
|
void setRoot(const QJsonRoot &root);
|
||||||
QString toJson(const QJsonValue &v, JsonFormat format) const;
|
QString toJson(const QJsonValue &v, JsonFormat format, int indent = 1) const;
|
||||||
QString escapeString(const QString &s) const;
|
QString escapeString(const QString &s) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void swap(QJsonDocument &other);
|
void swap(QJsonDocument &other);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QJsonRoot *root_;
|
QJsonRoot *root_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
21
res/app.qrc
|
@ -1,19 +1,19 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/img">
|
<qresource prefix="/img">
|
||||||
<file>5sync-48.png</file>
|
|
||||||
<file>5sync-16.png</file>
|
|
||||||
<file>5sync-24.png</file>
|
|
||||||
<file>5sync-32.png</file>
|
|
||||||
<file>5sync-40.png</file>
|
|
||||||
<file>5sync-64.png</file>
|
|
||||||
<file>5sync-96.png</file>
|
|
||||||
<file>5sync-128.png</file>
|
|
||||||
<file>5sync-256.png</file>
|
|
||||||
<file>add.svgz</file>
|
<file>add.svgz</file>
|
||||||
<file>avatararea.png</file>
|
<file>avatararea.png</file>
|
||||||
<file>avatarareaimport.png</file>
|
<file>avatarareaimport.png</file>
|
||||||
<file>back.svgz</file>
|
<file>back.svgz</file>
|
||||||
<file>empty1x16.png</file>
|
<file>empty1x16.png</file>
|
||||||
|
<file>gta5view-16.png</file>
|
||||||
|
<file>gta5view-24.png</file>
|
||||||
|
<file>gta5view-32.png</file>
|
||||||
|
<file>gta5view-40.png</file>
|
||||||
|
<file>gta5view-48.png</file>
|
||||||
|
<file>gta5view-64.png</file>
|
||||||
|
<file>gta5view-96.png</file>
|
||||||
|
<file>gta5view-128.png</file>
|
||||||
|
<file>gta5view-256.png</file>
|
||||||
<file>mappreview.jpg</file>
|
<file>mappreview.jpg</file>
|
||||||
<file>next.svgz</file>
|
<file>next.svgz</file>
|
||||||
<file>pointmaker-8.png</file>
|
<file>pointmaker-8.png</file>
|
||||||
|
@ -25,9 +25,6 @@
|
||||||
<file>watermark_2b.png</file>
|
<file>watermark_2b.png</file>
|
||||||
<file>watermark_2r.png</file>
|
<file>watermark_2r.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/global">
|
|
||||||
<file>global.rcc</file>
|
|
||||||
</qresource>
|
|
||||||
<qresource prefix="/template">
|
<qresource prefix="/template">
|
||||||
<file>template.g5e</file>
|
<file>template.g5e</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
15
res/app.rc
|
@ -1,14 +1,11 @@
|
||||||
IDI_ICON1 ICON DISCARDABLE "5sync.ico"
|
IDI_ICON1 ICON DISCARDABLE "5sync.ico"
|
||||||
|
|
||||||
#define RT_MANIFEST 24
|
#define RT_MANIFEST 24
|
||||||
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
|
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
|
||||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gta5view.exe.manifest"
|
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gta5view.exe.manifest"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1, 7, 1, 0
|
FILEVERSION 1, 8, 0, 0
|
||||||
PRODUCTVERSION 1, 7, 1, 0
|
PRODUCTVERSION 1, 8, 0, 0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS 0
|
FILEFLAGS 0
|
||||||
FILEOS VOS_NT_WINDOWS32
|
FILEOS VOS_NT_WINDOWS32
|
||||||
|
@ -25,12 +22,12 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Syping"
|
VALUE "CompanyName", "Syping"
|
||||||
VALUE "FileDescription", "gta5view"
|
VALUE "FileDescription", "gta5view"
|
||||||
VALUE "FileVersion", "1.7.1"
|
VALUE "FileVersion", "1.8.0"
|
||||||
VALUE "InternalName", "gta5view"
|
VALUE "InternalName", "gta5view"
|
||||||
VALUE "LegalCopyright", "Copyright © 2016-2019 Syping"
|
VALUE "LegalCopyright", "Copyright © 2016-2020 Syping"
|
||||||
VALUE "OriginalFilename", "gta5view.exe"
|
VALUE "OriginalFilename", "gta5view.exe"
|
||||||
VALUE "ProductName", "gta5view"
|
VALUE "ProductName", "gta5view"
|
||||||
VALUE "ProductVersion", "1.7.1"
|
VALUE "ProductVersion", "1.8.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
10
res/de.syping.gta5view.desktop
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=gta5view
|
||||||
|
Comment=Open and edit GTA V profiles
|
||||||
|
Comment[de]=GTA V Profile öffnen und bearbeiten
|
||||||
|
Categories=Qt;Utility;
|
||||||
|
Exec=gta5view
|
||||||
|
Icon=de.syping.gta5view
|
||||||
|
Terminal=false
|
||||||
|
StartupNotify=false
|
63
res/de.syping.gta5view.metainfo.xml
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Copyright 2020 Syping -->
|
||||||
|
<component type="desktop-application">
|
||||||
|
<id>de.syping.gta5view</id>
|
||||||
|
<launchable type="desktop-id">de.syping.gta5view.desktop</launchable>
|
||||||
|
<metadata_license>CC0-1.0</metadata_license>
|
||||||
|
<project_license>GPL-3.0+</project_license>
|
||||||
|
|
||||||
|
<name>gta5view</name>
|
||||||
|
|
||||||
|
<summary>Open and edit GTA V profiles</summary>
|
||||||
|
<summary xml:lang="de">GTA V Profile öffnen und bearbeiten</summary>
|
||||||
|
|
||||||
|
<icon type="remote">https://img.syping.de/gta5view/gta5view.png</icon>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
<p>Open Source Snapmatic picture and Savegame viewer/editor for GTA V</p>
|
||||||
|
<p>Features</p>
|
||||||
|
<ul>
|
||||||
|
<li>View Snapmatics with the ability to disable them in-game</li>
|
||||||
|
<li>Edit Snapmatic pictures and properties in multiple ways</li>
|
||||||
|
<li>Import/Export Snapmatics, Savegames and pictures</li>
|
||||||
|
<li>Choose between multiple Social Club accounts as GTA V profiles IDs</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<categories>
|
||||||
|
<category>Utility</category>
|
||||||
|
</categories>
|
||||||
|
|
||||||
|
<developer_name>Syping</developer_name>
|
||||||
|
|
||||||
|
<releases>
|
||||||
|
<release date="2020-10-11" version="1.8.0" />
|
||||||
|
</releases>
|
||||||
|
|
||||||
|
<screenshots>
|
||||||
|
<screenshot type="default">
|
||||||
|
<caption>User Interface</caption>
|
||||||
|
<image type="source">https://img.syping.de/gta5view/mainui_kde.png</image>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<caption>Snapmatic Viewer</caption>
|
||||||
|
<image type="source">https://img.syping.de/gta5view/picture_kde.png</image>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<caption>Picture Importer</caption>
|
||||||
|
<image type="source">https://img.syping.de/gta5view/import_kde.png</image>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<caption>Snapmatic Player Editor</caption>
|
||||||
|
<image type="source">https://img.syping.de/gta5view/players_kde.png</image>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<caption>Snapmatic Property Editor</caption>
|
||||||
|
<image type="source">https://img.syping.de/gta5view/prop_kde.png</image>
|
||||||
|
</screenshot>
|
||||||
|
</screenshots>
|
||||||
|
|
||||||
|
<content_rating type="oars-1.1" />
|
||||||
|
|
||||||
|
<url type="homepage">https://gta5view.syping.de/</url>
|
||||||
|
</component>
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
761
res/gta5sync.ts
2469
res/gta5sync_es.ts
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 585 B |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 776 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
res/gta5view-512.png
Normal file
After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -1,11 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Version=1.6
|
|
||||||
Encoding=UTF-8
|
|
||||||
Type=Application
|
|
||||||
Name=gta5view
|
|
||||||
Comment=gta5view
|
|
||||||
Categories=Qt;Application;Utility;
|
|
||||||
Exec=gta5view
|
|
||||||
Icon=gta5view
|
|
||||||
Terminal=false
|
|
||||||
StartupNotify=false
|
|
BIN
res/qtbase_de.qm
BIN
res/qtbase_fr.qm
BIN
res/qtbase_ko.qm
BIN
res/qtbase_ru.qm
BIN
res/qtbase_uk.qm
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2017 Syping
|
* Copyright (C) 2017-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,7 +17,6 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "JSHighlighter.h"
|
#include "JSHighlighter.h"
|
||||||
#include <QRegExp>
|
|
||||||
|
|
||||||
JSHighlighter::JSHighlighter(QTextDocument *parent) :
|
JSHighlighter::JSHighlighter(QTextDocument *parent) :
|
||||||
QSyntaxHighlighter(parent)
|
QSyntaxHighlighter(parent)
|
||||||
|
@ -31,34 +30,61 @@ JSHighlighter::JSHighlighter(QTextDocument *parent) :
|
||||||
keywordPatterns << "\\btrue\\b" << "\\bfalse\\b";
|
keywordPatterns << "\\btrue\\b" << "\\bfalse\\b";
|
||||||
for (QString pattern : keywordPatterns)
|
for (QString pattern : keywordPatterns)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
rule.pattern = QRegularExpression(pattern);
|
||||||
|
#else
|
||||||
rule.pattern = QRegExp(pattern);
|
rule.pattern = QRegExp(pattern);
|
||||||
|
#endif
|
||||||
rule.format = keywordFormat;
|
rule.format = keywordFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
QBrush doubleBrush(QColor::fromRgb(66, 137, 244));
|
QBrush doubleBrush(QColor::fromRgb(66, 137, 244));
|
||||||
doubleFormat.setForeground(doubleBrush);
|
doubleFormat.setForeground(doubleBrush);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
rule.pattern = QRegularExpression("[+-]?\\d*\\.?\\d+");
|
||||||
|
#else
|
||||||
rule.pattern = QRegExp("[+-]?\\d*\\.?\\d+");
|
rule.pattern = QRegExp("[+-]?\\d*\\.?\\d+");
|
||||||
|
#endif
|
||||||
rule.format = doubleFormat;
|
rule.format = doubleFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
|
|
||||||
QBrush quotationBrush(QColor::fromRgb(66, 244, 104));
|
QBrush quotationBrush(QColor::fromRgb(66, 244, 104));
|
||||||
quotationFormat.setForeground(quotationBrush);
|
quotationFormat.setForeground(quotationBrush);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
rule.pattern = QRegularExpression("\"[^\"]*\"");
|
||||||
|
#else
|
||||||
rule.pattern = QRegExp("\"[^\"]*\"");
|
rule.pattern = QRegExp("\"[^\"]*\"");
|
||||||
|
#endif
|
||||||
rule.format = quotationFormat;
|
rule.format = quotationFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
|
|
||||||
QBrush objectBrush(QColor::fromRgb(255, 80, 80));
|
QBrush objectBrush(QColor::fromRgb(255, 80, 80));
|
||||||
objectFormat.setForeground(objectBrush);
|
objectFormat.setForeground(objectBrush);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
rule.pattern = QRegularExpression("\"[^\"]*\"(?=:)");
|
||||||
|
#else
|
||||||
rule.pattern = QRegExp("\"[^\"]*\"(?=:)");
|
rule.pattern = QRegExp("\"[^\"]*\"(?=:)");
|
||||||
|
#endif
|
||||||
rule.format = objectFormat;
|
rule.format = objectFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JSHighlighter::highlightBlock(const QString &text)
|
void JSHighlighter::highlightBlock(const QString &text)
|
||||||
{
|
{
|
||||||
for (HighlightingRule rule : highlightingRules)
|
#if QT_VERSION >= 0x050000
|
||||||
|
for (const HighlightingRule &rule : qAsConst(highlightingRules))
|
||||||
|
#else
|
||||||
|
for (const HighlightingRule &rule : highlightingRules)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text);
|
||||||
|
while (matchIterator.hasNext()) {
|
||||||
|
QRegularExpressionMatch match = matchIterator.next();
|
||||||
|
setFormat(match.capturedStart(), match.capturedLength(), rule.format);
|
||||||
|
}
|
||||||
|
#else
|
||||||
QRegExp expression(rule.pattern);
|
QRegExp expression(rule.pattern);
|
||||||
int index = expression.indexIn(text);
|
int index = expression.indexIn(text);
|
||||||
while (index >= 0)
|
while (index >= 0)
|
||||||
|
@ -67,6 +93,7 @@ void JSHighlighter::highlightBlock(const QString &text)
|
||||||
setFormat(index, length, rule.format);
|
setFormat(index, length, rule.format);
|
||||||
index = expression.indexIn(text, index + length);
|
index = expression.indexIn(text, index + length);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
setCurrentBlockState(0);
|
setCurrentBlockState(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* gta5view Grand Theft Auto V Profile Viewer
|
* gta5view Grand Theft Auto V Profile Viewer
|
||||||
* Copyright (C) 2017 Syping
|
* Copyright (C) 2017-2020 Syping
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,10 +24,15 @@
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QTextFormat>
|
#include <QTextFormat>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QRegExp>
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#else
|
||||||
|
#include <QRegExp>
|
||||||
|
#endif
|
||||||
|
|
||||||
class QTextDocument;
|
class QTextDocument;
|
||||||
|
|
||||||
class JSHighlighter : public QSyntaxHighlighter
|
class JSHighlighter : public QSyntaxHighlighter
|
||||||
|
@ -37,7 +42,11 @@ class JSHighlighter : public QSyntaxHighlighter
|
||||||
public:
|
public:
|
||||||
struct HighlightingRule
|
struct HighlightingRule
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
QRegularExpression pattern;
|
||||||
|
#else
|
||||||
QRegExp pattern;
|
QRegExp pattern;
|
||||||
|
#endif
|
||||||
QTextCharFormat format;
|
QTextCharFormat format;
|
||||||
};
|
};
|
||||||
QVector<HighlightingRule> highlightingRules;
|
QVector<HighlightingRule> highlightingRules;
|
||||||
|
|
|
@ -80,7 +80,11 @@ void UiModWidget::paintEvent(QPaintEvent *paintEvent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(paintEvent)
|
Q_UNUSED(paintEvent)
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
|
#if QT_VERSION <= 0x060000
|
||||||
|
opt.initFrom(this);
|
||||||
|
#else
|
||||||
opt.init(this);
|
opt.init(this);
|
||||||
|
#endif
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
}
|
}
|
||||||
|
|