2017-01-05 03:05:08 +00:00
|
|
|
#include "AnalyticsWizardPage.h"
|
2021-11-20 15:22:22 +00:00
|
|
|
#include <Application.h>
|
2017-01-05 03:05:08 +00:00
|
|
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QTextBrowser>
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
|
|
|
#include <ganalytics.h>
|
2017-01-13 01:12:40 +00:00
|
|
|
#include <BuildConfig.h>
|
2017-01-05 03:05:08 +00:00
|
|
|
|
|
|
|
AnalyticsWizardPage::AnalyticsWizardPage(QWidget *parent)
|
2018-07-15 13:51:05 +01:00
|
|
|
: BaseWizardPage(parent)
|
2017-01-05 03:05:08 +00:00
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
setObjectName(QStringLiteral("analyticsPage"));
|
|
|
|
verticalLayout_3 = new QVBoxLayout(this);
|
|
|
|
verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3"));
|
|
|
|
textBrowser = new QTextBrowser(this);
|
|
|
|
textBrowser->setObjectName(QStringLiteral("textBrowser"));
|
|
|
|
textBrowser->setAcceptRichText(false);
|
|
|
|
textBrowser->setOpenExternalLinks(true);
|
|
|
|
verticalLayout_3->addWidget(textBrowser);
|
2017-01-05 03:05:08 +00:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
checkBox = new QCheckBox(this);
|
|
|
|
checkBox->setObjectName(QStringLiteral("checkBox"));
|
|
|
|
checkBox->setChecked(true);
|
|
|
|
verticalLayout_3->addWidget(checkBox);
|
|
|
|
retranslate();
|
2017-01-05 03:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AnalyticsWizardPage::~AnalyticsWizardPage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool AnalyticsWizardPage::validatePage()
|
|
|
|
{
|
2021-11-20 15:22:22 +00:00
|
|
|
auto settings = APPLICATION->settings();
|
|
|
|
auto analytics = APPLICATION->analytics();
|
2018-07-15 13:51:05 +01:00
|
|
|
auto status = checkBox->isChecked();
|
|
|
|
settings->set("AnalyticsSeen", analytics->version());
|
|
|
|
settings->set("Analytics", status);
|
|
|
|
return true;
|
2017-01-05 03:05:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AnalyticsWizardPage::retranslate()
|
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
setTitle(tr("Analytics"));
|
|
|
|
setSubTitle(tr("We track some anonymous statistics about users."));
|
|
|
|
textBrowser->setHtml(tr(
|
|
|
|
"<html><body>"
|
2021-10-17 23:47:02 +01:00
|
|
|
"<p>The launcher sends anonymous usage statistics on every start of the application. This helps us decide what platforms and issues to focus on.</p>"
|
2018-07-15 13:51:05 +01:00
|
|
|
"<p>The data is processed by Google Analytics, see their <a href=\"https://support.google.com/analytics/answer/6004245?hl=en\">article on the "
|
|
|
|
"matter</a>.</p>"
|
|
|
|
"<p>The following data is collected:</p>"
|
2021-10-17 23:47:02 +01:00
|
|
|
"<ul><li>A random unique ID of the installation.<br />It is stored in the application settings file.</li>"
|
2018-07-15 13:51:05 +01:00
|
|
|
"<li>Anonymized (partial) IP address.</li>"
|
2021-10-17 23:47:02 +01:00
|
|
|
"<li>Launcher version.</li>"
|
2018-07-15 13:51:05 +01:00
|
|
|
"<li>Operating system name, version and architecture.</li>"
|
|
|
|
"<li>CPU architecture (kernel architecture on linux).</li>"
|
|
|
|
"<li>Size of system memory.</li>"
|
|
|
|
"<li>Java version, architecture and memory settings.</li></ul>"
|
|
|
|
"<p>If we change the tracked information, you will see this page again.</p></body></html>"));
|
|
|
|
checkBox->setText(tr("Enable Analytics"));
|
2017-01-05 03:05:08 +00:00
|
|
|
}
|