Compare commits

..

2 commits
1.7.x ... 1.6.x

Author SHA1 Message Date
Syping 8cada11fb8 gta5view 1.6.2 2018-10-25 18:16:29 +02:00
Syping 90265d23b8 remove player fetching to protect players 2018-09-20 10:46:58 +02:00
65 changed files with 2723 additions and 4823 deletions

View file

@ -24,10 +24,10 @@ 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 && \ 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 && \
make depend && \ make depend && \
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,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 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,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=${PROJECT_DIR}/assets

View file

@ -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 dpkg-dev fakeroot g++ gcc qtbase5-dev qt5-qmake qttranslations5-l10n libqt4-dev

View file

@ -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.6.2.0"
!define COPYRIGHT "Copyright © 2016-2019 Syping" !define COPYRIGHT "Copyright © 2016-2018 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"
@ -33,7 +33,6 @@ Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}" OutFile "${INSTALLER_NAME}"
#BrandingText "${APP_NAME}" #BrandingText "${APP_NAME}"
XPStyle on XPStyle on
Unicode true
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" "" InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES64\Syping\gta5view" InstallDir "$PROGRAMFILES64\Syping\gta5view"
@ -79,7 +78,6 @@ InstallDir "$PROGRAMFILES64\Syping\gta5view"
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Russian" !insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Ukrainian" !insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "TradChinese" !insertmacro MUI_LANGUAGE "TradChinese"
@ -104,10 +102,10 @@ ${INSTALL_TYPE}
SetOverwrite ifnewer SetOverwrite ifnewer
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File "../build/release/gta5view.exe" File "../build/release/gta5view.exe"
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libgcc_s_seh-1.dll" File "/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/libgcc_s_seh-1.dll"
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libstdc++-6.dll" File "/usr/lib/gcc/x86_64-w64-mingw32/6.3-win32/libstdc++-6.dll"
File "/opt/windev/openssl-latest_qt64d/bin/libcrypto-1_1-x64.dll" File "/opt/windev/libressl-latest_qt64d/bin/libcrypto-43.dll"
File "/opt/windev/openssl-latest_qt64d/bin/libssl-1_1-x64.dll" File "/opt/windev/libressl-latest_qt64d/bin/libssl-45.dll"
File "/opt/windev/libjpeg-turbo-latest_qt64d/bin/libjpeg-62.dll" File "/opt/windev/libjpeg-turbo-latest_qt64d/bin/libjpeg-62.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Core.dll" File "/opt/windev/qt64d-latest/bin/Qt5Core.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Gui.dll" File "/opt/windev/qt64d-latest/bin/Qt5Gui.dll"
@ -119,17 +117,17 @@ SetOutPath "$INSTDIR\lang"
File "../res/gta5sync_en_US.qm" File "../res/gta5sync_en_US.qm"
File "../res/gta5sync_de.qm" File "../res/gta5sync_de.qm"
File "../res/gta5sync_fr.qm" File "../res/gta5sync_fr.qm"
File "../res/gta5sync_ko.qm"
File "../res/gta5sync_ru.qm" File "../res/gta5sync_ru.qm"
File "../res/gta5sync_uk.qm" File "../res/gta5sync_uk.qm"
File "../res/gta5sync_zh_TW.qm" File "../res/gta5sync_zh_TW.qm"
File "../res/qtbase_en_GB.qm" File "../res/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_ru.qm" 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\audio"
File "/opt/windev/qt64d-latest/plugins/audio/qtaudio_windows.dll"
SetOutPath "$INSTDIR\imageformats" SetOutPath "$INSTDIR\imageformats"
File "/opt/windev/qt64d-latest/plugins/imageformats/qgif.dll" File "/opt/windev/qt64d-latest/plugins/imageformats/qgif.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qicns.dll" File "/opt/windev/qt64d-latest/plugins/imageformats/qicns.dll"
@ -145,7 +143,6 @@ File "/opt/windev/qt64d-latest/plugins/platforms/qwindows.dll"
SetOutPath "$INSTDIR\styles" SetOutPath "$INSTDIR\styles"
File "/opt/windev/qt64d-latest/plugins/styles/qcleanlooksstyle.dll" File "/opt/windev/qt64d-latest/plugins/styles/qcleanlooksstyle.dll"
File "/opt/windev/qt64d-latest/plugins/styles/qplastiquestyle.dll" File "/opt/windev/qt64d-latest/plugins/styles/qplastiquestyle.dll"
File "/opt/windev/qt64d-latest/plugins/styles/qwindowsvistastyle.dll"
SectionEnd SectionEnd
###################################################################### ######################################################################
@ -197,8 +194,8 @@ ${INSTALL_TYPE}
Delete "$INSTDIR\gta5view.exe" Delete "$INSTDIR\gta5view.exe"
Delete "$INSTDIR\libgcc_s_seh-1.dll" Delete "$INSTDIR\libgcc_s_seh-1.dll"
Delete "$INSTDIR\libstdc++-6.dll" Delete "$INSTDIR\libstdc++-6.dll"
Delete "$INSTDIR\libcrypto-1_1-x64.dll" Delete "$INSTDIR\libcrypto-43.dll"
Delete "$INSTDIR\libssl-1_1-x64.dll" Delete "$INSTDIR\libssl-45.dll"
Delete "$INSTDIR\libjpeg-62.dll" Delete "$INSTDIR\libjpeg-62.dll"
Delete "$INSTDIR\Qt5Core.dll" Delete "$INSTDIR\Qt5Core.dll"
Delete "$INSTDIR\Qt5Gui.dll" Delete "$INSTDIR\Qt5Gui.dll"
@ -209,17 +206,16 @@ Delete "$INSTDIR\Qt5WinExtras.dll"
Delete "$INSTDIR\lang\gta5sync_en_US.qm" Delete "$INSTDIR\lang\gta5sync_en_US.qm"
Delete "$INSTDIR\lang\gta5sync_de.qm" Delete "$INSTDIR\lang\gta5sync_de.qm"
Delete "$INSTDIR\lang\gta5sync_fr.qm" Delete "$INSTDIR\lang\gta5sync_fr.qm"
Delete "$INSTDIR\lang\gta5sync_ko.qm"
Delete "$INSTDIR\lang\gta5sync_ru.qm" Delete "$INSTDIR\lang\gta5sync_ru.qm"
Delete "$INSTDIR\lang\gta5sync_uk.qm" Delete "$INSTDIR\lang\gta5sync_uk.qm"
Delete "$INSTDIR\lang\gta5sync_zh_TW.qm" Delete "$INSTDIR\lang\gta5sync_zh_TW.qm"
Delete "$INSTDIR\lang\qtbase_en_GB.qm" Delete "$INSTDIR\lang\qtbase_en_GB.qm"
Delete "$INSTDIR\lang\qtbase_de.qm" Delete "$INSTDIR\lang\qtbase_de.qm"
Delete "$INSTDIR\lang\qtbase_fr.qm" Delete "$INSTDIR\lang\qtbase_fr.qm"
Delete "$INSTDIR\lang\qtbase_ko.qm"
Delete "$INSTDIR\lang\qtbase_ru.qm" Delete "$INSTDIR\lang\qtbase_ru.qm"
Delete "$INSTDIR\lang\qtbase_uk.qm" Delete "$INSTDIR\lang\qtbase_uk.qm"
Delete "$INSTDIR\lang\qtbase_zh_TW.qm" Delete "$INSTDIR\lang\qtbase_zh_TW.qm"
Delete "$INSTDIR\audio\qtaudio_windows.dll"
Delete "$INSTDIR\imageformats\qgif.dll" Delete "$INSTDIR\imageformats\qgif.dll"
Delete "$INSTDIR\imageformats\qicns.dll" Delete "$INSTDIR\imageformats\qicns.dll"
Delete "$INSTDIR\imageformats\qico.dll" Delete "$INSTDIR\imageformats\qico.dll"
@ -232,8 +228,8 @@ Delete "$INSTDIR\imageformats\qwebp.dll"
Delete "$INSTDIR\platforms\qwindows.dll" Delete "$INSTDIR\platforms\qwindows.dll"
Delete "$INSTDIR\styles\qcleanlooksstyle.dll" Delete "$INSTDIR\styles\qcleanlooksstyle.dll"
Delete "$INSTDIR\styles\qplastiquestyle.dll" Delete "$INSTDIR\styles\qplastiquestyle.dll"
Delete "$INSTDIR\styles\qwindowsvistastyle.dll"
RmDir "$INSTDIR\lang" RmDir "$INSTDIR\lang"
RmDir "$INSTDIR\audio"
RmDir "$INSTDIR\imageformats" RmDir "$INSTDIR\imageformats"
RmDir "$INSTDIR\platforms" RmDir "$INSTDIR\platforms"
RmDir "$INSTDIR\styles" RmDir "$INSTDIR\styles"

View file

@ -16,4 +16,5 @@ qmake-static ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE
make depend && \ make depend && \
make -j 4 && \ make -j 4 && \
cp -Rf release/*.exe ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} && \ cp -Rf release/*.exe ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} && \
cd ${PROJECT_DIR}/assets cd ${PROJECT_DIR}/assets && \
upx --best ${GTA5VIEW_EXECUTABLE}

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
DOCKER_IMAGE=sypingauto/gta5view-build:1.7-static QT_VERSION=5.9.6
DOCKER_IMAGE=syping/qt5-static-mingw:${QT_VERSION}
PROJECT_DIR_DOCKER=/gta5view PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \ cd ${PROJECT_DIR} && \

View file

@ -12,7 +12,7 @@ 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 && \ 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\\\"' ../gta5view.pro && \
make depend && \ make depend && \
make -j 4 && \ make -j 4 && \
cd ${PROJECT_DIR}/assets && \ cd ${PROJECT_DIR}/assets && \

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
DOCKER_IMAGE=sypingauto/gta5view-build:1.7-shared QT_VERSION=5.9.6
DOCKER_IMAGE=syping/qt5-shared-mingw:${QT_VERSION}
PROJECT_DIR_DOCKER=/gta5view PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \ cd ${PROJECT_DIR} && \

View file

@ -6,7 +6,7 @@ variables:
Windows Installer: Windows Installer:
stage: build stage: build
image: sypingauto/gta5view-build:1.7-shared image: syping/qt5-shared-mingw:5.9.6
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: syping/qt5-static-mingw:5.9.6
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"

View file

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
# Install curl, git, lua, nsis and openssl
apt-get update -qq && \
apt-get install -qq curl git lua5.2 nsis openssl
# 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

View file

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
# Install lua # Install curl and lua
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
brew install lua
else
sudo apt-get update -qq && \ sudo apt-get update -qq && \
sudo apt-get install -qq lua5.2 sudo apt-get install -qq curl lua5.2
elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
brew install lua
fi fi
# Check if build is not tagged # Check if build is not tagged

View file

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

View file

@ -509,12 +509,3 @@ qreal AppEnv::screenRatio()
return (dpi / 96); return (dpi / 96);
#endif #endif
} }
qreal AppEnv::screenRatioPR()
{
#if QT_VERSION >= 0x050600
return QGuiApplication::primaryScreen()->devicePixelRatio();
#else
return 1;
#endif
}

View file

@ -56,7 +56,6 @@ public:
// Screen Stuff // Screen Stuff
static qreal screenRatio(); static qreal screenRatio();
static qreal screenRatioPR();
}; };
#endif // APPENV_H #endif // APPENV_H

View file

@ -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-2018 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
@ -142,7 +142,6 @@ void ImportDialog::processImage()
QPixmap snapmaticPixmap(snapmaticResolutionW, snapmaticResolutionH); QPixmap snapmaticPixmap(snapmaticResolutionW, snapmaticResolutionH);
snapmaticPixmap.fill(selectedColour); snapmaticPixmap.fill(selectedColour);
QPainter snapmaticPainter(&snapmaticPixmap); QPainter snapmaticPainter(&snapmaticPixmap);
qreal screenRatioPR = AppEnv::screenRatioPR();
if (!backImage.isNull()) if (!backImage.isNull())
{ {
if (!ui->cbStretch->isChecked()) if (!ui->cbStretch->isChecked())
@ -226,10 +225,7 @@ void ImportDialog::processImage()
} }
snapmaticPainter.end(); snapmaticPainter.end();
newImage = snapmaticPixmap.toImage(); newImage = snapmaticPixmap.toImage();
#if QT_VERSION >= 0x050600 ui->labPicture->setPixmap(snapmaticPixmap.scaled(snapmaticResolutionLW, snapmaticResolutionLH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
snapmaticPixmap.setDevicePixelRatio(screenRatioPR);
#endif
ui->labPicture->setPixmap(snapmaticPixmap.scaled(snapmaticResolutionLW * screenRatioPR, snapmaticResolutionLH * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
} }
void ImportDialog::processWatermark(QPainter *snapmaticPainter) void ImportDialog::processWatermark(QPainter *snapmaticPainter)

View file

@ -94,7 +94,6 @@ JsonEditorDialog::JsonEditorDialog(SnapmaticPicture *picture, QWidget *parent) :
{ {
ui->lineJSON->setMinimumHeight(qRound(1 * screenRatio)); ui->lineJSON->setMinimumHeight(qRound(1 * screenRatio));
ui->lineJSON->setMaximumHeight(qRound(1 * screenRatio)); ui->lineJSON->setMaximumHeight(qRound(1 * screenRatio));
ui->lineJSON->setLineWidth(qRound(1 * screenRatio));
} }
resize(450 * screenRatio, 550 * screenRatio); resize(450 * screenRatio, 550 * screenRatio);
} }

View file

@ -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 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
@ -61,10 +61,9 @@ MapLocationDialog::~MapLocationDialog()
void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d) void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d)
{ {
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR(); int pointMakerSize = 8 * screenRatio;
int pointMakerSize = 8 * screenRatio * screenRatioPR;
QPixmap pointMakerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMakerSize, pointMakerSize)); QPixmap pointMakerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMakerSize, pointMakerSize));
QSize mapPixelSize = QSize(width() * screenRatioPR, height() * screenRatioPR); QSize mapPixelSize = size();
int pointMakerHalfSize = pointMakerSize / 2; int pointMakerHalfSize = pointMakerSize / 2;
long xpos_ms = qRound(xpos_d); long xpos_ms = qRound(xpos_d);
@ -83,9 +82,6 @@ void MapLocationDialog::drawPointOnMap(double xpos_d, double ypos_d)
mapPainter.drawPixmap(0, 0, mapPixelSize.width(), mapPixelSize.height(), QPixmap(":/img/mappreview.jpg").scaled(mapPixelSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); 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.drawPixmap(xpos_pr, mapPixelSize.height() - ypos_pr, pointMakerSize, pointMakerSize, pointMakerPixmap);
mapPainter.end(); mapPainter.end();
#if QT_VERSION >= 0x050600
mapPixmap.setDevicePixelRatio(screenRatioPR);
#endif
QPalette backgroundPalette; QPalette backgroundPalette;
backgroundPalette.setBrush(backgroundRole(), QBrush(mapPixmap)); backgroundPalette.setBrush(backgroundRole(), QBrush(mapPixmap));

View file

@ -703,7 +703,7 @@ void OptionsDialog::setupSnapmaticPictureViewer()
#ifdef GTA5SYNC_WIN #ifdef GTA5SYNC_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", false).toBool());
settings->endGroup(); settings->endGroup();
#else #else
ui->cbSnapmaticNavigationBar->setVisible(false); ui->cbSnapmaticNavigationBar->setVisible(false);

View file

@ -138,10 +138,9 @@ void PictureDialog::setupPictureDialog()
// Avatar area // Avatar area
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR(); if (screenRatio != 1)
if (screenRatio != 1 || screenRatioPR != 1)
{ {
avatarAreaPicture = QImage(":/img/avatararea.png").scaledToHeight(536 * screenRatio * screenRatioPR, Qt::FastTransformation); avatarAreaPicture = QImage(":/img/avatararea.png").scaledToHeight(536 * screenRatio, Qt::FastTransformation);
} }
else else
{ {
@ -151,11 +150,6 @@ void PictureDialog::setupPictureDialog()
avatarLocY = 66; avatarLocY = 66;
avatarSize = 470; avatarSize = 470;
// DPI calculation (picture)
ui->labPicture->setFixedSize(960 * screenRatio, 536 * screenRatio);
ui->labPicture->setFocusPolicy(Qt::StrongFocus);
ui->labPicture->setScaledContents(true);
// Overlay area // Overlay area
renderOverlayPicture(); renderOverlayPicture();
overlayEnabled = true; overlayEnabled = true;
@ -191,12 +185,8 @@ void PictureDialog::setupPictureDialog()
installEventFilter(this); installEventFilter(this);
installEventFilter(ui->labPicture); installEventFilter(ui->labPicture);
ui->labPicture->setFixedSize(960 * screenRatio, 536 * screenRatio);
// DPI calculation ui->labPicture->setFocusPolicy(Qt::StrongFocus);
ui->hlButtons->setSpacing(6 * screenRatio);
ui->vlButtons->setSpacing(6 * screenRatio);
ui->vlButtons->setContentsMargins(0, 0, 5 * screenRatio, 5 * 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(960 * screenRatio);
@ -242,8 +232,8 @@ void PictureDialog::addPreviousNextButtons()
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.png"), "", this, SLOT(previousPictureRequestedSlot()));
uiToolbar->addAction(QIcon(":/img/next.svgz"), "", this, SLOT(nextPictureRequestedSlot())); uiToolbar->addAction(QIcon(":/img/next.png"), "", this, SLOT(nextPictureRequestedSlot()));
layout()->setMenuBar(uiToolbar); layout()->setMenuBar(uiToolbar);
naviEnabled = true; naviEnabled = true;
@ -347,7 +337,7 @@ LRESULT PictureDialog::HitTestNCA(HWND hWnd, LPARAM lParam)
void PictureDialog::resizeEvent(QResizeEvent *event) void PictureDialog::resizeEvent(QResizeEvent *event)
{ {
Q_UNUSED(event) Q_UNUSED(event)
// int newDialogHeight = (ui->labPicture->pixmap()->height() / AppEnv::screenRatioPR()); // int newDialogHeight = ui->labPicture->pixmap()->height();
// newDialogHeight = newDialogHeight + ui->jsonFrame->height(); // newDialogHeight = newDialogHeight + ui->jsonFrame->height();
// if (naviEnabled) newDialogHeight = newDialogHeight + layout()->menuBar()->height(); // if (naviEnabled) newDialogHeight = newDialogHeight + layout()->menuBar()->height();
// int buttomBorderSize = (frameSize().height() - size().height()); // int buttomBorderSize = (frameSize().height() - size().height());
@ -368,7 +358,7 @@ void PictureDialog::resizeEvent(QResizeEvent *event)
void PictureDialog::adaptNewDialogSize(QSize newLabelSize) void PictureDialog::adaptNewDialogSize(QSize newLabelSize)
{ {
Q_UNUSED(newLabelSize) Q_UNUSED(newLabelSize)
int newDialogHeight = (ui->labPicture->pixmap()->height() / AppEnv::screenRatioPR()); int newDialogHeight = ui->labPicture->pixmap()->height();
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);
@ -379,14 +369,14 @@ void PictureDialog::adaptNewDialogSize(QSize newLabelSize)
updateGeometry(); updateGeometry();
} }
void PictureDialog::styliseDialog() void PictureDialog::stylizeDialog()
{ {
#ifdef GTA5SYNC_WIN #ifdef GTA5SYNC_WIN
#if QT_VERSION >= 0x050200 #if QT_VERSION >= 0x050200
if (QtWin::isCompositionEnabled()) if (QtWin::isCompositionEnabled())
{ {
QPalette palette; QPalette palette;
QtWin::extendFrameIntoClientArea(this, 0, qRound(layout()->menuBar()->height() * AppEnv::screenRatioPR()), 0, 0); QtWin::extendFrameIntoClientArea(this, 0, this->layout()->menuBar()->height(), 0, 0);
ui->jsonFrame->setStyleSheet(QString("QFrame { background: %1; }").arg(palette.window().color().name())); ui->jsonFrame->setStyleSheet(QString("QFrame { background: %1; }").arg(palette.window().color().name()));
setStyleSheet("PictureDialog { background: transparent; }"); setStyleSheet("PictureDialog { background: transparent; }");
} }
@ -409,7 +399,7 @@ bool PictureDialog::event(QEvent *event)
{ {
if (event->type() == QWinEvent::CompositionChange || event->type() == QWinEvent::ColorizationChange) if (event->type() == QWinEvent::CompositionChange || event->type() == QWinEvent::ColorizationChange)
{ {
styliseDialog(); stylizeDialog();
} }
} }
#endif #endif
@ -570,25 +560,24 @@ void PictureDialog::renderOverlayPicture()
{ {
// Generating Overlay Preview // Generating Overlay Preview
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR(); QRect preferedRect = QRect(0, 0, 200 * screenRatio, 160 * screenRatio);
QRect preferedRect = QRect(0, 0, 200 * screenRatio * screenRatioPR, 160 * screenRatio * screenRatioPR);
QString overlayText = tr("Key 1 - Avatar Preview Mode\nKey 2 - Toggle Overlay\nArrow Keys - Navigate"); QString overlayText = tr("Key 1 - Avatar Preview Mode\nKey 2 - Toggle Overlay\nArrow Keys - Navigate");
QFont overlayPainterFont; QFont overlayPainterFont;
overlayPainterFont.setPixelSize(12 * screenRatio * screenRatioPR); overlayPainterFont.setPixelSize(12 * screenRatio);
QFontMetrics fontMetrics(overlayPainterFont); QFontMetrics fontMetrics(overlayPainterFont);
QRect overlaySpace = fontMetrics.boundingRect(preferedRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextDontClip | Qt::TextWordWrap, overlayText); QRect overlaySpace = fontMetrics.boundingRect(preferedRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextDontClip | Qt::TextWordWrap, overlayText);
int hOverlay = Qt::AlignTop; int hOverlay = Qt::AlignTop;
if (overlaySpace.height() < 74 * screenRatio * screenRatioPR) if (overlaySpace.height() < 74 * screenRatio)
{ {
hOverlay = Qt::AlignVCenter; hOverlay = Qt::AlignVCenter;
preferedRect.setHeight(71 * screenRatio * screenRatioPR); preferedRect.setHeight(71 * screenRatio);
overlaySpace.setHeight(80 * screenRatio * screenRatioPR); overlaySpace.setHeight(80 * screenRatio);
} }
else else
{ {
overlaySpace.setHeight(overlaySpace.height() + 6 * screenRatio * screenRatioPR); overlaySpace.setHeight(overlaySpace.height() + 6 * screenRatio);
} }
QImage overlayImage(overlaySpace.size(), QImage::Format_ARGB32_Premultiplied); QImage overlayImage(overlaySpace.size(), QImage::Format_ARGB32_Premultiplied);
@ -600,13 +589,13 @@ void PictureDialog::renderOverlayPicture()
overlayPainter.drawText(preferedRect, Qt::AlignLeft | hOverlay | Qt::TextDontClip | Qt::TextWordWrap, overlayText); overlayPainter.drawText(preferedRect, Qt::AlignLeft | hOverlay | Qt::TextDontClip | Qt::TextWordWrap, overlayText);
overlayPainter.end(); overlayPainter.end();
if (overlaySpace.width() < 194 * screenRatio * screenRatioPR) if (overlaySpace.width() < 194 * screenRatio)
{ {
overlaySpace.setWidth(200 * screenRatio * screenRatioPR); overlaySpace.setWidth(200 * screenRatio);
} }
else else
{ {
overlaySpace.setWidth(overlaySpace.width() + 6 * screenRatio * screenRatioPR); overlaySpace.setWidth(overlaySpace.width() + 6 * screenRatio);
} }
QImage overlayBorderImage(overlaySpace.width(), overlaySpace.height(), QImage::Format_ARGB6666_Premultiplied); QImage overlayBorderImage(overlaySpace.width(), overlaySpace.height(), QImage::Format_ARGB6666_Premultiplied);
@ -616,7 +605,7 @@ void PictureDialog::renderOverlayPicture()
overlayTempImage.fill(Qt::transparent); overlayTempImage.fill(Qt::transparent);
QPainter overlayTempPainter(&overlayTempImage); QPainter overlayTempPainter(&overlayTempImage);
overlayTempPainter.drawImage(0, 0, overlayBorderImage); overlayTempPainter.drawImage(0, 0, overlayBorderImage);
overlayTempPainter.drawImage(3 * screenRatio * screenRatioPR, 3 * screenRatio * screenRatioPR, overlayImage); overlayTempPainter.drawImage(3 * screenRatio, 3 * screenRatio, overlayImage);
overlayTempPainter.end(); overlayTempPainter.end();
} }
@ -689,51 +678,63 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture)
void PictureDialog::renderPicture() void PictureDialog::renderPicture()
{ {
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR();
if (!previewMode) if (!previewMode)
{ {
if (overlayEnabled) if (overlayEnabled)
{ {
QPixmap shownImagePixmap(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR); QPixmap shownImagePixmap(960 * screenRatio, 536 * screenRatio);
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)); if (screenRatio == 1)
shownImagePainter.drawImage(3 * screenRatio * screenRatioPR, 3 * screenRatio * screenRatioPR, overlayTempImage); {
shownImagePainter.drawImage(0, 0, snapmaticPicture);
shownImagePainter.drawImage(3 * screenRatio, 3 * screenRatio, overlayTempImage);
}
else
{
shownImagePainter.drawImage(0, 0, snapmaticPicture.scaledToHeight(536 * screenRatio, Qt::SmoothTransformation));
shownImagePainter.drawImage(3 * screenRatio, 3 * screenRatio, overlayTempImage);
}
shownImagePainter.end(); shownImagePainter.end();
#if QT_VERSION >= 0x050600
shownImagePixmap.setDevicePixelRatio(screenRatioPR);
#endif
ui->labPicture->setPixmap(shownImagePixmap); ui->labPicture->setPixmap(shownImagePixmap);
} }
else else
{ {
QPixmap shownImagePixmap(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR); if (screenRatio != 1)
shownImagePixmap.fill(Qt::transparent); {
QPainter shownImagePainter(&shownImagePixmap); QPixmap shownImagePixmap(960 * screenRatio, 536 * screenRatio);
shownImagePainter.drawImage(0, 0, snapmaticPicture.scaled(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); shownImagePixmap.fill(Qt::transparent);
shownImagePainter.end(); QPainter shownImagePainter(&shownImagePixmap);
#if QT_VERSION >= 0x050600 shownImagePainter.drawImage(0, 0, snapmaticPicture.scaledToHeight(536 * screenRatio, Qt::SmoothTransformation));
shownImagePixmap.setDevicePixelRatio(screenRatioPR); shownImagePainter.end();
#endif ui->labPicture->setPixmap(shownImagePixmap);
ui->labPicture->setPixmap(shownImagePixmap); }
else
{
ui->labPicture->setPixmap(QPixmap::fromImage(snapmaticPicture));
}
} }
} }
else else
{ {
// Generating Avatar Preview // Generating Avatar Preview
QPixmap avatarPixmap(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR); QPixmap avatarPixmap(960 * screenRatio, 536 * screenRatio);
QPainter snapPainter(&avatarPixmap); QPainter snapPainter(&avatarPixmap);
QFont snapPainterFont; QFont snapPainterFont;
snapPainterFont.setPixelSize(12 * screenRatio * screenRatioPR); snapPainterFont.setPixelSize(12 * screenRatio);
snapPainter.drawImage(0, 0, snapmaticPicture.scaled(960 * screenRatio * screenRatioPR, 536 * screenRatio * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); if (screenRatio == 1)
{
snapPainter.drawImage(0, 0, snapmaticPicture);
}
else
{
snapPainter.drawImage(0, 0, snapmaticPicture.scaledToHeight(536 * screenRatio, 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, 3 * screenRatio, 140 * screenRatio, 536 * screenRatio), Qt::AlignLeft | Qt::TextWordWrap, tr("Avatar Preview Mode\nPress 1 for Default View"));
snapPainter.end(); snapPainter.end();
#if QT_VERSION >= 0x050600
avatarPixmap.setDevicePixelRatio(screenRatioPR);
#endif
ui->labPicture->setPixmap(avatarPixmap); ui->labPicture->setPixmap(avatarPixmap);
} }
} }
@ -761,15 +762,10 @@ void PictureDialog::playerNameUpdated()
QString PictureDialog::generateCrewString() QString PictureDialog::generateCrewString()
{ {
SnapmaticPicture *picture = smpic; // used by macro SnapmaticPicture *picture = smpic; // used by macro
const QString crewIDStr = crewID; // save operation time QString crewIDStr = crewID; // save operation time
if (crewIDStr != "0" && !crewIDStr.isEmpty()) if (crewIDStr != "0" && !crewIDStr.isEmpty())
{ {
if (crewIDStr != crewStr) { return QString("<a href=\"https://socialclub.rockstargames.com/crew/" % QString(crewStr).replace(" ", "_") % "/" % crewIDStr % "\">" % crewStr % "</a>");
return QString("<a href=\"https://socialclub.rockstargames.com/crew/" % QString(crewStr).replace(" ", "_") % "/" % crewIDStr % "\">" % crewStr % "</a>");
}
else {
return QString(crewIDStr);
}
} }
return tr("No Crew"); return tr("No Crew");
} }
@ -781,15 +777,11 @@ QString PictureDialog::generatePlayersString()
QString plyrsStr; QString plyrsStr;
if (playersList.length() >= 1) if (playersList.length() >= 1)
{ {
for (const QString player : playersList) for (QString player : playersList)
{ {
const QString playerName = profileDB->getPlayerName(player); QString playerName;
if (player != playerName) { playerName = profileDB->getPlayerName(player);
plyrsStr += ", <a href=\"https://socialclub.rockstargames.com/member/" % playerName % "/" % player % "\">" % playerName % "</a>"; plyrsStr += ", <a href=\"https://socialclub.rockstargames.com/member/" % playerName % "/" % player % "\">" % playerName % "</a>";
}
else {
plyrsStr += ", " % player;
}
} }
plyrsStr.remove(0, 2); plyrsStr.remove(0, 2);
} }

View file

@ -56,7 +56,7 @@ public:
void setSnapmaticPicture(SnapmaticPicture *picture, int index); void setSnapmaticPicture(SnapmaticPicture *picture, int index);
void setSnapmaticPicture(SnapmaticPicture *picture); void setSnapmaticPicture(SnapmaticPicture *picture);
void addPreviousNextButtons(); void addPreviousNextButtons();
void styliseDialog(); void stylizeDialog();
bool isIndexed(); bool isIndexed();
int getIndex(); int getIndex();
~PictureDialog(); ~PictureDialog();

View file

@ -79,9 +79,7 @@ PlayerListDialog::PlayerListDialog(QStringList players, ProfileDatabase *profile
} }
else else
{ {
ui->cmdMakeAv->setIcon(QIcon(":/img/back.svgz")); drawSwitchButtons();
ui->cmdMakeSe->setIcon(QIcon(":/img/next.svgz"));
ui->cmdMakeAd->setIcon(QIcon(":/img/add.svgz"));
} }
buildInterface(); buildInterface();
@ -103,6 +101,79 @@ PlayerListDialog::~PlayerListDialog()
delete ui; delete ui;
} }
void PlayerListDialog::drawSwitchButtons()
{
QFont painterFont = ui->cmdApply->font();
QPalette palette;
QFontMetrics fontMetrics(painterFont);
QRect makeAvRect = fontMetrics.boundingRect(QRect(0, 0, 0, 0), Qt::AlignCenter | Qt::TextDontClip, "<");
QRect makeSeRect = fontMetrics.boundingRect(QRect(0, 0, 0, 0), Qt::AlignCenter | Qt::TextDontClip, ">");
QRect makeAdRect = fontMetrics.boundingRect(QRect(0, 0, 0, 0), Qt::AlignCenter | Qt::TextDontClip, "+");
int makeAvSize;
if (makeAvRect.height() > makeAvRect.width())
{
makeAvSize = makeAvRect.height();
}
else
{
makeAvSize = makeAvRect.width();
}
int makeSeSize;
if (makeSeRect.height() > makeSeRect.width())
{
makeSeSize = makeSeRect.height();
}
else
{
makeSeSize = makeSeRect.width();
}
int makeAdSize;
if (makeAdRect.height() > makeAdRect.width())
{
makeAdSize = makeAdRect.height();
}
else
{
makeAdSize = makeAdRect.width();
}
QImage avImage(makeAvSize, makeAvSize, QImage::Format_ARGB32_Premultiplied);
avImage.fill(Qt::transparent);
QImage seImage(makeSeSize, makeSeSize, QImage::Format_ARGB32_Premultiplied);
seImage.fill(Qt::transparent);
QImage adImage(makeAdSize, makeAdSize, QImage::Format_ARGB32_Premultiplied);
adImage.fill(Qt::transparent);
QPainter avPainter(&avImage);
avPainter.setFont(painterFont);
avPainter.setBrush(palette.buttonText());
avPainter.setPen(palette.buttonText().color());
avPainter.drawText(0, 0, makeAvSize, makeAvSize, Qt::AlignCenter | Qt::TextDontClip, "<");
avPainter.end();
QPainter sePainter(&seImage);
sePainter.setFont(painterFont);
sePainter.setBrush(palette.buttonText());
sePainter.setPen(palette.buttonText().color());
sePainter.drawText(0, 0, makeSeSize, makeSeSize, Qt::AlignCenter | Qt::TextDontClip, ">");
sePainter.end();
QPainter adPainter(&adImage);
adPainter.setFont(painterFont);
adPainter.setBrush(palette.buttonText());
adPainter.setPen(palette.buttonText().color());
adPainter.drawText(0, 0, makeAdSize, makeAdSize, Qt::AlignCenter | Qt::TextDontClip, "+");
adPainter.end();
ui->cmdMakeAv->setIconSize(avImage.size());
ui->cmdMakeSe->setIconSize(seImage.size());
ui->cmdMakeAd->setIconSize(adImage.size());
ui->cmdMakeAv->setIcon(QIcon(QPixmap::fromImage(avImage)));
ui->cmdMakeSe->setIcon(QIcon(QPixmap::fromImage(seImage)));
ui->cmdMakeAd->setIcon(QIcon(QPixmap::fromImage(adImage)));
}
void PlayerListDialog::on_cmdCancel_clicked() void PlayerListDialog::on_cmdCancel_clicked()
{ {
close(); close();

View file

@ -48,6 +48,7 @@ private:
ProfileDatabase *profileDB; ProfileDatabase *profileDB;
Ui::PlayerListDialog *ui; Ui::PlayerListDialog *ui;
bool listUpdated; bool listUpdated;
void drawSwitchButtons();
void buildInterface(); void buildInterface();
signals: signals:

View file

@ -51,8 +51,8 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="cmdMakeSe"> <widget class="QPushButton" name="cmdMakeSe">
<property name="focusPolicy"> <property name="text">
<enum>Qt::NoFocus</enum> <string/>
</property> </property>
<property name="autoDefault"> <property name="autoDefault">
<bool>false</bool> <bool>false</bool>
@ -61,9 +61,6 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="cmdMakeAv"> <widget class="QPushButton" name="cmdMakeAv">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@ -74,9 +71,6 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="cmdMakeAd"> <widget class="QPushButton" name="cmdMakeAd">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>

View file

@ -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-2018 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
@ -51,6 +51,7 @@
#include <QScrollBar> #include <QScrollBar>
#include <QClipboard> #include <QClipboard>
#include <QFileInfo> #include <QFileInfo>
#include <QPalette>
#include <QPainter> #include <QPainter>
#include <QRegExp> #include <QRegExp>
#include <QAction> #include <QAction>
@ -1587,7 +1588,7 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev)
{ {
previousWidget->setStyleSheet(QLatin1String("")); previousWidget->setStyleSheet(QLatin1String(""));
} }
picWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); picWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
previousWidget = picWidget; previousWidget = picWidget;
} }
QMenu contextMenu(picWidget); QMenu contextMenu(picWidget);
@ -1638,7 +1639,7 @@ void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev)
{ {
previousWidget->setStyleSheet(QLatin1String("")); previousWidget->setStyleSheet(QLatin1String(""));
} }
sgdWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); sgdWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
previousWidget = sgdWidget; previousWidget = sgdWidget;
} }
QMenu contextMenu(sgdWidget); QMenu contextMenu(sgdWidget);
@ -1756,7 +1757,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{ {
if (pWidget != previousWidget) if (pWidget != previousWidget)
{ {
pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
styleSheetChanged = true; styleSheetChanged = true;
} }
} }
@ -1764,7 +1765,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{ {
if (pWidget != previousWidget) if (pWidget != previousWidget)
{ {
pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
styleSheetChanged = true; styleSheetChanged = true;
} }
} }
@ -1801,7 +1802,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{ {
if (pWidget != previousWidget) if (pWidget != previousWidget)
{ {
pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
styleSheetChanged = true; styleSheetChanged = true;
} }
} }
@ -1809,7 +1810,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{ {
if (pWidget != previousWidget) if (pWidget != previousWidget)
{ {
pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
styleSheetChanged = true; styleSheetChanged = true;
} }
} }
@ -1877,7 +1878,7 @@ void ProfileInterface::hoverProfileWidgetCheck()
{ {
if (pWidget != previousWidget) if (pWidget != previousWidget)
{ {
pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
styleSheetChanged = true; styleSheetChanged = true;
} }
} }
@ -1885,7 +1886,7 @@ void ProfileInterface::hoverProfileWidgetCheck()
{ {
if (pWidget != previousWidget) if (pWidget != previousWidget)
{ {
pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
styleSheetChanged = true; styleSheetChanged = true;
} }
} }
@ -1910,16 +1911,20 @@ void ProfileInterface::hoverProfileWidgetCheck()
void ProfileInterface::updatePalette() void ProfileInterface::updatePalette()
{ {
ui->saProfile->setStyleSheet(QString("QWidget#saProfileContent{background-color:palette(base)}")); QPalette palette;
QColor baseColor = palette.base().color();
highlightBackColor = palette.highlight().color();
highlightTextColor = palette.highlightedText().color();
ui->saProfile->setStyleSheet(QString("QWidget#saProfileContent{background-color: rgb(%1, %2, %3)}").arg(QString::number(baseColor.red()), QString::number(baseColor.green()), QString::number(baseColor.blue())));
if (previousWidget != nullptr) if (previousWidget != nullptr)
{ {
if (previousWidget->getWidgetType() == "SnapmaticWidget") if (previousWidget->getWidgetType() == "SnapmaticWidget")
{ {
previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
} }
else if (previousWidget->getWidgetType() == "SavegameWidget") else if (previousWidget->getWidgetType() == "SavegameWidget")
{ {
previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); previousWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
} }
} }
} }

View file

@ -101,6 +101,8 @@ private:
QMap<ProfileWidget*,QString> widgets; QMap<ProfileWidget*,QString> widgets;
QSpacerItem *saSpacerItem; QSpacerItem *saSpacerItem;
QStringList fixedPictures; QStringList fixedPictures;
QColor highlightBackColor;
QColor highlightTextColor;
QString enabledPicStr; QString enabledPicStr;
QString profileFolder; QString profileFolder;
QString profileName; QString profileName;

View file

@ -58,8 +58,9 @@ SavegameWidget::SavegameWidget(QWidget *parent) :
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
ui->labSavegamePic->setFixedSize(48 * screenRatio, 27 * screenRatio); ui->labSavegamePic->setFixedSize(48 * screenRatio, 27 * screenRatio);
ui->labSavegamePic->setScaledContents(true); QPixmap savegamePixmap(":/img/savegame.png");
ui->labSavegamePic->setPixmap(QPixmap(":/img/savegame.svgz")); if (screenRatio != 1) savegamePixmap = savegamePixmap.scaledToHeight(ui->labSavegamePic->height(), Qt::SmoothTransformation);
ui->labSavegamePic->setPixmap(savegamePixmap);
QString exportSavegameStr = tr("Export Savegame..."); QString exportSavegameStr = tr("Export Savegame...");
Q_UNUSED(exportSavegameStr) Q_UNUSED(exportSavegameStr)

View file

@ -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-2018 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
@ -78,16 +78,9 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
QObject::connect(picture, SIGNAL(customSignal(QString)), this, SLOT(customSignal(QString))); QObject::connect(picture, SIGNAL(customSignal(QString)), this, SLOT(customSignal(QString)));
qreal screenRatio = AppEnv::screenRatio(); qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR();
ui->labPicture->setFixedSize(48 * screenRatio, 27 * screenRatio); ui->labPicture->setFixedSize(48 * screenRatio, 27 * screenRatio);
ui->labPicture->setScaledContents(true); QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getImage().scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::AutoColor);
QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getImage().scaled(ui->labPicture->width() * screenRatioPR, ui->labPicture->height() * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::AutoColor);
#if QT_VERSION >= 0x050600
SnapmaticPixmap.setDevicePixelRatio(screenRatioPR);
#endif
ui->labPicStr->setText(smpic->getPictureStr() % "\n" % smpic->getPictureTitl()); ui->labPicStr->setText(smpic->getPictureStr() % "\n" % smpic->getPictureTitl());
ui->labPicture->setPixmap(SnapmaticPixmap); ui->labPicture->setPixmap(SnapmaticPixmap);
@ -120,7 +113,7 @@ void SnapmaticWidget::on_cmdView_clicked()
{ {
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("Interface"); settings.beginGroup("Interface");
bool navigationBar = settings.value("NavigationBar", true).toBool(); bool navigationBar = settings.value("NavigationBar", false).toBool();
settings.endGroup(); settings.endGroup();
PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, profileName, this); PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, profileName, this);
@ -142,7 +135,7 @@ void SnapmaticWidget::on_cmdView_clicked()
picDialog->showMaximized(); picDialog->showMaximized();
#else #else
picDialog->show(); picDialog->show();
if (navigationBar) picDialog->styliseDialog(); if (navigationBar) picDialog->stylizeDialog();
//picDialog->adaptNewDialogSize(); //picDialog->adaptNewDialogSize();
picDialog->setMinimumSize(picDialog->size()); picDialog->setMinimumSize(picDialog->size());
picDialog->setMaximumSize(picDialog->size()); picDialog->setMaximumSize(picDialog->size());

View file

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

View file

@ -40,11 +40,11 @@
#endif #endif
#ifndef GTA5SYNC_COPYRIGHT #ifndef GTA5SYNC_COPYRIGHT
#define GTA5SYNC_COPYRIGHT "2016-2019" #define GTA5SYNC_COPYRIGHT "2016-2018"
#endif #endif
#ifndef GTA5SYNC_APPVER #ifndef GTA5SYNC_APPVER
#define GTA5SYNC_APPVER "1.7.1" #define GTA5SYNC_APPVER "1.6.2"
#endif #endif
#if __cplusplus #if __cplusplus

80
dnr/DonationDialog.cpp Normal file
View file

@ -0,0 +1,80 @@
/*****************************************************************************
* 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/>.
*****************************************************************************/
#include "TranslationClass.h"
#include "DonationDialog.h"
#include "config.h"
#include <QSettings>
#include <QDebug>
DonationDialog::DonationDialog(QWidget *parent) : QDialog(parent)
{
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Donate"));
setLayout(&layout);
titleLabel.setText(tr("<h4>Hello, thank you for using %1!</h4>").arg(GTA5SYNC_APPSTR));
layout.addWidget(&titleLabel);
informationLabel.setText(tr("When you think %1 is useful for you, you should consider donate for support future development.").arg(GTA5SYNC_APPSTR));
informationLabel.setWordWrap(true);
layout.addWidget(&informationLabel);
donateLabel.setText(QString("<a href=\"%1\"><img src=\":/img/donate.png\"></a>").arg(donateUrl()));
donateLabel.setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
donateLabel.setOpenExternalLinks(true);
layout.addWidget(&donateLabel);
layout.addLayout(&buttomLayout);
showAgainBox.setChecked(true);
showAgainBox.setText(tr("Show Again"));
showAgainBox.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
buttomLayout.addWidget(&showAgainBox);
closeButton.setText(tr("&Close"));
connect(&closeButton, SIGNAL(clicked()), this, SLOT(close()));
buttomLayout.addWidget(&closeButton);
resize(((double)sizeHint().width() * 1.5), sizeHint().height());
}
DonationDialog::~DonationDialog()
{
}
void DonationDialog::closeEvent(QCloseEvent *ev)
{
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("Startup");
settings.setValue("ShowDonation", showAgainBox.isChecked());
settings.endGroup();
ev->accept();
}
QString DonationDialog::donateUrl()
{
QString donationUrl;
QString currencyCode = QLocale::system().currencySymbol(QLocale::CurrencyIsoCode);
if (currencyCode == "EUR")
{
donationUrl = QString("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=%1&item_name=Donation+for+%2&item_number=%3+Version&currency_code=EUR").arg(QString(GTA5SYNC_DONATION_EMAIL).replace("/at/", "@"), QString(GTA5SYNC_APPSTR).replace(" ", "+"), QString(GTA5SYNC_BUILDCODE).replace(" ", "+"));
}
else if (currencyCode == "GBP")
{
donationUrl = QString("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=%1&item_name=Donation+for+%2&item_number=%3+Version&currency_code=GBP").arg(QString(GTA5SYNC_DONATION_EMAIL).replace("/at/", "@"), QString(GTA5SYNC_APPSTR).replace(" ", "+"), QString(GTA5SYNC_BUILDCODE).replace(" ", "+"));
}
else
{
donationUrl = QString("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=%1&item_name=Donation+for+%2&item_number=%3+Version&currency_code=USD").arg(QString(GTA5SYNC_DONATION_EMAIL).replace("/at/", "@"), QString(GTA5SYNC_APPSTR).replace(" ", "+"), QString(GTA5SYNC_BUILDCODE).replace(" ", "+"));
}
return donationUrl;
}

57
dnr/DonationDialog.h Normal file
View file

@ -0,0 +1,57 @@
/*****************************************************************************
* 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/>.
*****************************************************************************/
#ifndef DONATIONDIALOG_H
#define DONATIONDIALOG_H
#include <QLabel>
#include <QDialog>
#include <QString>
#include <QCheckBox>
#include <QCloseEvent>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QSpacerItem>
namespace Ui {
class DonationDialog;
}
class DonationDialog : public QDialog
{
Q_OBJECT
public:
explicit DonationDialog(QWidget *parent = nullptr);
~DonationDialog();
protected:
void closeEvent(QCloseEvent *ev);
private:
QString donateUrl();
QVBoxLayout layout;
QLabel titleLabel;
QLabel informationLabel;
QLabel donateLabel;
QCheckBox showAgainBox;
QHBoxLayout buttomLayout;
QPushButton closeButton;
};
#endif // DONATIONDIALOG_H

View file

@ -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-2018 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
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
@ -64,6 +64,7 @@ SOURCES += main.cpp \
TranslationClass.cpp \ TranslationClass.cpp \
UserInterface.cpp \ UserInterface.cpp \
anpro/imagecropper.cpp \ anpro/imagecropper.cpp \
dnr/DonationDialog.cpp \
pcg/pcg_basic.c \ pcg/pcg_basic.c \
tmext/TelemetryClassAuthenticator.cpp \ tmext/TelemetryClassAuthenticator.cpp \
uimod/JSHighlighter.cpp \ uimod/JSHighlighter.cpp \
@ -108,6 +109,7 @@ HEADERS += \
anpro/imagecropper.h \ anpro/imagecropper.h \
anpro/imagecropper_e.h \ anpro/imagecropper_e.h \
anpro/imagecropper_p.h \ anpro/imagecropper_p.h \
dnr/DonationDialog.h \
pcg/pcg_basic.h \ pcg/pcg_basic.h \
tmext/TelemetryClassAuthenticator.h \ tmext/TelemetryClassAuthenticator.h \
uimod/JSHighlighter.h \ uimod/JSHighlighter.h \
@ -137,7 +139,6 @@ TRANSLATIONS += \
res/gta5sync_en_US.ts \ res/gta5sync_en_US.ts \
res/gta5sync_es.ts \ res/gta5sync_es.ts \
res/gta5sync_fr.ts \ res/gta5sync_fr.ts \
res/gta5sync_ko.ts \
res/gta5sync_ru.ts \ res/gta5sync_ru.ts \
res/gta5sync_uk.ts \ res/gta5sync_uk.ts \
res/gta5sync_zh_TW.ts res/gta5sync_zh_TW.ts
@ -152,7 +153,6 @@ DISTFILES += res/app.rc \
res/gta5sync_en_US.ts \ res/gta5sync_en_US.ts \
res/gta5sync_es.ts \ res/gta5sync_es.ts \
res/gta5sync_fr.ts \ res/gta5sync_fr.ts \
res/gta5sync_ko.ts \
res/gta5sync_ru.ts \ res/gta5sync_ru.ts \
res/gta5sync_uk.ts \ res/gta5sync_uk.ts \
res/gta5sync_zh_TW.ts \ res/gta5sync_zh_TW.ts \
@ -160,7 +160,7 @@ DISTFILES += res/app.rc \
res/gta5view.png \ res/gta5view.png \
lang/README.txt lang/README.txt
INCLUDEPATH += ./anpro ./pcg ./tmext ./uimod INCLUDEPATH += ./anpro ./dnr ./pcg ./tmext ./uimod
# GTA5SYNC/GTA5VIEW ONLY # GTA5SYNC/GTA5VIEW ONLY
@ -232,11 +232,18 @@ contains(DEFINES, GTA5SYNC_QCONF){
!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_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
INSTALLS += langfiles INSTALLS += langfiles
} }
} }
# DONATION BASED STUFF
!contains(DEFINES, GTA5SYNC_DONATION){
SOURCES -= dnr/DonationDialog.cpp
HEADERS -= dnr/DonationDialog.h
}
# TELEMETRY BASED STUFF # TELEMETRY BASED STUFF
!contains(DEFINES, GTA5SYNC_TELEMETRY){ !contains(DEFINES, GTA5SYNC_TELEMETRY){

View file

@ -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-2018 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
@ -63,12 +63,12 @@
#include "TelemetryClass.h" #include "TelemetryClass.h"
#endif #endif
#ifdef GTA5SYNC_DONATION
#include "DonationDialog.h"
#endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#if QT_VERSION >= 0x050600
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#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);
@ -316,5 +316,17 @@ int main(int argc, char *argv[])
uiWindow.show(); uiWindow.show();
#endif #endif
#ifdef GTA5SYNC_DONATION
settings.beginGroup("Startup");
bool showDonation = settings.value("ShowDonation", true).toBool();
settings.endGroup();
if (showDonation)
{
DonationDialog *donorDialog = new DonationDialog();
donorDialog->show();
QObject::connect(donorDialog, SIGNAL(finished(int)), donorDialog, SLOT(deleteLater()));
}
#endif
return a.exec(); return a.exec();
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

View file

@ -9,18 +9,18 @@
<file>5sync-96.png</file> <file>5sync-96.png</file>
<file>5sync-128.png</file> <file>5sync-128.png</file>
<file>5sync-256.png</file> <file>5sync-256.png</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.png</file>
<file>donate.png</file>
<file>empty1x16.png</file> <file>empty1x16.png</file>
<file>mappreview.jpg</file> <file>mappreview.jpg</file>
<file>next.svgz</file> <file>next.png</file>
<file>pointmaker-8.png</file> <file>pointmaker-8.png</file>
<file>pointmaker-16.png</file> <file>pointmaker-16.png</file>
<file>pointmaker-24.png</file> <file>pointmaker-24.png</file>
<file>pointmaker-32.png</file> <file>pointmaker-32.png</file>
<file>savegame.svgz</file> <file>savegame.png</file>
<file>watermark_1b.png</file> <file>watermark_1b.png</file>
<file>watermark_2b.png</file> <file>watermark_2b.png</file>
<file>watermark_2r.png</file> <file>watermark_2r.png</file>

View file

@ -7,8 +7,8 @@ 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, 6, 2, 0
PRODUCTVERSION 1, 7, 1, 0 PRODUCTVERSION 1, 6, 2, 0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
FILEFLAGS 0 FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32 FILEOS VOS_NT_WINDOWS32
@ -25,12 +25,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Syping" VALUE "CompanyName", "Syping"
VALUE "FileDescription", "gta5view" VALUE "FileDescription", "gta5view"
VALUE "FileVersion", "1.7.1" VALUE "FileVersion", "1.6.2"
VALUE "InternalName", "gta5view" VALUE "InternalName", "gta5view"
VALUE "LegalCopyright", "Copyright © 2016-2019 Syping" VALUE "LegalCopyright", "Copyright © 2016-2018 Syping"
VALUE "OriginalFilename", "gta5view.exe" VALUE "OriginalFilename", "gta5view.exe"
VALUE "ProductName", "gta5view" VALUE "ProductName", "gta5view"
VALUE "ProductVersion", "1.7.1" VALUE "ProductVersion", "1.6.2"
END END
END END
END END

BIN
res/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

BIN
res/donate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

BIN
res/next.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
res/savegame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

View file

@ -3,9 +3,8 @@
<file>gta5sync_en_US.qm</file> <file>gta5sync_en_US.qm</file>
<file>gta5sync_de.qm</file> <file>gta5sync_de.qm</file>
<file>gta5sync_fr.qm</file> <file>gta5sync_fr.qm</file>
<file>gta5sync_ko.qm</file>
<file>gta5sync_ru.qm</file> <file>gta5sync_ru.qm</file>
<file>gta5sync_uk.qm</file> <file>gta5sync_uk.qm</file>
<file>gta5sync_zh_TW.qm</file> <file>gta5sync_zh_TW.qm</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -2,7 +2,6 @@
<qresource prefix="/tr"> <qresource prefix="/tr">
<file>qt_de.qm</file> <file>qt_de.qm</file>
<file>qt_fr.qm</file> <file>qt_fr.qm</file>
<file>qt_ko.qm</file>
<file>qt_ru.qm</file> <file>qt_ru.qm</file>
<file>qt_uk.qm</file> <file>qt_uk.qm</file>
<file>qt_zh_TW.qm</file> <file>qt_zh_TW.qm</file>

View file

@ -3,7 +3,6 @@
<file>qtbase_en_GB.qm</file> <file>qtbase_en_GB.qm</file>
<file>qtbase_de.qm</file> <file>qtbase_de.qm</file>
<file>qtbase_fr.qm</file> <file>qtbase_fr.qm</file>
<file>qtbase_ko.qm</file>
<file>qtbase_ru.qm</file> <file>qtbase_ru.qm</file>
<file>qtbase_uk.qm</file> <file>qtbase_uk.qm</file>
<file>qtbase_zh_TW.qm</file> <file>qtbase_zh_TW.qm</file>