1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-31 03:00:05 +00:00

Projucer: Add analytics

This commit is contained in:
ed 2018-03-15 11:11:42 +00:00
parent 47af78fe0b
commit 711e75bdc8
28 changed files with 772 additions and 25 deletions

View file

@ -248,6 +248,14 @@ void HeaderComponent::timerCallback()
}
//======================================================================
static void sendProjectButtonAnalyticsEvent (StringRef label)
{
StringPairArray data;
data.set ("label", label);
Analytics::getInstance()->logEvent ("Project Button", data, ProjucerAnalyticsEvent::projectEvent);
}
void HeaderComponent::initialiseButtons() noexcept
{
auto& icons = getIcons();
@ -255,6 +263,8 @@ void HeaderComponent::initialiseButtons() noexcept
addAndMakeVisible (projectSettingsButton = new IconButton ("Project Settings", &icons.settings));
projectSettingsButton->onClick = [this]
{
sendProjectButtonAnalyticsEvent ("Project Settings");
if (auto* pcc = findParentComponentOfClass<ProjectContentComponent>())
pcc->showProjectSettings();
};
@ -263,6 +273,8 @@ void HeaderComponent::initialiseButtons() noexcept
saveAndOpenInIDEButton->isIDEButton = true;
saveAndOpenInIDEButton->onClick = [this]
{
sendProjectButtonAnalyticsEvent ("Save and Open in IDE (" + exporterBox.getText() + ")");
if (auto* pcc = findParentComponentOfClass<ProjectContentComponent>())
pcc->openInSelectedIDE (true);
};
@ -271,6 +283,8 @@ void HeaderComponent::initialiseButtons() noexcept
userSettingsButton->isUserButton = true;
userSettingsButton->onClick = [this]
{
sendProjectButtonAnalyticsEvent ("User Settings");
if (auto* pcc = findParentComponentOfClass<ProjectContentComponent>())
showUserSettings();
};
@ -278,6 +292,8 @@ void HeaderComponent::initialiseButtons() noexcept
addAndMakeVisible (runAppButton = new IconButton ("Run Application", &icons.play));
runAppButton->onClick = [this]
{
sendProjectButtonAnalyticsEvent ("Run Application");
if (childProcess != nullptr)
childProcess->launchApp();
};