Files
UnrealEngineUWP/Engine/Source/Editor/PluginWarden/Private/PluginWardenModule.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

49 lines
1.3 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "PluginWardenPrivatePCH.h"
#include "PluginWardenModule.h"
#include "SAuthorizingPlugin.h"
IMPLEMENT_MODULE( FPluginWardenModule, PluginWarden );
#define LOCTEXT_NAMESPACE "PluginWarden"
TSet<FString> AuthorizedPlugins;
void FPluginWardenModule::StartupModule()
{
}
void FPluginWardenModule::ShutdownModule()
{
}
void FPluginWardenModule::CheckEntitlementForPlugin(const FText& PluginFriendlyName, const FString& PluginGuid, TFunction<void()> AuthorizedCallback)
{
// If we've previously authorized the plug-in, just immediately verify access.
if ( AuthorizedPlugins.Contains(PluginGuid) )
{
AuthorizedCallback();
return;
}
// Create the window
TSharedRef<SWindow> AuthorizingPluginWindow = SNew(SWindow)
.SupportsMaximize(false)
.SupportsMinimize(false)
.HasCloseButton(true)
.SizingRule(ESizingRule::Autosized)
.Title(FText::Format(LOCTEXT("EntitlementCheckFormat", "{0} - Entitlement Check"), PluginFriendlyName));
TSharedRef<SAuthorizingPlugin> PluginAuthPanel = SNew(SAuthorizingPlugin, AuthorizingPluginWindow, PluginFriendlyName, PluginGuid, AuthorizedCallback);
AuthorizingPluginWindow->SetContent(PluginAuthPanel);
FSlateApplication::Get().AddModalWindow(AuthorizingPluginWindow, nullptr);
}
#undef LOCTEXT_NAMESPACE