1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

Merged in paul_jewell/librepilot/revert_usage_disable (pull request #55)

This commit is contained in:
a*morale 2015-09-24 21:58:51 +02:00
commit 26559a0934
9 changed files with 48 additions and 45 deletions

View File

@ -63,6 +63,8 @@ GCS_SMALL_NAME := $(call smallify,$(GCS_BIG_NAME))
# Change this once the DNS is set to http://wiki.librepilot.org/ # Change this once the DNS is set to http://wiki.librepilot.org/
WIKI_URL_ROOT := https://librepilot.atlassian.net/wiki/display/LPDOC/ WIKI_URL_ROOT := https://librepilot.atlassian.net/wiki/display/LPDOC/
USAGETRACKER_URL := https://usagetracker.librepilot.org/
# Set up default build configurations (debug | release) # Set up default build configurations (debug | release)
GCS_BUILD_CONF := release GCS_BUILD_CONF := release
GOOGLE_API_VERSION := 14 GOOGLE_API_VERSION := 14
@ -249,6 +251,7 @@ gcs_qmake $(GCS_MAKEFILE): | $(GCS_DIR)
'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \ 'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \
'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \ 'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \
'WIKI_URL_ROOT="$(WIKI_URL_ROOT)"' \ 'WIKI_URL_ROOT="$(WIKI_URL_ROOT)"' \
'USAGETRACKER_URL="$(USAGETRACKER_URL)"' \
'GCS_LIBRARY_BASENAME=$(libbasename)' \ 'GCS_LIBRARY_BASENAME=$(libbasename)' \
$(GCS_QMAKE_OPTS) $(GCS_QMAKE_OPTS)

View File

@ -2,6 +2,6 @@
<vendor>The LibrePilot Project</vendor> <vendor>The LibrePilot Project</vendor>
<copyright>(C) 2015 LibrePilot Project; (C) 2010 OpenPilot Project and Nokia</copyright> <copyright>(C) 2015 LibrePilot Project; (C) 2010 OpenPilot Project and Nokia</copyright>
<license>The GNU Public License (GPL) Version 3</license> <license>The GNU Public License (GPL) Version 3</license>
<description>The core plugin for the OpenPilot GCS</description> <description>The core plugin for the GCS</description>
<url>http://www.librepilot.org</url> <url>http://www.librepilot.org</url>
</plugin> </plugin>

View File

@ -128,8 +128,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
m_page->checkAutoSelect->setChecked(m_autoSelect); m_page->checkAutoSelect->setChecked(m_autoSelect);
m_page->cbUseUDPMirror->setChecked(m_useUDPMirror); m_page->cbUseUDPMirror->setChecked(m_useUDPMirror);
m_page->cbExpertMode->setChecked(m_useExpertMode); m_page->cbExpertMode->setChecked(m_useExpertMode);
// Usage data collection temporarily disabled m_page->cbUsageData->setChecked(m_collectUsageData);
// m_page->cbUsageData->setChecked(m_collectUsageData);
m_page->colorButton->setColor(StyleHelper::baseColor()); m_page->colorButton->setColor(StyleHelper::baseColor());
connect(m_page->resetButton, SIGNAL(clicked()), this, SLOT(resetInterfaceColor())); connect(m_page->resetButton, SIGNAL(clicked()), this, SLOT(resetInterfaceColor()));
@ -150,8 +149,7 @@ void GeneralSettings::apply()
m_useExpertMode = m_page->cbExpertMode->isChecked(); m_useExpertMode = m_page->cbExpertMode->isChecked();
m_autoConnect = m_page->checkAutoConnect->isChecked(); m_autoConnect = m_page->checkAutoConnect->isChecked();
m_autoSelect = m_page->checkAutoSelect->isChecked(); m_autoSelect = m_page->checkAutoSelect->isChecked();
// Usage data collection temporarily disabled setCollectUsageData(m_page->cbUsageData->isChecked());
// setCollectUsageData(m_page->cbUsageData->isChecked());
} }
void GeneralSettings::finish() void GeneralSettings::finish()
@ -162,16 +160,15 @@ void GeneralSettings::finish()
void GeneralSettings::readSettings(QSettings *qs) void GeneralSettings::readSettings(QSettings *qs)
{ {
qs->beginGroup(QLatin1String("General")); qs->beginGroup(QLatin1String("General"));
m_language = qs->value(QLatin1String("OverrideLanguage"), QLocale::system().name()).toString(); m_language = qs->value(QLatin1String("OverrideLanguage"), QLocale::system().name()).toString();
m_saveSettingsOnExit = qs->value(QLatin1String("SaveSettingsOnExit"), m_saveSettingsOnExit).toBool(); m_saveSettingsOnExit = qs->value(QLatin1String("SaveSettingsOnExit"), m_saveSettingsOnExit).toBool();
m_autoConnect = qs->value(QLatin1String("AutoConnect"), m_autoConnect).toBool(); m_autoConnect = qs->value(QLatin1String("AutoConnect"), m_autoConnect).toBool();
m_autoSelect = qs->value(QLatin1String("AutoSelect"), m_autoSelect).toBool(); m_autoSelect = qs->value(QLatin1String("AutoSelect"), m_autoSelect).toBool();
m_useUDPMirror = qs->value(QLatin1String("UDPMirror"), m_useUDPMirror).toBool(); m_useUDPMirror = qs->value(QLatin1String("UDPMirror"), m_useUDPMirror).toBool();
m_useExpertMode = qs->value(QLatin1String("ExpertMode"), m_useExpertMode).toBool(); m_useExpertMode = qs->value(QLatin1String("ExpertMode"), m_useExpertMode).toBool();
// Usage data collection temporarily disabled m_collectUsageData = qs->value(QLatin1String("CollectUsageData"), m_collectUsageData).toBool();
// m_collectUsageData = qs->value(QLatin1String("CollectUsageData"), m_collectUsageData).toBool(); m_showUsageDataDisclaimer = qs->value(QLatin1String("ShowUsageDataDisclaimer"), m_showUsageDataDisclaimer).toBool();
// m_showUsageDataDisclaimer = qs->value(QLatin1String("ShowUsageDataDisclaimer"), m_showUsageDataDisclaimer).toBool(); m_lastUsageHash = qs->value(QLatin1String("LastUsageHash"), m_lastUsageHash).toString();
m_lastUsageHash = qs->value(QLatin1String("LastUsageHash"), m_lastUsageHash).toString();
qs->endGroup(); qs->endGroup();
} }
@ -190,9 +187,8 @@ void GeneralSettings::saveSettings(QSettings *qs)
qs->setValue(QLatin1String("AutoSelect"), m_autoSelect); qs->setValue(QLatin1String("AutoSelect"), m_autoSelect);
qs->setValue(QLatin1String("UDPMirror"), m_useUDPMirror); qs->setValue(QLatin1String("UDPMirror"), m_useUDPMirror);
qs->setValue(QLatin1String("ExpertMode"), m_useExpertMode); qs->setValue(QLatin1String("ExpertMode"), m_useExpertMode);
// Usage data collection temporarily disabled qs->setValue(QLatin1String("CollectUsageData"), m_collectUsageData);
// qs->setValue(QLatin1String("CollectUsageData"), m_collectUsageData); qs->setValue(QLatin1String("ShowUsageDataDisclaimer"), m_showUsageDataDisclaimer);
// qs->setValue(QLatin1String("ShowUsageDataDisclaimer"), m_showUsageDataDisclaimer);
qs->setValue(QLatin1String("LastUsageHash"), m_lastUsageHash); qs->setValue(QLatin1String("LastUsageHash"), m_lastUsageHash);
qs->endGroup(); qs->endGroup();
} }
@ -264,18 +260,16 @@ bool GeneralSettings::useUDPMirror() const
return m_useUDPMirror; return m_useUDPMirror;
} }
/** Usage data collection temporarily disabled bool GeneralSettings::collectUsageData() const
bool GeneralSettings::collectUsageData() const {
{
return m_collectUsageData; return m_collectUsageData;
} }
bool GeneralSettings::showUsageDataDisclaimer() const
bool GeneralSettings::showUsageDataDisclaimer() const {
{
return m_showUsageDataDisclaimer; return m_showUsageDataDisclaimer;
} }
********************/
QString GeneralSettings::lastUsageHash() const QString GeneralSettings::lastUsageHash() const
{ {
return m_lastUsageHash; return m_lastUsageHash;
@ -286,20 +280,18 @@ bool GeneralSettings::useExpertMode() const
return m_useExpertMode; return m_useExpertMode;
} }
/** Usage data collection temporarily disabled void GeneralSettings::setCollectUsageData(bool collect)
void GeneralSettings::setCollectUsageData(bool collect) {
{
if (collect && collect != m_collectUsageData) { if (collect && collect != m_collectUsageData) {
setShowUsageDataDisclaimer(true); setShowUsageDataDisclaimer(true);
} }
m_collectUsageData = collect; m_collectUsageData = collect;
} }
void GeneralSettings::setShowUsageDataDisclaimer(bool show) void GeneralSettings::setShowUsageDataDisclaimer(bool show)
{ {
m_showUsageDataDisclaimer = show; m_showUsageDataDisclaimer = show;
} }
********************/
void GeneralSettings::setLastUsageHash(QString hash) void GeneralSettings::setLastUsageHash(QString hash)
{ {

View File

@ -154,13 +154,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<!-- <item row="15" column="0"> <item row="15" column="0">
<widget class="QLabel" name="labelExpert_2"> <widget class="QLabel" name="labelExpert_2">
<property name="text"> <property name="text">
<string>Contribute usage statistics:</string> <string>Contribute usage statistics:</string>
</property> </property>
</widget> </widget>
</item> --> </item>
<item row="9" column="2"> <item row="9" column="2">
<widget class="QWidget" name="widget_2" native="true"> <widget class="QWidget" name="widget_2" native="true">
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
@ -243,7 +243,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<!--<item row="15" column="2"> <item row="15" column="2">
<widget class="QCheckBox" name="cbUsageData"> <widget class="QCheckBox" name="cbUsageData">
<property name="text"> <property name="text">
<string/> <string/>
@ -252,7 +252,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> --> </item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -244,11 +244,10 @@ plugin_flightlog.depends += plugin_uavtalk
SUBDIRS += plugin_flightlog SUBDIRS += plugin_flightlog
# Usage Tracker plugin # Usage Tracker plugin
# Uncomment the following lines to re-enable the usagetracker plugin
plugin_usagetracker.subdir = usagetracker plugin_usagetracker.subdir = usagetracker
plugin_usagetracker.depends = plugin_coreplugin plugin_usagetracker.depends = plugin_coreplugin
plugin_usagetracker.depends += plugin_uavobjects plugin_usagetracker.depends += plugin_uavobjects
plugin_usagetracker.depends += plugin_uavtalk plugin_usagetracker.depends += plugin_uavtalk
plugin_setupwizard.depends += plugin_uavobjectutil plugin_setupwizard.depends += plugin_uavobjectutil
# SUBDIRS += plugin_usagetracker SUBDIRS += plugin_usagetracker

View File

@ -0,0 +1,7 @@
isEmpty(USAGETRACKER_URL) {
USAGETRACKER_URL = Unknown
} else {
USAGETRACKER_URL = "$$USAGETRACKER_URL"
}
DEFINES += USAGETRACKER_URL=$$shell_quote(\"$$USAGETRACKER_URL\")

View File

@ -3,6 +3,7 @@ TEMPLATE = lib
TARGET = UsageTracker TARGET = UsageTracker
QT += network QT += network
include(usagetracker.pri)
include(../../plugin.pri) include(../../plugin.pri)
include(../../libs/version_info/version_info.pri) include(../../libs/version_info/version_info.pri)
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)

View File

@ -2,7 +2,8 @@
****************************************************************************** ******************************************************************************
* *
* @file usagetrackerplugin.cpp * @file usagetrackerplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015. * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015.
* @addtogroup GCSPlugins GCS Plugins * @addtogroup GCSPlugins GCS Plugins
* @{ * @{
* @addtogroup UsageTrackerPlugin Usage Tracker Plugin * @addtogroup UsageTrackerPlugin Usage Tracker Plugin
@ -138,7 +139,7 @@ void UsageTrackerPlugin::trackUsage()
if (shouldSend(hash)) { if (shouldSend(hash)) {
query.addQueryItem("hash", hash); query.addQueryItem("hash", hash);
QUrl url("https://www.librepilot.org/opver?" + query.toString(QUrl::FullyEncoded)); QUrl url(QString(USAGETRACKER_URL) + "?" + query.toString(QUrl::FullyEncoded));
QNetworkAccessManager *networkAccessManager = new QNetworkAccessManager(); QNetworkAccessManager *networkAccessManager = new QNetworkAccessManager();
@ -261,7 +262,6 @@ QString UsageTrackerPlugin::getUAVFieldValue(UAVObjectManager *objManager, QStri
QString UsageTrackerPlugin::getQueryHash(QString source) const QString UsageTrackerPlugin::getQueryHash(QString source) const
{ {
source += "OpenPilot Fuck Yeah!";
return QString(QCryptographicHash::hash(QByteArray(source.toStdString().c_str()), QCryptographicHash::Md5).toHex()); return QString(QCryptographicHash::hash(QByteArray(source.toStdString().c_str()), QCryptographicHash::Md5).toHex());
} }

View File

@ -2,7 +2,8 @@
****************************************************************************** ******************************************************************************
* *
* @file usagetrackerplugin.h * @file usagetrackerplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015. * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015.
* @addtogroup GCSPlugins GCS Plugins * @addtogroup GCSPlugins GCS Plugins
* @{ * @{
* @addtogroup UsageTrackerPlugin Usage Tracker Plugin * @addtogroup UsageTrackerPlugin Usage Tracker Plugin
@ -36,7 +37,7 @@ class QNetworkReply;
class UsageTrackerPlugin : public ExtensionSystem::IPlugin { class UsageTrackerPlugin : public ExtensionSystem::IPlugin {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "OpenPilot.UsageTracker") Q_PLUGIN_METADATA(IID "LibrePilot.UsageTracker")
public: public:
UsageTrackerPlugin(); UsageTrackerPlugin();
~UsageTrackerPlugin(); ~UsageTrackerPlugin();