2015-03-05 00:11:00 -05:00
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
2015-01-27 16:31:40 -05:00
# include "LocalizationDashboardPrivatePCH.h"
2015-01-29 17:59:14 -05:00
# include "LocalizationDashboard.h"
2015-01-27 16:31:40 -05:00
# include "SLocalizationDashboardTargetRow.h"
# include "SHyperlink.h"
# include "SLocalizationTargetEditor.h"
# include "SLocalizationTargetStatusButton.h"
# include "LocalizationConfigurationScript.h"
# include "LocalizationCommandletTasks.h"
2015-01-27 18:24:26 -05:00
# define LOCTEXT_NAMESPACE "LocalizationDashboardTargetRow"
2015-01-27 16:31:40 -05:00
void SLocalizationDashboardTargetRow : : Construct ( const FTableRowArgs & InArgs , const TSharedRef < STableViewBase > & OwnerTableView , const TSharedRef < IPropertyUtilities > & InPropertyUtilities , const TSharedRef < IPropertyHandle > & InTargetObjectPropertyHandle )
{
PropertyUtilities = InPropertyUtilities ;
TargetObjectPropertyHandle = InTargetObjectPropertyHandle ;
FSuperRowType : : Construct ( InArgs , OwnerTableView ) ;
}
TSharedRef < SWidget > SLocalizationDashboardTargetRow : : GenerateWidgetForColumn ( const FName & ColumnName )
{
TSharedPtr < SWidget > Return ;
if ( ColumnName = = " Target " )
{
// Target Name
Return = SNew ( SHyperlink )
. Text ( this , & SLocalizationDashboardTargetRow : : GetTargetName )
. OnNavigate ( this , & SLocalizationDashboardTargetRow : : OnNavigate ) ;
}
else if ( ColumnName = = " Status " )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
// Status icon button.
Return = SNew ( SLocalizationTargetStatusButton , * LocalizationTarget ) ;
}
}
else if ( ColumnName = = " Cultures " )
{
// Culture Names
Return = SNew ( STextBlock )
. Text ( this , & SLocalizationDashboardTargetRow : : GetCulturesText ) ;
}
else if ( ColumnName = = " WordCount " )
{
// Progress Bar and Word Counts
Return = SNew ( STextBlock )
. Text ( this , & SLocalizationDashboardTargetRow : : GetWordCountText ) ;
}
else if ( ColumnName = = " Actions " )
{
TSharedRef < SHorizontalBox > HorizontalBox = SNew ( SHorizontalBox ) ;
Return = HorizontalBox ;
// Gather
HorizontalBox - > AddSlot ( )
. FillWidth ( 1.0f )
. HAlign ( HAlign_Center )
. VAlign ( VAlign_Center )
[
SNew ( SButton )
. ButtonStyle ( FEditorStyle : : Get ( ) , TEXT ( " HoverHintOnly " ) )
2015-01-27 18:24:26 -05:00
. ToolTipText ( LOCTEXT ( " GatherButtonLabel " , " Gather " ) )
2015-01-27 16:31:40 -05:00
. OnClicked ( this , & SLocalizationDashboardTargetRow : : Gather )
. Content ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( " LocalizationDashboard.GatherTarget " ) )
]
] ;
// Refresh Word Counts
HorizontalBox - > AddSlot ( )
. FillWidth ( 1.0f )
. HAlign ( HAlign_Center )
. VAlign ( VAlign_Center )
[
SNew ( SButton )
. ButtonStyle ( FEditorStyle : : Get ( ) , TEXT ( " HoverHintOnly " ) )
2015-01-27 18:24:26 -05:00
. ToolTipText ( LOCTEXT ( " RefreshWordCountButtonLabel " , " Refresh " ) )
2015-01-27 16:31:40 -05:00
. OnClicked ( this , & SLocalizationDashboardTargetRow : : RefreshWordCount )
. Content ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( " LocalizationDashboard.RefreshWordCount " ) )
]
] ;
// Import All
HorizontalBox - > AddSlot ( )
. FillWidth ( 1.0f )
. HAlign ( HAlign_Center )
. VAlign ( VAlign_Center )
[
SNew ( SButton )
. ButtonStyle ( FEditorStyle : : Get ( ) , TEXT ( " HoverHintOnly " ) )
2015-01-27 18:24:26 -05:00
. ToolTipText ( LOCTEXT ( " ImportAllButtonLabel " , " Import All " ) )
2015-01-27 16:31:40 -05:00
. OnClicked ( this , & SLocalizationDashboardTargetRow : : ImportAll )
. Content ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( " LocalizationDashboard.ImportForAllCultures " ) )
]
] ;
// Export All
HorizontalBox - > AddSlot ( )
. FillWidth ( 1.0f )
. HAlign ( HAlign_Center )
. VAlign ( VAlign_Center )
[
SNew ( SButton )
. ButtonStyle ( FEditorStyle : : Get ( ) , TEXT ( " HoverHintOnly " ) )
2015-01-27 18:24:26 -05:00
. ToolTipText ( LOCTEXT ( " ExportAllButtonLabel " , " Export All " ) )
2015-01-27 16:31:40 -05:00
. OnClicked ( this , & SLocalizationDashboardTargetRow : : ExportAll )
. Content ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( " LocalizationDashboard.ExportForAllCultures " ) )
]
] ;
2015-01-30 17:29:25 -05:00
// Compile
HorizontalBox - > AddSlot ( )
. FillWidth ( 1.0f )
. HAlign ( HAlign_Center )
. VAlign ( VAlign_Center )
[
SNew ( SButton )
. ButtonStyle ( FEditorStyle : : Get ( ) , TEXT ( " HoverHintOnly " ) )
. ToolTipText ( LOCTEXT ( " CompileButtonLabel " , " Compile " ) )
. OnClicked ( this , & SLocalizationDashboardTargetRow : : Compile )
. Content ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( " LocalizationDashboard.CompileTarget " ) )
]
] ;
2015-01-27 16:31:40 -05:00
// Delete Target
HorizontalBox - > AddSlot ( )
. FillWidth ( 1.0f )
. HAlign ( HAlign_Center )
. VAlign ( VAlign_Center )
[
SNew ( SButton )
. ButtonStyle ( FEditorStyle : : Get ( ) , TEXT ( " HoverHintOnly " ) )
2015-01-27 18:24:26 -05:00
. ToolTipText ( LOCTEXT ( " DeleteButtonLabel " , " Delete " ) )
2015-01-27 16:31:40 -05:00
. OnClicked ( this , & SLocalizationDashboardTargetRow : : EnqueueDeletion )
. Content ( )
[
SNew ( SImage )
. Image ( FEditorStyle : : GetBrush ( " LocalizationDashboard.DeleteTarget " ) )
]
] ;
}
return Return . IsValid ( ) ? Return . ToSharedRef ( ) : SNullWidget : : NullWidget ;
}
ULocalizationTarget * SLocalizationDashboardTargetRow : : GetTarget ( ) const
{
if ( TargetObjectPropertyHandle . IsValid ( ) & & TargetObjectPropertyHandle - > IsValidHandle ( ) )
{
UObject * Object = nullptr ;
if ( FPropertyAccess : : Result : : Success = = TargetObjectPropertyHandle - > GetValue ( Object ) )
{
return Cast < ULocalizationTarget > ( Object ) ;
}
}
return nullptr ;
}
FLocalizationTargetSettings * SLocalizationDashboardTargetRow : : GetTargetSettings ( ) const
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
return LocalizationTarget ? & ( LocalizationTarget - > Settings ) : nullptr ;
}
FText SLocalizationDashboardTargetRow : : GetTargetName ( ) const
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
return LocalizationTarget ? FText : : FromString ( LocalizationTarget - > Settings . Name ) : FText : : GetEmpty ( ) ;
}
void SLocalizationDashboardTargetRow : : OnNavigate ( )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
2015-01-29 17:59:14 -05:00
FLocalizationDashboard * const LocalizationDashboard = FLocalizationDashboard : : Get ( ) ;
2015-01-27 16:31:40 -05:00
2015-01-29 17:59:14 -05:00
if ( LocalizationDashboard )
2015-01-27 16:31:40 -05:00
{
2015-01-29 17:59:14 -05:00
TargetEditorDockTab = LocalizationDashboard - > ShowTargetEditorTab ( LocalizationTarget ) ;
2015-01-27 16:31:40 -05:00
}
}
}
FText SLocalizationDashboardTargetRow : : GetCulturesText ( ) const
{
FLocalizationTargetSettings * const TargetSettings = GetTargetSettings ( ) ;
if ( TargetSettings )
{
TArray < FString > OrderedCultureNames ;
2015-04-22 16:39:20 -04:00
for ( const auto & CultureStatistics : TargetSettings - > SupportedCulturesStatistics )
2015-01-27 16:31:40 -05:00
{
2015-04-22 16:39:20 -04:00
OrderedCultureNames . Add ( CultureStatistics . CultureName ) ;
2015-01-27 16:31:40 -05:00
}
FString Result ;
for ( FString & CultureName : OrderedCultureNames )
{
const FCulturePtr Culture = FInternationalization : : Get ( ) . GetCulture ( CultureName ) ;
if ( Culture . IsValid ( ) )
{
const FString CultureDisplayName = Culture - > GetDisplayName ( ) ;
if ( ! Result . IsEmpty ( ) )
{
Result . Append ( TEXT ( " , " ) ) ;
}
Result . Append ( CultureDisplayName ) ;
}
}
return FText : : FromString ( Result ) ;
}
return FText : : GetEmpty ( ) ;
}
uint32 SLocalizationDashboardTargetRow : : GetWordCount ( ) const
{
FLocalizationTargetSettings * const TargetSettings = GetTargetSettings ( ) ;
2015-04-22 16:39:20 -04:00
return TargetSettings & & TargetSettings - > SupportedCulturesStatistics . IsValidIndex ( TargetSettings - > NativeCultureIndex ) ? TargetSettings - > SupportedCulturesStatistics [ TargetSettings - > NativeCultureIndex ] . WordCount : 0 ;
2015-01-27 16:31:40 -05:00
}
uint32 SLocalizationDashboardTargetRow : : GetNativeWordCount ( ) const
{
FLocalizationTargetSettings * const TargetSettings = GetTargetSettings ( ) ;
2015-04-22 16:39:20 -04:00
return TargetSettings & & TargetSettings - > SupportedCulturesStatistics . IsValidIndex ( TargetSettings - > NativeCultureIndex ) ? TargetSettings - > SupportedCulturesStatistics [ TargetSettings - > NativeCultureIndex ] . WordCount : 0 ;
2015-01-27 16:31:40 -05:00
}
FText SLocalizationDashboardTargetRow : : GetWordCountText ( ) const
{
return FText : : AsNumber ( GetWordCount ( ) ) ;
}
void SLocalizationDashboardTargetRow : : UpdateTargetFromReports ( )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
//TArray< TSharedPtr<IPropertyHandle> > WordCountPropertyHandles;
//const TSharedPtr<IPropertyHandle> TargetSettingsPropertyHandle = TargetEditor->GetTargetSettingsPropertyHandle();
//if (TargetSettingsPropertyHandle.IsValid() && TargetSettingsPropertyHandle->IsValidHandle())
//{
// const TSharedPtr<IPropertyHandle> NativeCultureStatisticsPropertyHandle = TargetSettingsPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FLocalizationTargetSettings, NativeCultureStatistics));
// if (NativeCultureStatisticsPropertyHandle.IsValid() && NativeCultureStatisticsPropertyHandle->IsValidHandle())
// {
// const TSharedPtr<IPropertyHandle> WordCountPropertyHandle = NativeCultureStatisticsPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FCultureStatistics, WordCount));
// if (WordCountPropertyHandle.IsValid() && WordCountPropertyHandle->IsValidHandle())
// {
// WordCountPropertyHandles.Add(WordCountPropertyHandle);
// }
// }
// const TSharedPtr<IPropertyHandle> SupportedCulturesStatisticsPropertyHandle = TargetSettingsPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FLocalizationTargetSettings, SupportedCulturesStatistics));
// if (SupportedCulturesStatisticsPropertyHandle.IsValid() && SupportedCulturesStatisticsPropertyHandle->IsValidHandle())
// {
// uint32 SupportedCultureCount = 0;
// SupportedCulturesStatisticsPropertyHandle->GetNumChildren(SupportedCultureCount);
// for (uint32 i = 0; i < SupportedCultureCount; ++i)
// {
// const TSharedPtr<IPropertyHandle> ElementPropertyHandle = SupportedCulturesStatisticsPropertyHandle->GetChildHandle(i);
// if (ElementPropertyHandle.IsValid() && ElementPropertyHandle->IsValidHandle())
// {
// const TSharedPtr<IPropertyHandle> WordCountPropertyHandle = SupportedCulturesStatisticsPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FCultureStatistics, WordCount));
// if (WordCountPropertyHandle.IsValid() && WordCountPropertyHandle->IsValidHandle())
// {
// WordCountPropertyHandles.Add(WordCountPropertyHandle);
// }
// }
// }
// }
//}
//for (const TSharedPtr<IPropertyHandle>& WordCountPropertyHandle : WordCountPropertyHandles)
//{
// WordCountPropertyHandle->NotifyPreChange();
//}
2015-03-09 15:09:46 -04:00
LocalizationTarget - > UpdateWordCountsFromCSV ( ) ;
LocalizationTarget - > UpdateStatusFromConflictReport ( ) ;
2015-01-27 16:31:40 -05:00
//for (const TSharedPtr<IPropertyHandle>& WordCountPropertyHandle : WordCountPropertyHandles)
//{
// WordCountPropertyHandle->NotifyPostChange();
//}
}
}
FReply SLocalizationDashboardTargetRow : : RefreshWordCount ( )
{
bool HasSucceeded = false ;
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
const TSharedPtr < SWindow > ParentWindow = FSlateApplication : : Get ( ) . FindWidgetWindow ( AsShared ( ) ) ;
2015-03-18 19:14:43 -04:00
LocalizationCommandletTasks : : GenerateWordCountReportForTarget ( ParentWindow . ToSharedRef ( ) , LocalizationTarget ) ;
2015-01-27 16:31:40 -05:00
UpdateTargetFromReports ( ) ;
}
return FReply : : Handled ( ) ;
}
FReply SLocalizationDashboardTargetRow : : Gather ( )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
// Save unsaved packages.
2015-02-27 04:17:41 -05:00
const bool bPromptUserToSave = true ;
const bool bSaveMapPackages = true ;
const bool bSaveContentPackages = true ;
const bool bFastSave = false ;
const bool bNotifyNoPackagesSaved = false ;
const bool bCanBeDeclined = true ;
2015-01-27 16:31:40 -05:00
bool DidPackagesNeedSaving ;
2015-02-27 04:17:41 -05:00
const bool WerePackagesSaved = FEditorFileUtils : : SaveDirtyPackages ( bPromptUserToSave , bSaveMapPackages , bSaveContentPackages , bFastSave , bNotifyNoPackagesSaved , bCanBeDeclined , & DidPackagesNeedSaving ) ;
2015-01-27 16:31:40 -05:00
if ( DidPackagesNeedSaving & & ! WerePackagesSaved )
{
// Give warning dialog.
const FText MessageText = NSLOCTEXT ( " LocalizationCultureActions " , " UnsavedPackagesWarningDialogMessage " , " There are unsaved changes. These changes may not be gathered from correctly. " ) ;
const FText TitleText = NSLOCTEXT ( " LocalizationCultureActions " , " UnsavedPackagesWarningDialogTitle " , " Unsaved Changes Before Gather " ) ;
switch ( FMessageDialog : : Open ( EAppMsgType : : OkCancel , MessageText , & TitleText ) )
{
case EAppReturnType : : Cancel :
{
return FReply : : Handled ( ) ;
}
break ;
}
}
// Execute gather.
const TSharedPtr < SWindow > ParentWindow = FSlateApplication : : Get ( ) . FindWidgetWindow ( AsShared ( ) ) ;
2015-03-09 15:38:32 -04:00
LocalizationCommandletTasks : : GatherTarget ( ParentWindow . ToSharedRef ( ) , LocalizationTarget ) ;
2015-01-27 16:31:40 -05:00
UpdateTargetFromReports ( ) ;
}
return FReply : : Handled ( ) ;
}
FReply SLocalizationDashboardTargetRow : : ImportAll ( )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
2015-01-30 16:29:01 -05:00
IDesktopPlatform * DesktopPlatform = FDesktopPlatformModule : : Get ( ) ;
if ( LocalizationTarget & & DesktopPlatform )
2015-01-27 16:31:40 -05:00
{
2015-01-30 16:29:01 -05:00
void * ParentWindowWindowHandle = NULL ;
2015-01-27 16:31:40 -05:00
const TSharedPtr < SWindow > ParentWindow = FSlateApplication : : Get ( ) . FindWidgetWindow ( AsShared ( ) ) ;
2015-01-30 16:29:01 -05:00
if ( ParentWindow . IsValid ( ) & & ParentWindow - > GetNativeWindow ( ) . IsValid ( ) )
{
ParentWindowWindowHandle = ParentWindow - > GetNativeWindow ( ) - > GetOSWindowHandle ( ) ;
}
2015-01-27 16:31:40 -05:00
2015-03-09 15:38:32 -04:00
const FString DefaultPath = FPaths : : ConvertRelativePathToFull ( LocalizationConfigurationScript : : GetDataDirectory ( LocalizationTarget ) ) ;
2015-01-30 16:29:01 -05:00
FText DialogTitle ;
{
FFormatNamedArguments FormatArguments ;
FormatArguments . Add ( TEXT ( " TargetName " ) , FText : : FromString ( LocalizationTarget - > Settings . Name ) ) ;
DialogTitle = FText : : Format ( LOCTEXT ( " ImportAllTranslationsForTargetDialogTitleFormat " , " Import All Translations for {TargetName} from Directory " ) , FormatArguments ) ;
}
// Prompt the user for the directory
FString OutputDirectory ;
if ( DesktopPlatform - > OpenDirectoryDialog ( ParentWindowWindowHandle , DialogTitle . ToString ( ) , DefaultPath , OutputDirectory ) )
{
2015-03-09 15:38:32 -04:00
LocalizationCommandletTasks : : ImportTarget ( ParentWindow . ToSharedRef ( ) , LocalizationTarget , TOptional < FString > ( OutputDirectory ) ) ;
2015-01-30 16:29:01 -05:00
UpdateTargetFromReports ( ) ;
}
2015-01-27 16:31:40 -05:00
}
return FReply : : Handled ( ) ;
}
FReply SLocalizationDashboardTargetRow : : ExportAll ( )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
2015-01-30 16:29:01 -05:00
IDesktopPlatform * DesktopPlatform = FDesktopPlatformModule : : Get ( ) ;
if ( LocalizationTarget & & DesktopPlatform )
2015-01-27 16:31:40 -05:00
{
2015-01-30 16:29:01 -05:00
void * ParentWindowWindowHandle = NULL ;
2015-01-27 16:31:40 -05:00
const TSharedPtr < SWindow > ParentWindow = FSlateApplication : : Get ( ) . FindWidgetWindow ( AsShared ( ) ) ;
2015-01-30 16:29:01 -05:00
if ( ParentWindow . IsValid ( ) & & ParentWindow - > GetNativeWindow ( ) . IsValid ( ) )
{
ParentWindowWindowHandle = ParentWindow - > GetNativeWindow ( ) - > GetOSWindowHandle ( ) ;
}
2015-03-09 15:38:32 -04:00
const FString DefaultPath = FPaths : : ConvertRelativePathToFull ( LocalizationConfigurationScript : : GetDataDirectory ( LocalizationTarget ) ) ;
2015-01-30 16:29:01 -05:00
FText DialogTitle ;
{
FFormatNamedArguments FormatArguments ;
FormatArguments . Add ( TEXT ( " TargetName " ) , FText : : FromString ( LocalizationTarget - > Settings . Name ) ) ;
DialogTitle = FText : : Format ( LOCTEXT ( " ExportAllTranslationsForTargetDialogTitleFormat " , " Export All Translations for {TargetName} to Directory " ) , FormatArguments ) ;
}
// Prompt the user for the directory
FString OutputDirectory ;
if ( DesktopPlatform - > OpenDirectoryDialog ( ParentWindowWindowHandle , DialogTitle . ToString ( ) , DefaultPath , OutputDirectory ) )
{
2015-03-09 15:38:32 -04:00
LocalizationCommandletTasks : : ExportTarget ( ParentWindow . ToSharedRef ( ) , LocalizationTarget , TOptional < FString > ( OutputDirectory ) ) ;
2015-01-30 16:29:01 -05:00
}
2015-01-27 16:31:40 -05:00
}
2015-01-30 17:29:25 -05:00
return FReply : : Handled ( ) ;
}
FReply SLocalizationDashboardTargetRow : : Compile ( )
{
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
// Execute compile.
const TSharedPtr < SWindow > ParentWindow = FSlateApplication : : Get ( ) . FindWidgetWindow ( AsShared ( ) ) ;
2015-03-09 15:38:32 -04:00
LocalizationCommandletTasks : : CompileTarget ( ParentWindow . ToSharedRef ( ) , LocalizationTarget ) ;
2015-01-30 17:29:25 -05:00
}
2015-01-27 16:31:40 -05:00
return FReply : : Handled ( ) ;
}
FReply SLocalizationDashboardTargetRow : : EnqueueDeletion ( )
{
PropertyUtilities - > EnqueueDeferredAction ( FSimpleDelegate : : CreateSP ( this , & SLocalizationDashboardTargetRow : : Delete ) ) ;
return FReply : : Handled ( ) ;
}
void SLocalizationDashboardTargetRow : : Delete ( )
{
static bool IsExecuting = false ;
if ( ! IsExecuting )
{
TGuardValue < bool > ReentranceGuard ( IsExecuting , true ) ;
ULocalizationTarget * const LocalizationTarget = GetTarget ( ) ;
if ( LocalizationTarget )
{
// Setup dialog for deleting target.
const FText FormatPattern = NSLOCTEXT ( " LocalizationDashboard " , " DeleteTargetConfirmationDialogMessage " , " This action can not be undone and data will be permanently lost. Are you sure you would like to delete {TargetName}? " ) ;
FFormatNamedArguments Arguments ;
Arguments . Add ( TEXT ( " TargetName " ) , FText : : FromString ( LocalizationTarget - > Settings . Name ) ) ;
2015-04-22 16:39:20 -04:00
const FText MessageText = FText : : Format ( FormatPattern , Arguments ) ;
const FText TitleText = NSLOCTEXT ( " LocalizationDashboard " , " DeleteTargetConfirmationDialogTitle " , " Confirm Target Deletion " ) ;
2015-01-27 16:31:40 -05:00
switch ( FMessageDialog : : Open ( EAppMsgType : : OkCancel , MessageText , & TitleText ) )
{
case EAppReturnType : : Ok :
{
2015-03-09 15:09:46 -04:00
LocalizationTarget - > DeleteFiles ( ) ;
2015-01-27 16:31:40 -05:00
// Close target editor.
if ( TargetEditorDockTab . IsValid ( ) )
{
const TSharedPtr < SDockTab > OldTargetEditorTab = TargetEditorDockTab . Pin ( ) ;
OldTargetEditorTab - > RequestCloseTab ( ) ;
}
// Remove this element from the parent array.
const TSharedPtr < IPropertyHandle > ParentPropertyHandle = TargetObjectPropertyHandle - > GetParentHandle ( ) ;
if ( ParentPropertyHandle . IsValid ( ) & & ParentPropertyHandle - > IsValidHandle ( ) )
{
const TSharedPtr < IPropertyHandleArray > ParentArrayPropertyHandle = ParentPropertyHandle - > AsArray ( ) ;
if ( ParentArrayPropertyHandle . IsValid ( ) )
{
ParentArrayPropertyHandle - > DeleteItem ( TargetObjectPropertyHandle - > GetIndexInArray ( ) ) ;
}
}
}
break ;
}
}
}
}
2015-01-27 18:24:26 -05:00
# undef LOCTEXT_NAMESPACE