2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "SessionFrontendPrivatePCH.h"
|
2014-10-09 12:34:55 -04:00
|
|
|
#include "WorkspaceMenuStructureModule.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
static const FName SessionFrontendTabName("SessionFrontend");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements the SessionFrontend module.
|
|
|
|
|
*/
|
|
|
|
|
class FSessionFrontendModule
|
|
|
|
|
: public ISessionFrontendModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
// ISessionFrontendModule interface
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
virtual TSharedRef<class SWidget> CreateSessionBrowser( const ISessionManagerRef& SessionManager ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return SNew(SSessionBrowser, SessionManager);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
virtual TSharedRef<class SWidget> CreateSessionConsole( const ISessionManagerRef& SessionManager ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
return SNew(SSessionConsole, SessionManager);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
// IModuleInterface interface
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
virtual void StartupModule( ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-10-09 12:34:55 -04:00
|
|
|
auto& TabSpawnerEntry = FGlobalTabmanager::Get()->RegisterNomadTabSpawner(SessionFrontendTabName, FOnSpawnTab::CreateRaw(this, &FSessionFrontendModule::SpawnSessionFrontendTab))
|
2014-03-14 14:13:41 -04:00
|
|
|
.SetDisplayName(NSLOCTEXT("FSessionFrontendModule", "FrontendTabTitle", "Session Frontend"))
|
|
|
|
|
.SetTooltipText(NSLOCTEXT("FSessionFrontendModule", "FrontendTooltipText", "Open the Session Frontend tab."))
|
|
|
|
|
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "SessionFrontEnd.TabIcon"));
|
2014-10-09 12:34:55 -04:00
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
TabSpawnerEntry.SetGroup(WorkspaceMenu::GetMenuStructure().GetDeveloperToolsMiscCategory());
|
|
|
|
|
#else
|
|
|
|
|
TabSpawnerEntry.SetGroup(WorkspaceMenu::GetMenuStructure().GetToolsCategory());
|
|
|
|
|
#endif
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
virtual void ShutdownModule( ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-10-09 12:34:55 -04:00
|
|
|
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(SessionFrontendTabName);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new session front-end tab.
|
|
|
|
|
*
|
|
|
|
|
* @param SpawnTabArgs - The arguments for the tab to spawn.
|
|
|
|
|
* @return The spawned tab.
|
|
|
|
|
*/
|
|
|
|
|
TSharedRef<SDockTab> SpawnSessionFrontendTab( const FSpawnTabArgs& SpawnTabArgs )
|
|
|
|
|
{
|
|
|
|
|
const TSharedRef<SDockTab> DockTab = SNew(SDockTab)
|
|
|
|
|
.TabRole(ETabRole::MajorTab);
|
|
|
|
|
|
|
|
|
|
DockTab->SetContent(SNew(SSessionFrontend, DockTab, SpawnTabArgs.GetOwnerWindow()));
|
|
|
|
|
|
|
|
|
|
return DockTab;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FSessionFrontendModule, SessionFrontend);
|