当前位置: 首页>>代码示例>>C++>>正文


C++ IDesktopPlatform::OpenDirectoryDialog方法代码示例

本文整理汇总了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();
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:35,代码来源:SProjectLauncherDeployRepositorySettings.cpp

示例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();
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:35,代码来源:SSessionLauncherDeployRepositorySettings.cpp

示例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("//");
	}
}
开发者ID:Nicole-W,项目名称:janusvr_utils,代码行数:27,代码来源:JanusExporterTool.cpp

示例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();
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:32,代码来源:SLocalizationDashboardTargetRow.cpp

示例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();
		}
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:36,代码来源:ProfilerCommands.cpp

示例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();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:64,代码来源:DirectoryPathStructCustomization.cpp


注:本文中的IDesktopPlatform::OpenDirectoryDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。