本文整理汇总了C++中IDesktopPlatform::OpenDirectoryDialog方法的典型用法代码示例。如果您正苦于以下问题:C++ IDesktopPlatform::OpenDirectoryDialog方法的具体用法?C++ IDesktopPlatform::OpenDirectoryDialog怎么用?C++ IDesktopPlatform::OpenDirectoryDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDesktopPlatform
的用法示例。
在下文中一共展示了IDesktopPlatform::OpenDirectoryDialog方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleBrowseButtonClicked
FReply SProjectLauncherDeployRepositorySettings::HandleBrowseButtonClicked( )
{
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if ( DesktopPlatform )
{
TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().FindWidgetWindow(AsShared());
void* ParentWindowHandle = (ParentWindow.IsValid() && ParentWindow->GetNativeWindow().IsValid()) ? ParentWindow->GetNativeWindow()->GetOSWindowHandle() : nullptr;
FString FolderName;
const bool bFolderSelected = DesktopPlatform->OpenDirectoryDialog(
ParentWindowHandle,
LOCTEXT("RepositoryBrowseTitle", "Choose a repository location").ToString(),
RepositoryPathTextBox->GetText().ToString(),
FolderName
);
if ( bFolderSelected )
{
if ( !FolderName.EndsWith(TEXT("/")) )
{
FolderName += TEXT("/");
}
RepositoryPathTextBox->SetText(FText::FromString(FolderName));
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
if(SelectedProfile.IsValid())
{
SelectedProfile->SetPackageDirectory(FolderName);
}
}
}
return FReply::Handled();
}
示例2: HandleBrowseButtonClicked
FReply SSessionLauncherDeployRepositorySettings::HandleBrowseButtonClicked( )
{
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if ( DesktopPlatform )
{
void* ParentWindowWindowHandle = NULL;
FString FolderName;
const FString Title = LOCTEXT("RepositoryBrowseTitle", "Choose a repository location").ToString();
const bool bFolderSelected = DesktopPlatform->OpenDirectoryDialog(
0,
Title,
RepositoryPathTextBox->GetText().ToString(),
FolderName
);
if ( bFolderSelected )
{
if ( !FolderName.EndsWith(TEXT("/")) )
{
FolderName += TEXT("/");
}
RepositoryPathTextBox->SetText(FText::FromString(FolderName));
ILauncherProfilePtr SelectedProfile = Model->GetSelectedProfile();
if(SelectedProfile.IsValid())
{
SelectedProfile->SetPackageDirectory(FolderName);
}
}
}
return FReply::Handled();
}
示例3: SearchForExport
void UJanusExporterTool::SearchForExport()
{
// If not prompting individual files, prompt the user to select a target directory.
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
void* ParentWindowWindowHandle = NULL;
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>(TEXT("MainFrame"));
const TSharedPtr<SWindow>& MainFrameParentWindow = MainFrameModule.GetParentWindow();
if (MainFrameParentWindow.IsValid() && MainFrameParentWindow->GetNativeWindow().IsValid())
{
ParentWindowWindowHandle = MainFrameParentWindow->GetNativeWindow()->GetOSWindowHandle();
}
FString FolderName;
const FString Title = NSLOCTEXT("UnrealEd", "ChooseADirectory", "Choose A Directory").ToString();
const bool bFolderSelected = DesktopPlatform->OpenDirectoryDialog(
ParentWindowWindowHandle,
Title,
ExportPath,
FolderName
);
if (bFolderSelected)
{
ExportPath = FolderName.Append("//");
}
}
示例4: ExportAll
FReply SLocalizationDashboardTargetRow::ExportAll()
{
ULocalizationTarget* const LocalizationTarget = GetTarget();
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if (LocalizationTarget && DesktopPlatform)
{
void* ParentWindowWindowHandle = NULL;
const TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().FindWidgetWindow(AsShared());
if (ParentWindow.IsValid() && ParentWindow->GetNativeWindow().IsValid())
{
ParentWindowWindowHandle = ParentWindow->GetNativeWindow()->GetOSWindowHandle();
}
const FString DefaultPath = FPaths::ConvertRelativePathToFull(LocalizationConfigurationScript::GetDataDirectory(LocalizationTarget->Settings));
FText DialogTitle;
{
FFormatNamedArguments FormatArguments;
FormatArguments.Add(TEXT("TargetName"), FText::FromString(LocalizationTarget->Settings.Name));
DialogTitle = FText::Format(LOCTEXT("ExportAllTranslationsForTargetDialogTitleFormat", "Export All Translations for {TargetName} to Directory"), FormatArguments);
}
// Prompt the user for the directory
FString OutputDirectory;
if (DesktopPlatform->OpenDirectoryDialog(ParentWindowWindowHandle, DialogTitle.ToString(), DefaultPath, OutputDirectory))
{
LocalizationCommandletTasks::ExportTarget(ParentWindow.ToSharedRef(), LocalizationTarget->Settings, TOptional<FString>(OutputDirectory));
}
}
return FReply::Handled();
}
示例5: ProfilerManager_LoadMultiple_Execute
void FProfilerActionManager::ProfilerManager_LoadMultiple_Execute()
{
// @see FStatConstants::StatsFileExtension
FString OutFolder;
const FString ProfilingDirectory = *FPaths::ConvertRelativePathToFull(*FPaths::ProfilingDir());
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
bool bOpened = false;
if (DesktopPlatform != NULL)
{
bOpened = DesktopPlatform->OpenDirectoryDialog(NULL,
LOCTEXT("ProfilerManager_Load_Desc", "Open capture folder...").ToString(),
ProfilingDirectory,
OutFolder);
}
if (bOpened == true)
{
This->ProfilerWindow.Pin()->MultiDumpBrowser->Clear();
if (!OutFolder.IsEmpty())
{
TArray<FString> FoundFiles;
FFileManagerGeneric::Get().FindFiles(FoundFiles, *OutFolder, TEXT(".ue4stats"));
for (FString &FilePath : FoundFiles)
{
const TCHAR* PathDelimiter = FPlatformMisc::GetDefaultPathSeparator();
SMultiDumpBrowser::FFileDescriptor *Desc = new SMultiDumpBrowser::FFileDescriptor();
Desc->FullPath = OutFolder + PathDelimiter + FilePath;
Desc->DisplayName = FilePath;
This->ProfilerWindow.Pin()->MultiDumpBrowser->AddFile(Desc);
}
This->ProfilerWindow.Pin()->MultiDumpBrowser->Update();
}
}
}
示例6: OnPickDirectory
FReply FDirectoryPathStructCustomization::OnPickDirectory(TSharedRef<IPropertyHandle> PropertyHandle, const bool bRelativeToGameContentDir, const bool bUseRelativePath, const bool bLongPackageName) const
{
FString Directory;
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if (DesktopPlatform)
{
TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().FindWidgetWindow(BrowseButton.ToSharedRef());
void* ParentWindowHandle = (ParentWindow.IsValid() && ParentWindow->GetNativeWindow().IsValid()) ? ParentWindow->GetNativeWindow()->GetOSWindowHandle() : nullptr;
FString StartDirectory = FEditorDirectories::Get().GetLastDirectory(ELastDirectory::GENERIC_IMPORT);
if (bRelativeToGameContentDir && !IsValidPath(StartDirectory, bRelativeToGameContentDir))
{
StartDirectory = AbsoluteGameContentDir;
}
// Loop until; a) the user cancels (OpenDirectoryDialog returns false), or, b) the chosen path is valid (IsValidPath returns true)
for (;;)
{
if (DesktopPlatform->OpenDirectoryDialog(ParentWindowHandle, LOCTEXT("FolderDialogTitle", "Choose a directory").ToString(), StartDirectory, Directory))
{
FText FailureReason;
if (IsValidPath(Directory, bRelativeToGameContentDir, &FailureReason))
{
FEditorDirectories::Get().SetLastDirectory(ELastDirectory::GENERIC_IMPORT, Directory);
if (bLongPackageName)
{
FString LongPackageName;
FString StringFailureReason;
if (FPackageName::TryConvertFilenameToLongPackageName(Directory, LongPackageName, &StringFailureReason) == false)
{
StartDirectory = Directory;
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(StringFailureReason));
continue;
}
Directory = LongPackageName;
}
if (bRelativeToGameContentDir)
{
Directory = Directory.RightChop(AbsoluteGameContentDir.Len());
}
if (bUseRelativePath)
{
Directory = IFileManager::Get().ConvertToRelativePath(*Directory);
}
PropertyHandle->SetValue(Directory);
}
else
{
StartDirectory = Directory;
FMessageDialog::Open(EAppMsgType::Ok, FailureReason);
continue;
}
}
break;
}
}
return FReply::Handled();
}