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

Projucer: Remove the JUCE splash screen and update licensing

This commit is contained in:
Tom Poole 2024-03-25 12:11:50 +00:00 committed by Anthony Nicholls
parent 22d4747038
commit fd933dfac6
95 changed files with 355 additions and 988 deletions

View file

@ -75,9 +75,6 @@ static void doBasicProjectSetup (Project& project, const NewProjectTemplates::Pr
project.getProjectValue (Ids::useAppConfig) = false;
project.getProjectValue (Ids::addUsingNamespaceToJuceHeader) = false;
if (! ProjucerApplication::getApp().getLicenseController().getCurrentState().canUnlockFullFeatures())
project.getProjectValue (Ids::displaySplashScreen) = true;
if (NewProjectTemplates::isPlugin (projectTemplate))
project.getConfigFlag ("JUCE_VST3_CAN_REPLACE_VST2") = 0;
}

View file

@ -47,9 +47,9 @@ public:
}
//==============================================================================
static LicenseState getGPLState()
static LicenseState getAGPLState()
{
return { LicenseState::Type::gpl, projucerMajorVersion, {}, {} };
return { LicenseState::Type::agplv3, projucerMajorVersion, {}, {} };
}
LicenseState getCurrentState() const noexcept
@ -113,7 +113,7 @@ private:
{
switch (type)
{
case LicenseState::Type::gpl: return "GPL";
case LicenseState::Type::agplv3: return "AGPLv3";
case LicenseState::Type::personal: return "personal";
case LicenseState::Type::educational: return "edu";
case LicenseState::Type::indie: return "indie";
@ -127,7 +127,7 @@ private:
static LicenseState::Type getLicenseTypeFromValue (const String& d)
{
if (d == getLicenseStateValue (LicenseState::Type::gpl)) return LicenseState::Type::gpl;
if (d == getLicenseStateValue (LicenseState::Type::agplv3)) return LicenseState::Type::agplv3;
if (d == getLicenseStateValue (LicenseState::Type::personal)) return LicenseState::Type::personal;
if (d == getLicenseStateValue (LicenseState::Type::educational)) return LicenseState::Type::educational;
if (d == getLicenseStateValue (LicenseState::Type::indie)) return LicenseState::Type::indie;
@ -188,7 +188,7 @@ private:
//==============================================================================
void checkLicense()
{
if (state.authToken.isNotEmpty() && ! state.isGPL())
if (state.authToken.isNotEmpty() && ! state.isAGPL())
{
auto completionCallback = [this] (LicenseQueryThread::ErrorMessageAndType error,
LicenseState updatedState)
@ -218,11 +218,7 @@ private:
}
//==============================================================================
#if JUCER_ENABLE_GPL_MODE
LicenseState state = getGPLState();
#else
LicenseState state = licenseStateFromSettings (getGlobalProperties());
#endif
ListenerList<LicenseStateListener> stateListeners;
LicenseQueryThread licenseQueryThread;

View file

@ -63,7 +63,7 @@ namespace LicenseHelpers
case LicenseState::Type::indie: return 3;
case LicenseState::Type::educational: return 2;
case LicenseState::Type::personal: return 1;
case LicenseState::Type::gpl:
case LicenseState::Type::agplv3:
case LicenseState::Type::none:
default: return -1;
}

View file

@ -41,7 +41,7 @@ struct LicenseState
enum class Type
{
none,
gpl,
agplv3,
personal,
educational,
indie,
@ -68,21 +68,17 @@ struct LicenseState
return ! operator== (other);
}
bool isSignedIn() const noexcept { return isGPL() || (version > 0 && username.isNotEmpty()); }
bool isOldLicense() const noexcept { return isSignedIn() && version < projucerMajorVersion; }
bool isGPL() const noexcept { return type == Type::gpl; }
bool canUnlockFullFeatures() const noexcept
{
return isGPL() || (isSignedIn() && ! isOldLicense() && (type == Type::indie || type == Type::pro));
}
bool isSignedIn() const noexcept { return isAGPL() || (version > 0 && username.isNotEmpty()); }
bool isOldLicense() const noexcept { return isSignedIn() && version < projucerMajorVersion; }
bool isAGPL() const noexcept { return type == Type::agplv3; }
bool isPersonalOrNone() const noexcept { return type == Type::none || type == Type::personal; }
String getLicenseTypeString() const
{
switch (type)
{
case Type::none: return "No license";
case Type::gpl: return "GPL";
case Type::agplv3: return "AGPLv3";
case Type::personal: return "Personal";
case Type::educational: return "Educational";
case Type::indie: return "Indie";

View file

@ -63,10 +63,10 @@ public:
addAndMakeVisible (logInButton);
logInButton.onClick = [this] { submitDetails(); };
addAndMakeVisible (enableGPLButton);
enableGPLButton.onClick = [this]
addAndMakeVisible (enableAGPLButton);
enableAGPLButton.onClick = [this]
{
ProjucerApplication::getApp().getLicenseController().setState (LicenseController::getGPLState());
ProjucerApplication::getApp().getLicenseController().setState (LicenseController::getAGPLState());
mainWindow.hideLoginFormOverlay();
};
@ -127,7 +127,7 @@ public:
auto slice = bounds.removeFromTop (textEditorHeight);
createAccountLabel.setBounds (slice.removeFromLeft (createAccountLabel.getFont().getStringWidth (createAccountLabel.getText()) + 5));
slice.removeFromLeft (15);
enableGPLButton.setBounds (slice.reduced (0, 5));
enableAGPLButton.setBounds (slice.reduced (0, 5));
dismissButton.setBounds (getLocalBounds().reduced (10).removeFromTop (20).removeFromRight (20));
}
@ -145,7 +145,7 @@ public:
void updateLookAndFeel()
{
enableGPLButton.setColour (TextButton::buttonColourId, findColour (secondaryButtonBackgroundColourId));
enableAGPLButton.setColour (TextButton::buttonColourId, findColour (secondaryButtonBackgroundColourId));
}
void lookAndFeelChanged() override
@ -284,7 +284,7 @@ private:
TextEditor emailBox, passwordBox;
ProgressButton logInButton { "Sign In" };
TextButton enableGPLButton { "Enable GPL Mode" };
TextButton enableAGPLButton { "Enable AGPLv3 Mode" };
ShapeButton dismissButton { {},
findColour (treeIconColourId),
findColour (treeIconColourId).overlaidWith (findColour (defaultHighlightedTextColourId).withAlpha (0.2f)),

View file

@ -374,10 +374,7 @@ PopupMenu ProjucerApplication::createFileMenu()
menu.addCommandItem (commandManager.get(), CommandIDs::openInIDE);
menu.addCommandItem (commandManager.get(), CommandIDs::saveAndOpenInIDE);
menu.addSeparator();
#if ! JUCER_ENABLE_GPL_MODE
menu.addCommandItem (commandManager.get(), CommandIDs::loginLogout);
#endif
#if ! JUCE_MAC
menu.addCommandItem (commandManager.get(), CommandIDs::showAboutWindow);
@ -1038,8 +1035,8 @@ void ProjucerApplication::getCommandInfo (CommandID commandID, ApplicationComman
{
auto licenseState = licenseController->getCurrentState();
if (licenseState.isGPL())
result.setInfo ("Disable GPL mode", "Disables GPL mode", CommandCategories::general, 0);
if (licenseState.isAGPL())
result.setInfo ("Disable AGPLv3 mode", "Disables AGPLv3 mode", CommandCategories::general, 0);
else
result.setInfo (licenseState.isSignedIn() ? String ("Sign out ") + licenseState.username + "..." : String ("Sign in..."),
"Sign out of your JUCE account",

View file

@ -32,6 +32,10 @@
==============================================================================
*/
#ifdef JUCER_ENABLE_GPL_MODE
#warning The flag JUCER_ENABLE_GPL_MODE has been removed
#endif
#include "jucer_Headers.h"
#include "jucer_Application.h"