1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: Removed the live build

This commit is contained in:
Tom Poole 2021-05-14 08:18:19 +01:00
parent 64896eefcd
commit bfdda737a2
74 changed files with 673 additions and 7583 deletions

View file

@ -30,12 +30,6 @@
#include "../../ProjectSaving/jucer_ProjectExporter.h"
#include "../../Project/UI/jucer_ProjectContentComponent.h"
#include "../../LiveBuildEngine/jucer_MessageIDs.h"
#include "../../LiveBuildEngine/jucer_SourceCodeRange.h"
#include "../../LiveBuildEngine/jucer_ClassDatabase.h"
#include "../../LiveBuildEngine/jucer_DiagnosticMessage.h"
#include "../../LiveBuildEngine/jucer_CompileEngineClient.h"
//==============================================================================
HeaderComponent::HeaderComponent (ProjectContentComponent* pcc)
: projectContentComponent (pcc)
@ -60,15 +54,6 @@ HeaderComponent::HeaderComponent (ProjectContentComponent* pcc)
initialiseButtons();
}
HeaderComponent::~HeaderComponent()
{
if (childProcess != nullptr)
{
childProcess->activityList.removeChangeListener (this);
childProcess->errorList.removeChangeListener (this);
}
}
//==============================================================================
void HeaderComponent::resized()
{
@ -95,7 +80,6 @@ void HeaderComponent::resized()
exporterBounds.setCentre (bounds.getCentre());
runAppButton.setBounds (exporterBounds.removeFromRight (exporterBounds.getHeight()).reduced (2));
saveAndOpenInIDEButton.setBounds (exporterBounds.removeFromRight (exporterBounds.getHeight()).reduced (2));
exporterBounds.removeFromRight (5);
@ -110,17 +94,11 @@ void HeaderComponent::resized()
void HeaderComponent::paint (Graphics& g)
{
g.fillAll (findColour (backgroundColourId));
if (isBuilding)
getLookAndFeel().drawSpinningWaitAnimation (g, findColour (treeIconColourId),
runAppButton.getX(), runAppButton.getY(),
runAppButton.getWidth(), runAppButton.getHeight());
}
//==============================================================================
void HeaderComponent::setCurrentProject (Project* newProject)
{
isBuilding = false;
stopTimer();
repaint();
@ -137,22 +115,6 @@ void HeaderComponent::setCurrentProject (Project* newProject)
projectNameValue.referTo (project->getProjectValue (Ids::name));
projectNameValue.addListener (this);
updateName();
childProcess = ProjucerApplication::getApp().childProcessCache->getExisting (*project);
if (childProcess != nullptr)
{
childProcess->activityList.addChangeListener (this);
childProcess->errorList.addChangeListener (this);
runAppButton.setTooltip ({});
runAppButton.setEnabled (true);
}
else
{
runAppButton.setTooltip ("Enable live-build engine to launch application");
runAppButton.setEnabled (false);
}
}
}
@ -236,25 +198,11 @@ void HeaderComponent::sidebarTabsWidthChanged (int newWidth)
resized();
}
void HeaderComponent::liveBuildEnablementChanged (bool isEnabled)
{
runAppButton.setVisible (isEnabled);
}
//==============================================================================
void HeaderComponent::changeListenerCallback (ChangeBroadcaster* source)
{
if (source == &userAvatar)
{
resized();
}
else if (childProcess != nullptr && source == &childProcess->activityList)
{
if (childProcess->activityList.getNumActivities() > 0)
buildPing();
else
buildFinished (childProcess->errorList.getNumErrors() == 0);
}
}
void HeaderComponent::valueChanged (Value&)
@ -305,14 +253,6 @@ void HeaderComponent::initialiseButtons()
}
};
addAndMakeVisible (runAppButton);
runAppButton.setIconInset (7);
runAppButton.onClick = [this]
{
if (childProcess != nullptr)
childProcess->launchApp();
};
updateExporterButton();
}
@ -339,57 +279,3 @@ void HeaderComponent::updateExporterButton()
}
}
}
//==============================================================================
void HeaderComponent::buildPing()
{
if (! isTimerRunning())
{
isBuilding = true;
runAppButton.setEnabled (false);
runAppButton.setTooltip ("Building...");
startTimer (50);
}
}
void HeaderComponent::buildFinished (bool success)
{
stopTimer();
isBuilding = false;
repaint();
setRunAppButtonState (success);
}
void HeaderComponent::setRunAppButtonState (bool buildWasSuccessful)
{
bool shouldEnableButton = false;
if (buildWasSuccessful)
{
if (childProcess != nullptr)
{
if (childProcess->isAppRunning() || (! childProcess->isAppRunning() && childProcess->canLaunchApp()))
{
runAppButton.setTooltip ("Launch application");
shouldEnableButton = true;
}
else
{
runAppButton.setTooltip ("Application can't be launched");
}
}
else
{
runAppButton.setTooltip ("Enable live-build engine to launch application");
}
}
else
{
runAppButton.setTooltip ("Error building application");
}
runAppButton.setEnabled (shouldEnableButton);
}