Files
UnrealEngineUWP/Engine/Source/Editor/TranslationEditor/Private/ITranslationEditor.cpp
Joe Conley ef4922e537 Translation Picker improvements:
- Can now start the translation picker from the main Window menu in the editor
- Disable "save" button for text that we can't find the manifest/archive data for
- Hover window now presents the information about an FText in a more readable format
- Fixed issue where the same FText info was not displayed twice in certain cases

[CL 2452676 by Joe Conley in Main branch]
2015-02-19 20:53:05 -05:00

56 lines
1.7 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "TranslationEditorPrivatePCH.h"
#include "ITranslationEditor.h"
#include "Editor/TranslationEditor/Private/TranslationPickerWidget.h"
/** To keep track of what translation editors are open editing which manifest files */
TMap<FString, ITranslationEditor*> ITranslationEditor::OpenTranslationEditors = TMap<FString, ITranslationEditor*>();
void ITranslationEditor::OpenTranslationEditor(const FString& InManifestFile, const FString& InArchiveFile)
{
// Only open a new translation editor if there isn't another one open for this archive file already
if (!OpenTranslationEditors.Contains(InArchiveFile))
{
FTranslationEditorModule& TranslationEditorModule = FModuleManager::LoadModuleChecked<FTranslationEditorModule>("TranslationEditor");
ITranslationEditor* NewTranslationEditor = (ITranslationEditor*)&(TranslationEditorModule.CreateTranslationEditor(InManifestFile, InArchiveFile).Get());
NewTranslationEditor->RegisterTranslationEditor();
}
else
{
// If already editing this archive file, flash the tab that contains the editor that has that file open
ITranslationEditor* OpenEditor = *OpenTranslationEditors.Find(InArchiveFile);
OpenEditor->FocusWindow();
}
}
void ITranslationEditor::OpenTranslationPicker()
{
if (!TranslationPickerManager::IsPickerWindowOpen())
{
TranslationPickerManager::OpenPickerWindow();
}
}
void ITranslationEditor::RegisterTranslationEditor()
{
ITranslationEditor::OpenTranslationEditors.Add(ArchiveFilePath, this);
}
void ITranslationEditor::UnregisterTranslationEditor()
{
OpenTranslationEditors.Remove(ArchiveFilePath);
}
bool ITranslationEditor::OnRequestClose()
{
ITranslationEditor::UnregisterTranslationEditor();
return true;
}