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 && \
make depend && \
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 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 && \
make depend && \
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
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 COMP_NAME "Syping"
!define WEB_SITE "https://gta5view.syping.de/"
!define VERSION "1.7.1.0"
!define COPYRIGHT "Copyright © 2016-2019 Syping"
!define VERSION "1.6.2.0"
!define COPYRIGHT "Copyright © 2016-2018 Syping"
!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor"
!define INSTALLER_NAME "gta5view_setup.exe"
!define MAIN_APP_EXE "gta5view.exe"
@ -33,7 +33,6 @@ Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
#BrandingText "${APP_NAME}"
XPStyle on
Unicode true
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES64\Syping\gta5view"
@ -79,7 +78,6 @@ InstallDir "$PROGRAMFILES64\Syping\gta5view"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "TradChinese"
@ -104,10 +102,10 @@ ${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
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/8.3-win32/libstdc++-6.dll"
File "/opt/windev/openssl-latest_qt64d/bin/libcrypto-1_1-x64.dll"
File "/opt/windev/openssl-latest_qt64d/bin/libssl-1_1-x64.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/6.3-win32/libstdc++-6.dll"
File "/opt/windev/libressl-latest_qt64d/bin/libcrypto-43.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/qt64d-latest/bin/Qt5Core.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_de.qm"
File "../res/gta5sync_fr.qm"
File "../res/gta5sync_ko.qm"
File "../res/gta5sync_ru.qm"
File "../res/gta5sync_uk.qm"
File "../res/gta5sync_zh_TW.qm"
File "../res/qtbase_en_GB.qm"
File "../res/qtbase_de.qm"
File "../res/qtbase_fr.qm"
File "../res/qtbase_ko.qm"
File "../res/qtbase_ru.qm"
File "../res/qtbase_uk.qm"
File "../res/qtbase_zh_TW.qm"
SetOutPath "$INSTDIR\audio"
File "/opt/windev/qt64d-latest/plugins/audio/qtaudio_windows.dll"
SetOutPath "$INSTDIR\imageformats"
File "/opt/windev/qt64d-latest/plugins/imageformats/qgif.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"
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/qwindowsvistastyle.dll"
SectionEnd
######################################################################
@ -197,8 +194,8 @@ ${INSTALL_TYPE}
Delete "$INSTDIR\gta5view.exe"
Delete "$INSTDIR\libgcc_s_seh-1.dll"
Delete "$INSTDIR\libstdc++-6.dll"
Delete "$INSTDIR\libcrypto-1_1-x64.dll"
Delete "$INSTDIR\libssl-1_1-x64.dll"
Delete "$INSTDIR\libcrypto-43.dll"
Delete "$INSTDIR\libssl-45.dll"
Delete "$INSTDIR\libjpeg-62.dll"
Delete "$INSTDIR\Qt5Core.dll"
Delete "$INSTDIR\Qt5Gui.dll"
@ -209,17 +206,16 @@ Delete "$INSTDIR\Qt5WinExtras.dll"
Delete "$INSTDIR\lang\gta5sync_en_US.qm"
Delete "$INSTDIR\lang\gta5sync_de.qm"
Delete "$INSTDIR\lang\gta5sync_fr.qm"
Delete "$INSTDIR\lang\gta5sync_ko.qm"
Delete "$INSTDIR\lang\gta5sync_ru.qm"
Delete "$INSTDIR\lang\gta5sync_uk.qm"
Delete "$INSTDIR\lang\gta5sync_zh_TW.qm"
Delete "$INSTDIR\lang\qtbase_en_GB.qm"
Delete "$INSTDIR\lang\qtbase_de.qm"
Delete "$INSTDIR\lang\qtbase_fr.qm"
Delete "$INSTDIR\lang\qtbase_ko.qm"
Delete "$INSTDIR\lang\qtbase_ru.qm"
Delete "$INSTDIR\lang\qtbase_uk.qm"
Delete "$INSTDIR\lang\qtbase_zh_TW.qm"
Delete "$INSTDIR\audio\qtaudio_windows.dll"
Delete "$INSTDIR\imageformats\qgif.dll"
Delete "$INSTDIR\imageformats\qicns.dll"
Delete "$INSTDIR\imageformats\qico.dll"
@ -232,8 +228,8 @@ Delete "$INSTDIR\imageformats\qwebp.dll"
Delete "$INSTDIR\platforms\qwindows.dll"
Delete "$INSTDIR\styles\qcleanlooksstyle.dll"
Delete "$INSTDIR\styles\qplastiquestyle.dll"
Delete "$INSTDIR\styles\qwindowsvistastyle.dll"
RmDir "$INSTDIR\lang"
RmDir "$INSTDIR\audio"
RmDir "$INSTDIR\imageformats"
RmDir "$INSTDIR\platforms"
RmDir "$INSTDIR\styles"

View File

@ -16,4 +16,5 @@ qmake-static ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE
make depend && \
make -j 4 && \
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
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
cd ${PROJECT_DIR} && \

View File

@ -12,7 +12,7 @@ mkdir -p assets && \
# Starting 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 -j 4 && \
cd ${PROJECT_DIR}/assets && \

View File

@ -1,6 +1,7 @@
#!/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
cd ${PROJECT_DIR} && \

View File

@ -6,7 +6,7 @@ variables:
Windows Installer:
stage: build
image: sypingauto/gta5view-build:1.7-shared
image: syping/qt5-shared-mingw:5.9.6
variables:
BUILD_SCRIPT: "wininstall_build.sh"
QT_SELECT: "qt5-x86_64-w64-mingw32"
@ -19,7 +19,7 @@ Windows Installer:
Windows Portable:
stage: build
image: sypingauto/gta5view-build:1.7-static
image: syping/qt5-static-mingw:5.9.6
variables:
BUILD_SCRIPT: "windows_build.sh"
QT_SELECT: "qt5-x86_64-w64-mingw32"

View File

@ -1,5 +1,9 @@
#!/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
rm -rf tmext/TelemetryClassAuthenticator.cpp && \
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
# Install lua
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
brew install lua
else
# Install curl and lua
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
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
# Check if build is not tagged

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* 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);
#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
static qreal screenRatio();
static qreal screenRatioPR();
};
#endif // APPENV_H

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* it under the terms of the GNU General Public License as published by
@ -142,7 +142,6 @@ void ImportDialog::processImage()
QPixmap snapmaticPixmap(snapmaticResolutionW, snapmaticResolutionH);
snapmaticPixmap.fill(selectedColour);
QPainter snapmaticPainter(&snapmaticPixmap);
qreal screenRatioPR = AppEnv::screenRatioPR();
if (!backImage.isNull())
{
if (!ui->cbStretch->isChecked())
@ -226,10 +225,7 @@ void ImportDialog::processImage()
}
snapmaticPainter.end();
newImage = snapmaticPixmap.toImage();
#if QT_VERSION >= 0x050600
snapmaticPixmap.setDevicePixelRatio(screenRatioPR);
#endif
ui->labPicture->setPixmap(snapmaticPixmap.scaled(snapmaticResolutionLW * screenRatioPR, snapmaticResolutionLH * screenRatioPR, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
ui->labPicture->setPixmap(snapmaticPixmap.scaled(snapmaticResolutionLW, snapmaticResolutionLH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
}
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->setMaximumHeight(qRound(1 * screenRatio));
ui->lineJSON->setLineWidth(qRound(1 * screenRatio));
}
resize(450 * screenRatio, 550 * screenRatio);
}

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* 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)
{
qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR();
int pointMakerSize = 8 * screenRatio * screenRatioPR;
int pointMakerSize = 8 * screenRatio;
QPixmap pointMakerPixmap = IconLoader::loadingPointmakerIcon().pixmap(QSize(pointMakerSize, pointMakerSize));
QSize mapPixelSize = QSize(width() * screenRatioPR, height() * screenRatioPR);
QSize mapPixelSize = size();
int pointMakerHalfSize = pointMakerSize / 2;
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(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));

View File

@ -703,7 +703,7 @@ void OptionsDialog::setupSnapmaticPictureViewer()
#ifdef GTA5SYNC_WIN
#if QT_VERSION >= 0x050200
settings->beginGroup("Interface");
ui->cbSnapmaticNavigationBar->setChecked(settings->value("NavigationBar", true).toBool());
ui->cbSnapmaticNavigationBar->setChecked(settings->value("NavigationBar", false).toBool());
settings->endGroup();
#else
ui->cbSnapmaticNavigationBar->setVisible(false);

View File

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

View File

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

View File

@ -79,9 +79,7 @@ PlayerListDialog::PlayerListDialog(QStringList players, ProfileDatabase *profile
}
else
{
ui->cmdMakeAv->setIcon(QIcon(":/img/back.svgz"));
ui->cmdMakeSe->setIcon(QIcon(":/img/next.svgz"));
ui->cmdMakeAd->setIcon(QIcon(":/img/add.svgz"));
drawSwitchButtons();
}
buildInterface();
@ -103,6 +101,79 @@ PlayerListDialog::~PlayerListDialog()
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()
{
close();

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* it under the terms of the GNU General Public License as published by
@ -51,6 +51,7 @@
#include <QScrollBar>
#include <QClipboard>
#include <QFileInfo>
#include <QPalette>
#include <QPainter>
#include <QRegExp>
#include <QAction>
@ -1587,7 +1588,7 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev)
{
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;
}
QMenu contextMenu(picWidget);
@ -1638,7 +1639,7 @@ void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev)
{
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;
}
QMenu contextMenu(sgdWidget);
@ -1756,7 +1757,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{
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;
}
}
@ -1764,7 +1765,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{
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;
}
}
@ -1801,7 +1802,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{
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;
}
}
@ -1809,7 +1810,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event)
{
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;
}
}
@ -1877,7 +1878,7 @@ void ProfileInterface::hoverProfileWidgetCheck()
{
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;
}
}
@ -1885,7 +1886,7 @@ void ProfileInterface::hoverProfileWidgetCheck()
{
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;
}
}
@ -1910,16 +1911,20 @@ void ProfileInterface::hoverProfileWidgetCheck()
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->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")
{
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;
QSpacerItem *saSpacerItem;
QStringList fixedPictures;
QColor highlightBackColor;
QColor highlightTextColor;
QString enabledPicStr;
QString profileFolder;
QString profileName;

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* it under the terms of the GNU General Public License as published by

View File

@ -40,11 +40,11 @@
#endif
#ifndef GTA5SYNC_COPYRIGHT
#define GTA5SYNC_COPYRIGHT "2016-2019"
#define GTA5SYNC_COPYRIGHT "2016-2018"
#endif
#ifndef GTA5SYNC_APPVER
#define GTA5SYNC_APPVER "1.7.1"
#define GTA5SYNC_APPVER "1.6.2"
#endif
#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
#* Copyright (C) 2015-2019 Syping
#* Copyright (C) 2015-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
@ -16,7 +16,7 @@
#* 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): greaterThan(QT_MINOR_VERSION, 1): win32: QT += winextras
@ -64,6 +64,7 @@ SOURCES += main.cpp \
TranslationClass.cpp \
UserInterface.cpp \
anpro/imagecropper.cpp \
dnr/DonationDialog.cpp \
pcg/pcg_basic.c \
tmext/TelemetryClassAuthenticator.cpp \
uimod/JSHighlighter.cpp \
@ -108,6 +109,7 @@ HEADERS += \
anpro/imagecropper.h \
anpro/imagecropper_e.h \
anpro/imagecropper_p.h \
dnr/DonationDialog.h \
pcg/pcg_basic.h \
tmext/TelemetryClassAuthenticator.h \
uimod/JSHighlighter.h \
@ -137,7 +139,6 @@ TRANSLATIONS += \
res/gta5sync_en_US.ts \
res/gta5sync_es.ts \
res/gta5sync_fr.ts \
res/gta5sync_ko.ts \
res/gta5sync_ru.ts \
res/gta5sync_uk.ts \
res/gta5sync_zh_TW.ts
@ -152,7 +153,6 @@ DISTFILES += res/app.rc \
res/gta5sync_en_US.ts \
res/gta5sync_es.ts \
res/gta5sync_fr.ts \
res/gta5sync_ko.ts \
res/gta5sync_ru.ts \
res/gta5sync_uk.ts \
res/gta5sync_zh_TW.ts \
@ -160,7 +160,7 @@ DISTFILES += res/app.rc \
res/gta5view.png \
lang/README.txt
INCLUDEPATH += ./anpro ./pcg ./tmext ./uimod
INCLUDEPATH += ./anpro ./dnr ./pcg ./tmext ./uimod
# GTA5SYNC/GTA5VIEW ONLY
@ -232,11 +232,18 @@ contains(DEFINES, GTA5SYNC_QCONF){
!contains(DEFINES, GTA5SYNC_QCONF_IN){
RESOURCES -= res/tr_g5p.qrc
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
}
}
# DONATION BASED STUFF
!contains(DEFINES, GTA5SYNC_DONATION){
SOURCES -= dnr/DonationDialog.cpp
HEADERS -= dnr/DonationDialog.h
}
# TELEMETRY BASED STUFF
!contains(DEFINES, GTA5SYNC_TELEMETRY){

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* it under the terms of the GNU General Public License as published by
@ -63,12 +63,12 @@
#include "TelemetryClass.h"
#endif
#ifdef GTA5SYNC_DONATION
#include "DonationDialog.h"
#endif
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);
a.setApplicationName(GTA5SYNC_APPSTR);
a.setApplicationVersion(GTA5SYNC_APPVER);
@ -316,5 +316,17 @@ int main(int argc, char *argv[])
uiWindow.show();
#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();
}

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-128.png</file>
<file>5sync-256.png</file>
<file>add.svgz</file>
<file>avatararea.png</file>
<file>avatarareaimport.png</file>
<file>back.svgz</file>
<file>back.png</file>
<file>donate.png</file>
<file>empty1x16.png</file>
<file>mappreview.jpg</file>
<file>next.svgz</file>
<file>next.png</file>
<file>pointmaker-8.png</file>
<file>pointmaker-16.png</file>
<file>pointmaker-24.png</file>
<file>pointmaker-32.png</file>
<file>savegame.svgz</file>
<file>savegame.png</file>
<file>watermark_1b.png</file>
<file>watermark_2b.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>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 7, 1, 0
PRODUCTVERSION 1, 7, 1, 0
FILEVERSION 1, 6, 2, 0
PRODUCTVERSION 1, 6, 2, 0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
@ -25,12 +25,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Syping"
VALUE "FileDescription", "gta5view"
VALUE "FileVersion", "1.7.1"
VALUE "FileVersion", "1.6.2"
VALUE "InternalName", "gta5view"
VALUE "LegalCopyright", "Copyright © 2016-2019 Syping"
VALUE "LegalCopyright", "Copyright © 2016-2018 Syping"
VALUE "OriginalFilename", "gta5view.exe"
VALUE "ProductName", "gta5view"
VALUE "ProductVersion", "1.7.1"
VALUE "ProductVersion", "1.6.2"
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_de.qm</file>
<file>gta5sync_fr.qm</file>
<file>gta5sync_ko.qm</file>
<file>gta5sync_ru.qm</file>
<file>gta5sync_uk.qm</file>
<file>gta5sync_zh_TW.qm</file>
</qresource>
</RCC>
</RCC>

View File

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

View File

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