Fixing up case of "iOS" folders (pt 2)

#rb none
#jira UE-123

[CL 3533003 by Ben Marsh in Staging-4.17 branch]
This commit is contained in:
Ben Marsh
2017-07-12 10:09:45 -04:00
parent 4dbac627c5
commit 31ef40810e
61 changed files with 13991 additions and 0 deletions
@@ -0,0 +1,48 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class IOSPlatformEditor : ModuleRules
{
public IOSPlatformEditor(ReadOnlyTargetRules Target) : base(Target)
{
BinariesSubFolder = "IOS";
PrivateDependencyModuleNames.AddRange(
new string[] {
"Core",
"CoreUObject",
"InputCore",
"DesktopPlatform",
"Engine",
"MainFrame",
"Slate",
"SlateCore",
"EditorStyle",
"PropertyEditor",
"SharedSettingsWidgets",
"SourceControl",
"IOSRuntimeSettings",
"TargetPlatform",
"MaterialShaderQualitySettings",
"RenderCore",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[] {
"GameProjectGeneration",
"Settings",
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[] {
"GameProjectGeneration",
}
);
// this is listed above, so it isn't really dynamically loaded, this just marks it as being platform specific.
PlatformSpecificDynamicallyLoadedModuleNames.Add("IOSRuntimeSettings");
}
}
@@ -0,0 +1,101 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
#include "Materials/Material.h"
#include "Materials/MaterialInstance.h"
#include "PropertyEditorModule.h"
#include "IOSRuntimeSettings.h"
#include "IOSTargetSettingsCustomization.h"
#include "ISettingsModule.h"
#include "MaterialShaderQualitySettings.h"
#include "MaterialShaderQualitySettingsCustomization.h"
#include "ComponentRecreateRenderStateContext.h"
#include "ShaderPlatformQualitySettings.h"
#define LOCTEXT_NAMESPACE "FIOSPlatformEditorModule"
/**
* Module for iOS as a target platform
*/
class FIOSPlatformEditorModule
: public IModuleInterface
{
// IModuleInterface interface
virtual void StartupModule() override
{
// register settings detail panel customization
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.RegisterCustomClassLayout(
"IOSRuntimeSettings",
FOnGetDetailCustomizationInstance::CreateStatic(&FIOSTargetSettingsCustomization::MakeInstance)
);
FOnUpdateMaterialShaderQuality UpdateMaterials = FOnUpdateMaterialShaderQuality::CreateLambda([]()
{
FGlobalComponentRecreateRenderStateContext Recreate;
FlushRenderingCommands();
UMaterial::AllMaterialsCacheResourceShadersForRendering();
UMaterialInstance::AllMaterialsCacheResourceShadersForRendering();
});
PropertyModule.RegisterCustomClassLayout(
UShaderPlatformQualitySettings::StaticClass()->GetFName(),
FOnGetDetailCustomizationInstance::CreateStatic(&FMaterialShaderQualitySettingsCustomization::MakeInstance, UpdateMaterials)
);
PropertyModule.NotifyCustomizationModuleChanged();
// register settings
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
if (SettingsModule != nullptr)
{
SettingsModule->RegisterSettings("Project", "Platforms", "iOS",
LOCTEXT("RuntimeSettingsName", "iOS"),
LOCTEXT("RuntimeSettingsDescription", "Settings and resources for the iOS platform"),
GetMutableDefault<UIOSRuntimeSettings>()
);
{
static FName NAME_OPENGL_ES2_IOS(TEXT("GLSL_ES2_IOS"));
const UShaderPlatformQualitySettings* IOSMaterialQualitySettings = UMaterialShaderQualitySettings::Get()->GetShaderPlatformQualitySettings(NAME_OPENGL_ES2_IOS);
SettingsModule->RegisterSettings("Project", "Platforms", "iOSES2Quality",
LOCTEXT("IOSES2QualitySettingsName", "iOS Material Quality - ES2"),
LOCTEXT("IOSES2QualitySettingsDescription", "Settings for iOS ES2 material quality"),
IOSMaterialQualitySettings
);
}
{
static FName NAME_SF_METAL(TEXT("SF_METAL"));
const UShaderPlatformQualitySettings* IOSMaterialQualitySettings = UMaterialShaderQualitySettings::Get()->GetShaderPlatformQualitySettings(NAME_SF_METAL);
SettingsModule->RegisterSettings("Project", "Platforms", "iOSMetalQuality",
LOCTEXT("IOSMetalQualitySettingsName", "iOS Material Quality - Metal"),
LOCTEXT("IOSMetalQualitySettingsDescription", "Settings for iOS Metal material quality"),
IOSMaterialQualitySettings
);
}
}
}
virtual void ShutdownModule() override
{
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
if (SettingsModule != nullptr)
{
SettingsModule->UnregisterSettings("Project", "Platforms", "iOS");
SettingsModule->UnregisterSettings("Project", "Platforms", "iOSES2Quality");
SettingsModule->UnregisterSettings("Project", "Platforms", "iOSMetalQuality");
}
}
};
IMPLEMENT_MODULE(FIOSPlatformEditorModule, IOSPlatformEditor);
#undef LOCTEXT_NAMESPACE
@@ -0,0 +1,228 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "SlateFwd.h"
#include "Misc/Attribute.h"
#include "Input/Reply.h"
#include "Widgets/Views/STableViewBase.h"
#include "Widgets/Views/STableRow.h"
#include "IDetailCustomization.h"
#include "ShaderFormatsPropertyDetails.h"
class FMonitoredProcess;
class IDetailLayoutBuilder;
class IPropertyHandle;
class SEditableTextBox;
class SErrorText;
//////////////////////////////////////////////////////////////////////////
// FProvision structure
class FProvision
{
public:
FString Name;
FString FileName;
FString Status;
bool bDistribution;
bool bSelected;
bool bManuallySelected;
};
typedef TSharedPtr<class FProvision> ProvisionPtr;
typedef TSharedPtr<TArray<ProvisionPtr>> ProvisionListPtr;
//////////////////////////////////////////////////////////////////////////
// FCertificate structure
class FCertificate
{
public:
FString Name;
FString Status;
FString Expires;
bool bSelected;
bool bManuallySelected;
};
typedef TSharedPtr<class FCertificate> CertificatePtr;
typedef TSharedPtr<TArray<CertificatePtr>> CertificateListPtr;
//////////////////////////////////////////////////////////////////////////
// FIOSTargetSettingsCustomization
class FIOSTargetSettingsCustomization : public IDetailCustomization
{
public:
~FIOSTargetSettingsCustomization();
// Makes a new instance of this detail layout class for a specific detail view requesting it
static TSharedRef<IDetailCustomization> MakeInstance();
// IDetailCustomization interface
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailLayout) override;
// End of IDetailCustomization interface
private:
TArray<struct FPlatformIconInfo> IconNames;
TArray<struct FPlatformIconInfo> LaunchImageNames;
const FString EngineInfoPath;
const FString GameInfoPath;
const FString EngineGraphicsPath;
const FString GameGraphicsPath;
IDetailLayoutBuilder* SavedLayoutBuilder;
// Is the manifest writable?
TAttribute<bool> SetupForPlatformAttribute;
bool bProvisionInstalled;
bool bCertificateInstalled;
bool bShowAllProvisions;
bool bShowAllCertificates;
bool bManuallySelected;
TSharedPtr<FMonitoredProcess> IPPProcess;
FDelegateHandle TickerHandle;
TSharedPtr<TArray<ProvisionPtr>> ProvisionList;
TArray<ProvisionPtr> FilteredProvisionList;
TSharedPtr<SListView<ProvisionPtr> > ProvisionListView;
TSharedPtr<SWidgetSwitcher > ProvisionInfoSwitcher;
TSharedPtr<TArray<CertificatePtr>> CertificateList;
TArray<CertificatePtr> FilteredCertificateList;
TSharedPtr<SListView<CertificatePtr> > CertificateListView;
TSharedPtr<SWidgetSwitcher > CertificateInfoSwitcher;
TAttribute<bool> RunningIPPProcess;
TSharedPtr<IPropertyHandle> MobileProvisionProperty;
TSharedPtr<IPropertyHandle> SignCertificateProperty;
TSharedPtr<IPropertyHandle> ShaderVersionPropertyHandle;
TSharedPtr<IPropertyHandle> MinOSPropertyHandle;
TSharedPtr<IPropertyHandle> GLES2PropertyHandle;
TSharedPtr<IPropertyHandle> DevArmV7PropertyHandle;
TSharedPtr<IPropertyHandle> DevArmV7sPropertyHandle;
TSharedPtr<IPropertyHandle> ShipArmV7PropertyHandle;
TSharedPtr<IPropertyHandle> ShipArmV7sPropertyHandle;
TSharedPtr<IPropertyHandle> AutomaticSigningProperty;
FString SelectedProvision;
FString SelectedFile;
FString SelectedCert;
private:
FIOSTargetSettingsCustomization();
void BuildPListSection(IDetailLayoutBuilder& DetailLayout);
void BuildIconSection(IDetailLayoutBuilder& DetailLayout);
void BuildRemoteBuildingSection(IDetailLayoutBuilder& DetailLayout);
// Navigates to the plist in explorer or finder
FReply OpenPlistFolder();
// Copies the setup files for the platform into the project
void CopySetupFilesIntoProject();
// Builds an image row
void BuildImageRow(class IDetailLayoutBuilder& DetailLayout, class IDetailCategoryBuilder& Category, const struct FPlatformIconInfo& Info, const FVector2D& MaxDisplaySize);
// Install the provision
FReply OnInstallProvisionClicked();
// Install the provision
FReply OnInstallCertificateClicked();
// certificate request
FReply OnCertificateRequestClicked();
// ssh key request
FReply OnGenerateSSHKey();
// Get the image to display for the provision status
const FSlateBrush* GetProvisionStatus() const;
// Get the image to display for the certificate status
const FSlateBrush* GetCertificateStatus() const;
// find the installed certificates and provisions
void FindRequiredFiles();
// Update the provision status
void UpdateStatus();
// Update the ssh key status
void UpdateSSHStatus();
// status tick delay
bool UpdateStatusDelegate(float delay);
// handle provision list generate row
TSharedRef<ITableRow> HandleProvisionListGenerateRow( ProvisionPtr Provision, const TSharedRef<STableViewBase>& OwnerTable );
// handle certificate list generate row
TSharedRef<ITableRow> HandleCertificateListGenerateRow( CertificatePtr Certificate, const TSharedRef<STableViewBase>& OwnerTable );
// handle which set of provisions to view
void HandleAllProvisionsHyperlinkNavigate( bool AllProvisions );
// handle which set of provisions to view
void HandleAllCertificatesHyperlinkNavigate( bool AllCertificates );
// filter the lists based on the settings
void FilterLists();
// returns whether we are importing or not
bool IsImportEnabled() const;
// updates the bundle identifier if it is valid and checks for a matching provision/certificate
void OnBundleIdentifierChanged(const FText& NewText, ETextCommit::Type, TSharedRef<IPropertyHandle> InPropertyHandle);
// posts an error if the bundle identifier has become invalid
void OnBundleIdentifierTextChanged(const FText& NewText, ETextCommit::Type, TSharedRef<IPropertyHandle> InPropertyHandle);
// returns true if the given string is a valid bundle identifier
bool IsBundleIdentifierValid(const FString& inIdentifier);
// updates the text in the ini file and checks for a valid provision/certificate
void OnRemoteServerChanged(const FText& NewText, ETextCommit::Type, TSharedRef<IPropertyHandle> InPropertyHandle);
void HandleProvisionChanged(FString Provision);
void HandleCertificateChanged(FString Certificate);
/** Delegate handler to get the list of shader standards */
TSharedRef<SWidget> OnGetShaderVersionContent();
/** Delegate handler to get the description of the shader standard */
FText GetShaderVersionDesc() const;
/** Delegate handler to get the list of shader standards */
TSharedRef<SWidget> OnGetMinVersionContent();
/** Delegate handler to get the description of the shader standard */
FText GetMinVersionDesc() const;
void SetShaderStandard(int32 Value);
void UpdateShaderStandardWarning();
void UpdateOSVersionWarning();
void UpdateGLVersionWarning();
void SetMinVersion(int32 Value);
void HandleGLES2CheckBoxCheckStateChanged(ECheckBoxState NewState);
//
FText GetBundleText(TSharedRef<IPropertyHandle> InPropertyHandle) const;
TSharedPtr< SEditableTextBox > BundleIdTextBox;
/** Reference to the shader version property warning text box. */
TSharedPtr< SErrorText > ShaderVersionWarningTextBox;
/** Reference to the shader version property warning text box. */
TSharedPtr< SErrorText > IOSVersionWarningTextBox;
/** Reference to the os version property warning text box. */
TSharedPtr< SErrorText > GLVersionWarningTextBox;
};
@@ -0,0 +1,188 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Styling/SlateColor.h"
#include "Widgets/SWidget.h"
#include "Layout/Margin.h"
#include "Widgets/SNullWidget.h"
#include "Widgets/Views/STableViewBase.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Styling/SlateTypes.h"
#include "Widgets/Layout/SBox.h"
#include "Widgets/Views/STableRow.h"
#include "IOSTargetSettingsCustomization.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/Input/SCheckBox.h"
#include "Widgets/Views/SListView.h"
#include "SlateOptMacros.h"
DECLARE_DELEGATE_OneParam(FOnCertificateChanged, FString);
/**
* Implements a row widget for the certificate list view.
*/
class SCertificateListRow
: public SMultiColumnTableRow<CertificatePtr>
{
public:
SLATE_BEGIN_ARGS(SCertificateListRow) { }
SLATE_ARGUMENT(CertificatePtr, Certificate)
SLATE_ARGUMENT(CertificateListPtr, CertificateList)
SLATE_EVENT(FOnCertificateChanged, OnCertificateChanged)
SLATE_END_ARGS()
public:
/**
* Constructs the widget.
*
* @param InArgs The arguments.
*/
void Construct( const FArguments& InArgs, const TSharedRef<STableViewBase>& InOwnerTableView )
{
Certificate = InArgs._Certificate;
CertificateList = InArgs._CertificateList;
OnCertificateChanged_Handler = InArgs._OnCertificateChanged;
SMultiColumnTableRow<CertificatePtr>::Construct(FSuperRowType::FArguments(), InOwnerTableView);
}
public:
/**
* Generates the widget for the specified column.
*
* @param ColumnName The name of the column to generate the widget for.
* @return The widget.
*/
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
virtual TSharedRef<SWidget> GenerateWidgetForColumn( const FName& ColumnName ) override
{
if (ColumnName == TEXT("Selected"))
{
return SNew(SCheckBox)
.IsChecked(this, &SCertificateListRow::HandleChecked)
.OnCheckStateChanged(this, &SCertificateListRow::HandleCheckStateChanged);
}
else if (ColumnName == TEXT("Name"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(this, &SCertificateListRow::HandleSelectedColorAndOpacity)
.Text(this, &SCertificateListRow::HandleNameText)
];
}
else if (ColumnName == TEXT("Status"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(this, &SCertificateListRow::HandleStatusTextColorAndOpacity)
.Text(this, &SCertificateListRow::HandleStatusTextBlockText)
];
}
else if (ColumnName == TEXT("Expires"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(this, &SCertificateListRow::HandleSelectedColorAndOpacity)
.Text(this, &SCertificateListRow::HandleExpiresText)
];
}
return SNullWidget::NullWidget;
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
private:
// Callback for getting the text in the 'Name' column.
FText HandleNameText( ) const
{
return FText::FromString(Certificate->Name);
}
// Callback for getting the status text.
FText HandleStatusTextBlockText( ) const
{
if (Certificate->Status == TEXT("EXPIRED"))
{
return FText::FromString(TEXT("Expired"));
}
return FText::FromString(TEXT("Valid"));
}
// Callback for getting the status text color.
FSlateColor HandleStatusTextColorAndOpacity( ) const
{
if (Certificate->Status == TEXT("EXPIRED"))
{
return FSlateColor(FLinearColor(1.0f, 0.0f, 0.0f));
}
else if (Certificate->bSelected)
{
return FSlateColor(FLinearColor(0.0f, 1.0f, 0.0f));
}
return FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f));
}
// Callback for getting the status text color.
FSlateColor HandleSelectedColorAndOpacity( ) const
{
if (Certificate->bSelected)
{
return FSlateColor(FLinearColor(0.0f, 1.0f, 0.0f));
}
return FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f));
}
// Callback for getting the text in the 'Expires' column.
FText HandleExpiresText( ) const
{
return FText::FromString(Certificate->Expires);
}
ECheckBoxState HandleChecked() const
{
return Certificate->bManuallySelected ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
}
void HandleCheckStateChanged(ECheckBoxState InState)
{
Certificate->bManuallySelected = InState == ECheckBoxState::Checked;
// update the property
if (OnCertificateChanged_Handler.IsBound())
{
OnCertificateChanged_Handler.Execute(Certificate->bManuallySelected ? Certificate->Name : "");
}
// disable any other objects
for (int32 Idx = 0; Idx < CertificateList->Num(); ++Idx)
{
if ((*CertificateList)[Idx] != Certificate && (*CertificateList)[Idx]->bManuallySelected)
{
(*CertificateList)[Idx]->bManuallySelected = false;
}
}
}
private:
// Holds the target device service used to populate this row.
CertificatePtr Certificate;
CertificateListPtr CertificateList;
FOnCertificateChanged OnCertificateChanged_Handler;
};
@@ -0,0 +1,244 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Styling/SlateColor.h"
#include "Widgets/SWidget.h"
#include "Layout/Margin.h"
#include "Widgets/SNullWidget.h"
#include "Widgets/Views/STableViewBase.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Styling/SlateTypes.h"
#include "Misc/Paths.h"
#include "Brushes/SlateNoResource.h"
#include "Widgets/Layout/SBox.h"
#include "Widgets/Views/STableRow.h"
#include "IOSTargetSettingsCustomization.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/Input/SCheckBox.h"
#include "Widgets/Views/SListView.h"
#include "Brushes/SlateImageBrush.h"
#include "SlateOptMacros.h"
#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( FPaths::EngineContentDir() / TEXT("Editor/Slate") / RelativePath + TEXT(".png"), __VA_ARGS__ )
DECLARE_DELEGATE_OneParam(FOnProvisionChanged, FString);
/**
* Implements a row widget for the provision list view.
*/
class SProvisionListRow
: public SMultiColumnTableRow<ProvisionPtr>
{
public:
SLATE_BEGIN_ARGS(SProvisionListRow) { }
SLATE_ARGUMENT(ProvisionPtr, Provision)
SLATE_ARGUMENT(ProvisionListPtr, ProvisionList)
SLATE_EVENT(FOnProvisionChanged, OnProvisionChanged)
SLATE_END_ARGS()
public:
/**
* Constructs the widget.
*
* @param InArgs The arguments.
*/
void Construct( const FArguments& InArgs, const TSharedRef<STableViewBase>& InOwnerTableView )
{
Provision = InArgs._Provision;
ProvisionList = InArgs._ProvisionList;
OnProvisionChanged_Handler = InArgs._OnProvisionChanged;
SMultiColumnTableRow<ProvisionPtr>::Construct(FSuperRowType::FArguments(), InOwnerTableView);
/* Set images for various SCheckBox states ... */
if (!bInitialized)
{
ProvisionCheckBoxStyle = FCheckBoxStyle()
.SetCheckBoxType(ESlateCheckBoxType::CheckBox)
.SetUncheckedImage( FSlateNoResource() )
.SetUncheckedHoveredImage( FSlateNoResource() )
.SetUncheckedPressedImage( FSlateNoResource() )
.SetCheckedImage( IMAGE_BRUSH( "Automation/Success", FVector2D(16.0f, 16.0f) ) )
.SetCheckedHoveredImage( IMAGE_BRUSH( "Automation/Success", FVector2D(16.0f, 16.0f), FLinearColor( 0.5f, 0.5f, 0.5f ) ) )
.SetCheckedPressedImage( IMAGE_BRUSH( "Automation/Success", FVector2D(16.0f, 16.0f) ) )
.SetUndeterminedImage(FSlateNoResource() )
.SetUndeterminedHoveredImage( FSlateNoResource() )
.SetUndeterminedPressedImage( FSlateNoResource() );
bInitialized = true;
}
}
public:
/**
* Generates the widget for the specified column.
*
* @param ColumnName The name of the column to generate the widget for.
* @return The widget.
*/
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
virtual TSharedRef<SWidget> GenerateWidgetForColumn( const FName& ColumnName ) override
{
if (ColumnName == TEXT("Selected"))
{
return SNew(SCheckBox)
.IsChecked(this, &SProvisionListRow::HandleChecked)
.OnCheckStateChanged(this, &SProvisionListRow::HandleCheckStateChanged);
}
else if (ColumnName == TEXT("Name"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(this, &SProvisionListRow::HandleSelectedColorAndOpacity)
.Text(this, &SProvisionListRow::HandleNameText)
];
}
else if (ColumnName == TEXT("File"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(this, &SProvisionListRow::HandleSelectedColorAndOpacity)
.Text(this, &SProvisionListRow::HandleFileText)
];
}
else if (ColumnName == TEXT("Status"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.ColorAndOpacity(this, &SProvisionListRow::HandleStatusTextColorAndOpacity)
.Text(this, &SProvisionListRow::HandleStatusTextBlockText)
];
}
else if (ColumnName == TEXT("Distribution"))
{
return SNew(SBox)
.Padding(FMargin(4.0f, 0.0f))
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(SCheckBox)
.IsChecked(this, &SProvisionListRow::HandleDistribution)
.Style(&ProvisionCheckBoxStyle)
];
}
return SNullWidget::NullWidget;
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
private:
// Callback for getting the text in the 'Name' column.
FText HandleNameText( ) const
{
return FText::FromString(Provision->Name);
}
// Callback for getting the text in the 'File' column.
FText HandleFileText( ) const
{
return FText::FromString(Provision->FileName);
}
// Callback for getting the status text.
FText HandleStatusTextBlockText( ) const
{
if (Provision->Status == TEXT("NO_MATCH"))
{
return FText::FromString(TEXT("Identifier Not Matched"));
}
else if (Provision->Status == TEXT("NO_CERT"))
{
return FText::FromString(TEXT("No Valid Certificate Found"));
}
else if (Provision->Status == TEXT("EXPIRED"))
{
return FText::FromString(TEXT("Expired"));
}
return FText::FromString(TEXT("Valid"));
}
// Callback for getting the status text color.
FSlateColor HandleStatusTextColorAndOpacity( ) const
{
if (Provision->Status == TEXT("NO_MATCH"))
{
return FSlateColor(FLinearColor(1.0f, 1.0f, 0.0f));
}
else if (Provision->Status == TEXT("NO_CERT") || Provision->Status == TEXT("EXPIRED"))
{
return FSlateColor(FLinearColor(1.0f, 0.0f, 0.0f));
}
else if (Provision->bSelected)
{
return FSlateColor(FLinearColor(0.0f, 1.0f, 0.0f));
}
return FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f));
}
// Callback for getting the status text color.
FSlateColor HandleSelectedColorAndOpacity( ) const
{
if (Provision->bSelected)
{
return FSlateColor(FLinearColor(0.0f, 1.0f, 0.0f));
}
return FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f));
}
// Callback to determine distribution
ECheckBoxState HandleDistribution( ) const
{
return Provision->bDistribution ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
}
ECheckBoxState HandleChecked() const
{
return Provision->bManuallySelected ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
}
void HandleCheckStateChanged(ECheckBoxState InState)
{
Provision->bManuallySelected = InState == ECheckBoxState::Checked;
// update the property
if (OnProvisionChanged_Handler.IsBound())
{
OnProvisionChanged_Handler.Execute(Provision->bManuallySelected ? Provision->FileName : "");
}
// disable any other objects
for (int32 Idx = 0; Idx < ProvisionList->Num(); ++Idx)
{
if ((*ProvisionList)[Idx] != Provision && (*ProvisionList)[Idx]->bManuallySelected)
{
(*ProvisionList)[Idx]->bManuallySelected = false;
}
}
}
private:
// Holds the target device service used to populate this row.
ProvisionPtr Provision;
ProvisionListPtr ProvisionList;
FOnProvisionChanged OnProvisionChanged_Handler;
static bool bInitialized;
static FCheckBoxStyle ProvisionCheckBoxStyle;
};