// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Experimental/BuildServerInterface.h" #include "Experimental/ZenServerInterface.h" #include "Templates/SharedPointer.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/Input/SComboBox.h" #include "Widgets/Layout/SGridPanel.h" #include "Widgets/SBoxPanel.h" #include "Widgets/SCompoundWidget.h" #include "Widgets/SWidget.h" #include "Widgets/Views/ITableRow.h" #include "Widgets/Views/SListView.h" #include "Widgets/Views/STableRow.h" #include "Widgets/Views/STableViewBase.h" class SMultiSelectComboBox; namespace UE::BuildSelection::Internal{ struct FListBuildsState; } DECLARE_DELEGATE_ThreeParams(FOnBuildTransferStarted, UE::Zen::Build::FBuildServiceInstance::FBuildTransfer /*Transfer*/, FStringView /*Name*/, FStringView /*Platform*/); class STORAGESERVERWIDGETS_API SBuildSelection : public SCompoundWidget { SLATE_BEGIN_ARGS(SBuildSelection) : _ZenServiceInstance(nullptr) , _BuildServiceInstance(nullptr) { } SLATE_ATTRIBUTE(TSharedPtr, ZenServiceInstance); SLATE_ATTRIBUTE(TSharedPtr, BuildServiceInstance); SLATE_EVENT(FOnBuildTransferStarted, OnBuildTransferStarted) SLATE_END_ARGS() struct FBuildGroup : public TSharedFromThis { FString Namespace; FString DisplayName; FString CommitIdentifier; FString Suffix; FDateTime CreatedAt; FString Category; TMap PerPlatformBuilds; }; void Construct(const FArguments& InArgs); private: enum class EBuildType { Oplog, StagedBuild, PackagedBuild, EditorPreCompiledBinary, EditorInstalledBuild, Unknown }; EBuildType GetSelectedBuildType() const; void RebuildLists(); void ReselectDestination(TSharedPtr Item); void RegenerateBuildGroups(UE::BuildSelection::Internal::FListBuildsState& ListBuildsState); void RegenerateActivePlatformFilters(); void ValidateBuildGroupSelection(); TSharedRef OnGenerateTextBlockFromString(TSharedPtr Item); bool BuildGroupIsSelectableOrNavigable(TSharedPtr InItem) const; TSharedRef GenerateBuildGroupRow(TSharedPtr InItem, const TSharedRef& InOwningTable); void OnOpenDestinationDirectoryClicked(); TSharedRef GetBuildDestinationPanel(); TSharedRef GetGridPanel(); void BuildGroupSelectionChanged(TSharedPtr Item, ESelectInfo::Type SelectInfo); TSharedPtr>> ProjectWidget; TSharedPtr>> StreamWidget; TSharedPtr>> BuildTypeWidget; TSharedPtr RequiredPlatformsWidget; TSharedPtr SelectedGroupPlatformGrid; TArray SelectedGroupSelectedPlatforms; TMultiMap BucketsToNamespaces; TArray> ProjectList; TArray> StreamList; TArray> BuildTypeList; TArray> PlatformList; TArray ActivePlatformFilters; FString DestinationFolderPath; FString DestinationZenProjectId; TSharedPtr SelectedStream; TSharedPtr SelectedProject; TSharedPtr SelectedBuildType; TSharedPtr>> BuildListView; std::atomic BuildListRefreshesInProgress = 0; std::atomic BuildRefreshGeneration = 0; TArray> BuildGroups; SVerticalBox::FSlot* GridSlot = nullptr; TAttribute> ZenServiceInstance; TAttribute> BuildServiceInstance; FOnBuildTransferStarted OnBuildTransferStarted; }; typedef TSharedPtr FBuildSelectionBuildGroupPtr; class SBuildGroupTableRow : public SMultiColumnTableRow { public: SLATE_BEGIN_ARGS(SBuildGroupTableRow) { } SLATE_END_ARGS() void Construct(const FArguments& InArgs, const TSharedRef& InOwnerTableView, const FBuildSelectionBuildGroupPtr InBuildGroup); virtual TSharedRef GenerateWidgetForColumn(const FName& ColumnName) override; const FSlateBrush* GetBorder() const; FReply OnBrowseClicked(); private: FBuildSelectionBuildGroupPtr BuildGroup; };