Browse Source

Minor changes and MimeType support

1.10.x
Syping 5 months ago
parent
commit
4a293b6acd
  1. 2
      .ci/debian_ci.sh
  2. 12
      .ci/debian_docker.sh
  3. 2
      .ci/gta5view.nsi
  4. 20
      .ci/windows_docker.sh
  5. 8
      .ci/wininstall_docker.sh
  6. 2
      CMakeLists.txt
  7. 42
      ProfileInterface.cpp
  8. 2
      README.md
  9. 9
      res/de.syping.gta5view.desktop
  10. 3
      res/de.syping.gta5view.metainfo.xml
  11. 8
      res/de.syping.gta5view.xml

2
.ci/debian_ci.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Install packages
.ci/debian_install.sh && \

12
.ci/debian_docker.sh

@ -1,15 +1,15 @@
#!/bin/bash
#!/usr/bin/env bash
if [ "${DOCKER_USER}" != "" ]; then
DOCKER_IMAGE=${DOCKER_USER}/debian:${DEBIAN_VERSION}
DOCKER_IMAGE=${DOCKER_USER}/debian:${DEBIAN_VERSION}
else
DOCKER_IMAGE=debian:${DEBIAN_VERSION}
DOCKER_IMAGE=debian:${DEBIAN_VERSION}
fi
PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \
docker pull ${DOCKER_IMAGE} && \
docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh"
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh"

2
.ci/gta5view.nsi

@ -5,7 +5,7 @@
!define WEB_SITE "https://gta5view.syping.de/"
!define VERSION "1.10.0.0"
!define COPYRIGHT "Copyright © 2016-2021 Syping"
!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor"
!define DESCRIPTION "Open Source Snapmatic and Savegame viewer/editor for GTA V"
!define INSTALLER_NAME "gta5view_setup.exe"
!define MAIN_APP_EXE "gta5view.exe"
!define INSTALL_TYPE "SetShellVarContext all"

20
.ci/windows_docker.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DOCKER_IMAGE=sypingauto/gta5view-build:1.10-static
PROJECT_DIR_DOCKER=/gta5view
@ -6,20 +6,20 @@ PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \
docker pull ${DOCKER_IMAGE} && \
docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \
# Prepare environment variable
export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \
# Upload Assets to Dropbox
if [ "${PACKAGE_CODE}" == "gta5-mods" ]; then
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION}
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE}
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION}
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE}
elif [ "${PACKAGE_CODE}" == "gtainside" ]; then
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gtainside/${PACKAGE_VERSION}
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gtainside/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE}
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gtainside/${PACKAGE_VERSION}
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gtainside/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE}
fi

8
.ci/wininstall_docker.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DOCKER_IMAGE=sypingauto/gta5view-build:1.10-shared
PROJECT_DIR_DOCKER=/gta5view
@ -6,6 +6,6 @@ PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \
docker pull ${DOCKER_IMAGE} && \
docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh"
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh"

2
CMakeLists.txt

@ -365,6 +365,7 @@ target_link_libraries(gta5view PRIVATE Qt${QT_VERSION_MAJOR}::Network Qt${QT_VER
install(TARGETS gta5view DESTINATION bin)
install(FILES res/de.syping.gta5view.desktop DESTINATION share/applications)
install(FILES res/de.syping.gta5view.metainfo.xml DESTINATION share/metainfo)
install(FILES res/de.syping.gta5view.xml DESTINATION share/mime/packages)
install(FILES res/gta5view-16.png DESTINATION share/icons/hicolor/16x16/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-24.png DESTINATION share/icons/hicolor/24x24/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-32.png DESTINATION share/icons/hicolor/32x32/apps RENAME de.syping.gta5view.png)
@ -374,7 +375,6 @@ install(FILES res/gta5view-96.png DESTINATION share/icons/hicolor/96x96/apps REN
install(FILES res/gta5view-128.png DESTINATION share/icons/hicolor/128x128/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-256.png DESTINATION share/icons/hicolor/256x256/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-512.png DESTINATION share/icons/hicolor/512x512/apps RENAME de.syping.gta5view.png)
install(FILES res/de.syping.gta5view.png DESTINATION share/pixmaps)
if(QCONF_BUILD)
include(res/img.cmake)
install(FILES ${GTA5VIEW_IMGFILES} DESTINATION share/gta5view/resources)

42
ProfileInterface.cpp

@ -266,11 +266,13 @@ void ProfileInterface::loadingProgress(int value, int maximum)
void ProfileInterface::directoryChanged(const QString &path)
{
Q_UNUSED(path)
QDir dir(profileFolder);
QVector<QString> t_savegameFiles;
QVector<QString> t_snapmaticPics;
QVector<QString> n_savegameFiles;
QVector<QString> n_snapmaticPics;
const QStringList files = dir.entryList(QDir::Files);
for (const QString &fileName : files) {
if (fileName.startsWith("SGTA5") && !fileName.endsWith(".bak")) {
@ -290,26 +292,24 @@ void ProfileInterface::directoryChanged(const QString &path)
snapmaticPics = t_snapmaticPics;
if (!n_savegameFiles.isEmpty() || !n_snapmaticPics.isEmpty()) {
QEventLoop loop;
QTimer::singleShot(1000, &loop, SLOT(quit()));
loop.exec();
for (const QString &fileName : qAsConst(n_savegameFiles)) {
const QString filePath = profileFolder % "/" % fileName;
SavegameData *savegame = new SavegameData(filePath);
if (savegame->readingSavegame())
savegameLoaded(savegame, filePath, true);
else
delete savegame;
}
for (const QString &fileName : qAsConst(n_snapmaticPics)) {
const QString filePath = profileFolder % "/" % fileName;
SnapmaticPicture *picture = new SnapmaticPicture(filePath);
if (picture->readingPicture(true))
pictureLoaded(picture, true);
else
delete picture;
}
QTimer::singleShot(1000, this, [=](){
for (const QString &fileName : qAsConst(n_savegameFiles)) {
const QString filePath = profileFolder % "/" % fileName;
SavegameData *savegame = new SavegameData(filePath);
if (savegame->readingSavegame())
savegameLoaded(savegame, filePath, true);
else
delete savegame;
}
for (const QString &fileName : qAsConst(n_snapmaticPics)) {
const QString filePath = profileFolder % "/" % fileName;
SnapmaticPicture *picture = new SnapmaticPicture(filePath);
if (picture->readingPicture(true))
pictureLoaded(picture, true);
else
delete picture;
}
});
}
}
@ -318,7 +318,7 @@ void ProfileInterface::directoryScanned(QVector<QString> savegameFiles_s, QVecto
savegameFiles = savegameFiles_s;
snapmaticPics = snapmaticPics_s;
fileSystemWatcher.addPath(profileFolder);
QObject::connect(&fileSystemWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString)));
QObject::connect(&fileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, &ProfileInterface::directoryChanged);
}
#endif

2
README.md

@ -1,5 +1,5 @@
## gta5view
Grand Theft Auto V Savegame and Snapmatic viewer/editor
Open Source Snapmatic and Savegame viewer/editor for GTA V
- View Snapmatics with the ability to disable them in-game
- Edit Snapmatic pictures and properties in multiple ways

9
res/de.syping.gta5view.desktop

@ -4,8 +4,9 @@ Name=gta5view
Comment=Open and edit GTA V profiles
Comment[de]=GTA V Profile öffnen und bearbeiten
Comment[ru]=Просмотрщик и редактор профилей GTA V
Categories=Qt;Utility;FileTools
Exec=gta5view
Comment[zh_TW]=打開與編輯 GTA V 個人檔案
Categories=Qt;Utility;FileTools;
TryExec=gta5view
Exec=gta5view %f
Icon=de.syping.gta5view
Terminal=false
StartupNotify=false
MimeType=application/x-gta5view-export;

3
res/de.syping.gta5view.metainfo.xml

@ -11,11 +11,12 @@
<summary>Open and edit GTA V profiles</summary>
<summary xml:lang="de">GTA V Profile öffnen und bearbeiten</summary>
<summary xml:lang="ru">Просмотрщик и редактор профилей GTA V</summary>
<summary xml:lang="zh-TW">打開與編輯 GTA V 個人檔案</summary>
<icon type="remote">https://img.syping.de/gta5view/gta5view.png</icon>
<description>
<p>Open Source Snapmatic picture and Savegame viewer/editor for GTA V</p>
<p>Open Source Snapmatic and Savegame viewer/editor for GTA V</p>
<p>Features</p>
<ul>
<li>View Snapmatics with the ability to disable them in-game</li>

8
res/de.syping.gta5view.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-gta5view-export">
<comment>gta5view Export</comment>
<glob pattern="*.g5e"/>
<generic-icon name="de.syping.gta5view"/>
</mime-type>
</mime-info>
Loading…
Cancel
Save