From dabb814dd1b4d92e15bdf70d2990393dd2cb243d Mon Sep 17 00:00:00 2001 From: kelteseth Date: Fri, 14 Sep 2018 12:55:10 +0200 Subject: [PATCH] Add google analytics Add missing stomt submodule --- .gitmodules | 6 ++++++ ScreenPlay.pro | 3 +++ ScreenPlay/ScreenPlay.pro | 14 +++++++++++++- ScreenPlay/ThirdParty/qt-google-analytics | 1 + ScreenPlay/ThirdParty/stomt-qt-sdk | 1 + ScreenPlay/main.cpp | 5 ++++- ScreenPlay/main.qml | 10 ++++++++++ 7 files changed, 38 insertions(+), 2 deletions(-) create mode 160000 ScreenPlay/ThirdParty/qt-google-analytics create mode 160000 ScreenPlay/ThirdParty/stomt-qt-sdk diff --git a/.gitmodules b/.gitmodules index 35dca663..719fe236 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "ScreenPlay/examples"] path = ScreenPlay/examples url = https://github.com/Aimber/ScreenPlay-examples.git +[submodule "ScreenPlay/ThirdParty/qt-google-analytics"] + path = ScreenPlay/ThirdParty/qt-google-analytics + url = https://github.com/HSAnet/qt-google-analytics.git +[submodule "ScreenPlay/ThirdParty/stomt-qt-sdk"] + path = ScreenPlay/ThirdParty/stomt-qt-sdk + url = https://github.com/Aimber/stomt-qt-sdk.git diff --git a/ScreenPlay.pro b/ScreenPlay.pro index e0b00c2e..8b1e5814 100644 --- a/ScreenPlay.pro +++ b/ScreenPlay.pro @@ -3,7 +3,10 @@ SUBDIRS = \ ScreenPlay/ScreenPlay.pro \ ScreenPlaySDK/Screenplaysdk.pro \ ScreenPlayWindow/ScreenPlayWindow.pro \ + ScreenPlay/ThirdParty/qt-google-analytics/qt-google-analytics.pro \ + ScreenPlay/ThirdParty/stomt-qt-sdk/sdk/stomt-qt-sdk.pro \ ScreenPlayWidget/ScreenPlayWidget.pro ScreenPlayWindow.depends = ScreenPlaySDK ScreenPlayWidget.depends = ScreenPlaySDK +ScreenPlay.depends = qt-google-analytics diff --git a/ScreenPlay/ScreenPlay.pro b/ScreenPlay/ScreenPlay.pro index a40c4a10..726a46dc 100644 --- a/ScreenPlay/ScreenPlay.pro +++ b/ScreenPlay/ScreenPlay.pro @@ -1,8 +1,9 @@ TEMPLATE = app QT += qml quick widgets quickcontrols2 core CONFIG += c++17 -#CONFIG += qtquickcompiler +CONFIG += qtquickcompiler #DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT + msvc: LIBS += -luser32 TARGETPATH = ScreenPlay @@ -55,12 +56,19 @@ INCLUDEPATH += \ $$PWD/ThirdParty/ \ $$PWD/src/ +include(ThirdParty/qt-google-analytics/qt-google-analytics.pri) +LIBS += -lqt-google-analytics CONFIG(debug, debug|release) { install_it.path = $${OUT_PWD}/debug/ + QMAKE_LIBDIR += $$OUT_PWD/ThirdParty/qt-google-analytics/debug + } else { install_it.path = $${OUT_PWD}/release/ + QMAKE_LIBDIR += $$OUT_PWD/ThirdParty/qt-google-analytics/release } + + installOut.path = $${OUT_PWD}/ install_it.files += assets/templates/config.json \ @@ -107,3 +115,7 @@ unix { LIBS += -L$$PWD/ThirdParty/steam/lib/linux64/ -lsdkencryptedappticket } + +DISTFILES += \ + favicon.ico \ + assets/shader/movingcolorramp.fsh diff --git a/ScreenPlay/ThirdParty/qt-google-analytics b/ScreenPlay/ThirdParty/qt-google-analytics new file mode 160000 index 00000000..fa90c92f --- /dev/null +++ b/ScreenPlay/ThirdParty/qt-google-analytics @@ -0,0 +1 @@ +Subproject commit fa90c92fec84bd7ec4a04f09ff50c47eee5e1104 diff --git a/ScreenPlay/ThirdParty/stomt-qt-sdk b/ScreenPlay/ThirdParty/stomt-qt-sdk new file mode 160000 index 00000000..f2d964e2 --- /dev/null +++ b/ScreenPlay/ThirdParty/stomt-qt-sdk @@ -0,0 +1 @@ +Subproject commit f2d964e22f4e51d99bc8f96188175984b57548e5 diff --git a/ScreenPlay/main.cpp b/ScreenPlay/main.cpp index 2716e187..f51ec5ea 100644 --- a/ScreenPlay/main.cpp +++ b/ScreenPlay/main.cpp @@ -26,6 +26,7 @@ #include #endif +#include "ThirdParty/qt-google-analytics/ganalytics.h" #include "src/create.h" #include "src/installedlistfilter.h" #include "src/installedlistmodel.h" @@ -50,6 +51,7 @@ int main(int argc, char* argv[]) QGuiApplication app(argc, argv); app.setQuitOnLastWindowClosed(false); + QTranslator trsl; trsl.load(":/translations/ScreenPlay_de.qm"); app.installTranslator(&trsl); @@ -63,7 +65,7 @@ int main(int argc, char* argv[]) AppId_t steamID = 672870; QCoreApplication::setOrganizationName("Aimber"); - QCoreApplication::setOrganizationDomain("aimber.net"); + QCoreApplication::setOrganizationDomain("screen-play.app"); QCoreApplication::setApplicationName("ScreenPlay"); QCoreApplication::setApplicationVersion("0.1.0"); @@ -136,6 +138,7 @@ int main(int argc, char* argv[]) settings.loadActiveProfiles(); QQmlApplicationEngine mainWindowEngine; + qmlRegisterType("analytics", 0, 1, "Tracker"); mainWindowEngine.rootContext()->setContextProperty("screenPlay", &screenPlay); mainWindowEngine.rootContext()->setContextProperty("screenPlayCreate", &create); mainWindowEngine.rootContext()->setContextProperty("utility", &qmlUtil); diff --git a/ScreenPlay/main.qml b/ScreenPlay/main.qml index 1ab4ea1b..82fb1e5b 100644 --- a/ScreenPlay/main.qml +++ b/ScreenPlay/main.qml @@ -4,6 +4,7 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import Qt.labs.platform 1.0 +import analytics 0.1 import "qml/" import "qml/Installed" @@ -18,7 +19,16 @@ ApplicationWindow { minimumHeight: 788 minimumWidth: 1050 + Tracker { + id: tracker + Component.onCompleted: tracker.sendScreenView("Main Screen") + trackingID: "UA-43193236-3" + } + + + Component.onCompleted: { + if (!screenPlaySettings.autostart) { show() }