You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added an exception to changelist validation for deleted files Improved display of deleted & shelved objects in changelists & submit dialog - improvements related to OFPA in a subsequent change. #rb sebastien.lussier #jira UE-107677, UE-107768 [CL 15322858 by julien lheureux in ue5-main branch]
119 lines
3.4 KiB
C++
119 lines
3.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
#include "Widgets/SCompoundWidget.h"
|
|
#include "Widgets/Views/STreeView.h"
|
|
|
|
#include "ISourceControlProvider.h"
|
|
#include "SSourceControlCommon.h"
|
|
|
|
class SChangelistTree : public STreeView<FChangelistTreeItemPtr>
|
|
{
|
|
private:
|
|
virtual void Private_SetItemSelection(FChangelistTreeItemPtr TheItem, bool bShouldBeSelected, bool bWasUserDirected = false) override;
|
|
};
|
|
|
|
class SSourceControlChangelistsWidget : public SCompoundWidget
|
|
{
|
|
public:
|
|
SLATE_BEGIN_ARGS(SSourceControlChangelistsWidget) {}
|
|
SLATE_END_ARGS()
|
|
|
|
/**
|
|
* Constructor.
|
|
*/
|
|
SSourceControlChangelistsWidget();
|
|
|
|
/** Constructs the widget */
|
|
void Construct(const FArguments& InArgs);
|
|
|
|
private:
|
|
TSharedRef<SChangelistTree> CreateTreeviewWidget();
|
|
|
|
TSharedRef<ITableRow> OnGenerateRow(FChangelistTreeItemPtr InTreeItem, const TSharedRef<STableViewBase>& OwnerTable);
|
|
void OnGetChildren(FChangelistTreeItemPtr InParent, TArray<FChangelistTreeItemPtr>& OutChildren);
|
|
|
|
FReply OnFilesDragged(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent);
|
|
|
|
void RequestRefresh();
|
|
void Refresh();
|
|
void ClearChangelistsTree();
|
|
|
|
TSharedPtr<SWidget> OnOpenContextMenu();
|
|
|
|
/** Returns the currently selected changelist state ptr or null in invalid cases */
|
|
FSourceControlChangelistStatePtr GetCurrentChangelistState();
|
|
FSourceControlChangelistPtr GetCurrentChangelist();
|
|
FSourceControlChangelistStatePtr GetChangelistStateFromSelection();
|
|
FSourceControlChangelistPtr GetChangelistFromSelection();
|
|
|
|
/** Returns list of currently selected files */
|
|
TArray<FString> GetSelectedFiles();
|
|
|
|
/** Returns list of currently selected shelved files */
|
|
TArray<FString> GetSelectedShelvedFiles();
|
|
|
|
/** Changelist operations */
|
|
void OnNewChangelist();
|
|
void OnDeleteChangelist();
|
|
bool CanDeleteChangelist();
|
|
void OnEditChangelist();
|
|
void OnSubmitChangelist();
|
|
bool CanSubmitChangelist();
|
|
|
|
/** Changelist & File operations */
|
|
void OnRevertUnchanged();
|
|
bool CanRevertUnchanged();
|
|
void OnRevert();
|
|
bool CanRevert();
|
|
void OnShelve();
|
|
|
|
/** Changelist & shelved files operations */
|
|
void OnUnshelve();
|
|
void OnDeleteShelvedFiles();
|
|
|
|
/** Files operations */
|
|
void OnLocateFile();
|
|
bool CanLocateFile();
|
|
void OnShowHistory();
|
|
void OnDiffAgainstDepot();
|
|
bool CanDiffAgainstDepot();
|
|
|
|
/** Shelved files operations */
|
|
void OnDiffAgainstWorkspace();
|
|
bool CanDiffAgainstWorkspace();
|
|
|
|
void OnSourceControlStateChanged();
|
|
void OnSourceControlProviderChanged(ISourceControlProvider& OldProvider, ISourceControlProvider& NewProvider);
|
|
void OnChangelistsStatusUpdated(const FSourceControlOperationRef& InOperation, ECommandResult::Type InType);
|
|
|
|
virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
|
|
|
|
private:
|
|
struct ExpandedState
|
|
{
|
|
bool bChangelistExpanded;
|
|
bool bShelveExpanded;
|
|
};
|
|
|
|
void SaveExpandedState(TMap<FSourceControlChangelistStateRef, ExpandedState>& ExpandedStates) const;
|
|
void RestoreExpandedState(const TMap<FSourceControlChangelistStateRef, ExpandedState>& ExpandedStates);
|
|
|
|
TSharedRef<SWidget> MakeToolBar();
|
|
|
|
private:
|
|
/** Changelists (root nodes) */
|
|
TArray<FChangelistTreeItemPtr> ChangelistsNodes;
|
|
|
|
/** Changelist treeview widget */
|
|
TSharedPtr<SChangelistTree> TreeView;
|
|
|
|
/** Source control state changed delegate handle */
|
|
FDelegateHandle SourceControlStateChangedDelegateHandle;
|
|
|
|
bool bShouldRefresh;
|
|
};
|