2024-05-15 08:55:14 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
# include "TraceChannel.h"
2024-09-19 13:07:01 -04:00
# include "Internationalization/Internationalization.h"
2024-05-15 08:55:14 -04:00
# include "Internationalization/Text.h"
// TraceTools
# include "Services/ISessionTraceFilterService.h"
2024-09-19 13:07:01 -04:00
# define LOCTEXT_NAMESPACE "UE::TraceTools::FTraceChannel"
2024-05-15 08:55:14 -04:00
namespace UE : : TraceTools
{
2024-06-12 13:53:22 -04:00
FTraceChannel : : FTraceChannel ( FString InName ,
FString InDescription ,
FString InParentName ,
2024-06-20 11:11:22 -04:00
uint32 InId ,
2024-06-12 13:53:22 -04:00
bool bInEnabled ,
bool bInReadOnly ,
TSharedPtr < ISessionTraceFilterService > InFilterService )
: Name ( InName ) ,
Description ( InDescription ) ,
ParentName ( InParentName ) ,
2024-06-20 11:11:22 -04:00
Id ( InId ) ,
2024-06-12 13:53:22 -04:00
bFiltered ( ! bInEnabled ) ,
bIsPending ( false ) ,
bReadOnly ( bInReadOnly ) ,
FilterService ( InFilterService )
2024-05-15 08:55:14 -04:00
{
}
FText FTraceChannel : : GetDisplayText ( ) const
{
return FText : : FromString ( Name ) ;
}
2024-06-12 13:53:22 -04:00
FText FTraceChannel : : GetTooltipText ( ) const
{
2024-09-19 13:07:01 -04:00
FText ChannelTooltip = FText : : FromString ( Description ) ;
if ( bReadOnly )
{
if ( Description . EndsWith ( " . " ) )
{
ChannelTooltip = FText : : Format ( LOCTEXT ( " ChannelTooltipFmt1 " , " {0} This channel is readonly and can only be enabled from the command line. " ) , FText : : FromString ( Description ) ) ;
}
else
{
ChannelTooltip = FText : : Format ( LOCTEXT ( " ChannelTooltipFmt2 " , " {0}. This channel is readonly and can only be enabled from the command line. " ) , FText : : FromString ( Description ) ) ;
}
}
return ChannelTooltip ;
2024-06-12 13:53:22 -04:00
}
2024-05-15 08:55:14 -04:00
FString FTraceChannel : : GetName ( ) const
{
return Name ;
}
2024-06-12 13:53:22 -04:00
FString FTraceChannel : : GetDescription ( ) const
{
return Description ;
}
2024-05-15 08:55:14 -04:00
void FTraceChannel : : SetPending ( )
{
bIsPending = true ;
}
bool FTraceChannel : : IsReadOnly ( ) const
{
return bReadOnly ;
}
void FTraceChannel : : SetIsFiltered ( bool bState )
{
SetPending ( ) ;
FilterService - > SetObjectFilterState ( Name , ! bState ) ;
}
bool FTraceChannel : : IsFiltered ( ) const
{
return bFiltered ;
}
bool FTraceChannel : : IsPending ( ) const
{
return bIsPending ;
}
void FTraceChannel : : GetSearchString ( TArray < FString > & OutFilterStrings ) const
{
OutFilterStrings . Add ( Name ) ;
}
2024-09-19 13:07:01 -04:00
} // namespace UE::TraceTools
# undef LOCTEXT_NAMESPACE // UE::TraceTools::FTraceChannel