Browse Source

Projucer: Don't add unnecessary dependency to the WebBrowserComponent when compiling in GPL mode

tags/2021-05-28
hogliux 8 years ago
parent
commit
98253adf23
2 changed files with 18 additions and 6 deletions
  1. +8
    -1
      extras/Projucer/Source/Licenses/jucer_LicenseController.cpp
  2. +10
    -5
      extras/Projucer/Source/Licenses/jucer_LicenseController.h

+ 8
- 1
extras/Projucer/Source/Licenses/jucer_LicenseController.cpp View File

@@ -29,8 +29,10 @@
#include "../Project/jucer_HeaderComponent.h"
#include "jucer_LicenseController.h"
#if ! JUCER_ENABLE_GPL_MODE
#include "jucer_LicenseWebview.h"
#include "jucer_LicenseThread.h"
#endif
//==============================================================================
const char* LicenseState::licenseTypeToString (LicenseState::Type type)
@@ -88,7 +90,7 @@ static LicenseState::ApplicationUsageData getApplicationUsageDataTypeFromValue (
return LicenseState::ApplicationUsageData::notChosenYet;
}
//==============================================================================
#if !JUCER_ENABLE_GPL_MODE
struct LicenseController::ModalCompletionCallback : ModalComponentManager::Callback
{
ModalCompletionCallback (LicenseController& controller) : owner (controller) {}
@@ -97,6 +99,7 @@ struct LicenseController::ModalCompletionCallback : ModalComponentManager::Callb
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ModalCompletionCallback)
};
#endif
//==============================================================================
LicenseController::LicenseController()
@@ -110,8 +113,10 @@ LicenseController::LicenseController()
LicenseController::~LicenseController()
{
#if !JUCER_ENABLE_GPL_MODE
thread = nullptr;
closeWebview (-1);
#endif
}
LicenseState LicenseController::getState() const noexcept
@@ -181,6 +186,7 @@ void LicenseController::setApplicationUsageDataState (LicenseState::ApplicationU
}
//==============================================================================
#if ! JUCER_ENABLE_GPL_MODE
void LicenseController::closeWebview (int result)
{
if (licenseWebview != nullptr)
@@ -244,6 +250,7 @@ void LicenseController::queryWebview (const String& startURL, const String& valu
}
});
}
#endif
void LicenseController::updateState (const LicenseState& newState)
{


+ 10
- 5
extras/Projucer/Source/Licenses/jucer_LicenseController.h View File

@@ -93,6 +93,13 @@ public:
void removeLicenseStatusChangedCallback (StateChangedCallback* callback) { listeners.remove (callback); }
private:
//==============================================================================
void updateState (const LicenseState&);
static LicenseState licenseStateFromSettings (PropertiesFile&);
static void licenseStateToSettings (const LicenseState&, PropertiesFile&);
#if ! JUCER_ENABLE_GPL_MODE
//==============================================================================
struct ModalCompletionCallback;
friend struct ModalCompletionCallback;
@@ -105,15 +112,13 @@ private:
void modalStateFinished (int);
void ensureLicenseWebviewIsOpenWithPage (const String&);
void queryWebview (const String&, const String&, HashMap<String, String>&);
void updateState (const LicenseState&);
static LicenseState licenseStateFromSettings (PropertiesFile&);
static void licenseStateToSettings (const LicenseState&, PropertiesFile&);
//==============================================================================
LicenseState state;
ScopedPointer<LicenseThread> thread;
LicenseWebview* licenseWebview = nullptr;
#endif
LicenseState state;
ListenerList<LicenseController::StateChangedCallback> listeners;
bool guiNotInitialisedYet = true;


Loading…
Cancel
Save