Commit 43846cba authored by Volker Krause's avatar Volker Krause
Browse files

Provide a little more fine grained control over telemetry

parent bd57dafb
......@@ -143,12 +143,12 @@ MainWindow::MainWindow() :
viewModeSource->addValueMapping(0, QStringLiteral("analytics"));
viewModeSource->addValueMapping(1, QStringLiteral("surveyEditor"));
viewModeSource->addValueMapping(2, QStringLiteral("schemaEditor"));
m_feedbackProvider->addDataSource(viewModeSource, Provider::AllStatistics);
m_feedbackProvider->addDataSource(new ApplicationVersionSource, Provider::BasicStatistics);
m_feedbackProvider->addDataSource(new PlatformInfoSource, Provider::AllStatistics);
m_feedbackProvider->addDataSource(new QtVersionSource, Provider::AllStatistics);
m_feedbackProvider->addDataSource(new StartCountSource, Provider::BasicStatistics);
m_feedbackProvider->addDataSource(new UsageTimeSource, Provider::BasicStatistics);
m_feedbackProvider->addDataSource(viewModeSource, Provider::DetailedUsageStatistics);
m_feedbackProvider->addDataSource(new ApplicationVersionSource, Provider::BasicSystemInformation);
m_feedbackProvider->addDataSource(new PlatformInfoSource, Provider::BasicSystemInformation);
m_feedbackProvider->addDataSource(new QtVersionSource, Provider::BasicSystemInformation);
m_feedbackProvider->addDataSource(new StartCountSource, Provider::BasicUsageStatistics);
m_feedbackProvider->addDataSource(new UsageTimeSource, Provider::BasicUsageStatistics);
}
MainWindow::~MainWindow()
......
......@@ -38,8 +38,11 @@ class USERFEEDBACKCORE_EXPORT Provider : public QObject
public:
enum StatisticsCollectionMode {
NoStatistics,
BasicStatistics,
AllStatistics,
BasicSystemInformation,
BasicUsageStatistics,
DetailedSystemInformation,
DetailedUsageStatistics,
AllStatistics = DetailedUsageStatistics,
CollectionModeCount = AllStatistics
};
Q_ENUMS(StatisticsCollectionMode)
......
......@@ -73,19 +73,26 @@ void FeedbackConfigWidgetPrivate::telemetrySliderChanged()
switch (telemetryModeMap[ui->telemetrySlider->value()]) {
case Provider::NoStatistics:
break;
case Provider::BasicStatistics:
case Provider::BasicSystemInformation:
ui->telemetryLabel->setText(FeedbackConfigWidget::tr(
"Share statistics on how often you use the application. "
"Share basic system information. "
"No unique identification is included, nor data processed with the application."
));
break;
// TODO
// case Provider::PlatformInformation:
// ui->telemetryLabel->setText(FeedbackConfigWidget::tr("Basic usage stats and system information TODO"));
// break;
case Provider::AllStatistics:
case Provider::BasicUsageStatistics:
ui->telemetryLabel->setText(FeedbackConfigWidget::tr(
"Share statistics on how often individual features of the application are used. "
"Share basic system information and basic statistics on how often you use the application. "
"No unique identification is included, nor data processed with the application."
));
break;
case Provider::DetailedSystemInformation:
ui->telemetryLabel->setText(FeedbackConfigWidget::tr(
"Share basic statistics on how often you use the application, as well as detailed information about your system. "
"No unique identification is included, nor data processed with the application."
));
case Provider::DetailedUsageStatistics:
ui->telemetryLabel->setText(FeedbackConfigWidget::tr(
"Share detailed system information and statistics on how often individual features of the application are used. "
"No unique identification is included, nor data processed with the application."
));
break;
......@@ -193,9 +200,10 @@ void FeedbackConfigWidget::setFeedbackProvider(Provider* provider)
d->telemetryModeMap.clear();
d->telemetryModeMap.push_back(Provider::NoStatistics);
d->telemetryModeMap.push_back(Provider::BasicStatistics);
// TODO
d->telemetryModeMap.push_back(Provider::AllStatistics);
d->telemetryModeMap.push_back(Provider::BasicSystemInformation);
d->telemetryModeMap.push_back(Provider::BasicUsageStatistics);
d->telemetryModeMap.push_back(Provider::DetailedSystemInformation);
d->telemetryModeMap.push_back(Provider::DetailedUsageStatistics);
QSet<Provider::StatisticsCollectionMode> supportedModes;
supportedModes.reserve(d->telemetryModeMap.size());
......
......@@ -40,10 +40,10 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
Provider provider;
provider.addDataSource(new ApplicationVersionSource, Provider::BasicStatistics);
provider.addDataSource(new PlatformInfoSource, Provider::AllStatistics);
provider.addDataSource(new ScreenInfoSource, Provider::AllStatistics);
provider.addDataSource(new QtVersionSource, Provider::AllStatistics);
provider.addDataSource(new ApplicationVersionSource, Provider::BasicSystemInformation);
provider.addDataSource(new PlatformInfoSource, Provider::BasicSystemInformation);
provider.addDataSource(new ScreenInfoSource, Provider::DetailedSystemInformation);
provider.addDataSource(new QtVersionSource, Provider::DetailedSystemInformation);
FeedbackConfigWidget w;
w.setFeedbackProvider(&provider);
......
......@@ -70,7 +70,7 @@ Orwell::Orwell(QWidget* parent) :
propertyMonitorSource->setDescription(QStringLiteral("The dial position."));
propertyMonitorSource->addValueMapping(0, QStringLiteral("off"));
propertyMonitorSource->addValueMapping(11, QStringLiteral("max"));
provider->addDataSource(propertyMonitorSource, UserFeedback::Provider::AllStatistics);
provider->addDataSource(propertyMonitorSource, UserFeedback::Provider::DetailedUsageStatistics);
}
Orwell::~Orwell() = default;
......@@ -109,12 +109,12 @@ int main(int argc, char** argv)
provider->setSubmissionInterval(1);
provider->setApplicationStartsUntilEncouragement(5);
provider->setEncouragementDelay(10);
provider->addDataSource(new UserFeedback::ApplicationVersionSource, UserFeedback::Provider::BasicStatistics);
provider->addDataSource(new UserFeedback::PlatformInfoSource, UserFeedback::Provider::AllStatistics);
provider->addDataSource(new UserFeedback::QtVersionSource, UserFeedback::Provider::BasicStatistics);
provider->addDataSource(new UserFeedback::ScreenInfoSource, UserFeedback::Provider::AllStatistics);
provider->addDataSource(new UserFeedback::StartCountSource, UserFeedback::Provider::BasicStatistics);
provider->addDataSource(new UserFeedback::UsageTimeSource, UserFeedback::Provider::BasicStatistics);
provider->addDataSource(new UserFeedback::ApplicationVersionSource, UserFeedback::Provider::BasicSystemInformation);
provider->addDataSource(new UserFeedback::PlatformInfoSource, UserFeedback::Provider::BasicSystemInformation);
provider->addDataSource(new UserFeedback::QtVersionSource, UserFeedback::Provider::BasicSystemInformation);
provider->addDataSource(new UserFeedback::ScreenInfoSource, UserFeedback::Provider::DetailedSystemInformation);
provider->addDataSource(new UserFeedback::StartCountSource, UserFeedback::Provider::BasicUsageStatistics);
provider->addDataSource(new UserFeedback::UsageTimeSource, UserFeedback::Provider::BasicUsageStatistics);
Orwell mainWindow;
mainWindow.show();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment