2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "TranslationEditorPrivatePCH.h"
|
|
|
|
|
#include "ModuleManager.h"
|
|
|
|
|
#include "TranslationEditor.h"
|
|
|
|
|
//#include "Toolkits/ToolkitManager.h"
|
|
|
|
|
#include "WorkspaceMenuStructureModule.h"
|
|
|
|
|
#include "MessageLogModule.h"
|
|
|
|
|
|
|
|
|
|
class FTranslationEditor;
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE( FTranslationEditorModule, TranslationEditor );
|
|
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "TranslationEditorModule"
|
|
|
|
|
|
|
|
|
|
const FName FTranslationEditorModule::TranslationEditorAppIdentifier( TEXT( "TranslationEditorApp" ) );
|
|
|
|
|
|
|
|
|
|
void FTranslationEditorModule::StartupModule()
|
|
|
|
|
{
|
|
|
|
|
#if WITH_UNREAL_DEVELOPER_TOOLS
|
|
|
|
|
// create a message log for source control to use
|
|
|
|
|
FMessageLogModule& MessageLogModule = FModuleManager::LoadModuleChecked<FMessageLogModule>("MessageLog");
|
|
|
|
|
MessageLogModule.RegisterLogListing("TranslationEditor", LOCTEXT("TranslationEditorLogLabel", "Translation Editor"));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
MenuExtensibilityManager = MakeShareable(new FExtensibilityManager);
|
|
|
|
|
ToolbarExtensibilityManager = MakeShareable(new FExtensibilityManager);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FTranslationEditorModule::ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
MenuExtensibilityManager.Reset();
|
2015-02-19 20:53:05 -05:00
|
|
|
TranslationPickerManager::ClosePickerWindow();
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#if WITH_UNREAL_DEVELOPER_TOOLS
|
|
|
|
|
// unregister message log
|
|
|
|
|
FMessageLogModule& MessageLogModule = FModuleManager::LoadModuleChecked<FMessageLogModule>("MessageLog");
|
|
|
|
|
MessageLogModule.UnregisterLogListing("TranslationEditor");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
TSharedRef<FTranslationEditor> FTranslationEditorModule::CreateTranslationEditor(const FString& ManifestFile, const FString& ArchiveFile)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2014-04-02 18:09:23 -04:00
|
|
|
TSharedRef< FTranslationDataManager > DataManager = MakeShareable( new FTranslationDataManager(ManifestFile, ArchiveFile) );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
GWarn->BeginSlowTask(LOCTEXT("BuildingUserInterface", "Building Translation Editor UI..."), true);
|
|
|
|
|
|
2014-04-02 18:09:23 -04:00
|
|
|
TSharedRef< FTranslationEditor > NewTranslationEditor( FTranslationEditor::Create(DataManager, ManifestFile, ArchiveFile) );
|
2014-04-23 18:47:10 -04:00
|
|
|
NewTranslationEditor->InitTranslationEditor( EToolkitMode::Standalone, TSharedPtr<IToolkitHost>() );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
GWarn->EndSlowTask();
|
|
|
|
|
|
|
|
|
|
return NewTranslationEditor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|