Files
UnrealEngineUWP/Engine/Source/Developer/MessageLog/Private/Presentation/MessageLogViewModel.cpp

153 lines
4.5 KiB
C++
Raw Normal View History

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
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 "Presentation/MessageLogViewModel.h"
#include "Misc/Paths.h"
#include "Misc/ConfigCacheIni.h"
#define LOCTEXT_NAMESPACE "MessageLog"
DEFINE_LOG_CATEGORY_STATIC(LogMessageLog, Log, All);
FMessageLogViewModel::FMessageLogViewModel( const TSharedPtr< FMessageLogModel >& InMessageLogModel )
: MessageLogModel( InMessageLogModel )
, SelectedLogListingViewModel( NULL )
{
}
FMessageLogViewModel::~FMessageLogViewModel()
{
check(MessageLogModel.IsValid());
MessageLogModel->OnChanged().RemoveAll( this );
}
void FMessageLogViewModel::Initialize()
{
check( MessageLogModel.IsValid() );
// Register with the model so that if it changes we get updates
MessageLogModel->OnChanged().AddSP( this, &FMessageLogViewModel::Update );
}
void FMessageLogViewModel::Update()
{
// Re-broadcasts to anything that is registered
ChangedEvent.Broadcast();
}
void FMessageLogViewModel::ChangeCurrentListingViewModel( const FName& LogName )
{
TSharedPtr<FMessageLogListingViewModel> LogListingViewModel = FindLogListingViewModel( LogName );
if( LogListingViewModel.IsValid() )
{
if ( FPaths::FileExists(GEditorPerProjectIni) )
{
GConfig->SetString( TEXT("MessageLog"), TEXT("LastLogListing"), *LogName.ToString(), GEditorPerProjectIni );
}
SelectedLogListingViewModel = LogListingViewModel;
SelectionChangedEvent.Broadcast();
}
}
TSharedPtr<FMessageLogListingViewModel> FMessageLogViewModel::GetCurrentListingViewModel() const
{
return SelectedLogListingViewModel;
}
FName FMessageLogViewModel::GetCurrentListingName() const
{
if( SelectedLogListingViewModel.IsValid() )
{
return SelectedLogListingViewModel->GetName();
}
return FName();
}
FString FMessageLogViewModel::GetCurrentListingLabel() const
{
if( SelectedLogListingViewModel.IsValid() )
{
return SelectedLogListingViewModel->GetLabel().ToString();
}
return FString();
}
TSharedRef<FMessageLogListingViewModel> FMessageLogViewModel::RegisterLogListingViewModel( const FName& LogName, const FText& LogLabel, const FMessageLogInitializationOptions& InitializationOptions )
{
check( LogName != NAME_None );
TSharedPtr< FMessageLogListingViewModel > LogListingViewModel = FindLogListingViewModel( LogName );
if( !LogListingViewModel.IsValid() )
{
LogListingViewModel = FMessageLogListingViewModel::Create( MessageLogModel->GetLogListingModel(LogName), LogLabel, InitializationOptions );
NameToViewModelMap.Add( LogName, LogListingViewModel );
UpdateListingViewModelArray();
}
else
{
// ViewModel may have been created earlier, as we can use it before any UI is constructed.
// Therefore we may need to set its label here (and its show filters flag, pages, etc.)
LogListingViewModel->SetLabel(LogLabel);
LogListingViewModel->SetShowFilters(InitializationOptions.bShowFilters);
LogListingViewModel->SetShowPages(InitializationOptions.bShowPages);
LogListingViewModel->SetDiscardDuplicates(InitializationOptions.bDiscardDuplicates);
LogListingViewModel->SetMaxPageCount(InitializationOptions.MaxPageCount);
}
return LogListingViewModel.ToSharedRef();
}
bool FMessageLogViewModel::UnregisterLogListingViewModel( const FName& LogName )
{
check( LogName != NAME_None );
return NameToViewModelMap.Remove( LogName ) > 0;
}
bool FMessageLogViewModel::IsRegisteredLogListingViewModel( const FName& LogName ) const
{
check( LogName != NAME_None );
return NameToViewModelMap.Find(LogName) != NULL;
}
TSharedPtr< FMessageLogListingViewModel > FMessageLogViewModel::FindLogListingViewModel( const FName& LogName ) const
{
check( LogName != NAME_None );
const TSharedPtr<FMessageLogListingViewModel>* ViewModel = NameToViewModelMap.Find(LogName);
if(ViewModel != NULL)
{
return *ViewModel;
}
return NULL;
}
TSharedRef< FMessageLogListingViewModel > FMessageLogViewModel::GetLogListingViewModel( const FName& LogName )
{
check( LogName != NAME_None );
TSharedPtr< FMessageLogListingViewModel > LogListingViewModel = FindLogListingViewModel( LogName );
if( !LogListingViewModel.IsValid() )
{
LogListingViewModel = FMessageLogListingViewModel::Create( MessageLogModel->GetLogListingModel(LogName), FText() );
NameToViewModelMap.Add( LogName, LogListingViewModel );
UpdateListingViewModelArray();
}
return LogListingViewModel.ToSharedRef();
}
void FMessageLogViewModel::UpdateListingViewModelArray()
{
ViewModelArray.Empty();
for(auto It = NameToViewModelMap.CreateConstIterator(); It; ++It)
{
if (It.Value()->ShouldShowInLogWindow())
{
ViewModelArray.Add(It.Value());
}
}
Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2771249 on 2015/11/18 by Joe.Tidmarsh Ensure that UCircularThrobber's Radius determines the widget's desired size when a child of UCanvasPanelSlot. #jira UE-23186 Change 2794402 on 2015/12/08 by Joe.Tidmarsh Reverting recent changes to Circular throbber. It's unintuative to enforce Size To Content. Will find some other solution. Change 2803507 on 2015/12/15 by Richard.TalbotWatkin BSP poly extrusion can now only be done in the normal direction of the poly. #jira UE-24168 - BSP face breaks off when extruding on Y or Z axes Change 2803510 on 2015/12/15 by Richard.TalbotWatkin Building new static mesh LODs now initializes override vertex colors based on LOD0. #jira UE-23747 - CLONE - if LODs are generated for meshes with vertex colors in a level the vertex colors dont propagate to the LOD in the level Change 2808877 on 2015/12/18 by Alexis.Matte Make sure the delta scale sign is swap when we have multiple axis with different sign current axis value #jira UE-21574 #codereview nick.darnell Change 2810114 on 2015/12/21 by Alexis.Matte #jira UE-23769 We now expose a message telling the user that we found some mesh that are not reference by any scene node in the fbx file. #codereview nick.darnell Change 2810211 on 2015/12/21 by Richard.TalbotWatkin Fixed issue with Show Only Selected not showing members of actor groups. #jira UE-24453 - CLONE - Show Selected is broken for certain Orion meshes Change 2811035 on 2015/12/22 by Alexis.Matte #jira UE-24671 Polish UI #codereview nick.darnell Change 2811123 on 2015/12/22 by Alexis.Matte #jira UE-21936 We now can decide which fbx sdk compatibility version we can use when exportting to a fbx file. #codereview nick.darnell Change 2812830 on 2015/12/28 by Richard.TalbotWatkin Prevent engine assets' properties from having project assets assigned to them. #jira UE-18215 - Details panel: prevent engine content from referencing game content Change 2812854 on 2015/12/28 by Richard.TalbotWatkin Fixed issue where floating windows were having their border size erroneously added again and again. Allowed PIE windows to not respect work area bounds if they are created centered, so that they can overlap off the edge of the screen. #jira UE-24465 - 10 Pixels Added to Width & Height of Floating Editor Windows Each Time Project is Reopened #jira UE-24364 - "Always Center Window to Screen" No Longer Functioning in New Editor Window (PIE) Change 2812875 on 2015/12/28 by Alexis.Matte #jira ue-22237 first implementation for skeletal mesh scene import and reimport. Small refator to remove duplicate code in different fbx list ui. #codereview nick.darnell Change 2813172 on 2015/12/29 by Alexis.Matte #jira ue-21656 Partial submit, the base code is there to add all light type with there properties. #codereview nick.darnell Change 2813403 on 2015/12/30 by Richard.TalbotWatkin PIE in New Editor Window now respects the Game Gets Mouse Control setting. This provides a workaround for UE-24824 where attempting to drag a PIE window fails due to the viewport capturing and locking the mouse to itself in FSceneViewport::OnFocusReceived. Change 2813429 on 2015/12/30 by Alexis.Matte #jira ue-21656 -spotlight and point light support fbx attenuation -fix the light orientation so now directional and spotlight point to the same direction of the fbx #codereview nick.darnell Change 2813456 on 2015/12/30 by Alexis.Matte #jira ue-21656 -Import the camera from fbx #codereview nick.darnell Change 2813457 on 2015/12/30 by Richard.TalbotWatkin Fixed issues with the code which determines whether the user is attempting to assign a game asset/class to an engine asset's property. #jira UE-18215 - Details panel: prevent engine content from referencing game content Change 2813475 on 2015/12/30 by Richard.TalbotWatkin Removed erroneous debug code. Change 2814451 on 2016/01/04 by Joe.Tidmarsh Fixed Tint colour for circular throbber. #jira UE-24445 Change 2814546 on 2016/01/04 by Richard.TalbotWatkin Force Message Log to update its category list if a new category is added while it is open. #jira UE-24266 - Message Log not updating Categories in Real-Time Change 2814613 on 2016/01/04 by Alexis.Matte [CL 2851481 by Nick Darnell in Main branch]
2016-02-01 14:57:29 -05:00
Update();
}
#undef LOCTEXT_NAMESPACE