2016-12-08 08:52:44 -05:00
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
2014-09-09 12:20:43 -04:00
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "Widgets/Deploy/SProjectLauncherDeployPage.h"
# include "Widgets/SBoxPanel.h"
# include "SlateOptMacros.h"
# include "Textures/SlateIcon.h"
# include "Framework/Commands/UIAction.h"
# include "Widgets/Layout/SBorder.h"
# include "Widgets/Images/SImage.h"
# include "Widgets/Text/STextBlock.h"
# include "Framework/MultiBox/MultiBoxBuilder.h"
# include "Widgets/Input/SComboButton.h"
# include "EditorStyleSet.h"
# include "Widgets/Deploy/SProjectLauncherDeployFileServerSettings.h"
# include "Widgets/Deploy/SProjectLauncherDeployToDeviceSettings.h"
# include "Widgets/Deploy/SProjectLauncherDeployRepositorySettings.h"
2014-09-09 12:20:43 -04:00
# define LOCTEXT_NAMESPACE "SProjectLauncherDevicesPage"
/* SProjectLauncherProfilePage structors
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
SProjectLauncherDeployPage : : ~ SProjectLauncherDeployPage ( )
{
if ( Model . IsValid ( ) )
{
Model - > OnProfileSelected ( ) . RemoveAll ( this ) ;
}
}
/* SProjectLauncherDevicesPage interface
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SProjectLauncherDeployPage : : Construct ( const FArguments & InArgs , const FProjectLauncherModelRef & InModel , bool IsFromRepository )
{
Model = InModel ;
// create deployment mode menu
FMenuBuilder DeploymentModeMenuBuilder ( true , NULL ) ;
{
FUIAction FileServerAction ( FExecuteAction : : CreateSP ( this , & SProjectLauncherDeployPage : : HandleDeploymentModeMenuEntryClicked , ELauncherProfileDeploymentModes : : FileServer ) ) ;
DeploymentModeMenuBuilder . AddMenuEntry ( LOCTEXT ( " FileServerAction " , " File server " ) , LOCTEXT ( " FileServerActionHint " , " Use a file server to deploy game content on the fly. " ) , FSlateIcon ( ) , FileServerAction ) ;
FUIAction CopyToDeviceAction ( FExecuteAction : : CreateSP ( this , & SProjectLauncherDeployPage : : HandleDeploymentModeMenuEntryClicked , ELauncherProfileDeploymentModes : : CopyToDevice ) ) ;
DeploymentModeMenuBuilder . AddMenuEntry ( LOCTEXT ( " CopyToDeviceAction " , " Copy to device " ) , LOCTEXT ( " CopyToDeviceActionHint " , " Copy the entire build to the device. " ) , FSlateIcon ( ) , CopyToDeviceAction ) ;
FUIAction DoNotDeployAction ( FExecuteAction : : CreateSP ( this , & SProjectLauncherDeployPage : : HandleDeploymentModeMenuEntryClicked , ELauncherProfileDeploymentModes : : DoNotDeploy ) ) ;
DeploymentModeMenuBuilder . AddMenuEntry ( LOCTEXT ( " DoNotDeployAction " , " Do not deploy " ) , LOCTEXT ( " DoNotDeployActionHint " , " Do not deploy the build at this time. " ) , FSlateIcon ( ) , DoNotDeployAction ) ;
FUIAction CopyRepositoryAction ( FExecuteAction : : CreateSP ( this , & SProjectLauncherDeployPage : : HandleDeploymentModeMenuEntryClicked , ELauncherProfileDeploymentModes : : CopyRepository ) ) ;
DeploymentModeMenuBuilder . AddMenuEntry ( LOCTEXT ( " CopyRepositoryAction " , " Copy repository " ) , LOCTEXT ( " CopyRepositoryActionHint " , " Copy a build from a repository to the device. " ) , FSlateIcon ( ) , CopyRepositoryAction ) ;
}
ChildSlot
[
SNew ( SVerticalBox )
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
[
SNew ( SHorizontalBox )
. Visibility ( IsFromRepository ? EVisibility : : Hidden : EVisibility : : Visible )
+ SHorizontalBox : : Slot ( )
. FillWidth ( 1.0f )
. VAlign ( VAlign_Center )
[
SNew ( STextBlock )
. Text ( LOCTEXT ( " HowToDeployText " , " How would you like to deploy the build? " ) )
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
. Padding ( 8.0f , 0.0f , 0.0f , 0.0f )
[
// deployment mode menu
SNew ( SComboButton )
. ButtonContent ( )
[
SNew ( STextBlock )
. Text ( this , & SProjectLauncherDeployPage : : HandleDeploymentModeComboButtonContentText )
]
. ContentPadding ( FMargin ( 6.0f , 2.0f ) )
. MenuContent ( )
[
DeploymentModeMenuBuilder . MakeWidget ( )
]
]
]
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
. Padding ( 0.0f , 8.0f , 0.0f , 0.0f )
[
SNew ( SBorder )
. BorderImage ( FEditorStyle : : GetBrush ( " ToolPanel.GroupBorder " ) )
. Padding ( 8.0f )
. Visibility ( this , & SProjectLauncherDeployPage : : HandleValidationErrorIconVisibility , ELauncherProfileValidationErrors : : CopyToDeviceRequiresCookByTheBook )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( TEXT ( " Icons.Error " ) ) )
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
. Padding ( 4.0f , 0.0f )
. VAlign ( VAlign_Center )
[
SNew ( STextBlock )
. Text ( LOCTEXT ( " CopyToDeviceRequiresCookByTheBookText " , " This mode requires 'By The Book' cooking " ) )
]
]
]
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
. Padding ( 0.0f , 8.0f , 0.0f , 0.0f )
[
// file server settings area
SNew ( SProjectLauncherDeployFileServerSettings , InModel )
. Visibility ( this , & SProjectLauncherDeployPage : : HandleDeployFileServerSettingsVisibility )
]
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
. Padding ( 0.0f , 8.0f , 0.0f , 0.0f )
[
// deploy to devices settings area
SNew ( SProjectLauncherDeployToDeviceSettings , InModel )
. Visibility ( this , & SProjectLauncherDeployPage : : HandleDeployToDeviceSettingsVisibility )
]
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
. Padding ( 0.0f , 8.0f , 0.0f , 0.0f )
[
// deploy repository to devices settings area
SNew ( SProjectLauncherDeployRepositorySettings , InModel )
. Visibility ( this , & SProjectLauncherDeployPage : : HandleDeployRepositorySettingsVisibility )
]
] ;
Model - > OnProfileSelected ( ) . AddSP ( this , & SProjectLauncherDeployPage : : HandleProfileManagerProfileSelected ) ;
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
/* SProjectLauncherDevicesPage callbacks
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2015-01-07 09:52:40 -05:00
FText SProjectLauncherDeployPage : : HandleDeploymentModeComboButtonContentText ( ) const
2014-09-09 12:20:43 -04:00
{
ILauncherProfilePtr SelectedProfile = Model - > GetSelectedProfile ( ) ;
if ( SelectedProfile . IsValid ( ) )
{
ELauncherProfileDeploymentModes : : Type DeploymentMode = SelectedProfile - > GetDeploymentMode ( ) ;
if ( DeploymentMode = = ELauncherProfileDeploymentModes : : CopyToDevice )
{
2015-01-07 09:52:40 -05:00
return LOCTEXT ( " CopyToDeviceAction " , " Copy to device " ) ;
2014-09-09 12:20:43 -04:00
}
if ( DeploymentMode = = ELauncherProfileDeploymentModes : : DoNotDeploy )
{
2015-01-07 09:52:40 -05:00
return LOCTEXT ( " DoNotDeployAction " , " Do not deploy " ) ;
2014-09-09 12:20:43 -04:00
}
if ( DeploymentMode = = ELauncherProfileDeploymentModes : : FileServer )
{
2015-01-07 09:52:40 -05:00
return LOCTEXT ( " FileServerAction " , " File server " ) ;
2014-09-09 12:20:43 -04:00
}
if ( DeploymentMode = = ELauncherProfileDeploymentModes : : CopyRepository )
{
2015-01-07 09:52:40 -05:00
return LOCTEXT ( " CopyRepositoryAction " , " Copy repository " ) ;
2014-09-09 12:20:43 -04:00
}
2015-01-07 09:52:40 -05:00
return LOCTEXT ( " DeploymentModeComboButtonDefaultText " , " Select... " ) ;
2014-09-09 12:20:43 -04:00
}
2015-01-07 09:52:40 -05:00
return FText : : GetEmpty ( ) ;
2014-09-09 12:20:43 -04:00
}
void SProjectLauncherDeployPage : : HandleDeploymentModeMenuEntryClicked ( ELauncherProfileDeploymentModes : : Type DeploymentMode )
{
ILauncherProfilePtr SelectedProfile = Model - > GetSelectedProfile ( ) ;
if ( SelectedProfile . IsValid ( ) )
{
SelectedProfile - > SetDeploymentMode ( DeploymentMode ) ;
}
}
EVisibility SProjectLauncherDeployPage : : HandleDeployFileServerSettingsVisibility ( ) const
{
ILauncherProfilePtr SelectedProfile = Model - > GetSelectedProfile ( ) ;
if ( SelectedProfile . IsValid ( ) )
{
if ( SelectedProfile - > GetDeploymentMode ( ) = = ELauncherProfileDeploymentModes : : FileServer )
{
return EVisibility : : Visible ;
}
}
return EVisibility : : Collapsed ;
}
EVisibility SProjectLauncherDeployPage : : HandleDeployToDeviceSettingsVisibility ( ) const
{
ILauncherProfilePtr SelectedProfile = Model - > GetSelectedProfile ( ) ;
if ( SelectedProfile . IsValid ( ) )
{
if ( SelectedProfile - > GetDeploymentMode ( ) = = ELauncherProfileDeploymentModes : : CopyToDevice )
{
if ( ! SelectedProfile - > HasValidationError ( ELauncherProfileValidationErrors : : CopyToDeviceRequiresCookByTheBook ) )
{
return EVisibility : : Visible ;
}
}
}
return EVisibility : : Collapsed ;
}
EVisibility SProjectLauncherDeployPage : : HandleDeployRepositorySettingsVisibility ( ) const
{
ILauncherProfilePtr SelectedProfile = Model - > GetSelectedProfile ( ) ;
if ( SelectedProfile . IsValid ( ) )
{
if ( SelectedProfile - > GetDeploymentMode ( ) = = ELauncherProfileDeploymentModes : : CopyRepository )
{
return EVisibility : : Visible ;
}
}
return EVisibility : : Collapsed ;
}
void SProjectLauncherDeployPage : : HandleProfileManagerProfileSelected ( const ILauncherProfilePtr & SelectedProfile , const ILauncherProfilePtr & PreviousProfile )
{
}
EVisibility SProjectLauncherDeployPage : : HandleValidationErrorIconVisibility ( ELauncherProfileValidationErrors : : Type Error ) const
{
ILauncherProfilePtr SelectedProfile = Model - > GetSelectedProfile ( ) ;
if ( SelectedProfile . IsValid ( ) )
{
if ( SelectedProfile - > HasValidationError ( Error ) )
{
return EVisibility : : Visible ;
}
}
return EVisibility : : Collapsed ;
}
# undef LOCTEXT_NAMESPACE