added telemetry
This commit is contained in:
parent
d3ce20a710
commit
d0caea372c
21 changed files with 851 additions and 44 deletions
70
main.cpp
70
main.cpp
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************************************************************
|
||||
* gta5sync GRAND THEFT AUTO V SYNC
|
||||
* Copyright (C) 2016-2017 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
|
||||
|
|
@ -49,6 +49,10 @@
|
|||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#ifdef GTA5SYNC_TELEMETRY
|
||||
#include "TelemetryClass.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
|
@ -100,30 +104,56 @@ int main(int argc, char *argv[])
|
|||
a.addLibraryPath(pluginsDir);
|
||||
}
|
||||
|
||||
TCInstance->initUserLanguage();
|
||||
TCInstance->loadTranslation(&a);
|
||||
|
||||
if (isFirstStart)
|
||||
{
|
||||
QMessageBox::StandardButton button = QMessageBox::information(a.desktop(), QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("<h4>Welcome to %1!</h4>You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||
if (button == QMessageBox::Yes)
|
||||
{
|
||||
ProfileDatabase profileDB;
|
||||
OptionsDialog optionsDialog(&profileDB);
|
||||
optionsDialog.setWindowIcon(IconLoader::loadingAppIcon());
|
||||
optionsDialog.show();
|
||||
optionsDialog.exec();
|
||||
}
|
||||
settings.setValue("IsFirstStart", false);
|
||||
}
|
||||
|
||||
settings.endGroup();
|
||||
|
||||
QStringList applicationArgs = a.arguments();
|
||||
QString selectedAction;
|
||||
QString arg1;
|
||||
applicationArgs.removeAt(0);
|
||||
|
||||
TCInstance->initUserLanguage();
|
||||
TCInstance->loadTranslation(&a);
|
||||
|
||||
if (!applicationArgs.contains("--skip-firststart"))
|
||||
{
|
||||
if (isFirstStart)
|
||||
{
|
||||
QMessageBox::StandardButton button = QMessageBox::information(a.desktop(), QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("<h4>Welcome to %1!</h4>You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||
if (button == QMessageBox::Yes)
|
||||
{
|
||||
ProfileDatabase profileDB;
|
||||
OptionsDialog optionsDialog(&profileDB);
|
||||
optionsDialog.setWindowIcon(IconLoader::loadingAppIcon());
|
||||
optionsDialog.show();
|
||||
optionsDialog.exec();
|
||||
}
|
||||
settings.setValue("IsFirstStart", false);
|
||||
}
|
||||
}
|
||||
|
||||
settings.endGroup();
|
||||
|
||||
#ifdef GTA5SYNC_TELEMETRY
|
||||
if (!applicationArgs.contains("--disable-telemetry"))
|
||||
{
|
||||
QObject::connect(Telemetry, SIGNAL(registered()), Telemetry, SLOT(pushStartupSet()));
|
||||
if (!applicationArgs.contains("--skip-telemetryinit"))
|
||||
{
|
||||
Telemetry->init();
|
||||
if (Telemetry->canPush())
|
||||
{
|
||||
Telemetry->pushStartupSet();
|
||||
}
|
||||
else if (Telemetry->canRegister())
|
||||
{
|
||||
Telemetry->registerClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Telemetry->setDisabled(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (QString currentArg : applicationArgs)
|
||||
{
|
||||
QString reworkedArg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue