1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-21 15:25:17 +03:00

More statistics

This commit is contained in:
bsongis 2014-05-27 16:20:12 +02:00
parent fdde364307
commit b736517986
10 changed files with 28 additions and 5 deletions

View file

@ -342,10 +342,12 @@ set(simu_SRCS
modeledit/edge.cpp # TODO not needed modeledit/edge.cpp # TODO not needed
appdata.cpp appdata.cpp
simulator.cpp simulator.cpp
googleanalytics.cpp
) )
set(simu_HDRS set(simu_HDRS
modeledit/node.h modeledit/node.h
googleanalytics.h
) )
qt4_wrap_cpp(simu_SRCS ${simu_HDRS} ) qt4_wrap_cpp(simu_SRCS ${simu_HDRS} )

View file

@ -3,6 +3,7 @@
#include <QtGui> #include <QtGui>
#include "eeprominterface.h" #include "eeprominterface.h"
#include "flashinterface.h" #include "flashinterface.h"
#include "googleanalytics.h"
#if defined WIN32 || !defined __GNUC__ #if defined WIN32 || !defined __GNUC__
#include <Windows.h> #include <Windows.h>
@ -93,6 +94,8 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
process->start(prog,arg); process->start(prog,arg);
} }
} }
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Flash");
} }
# if !__GNUC__ # if !__GNUC__

View file

@ -4,6 +4,7 @@
#include "appdata.h" #include "appdata.h"
#include <QDateTime> #include <QDateTime>
#include <QtGui> #include <QtGui>
#include "googleanalytics.h"
#define BIT_WARN_THR ( 0x01 ) #define BIT_WARN_THR ( 0x01 )
#define BIT_WARN_SW ( 0x02 ) #define BIT_WARN_SW ( 0x02 )
@ -307,6 +308,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->backlightColor1_label->hide(); ui->backlightColor1_label->hide();
ui->backlightColor2_label->hide(); ui->backlightColor2_label->hide();
} }
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " GeneralEdit");
} }
GeneralEdit::~GeneralEdit() GeneralEdit::~GeneralEdit()

View file

@ -16,7 +16,7 @@ GoogleAnalytics::~GoogleAnalytics()
delete networkManager; delete networkManager;
} }
void GoogleAnalytics::sendPageView(QString page) void GoogleAnalytics::sendPageView(QString title)
{ {
// create request and set URL of receiver // create request and set URL of receiver
QNetworkRequest request; QNetworkRequest request;
@ -30,7 +30,8 @@ void GoogleAnalytics::sendPageView(QString page)
requestParams += "&t=pageview"; // type of request requestParams += "&t=pageview"; // type of request
requestParams += "&tid=" TRACKING_ID; // Google Analytics account requestParams += "&tid=" TRACKING_ID; // Google Analytics account
requestParams += "&cid=" + QString::number(userId); // unique user identifier requestParams += "&cid=" + QString::number(userId); // unique user identifier
requestParams += "&dp=" + page; // name of page (or app name) requestParams += "&dp=companion-" + title.toLower().replace(" ", "-"); // name of page
requestParams += "&dt=" + title; // title of page
requestParams += "&ul=" + QLocale::system().name(); // language requestParams += "&ul=" + QLocale::system().name(); // language
// send request via post method // send request via post method

View file

@ -164,7 +164,7 @@ MainWindow::MainWindow():
QTimer::singleShot(0, this, SLOT(autoClose())); QTimer::singleShot(0, this, SLOT(autoClose()));
} }
ga.sendEvent(getBoardName(GetCurrentFirmware()->getBoard()), "Start Companion"); ga.sendPageView("Home");
} }
void MainWindow::displayWarnings() void MainWindow::displayWarnings()

View file

@ -55,6 +55,7 @@
#include "wizarddialog.h" #include "wizarddialog.h"
#include "taranisnotfound.h" #include "taranisnotfound.h"
#include <QFileInfo> #include <QFileInfo>
#include "googleanalytics.h"
#if defined WIN32 || !defined __GNUC__ #if defined WIN32 || !defined __GNUC__
#include <windows.h> #include <windows.h>
@ -80,6 +81,8 @@ MdiChild::MdiChild():
if(!(this->isMaximized() || this->isMinimized())) { if(!(this->isMaximized() || this->isMinimized())) {
adjustSize(); adjustSize();
} }
ga.sendPageView(getBoardName(firmware->getBoard()) + " Models");
} }
MdiChild::~MdiChild() MdiChild::~MdiChild()

View file

@ -13,6 +13,7 @@
#include "telemetry.h" #include "telemetry.h"
#include "appdata.h" #include "appdata.h"
#include <QScrollArea> #include <QScrollArea>
#include "googleanalytics.h"
ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, FirmwareInterface * firmware) : ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, FirmwareInterface * firmware) :
QDialog(parent), QDialog(parent),
@ -42,6 +43,8 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry")); addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry"));
connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits())); connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits()));
ga.sendPageView(getBoardName(firmware->getBoard()) + " ModelEdit");
} }
ModelEdit::~ModelEdit() ModelEdit::~ModelEdit()

View file

@ -6,6 +6,7 @@
#include <QImage> #include <QImage>
#include <QColor> #include <QColor>
#include <QPainter> #include <QPainter>
#include "googleanalytics.h"
#if !defined WIN32 && defined __GNUC__ #if !defined WIN32 && defined __GNUC__
#include <unistd.h> #include <unistd.h>
@ -61,6 +62,8 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
printToFile(); printToFile();
QTimer::singleShot(0, this, SLOT(autoClose())); QTimer::singleShot(0, this, SLOT(autoClose()));
} }
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " ModelsPrint");
} }
void PrintDialog::closeEvent(QCloseEvent *event) void PrintDialog::closeEvent(QCloseEvent *event)

View file

@ -4,6 +4,7 @@
#include <iostream> #include <iostream>
#include "helpers.h" #include "helpers.h"
#include "simulatorinterface.h" #include "simulatorinterface.h"
#include "googleanalytics.h"
#define GBALL_SIZE 20 #define GBALL_SIZE 20
#define RESX 1024 #define RESX 1024
@ -23,6 +24,7 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
trimPressed (TRIM_NONE), trimPressed (TRIM_NONE),
middleButtonPressed(false) middleButtonPressed(false)
{ {
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Simulator");
} }
uint32_t SimulatorDialog9X::switchstatus = 0; uint32_t SimulatorDialog9X::switchstatus = 0;

View file

@ -16,6 +16,7 @@
#include "wizarddialog.h" #include "wizarddialog.h"
#include "wizarddata.h" #include "wizarddata.h"
#include "helpers.h" #include "helpers.h"
#include "googleanalytics.h"
WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelId, QWidget *parent) WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelId, QWidget *parent)
: QWizard(parent), : QWizard(parent),
@ -55,6 +56,8 @@ WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelI
#endif #endif
setOption(HaveHelpButton, true); setOption(HaveHelpButton, true);
connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp())); connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
ga.sendPageView("Wizard");
} }
void WizardDialog::showHelp() void WizardDialog::showHelp()