Browse Source

Projucer: Made some usability and reliability improvements to the live-build engine

tags/2021-05-28
ed 8 years ago
parent
commit
994ab55247
4 changed files with 16 additions and 11 deletions
  1. +5
    -1
      extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp
  2. +1
    -3
      extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.h
  3. +9
    -6
      extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp
  4. +1
    -1
      extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.h

+ 5
- 1
extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp View File

@@ -264,7 +264,11 @@ private:
void* server; void* server;
#endif #endif
void timerCallback() { owner.handleCrash (String()); }
void timerCallback()
{
stopTimer();
owner.handleCrash (String());
}
}; };
//============================================================================== //==============================================================================


+ 1
- 3
extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.h View File

@@ -144,9 +144,7 @@ struct ChildProcessCache
void removeOrphans() void removeOrphans()
{ {
for (int i = processes.size(); --i >= 0;)
if (processes.getObjectPointerUnchecked (i)->getReferenceCount() <= 1)
processes.remove (i);
processes.clear();
} }
private: private:


+ 9
- 6
extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp View File

@@ -1129,16 +1129,19 @@ void ProjectContentComponent::killChildProcess()
} }
} }
void ProjectContentComponent::setBuildEnabled (bool b)
void ProjectContentComponent::setBuildEnabled (bool isEnabled, bool displayError)
{ {
if (project != nullptr && b != isBuildEnabled())
if (project != nullptr && isEnabled != isBuildEnabled())
{ {
LiveBuildProjectSettings::setBuildDisabled (*project, ! b);
if (! displayError)
lastCrashMessage = {};
LiveBuildProjectSettings::setBuildDisabled (*project, ! isEnabled);
killChildProcess(); killChildProcess();
refreshTabsIfBuildStatusChanged(); refreshTabsIfBuildStatusChanged();
if (auto* h = dynamic_cast<HeaderComponent*> (header.get())) if (auto* h = dynamic_cast<HeaderComponent*> (header.get()))
h->updateBuildButtons (b, isContinuousRebuildEnabled());
h->updateBuildButtons (isEnabled, isContinuousRebuildEnabled());
} }
} }
@@ -1159,7 +1162,7 @@ void ProjectContentComponent::handleCrash (const String& message)
if (project != nullptr) if (project != nullptr)
{ {
setBuildEnabled (false);
setBuildEnabled (false, true);
showBuildTab(); showBuildTab();
} }
} }
@@ -1316,7 +1319,7 @@ void ProjectContentComponent::handleMissingSystemHeaders()
const String alertWindowMessage = "Missing system headers\nPlease do sudo apt-get install ..."; const String alertWindowMessage = "Missing system headers\nPlease do sudo apt-get install ...";
#endif #endif
setBuildEnabled (false);
setBuildEnabled (false, true);
deleteProjectTabs(); deleteProjectTabs();
createProjectTabs(); createProjectTabs();


+ 1
- 1
extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.h View File

@@ -118,7 +118,7 @@ public:
void cleanAll(); void cleanAll();
void handleMissingSystemHeaders(); void handleMissingSystemHeaders();
bool isBuildTabEnabled() const; bool isBuildTabEnabled() const;
void setBuildEnabled (bool);
void setBuildEnabled (bool enabled, bool displayError = false);
bool isBuildEnabled() const; bool isBuildEnabled() const;
bool areWarningsEnabled() const; bool areWarningsEnabled() const;


Loading…
Cancel
Save