mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
Google analytics removed. Completely wrong, we use the compilation
server numbers instead.
This commit is contained in:
parent
cedac96cf4
commit
2fbd68ecb3
11 changed files with 1 additions and 124 deletions
|
@ -130,15 +130,10 @@ set(common_SRCS
|
|||
firmwares/opentx/opentxM128simulator.cpp
|
||||
firmwares/opentx/opentxM64simulator.cpp
|
||||
file.cpp
|
||||
googleanalytics.cpp
|
||||
appdata.cpp
|
||||
)
|
||||
|
||||
set(common_MOC_HDRS
|
||||
googleanalytics.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp( common_SRCS ${common_MOC_HDRS} )
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
#include "flashinterface.h"
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <Windows.h>
|
||||
|
@ -94,8 +93,6 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
|
|||
process->start(prog,arg);
|
||||
}
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Flash");
|
||||
}
|
||||
|
||||
# if !__GNUC__
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "appdata.h"
|
||||
#include <QDateTime>
|
||||
#include <QtGui>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#define BIT_WARN_THR ( 0x01 )
|
||||
#define BIT_WARN_SW ( 0x02 )
|
||||
|
@ -318,8 +317,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
|||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " GeneralEdit");
|
||||
}
|
||||
|
||||
GeneralEdit::~GeneralEdit()
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
#include "googleanalytics.h"
|
||||
#include <QtGui>
|
||||
|
||||
#define TRACKING_ID "UA-40098569-1"
|
||||
|
||||
GoogleAnalytics ga;
|
||||
|
||||
GoogleAnalytics::GoogleAnalytics():
|
||||
userId(qrand()),
|
||||
networkManager(new QNetworkAccessManager(this))
|
||||
{
|
||||
}
|
||||
|
||||
GoogleAnalytics::~GoogleAnalytics()
|
||||
{
|
||||
delete networkManager;
|
||||
}
|
||||
|
||||
void GoogleAnalytics::sendPageView(QString title)
|
||||
{
|
||||
// create request and set URL of receiver
|
||||
QNetworkRequest request;
|
||||
QUrl host("http://www.google-analytics.com/collect");
|
||||
request.setUrl(host);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
||||
// setup parameters of request
|
||||
QString requestParams;
|
||||
requestParams += "v=1"; // version of protocol
|
||||
requestParams += "&t=pageview"; // type of request
|
||||
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
|
||||
requestParams += "&cid=" + QString::number(userId); // unique user identifier
|
||||
requestParams += "&dp=companion-" + title.toLower().replace(" ", "-"); // name of page
|
||||
requestParams += "&dt=" + title; // title of page
|
||||
requestParams += "&ul=" + QLocale::system().name(); // language
|
||||
|
||||
// send request via post method
|
||||
networkManager->post(request, requestParams.toStdString().c_str());
|
||||
}
|
||||
|
||||
void GoogleAnalytics::sendEvent(QString category, QString action, QString label)
|
||||
{
|
||||
// create request and set URL of receiver
|
||||
QNetworkRequest request;
|
||||
QUrl host("http://www.google-analytics.com/collect");
|
||||
request.setUrl(host);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
||||
// setup parameters of request
|
||||
QString requestParams;
|
||||
requestParams += "v=1"; // version of protocol
|
||||
requestParams += "&t=event"; // type of request
|
||||
requestParams += "&ec=" + category;
|
||||
requestParams += "&ea=" + action;
|
||||
requestParams += "&el=" + label;
|
||||
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
|
||||
requestParams += "&cid=" + QString::number(userId); // unique user identifier
|
||||
requestParams += "&dt=Companion"; // name of page (or app name)
|
||||
requestParams += "&ul=" + QLocale::system().name(); // language
|
||||
|
||||
// send request via post method
|
||||
networkManager->post(request, requestParams.toStdString().c_str());
|
||||
}
|
||||
|
||||
void GoogleAnalytics::slot_receive(QNetworkReply * reply)
|
||||
{
|
||||
// output information about reply
|
||||
qDebug() << "RequestUrl:" << reply->request().url();
|
||||
qDebug() << "Status:" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
qDebug() << "Error:"<< reply->error();
|
||||
QByteArray bytes = reply->readAll();
|
||||
qDebug() << "Contents" << QString::fromUtf8(bytes.data(), bytes.size());
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#include <QtNetwork>
|
||||
|
||||
class GoogleAnalytics: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GoogleAnalytics();
|
||||
~GoogleAnalytics();
|
||||
void sendPageView(QString page);
|
||||
void sendEvent(QString category, QString action, QString label="");
|
||||
|
||||
protected slots:
|
||||
void slot_receive(QNetworkReply * reply);
|
||||
|
||||
protected:
|
||||
int userId;
|
||||
QNetworkAccessManager * networkManager;
|
||||
};
|
||||
|
||||
extern GoogleAnalytics ga;
|
|
@ -64,7 +64,6 @@
|
|||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include "radionotfound.h"
|
||||
#include "googleanalytics.h"
|
||||
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
|
||||
|
||||
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
|
||||
|
@ -164,8 +163,6 @@ MainWindow::MainWindow():
|
|||
if (printing) {
|
||||
QTimer::singleShot(0, this, SLOT(autoClose()));
|
||||
}
|
||||
|
||||
ga.sendPageView("Home");
|
||||
}
|
||||
|
||||
void MainWindow::displayWarnings()
|
||||
|
@ -512,7 +509,6 @@ void MainWindow::startFirmwareDownload()
|
|||
downloadDialog * dd = new downloadDialog(this, url, filename);
|
||||
connect(dd, SIGNAL(accepted()), this, SLOT(firmwareDownloadAccepted()));
|
||||
dd->exec();
|
||||
ga.sendEvent(getBoardName(GetCurrentFirmware()->getBoard()), "Download", url);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "appdata.h"
|
||||
#include "wizarddialog.h"
|
||||
#include <QFileInfo>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
|
@ -80,8 +79,6 @@ MdiChild::MdiChild():
|
|||
if (!(this->isMaximized() || this->isMinimized())) {
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(firmware->getBoard()) + " Models");
|
||||
}
|
||||
|
||||
MdiChild::~MdiChild()
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "telemetry.h"
|
||||
#include "appdata.h"
|
||||
#include <QScrollArea>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, FirmwareInterface * firmware) :
|
||||
QDialog(parent),
|
||||
|
@ -43,8 +42,6 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
|||
addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry"));
|
||||
|
||||
connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits()));
|
||||
|
||||
ga.sendPageView(getBoardName(firmware->getBoard()) + " ModelEdit");
|
||||
}
|
||||
|
||||
ModelEdit::~ModelEdit()
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <QImage>
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#if !defined WIN32 && defined __GNUC__
|
||||
#include <unistd.h>
|
||||
|
@ -62,8 +61,6 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
|
|||
printToFile();
|
||||
QTimer::singleShot(0, this, SLOT(autoClose()));
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " ModelsPrint");
|
||||
}
|
||||
|
||||
void PrintDialog::closeEvent(QCloseEvent *event)
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <iostream>
|
||||
#include "helpers.h"
|
||||
#include "simulatorinterface.h"
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#define GBALL_SIZE 20
|
||||
#define RESX 1024
|
||||
|
@ -24,7 +23,6 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
|
|||
trimPressed (TRIM_NONE),
|
||||
middleButtonPressed(false)
|
||||
{
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Simulator");
|
||||
}
|
||||
|
||||
uint32_t SimulatorDialog9X::switchstatus = 0;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "wizarddialog.h"
|
||||
#include "wizarddata.h"
|
||||
#include "helpers.h"
|
||||
#include "googleanalytics.h"
|
||||
|
||||
WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelId, QWidget *parent):
|
||||
QWizard(parent),
|
||||
|
@ -60,8 +59,6 @@ WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelI
|
|||
setOption(QWizard::NoCancelButton, false);
|
||||
setOption(HaveHelpButton, true);
|
||||
connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
|
||||
|
||||
ga.sendPageView("Wizard");
|
||||
}
|
||||
|
||||
void WizardDialog::showHelp()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue