Files
UnrealEngineUWP/Engine/Source/Editor/UndoHistory/Private/UndoHistoryModule.cpp
Tim Smith c93fc3201a Fixing PVS 7.7 Issues:
warning V1043: A global object variable 'XYZ' is declared in the header. Multiple copies of it will be created in all translation units that include this header

When we are 100% C++17, we could use the inline keyword instead of making things extern.

#rb trivial
#jira UE-91644

[CL 15048553 by Tim Smith in ue5-main branch]
2021-01-12 09:50:59 -04:00

46 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "UndoHistoryModule.h"
#include "EditorStyleSet.h"
#include "Widgets/SUndoHistory.h"
#include "Widgets/Docking/SDockTab.h"
#define LOCTEXT_NAMESPACE "FUndoHistoryModule"
const FName UndoHistoryTabName("UndoHistory");
void FUndoHistoryModule::StartupModule()
{
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(UndoHistoryTabName, FOnSpawnTab::CreateRaw(this, &FUndoHistoryModule::HandleSpawnSettingsTab))
.SetDisplayName(NSLOCTEXT("FUndoHistoryModule", "UndoHistoryTabTitle", "Undo History"))
.SetTooltipText(NSLOCTEXT("FUndoHistoryModule", "UndoHistoryTooltipText", "Open the Undo History tab."))
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "UndoHistory.TabIcon"))
.SetAutoGenerateMenuEntry(false);
}
void FUndoHistoryModule::ShutdownModule()
{
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(UndoHistoryTabName);
}
bool FUndoHistoryModule::SupportsDynamicReloading()
{
return true;
}
TSharedRef<SDockTab> FUndoHistoryModule::HandleSpawnSettingsTab(const FSpawnTabArgs& SpawnTabArgs)
{
const TSharedRef<SDockTab> DockTab = SNew(SDockTab)
.TabRole(ETabRole::NomadTab);
DockTab->SetContent(SNew(SUndoHistory));
return DockTab;
}
IMPLEMENT_MODULE(FUndoHistoryModule, UndoHistory);
#undef LOCTEXT_NAMESPACE