You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added Move files operation on files in changelist dialog (incl. move to new) Added new changelist button in toolbar Added cancellable "path beautification" when we have deleted/shelved files with no matching file, until we make it lazy and/or batched #rb sebastien.lussier [CL 15797238 by julien lheureux in ue5-main branch]
92 lines
2.5 KiB
C++
92 lines
2.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
#include "Widgets/SWidget.h"
|
|
#include "Widgets/SWindow.h"
|
|
#include "Widgets/SCompoundWidget.h"
|
|
#include "Widgets/Input/SMultiLineEditableTextBox.h"
|
|
|
|
struct SSourceControlDescriptionItem
|
|
{
|
|
SSourceControlDescriptionItem(const FText& InTitle, const FText& InDescription, bool bInCanEditDescription)
|
|
: Title(InTitle), Description(InDescription), bCanEditDescription(bInCanEditDescription)
|
|
{}
|
|
|
|
FText Title;
|
|
FText Description;
|
|
bool bCanEditDescription;
|
|
};
|
|
|
|
class SSourceControlDescriptionWidget : public SCompoundWidget
|
|
{
|
|
public:
|
|
SLATE_BEGIN_ARGS(SSourceControlDescriptionWidget)
|
|
: _ParentWindow()
|
|
, _Label()
|
|
, _Text()
|
|
, _Items()
|
|
{}
|
|
|
|
SLATE_ATTRIBUTE(TSharedPtr<SWindow>, ParentWindow)
|
|
SLATE_ATTRIBUTE(FText, Label)
|
|
SLATE_ATTRIBUTE(FText, Text)
|
|
SLATE_ARGUMENT(const TArray<SSourceControlDescriptionItem>*, Items)
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
/** Constructs the widget */
|
|
void Construct(const FArguments& InArgs);
|
|
|
|
/** Gets dialog result */
|
|
bool GetResult() const { return bResult; }
|
|
|
|
/** Used to intercept Escape key press, and interpret it as cancel */
|
|
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override;
|
|
|
|
/** Returns the text currently in the edit box */
|
|
FText GetDescription() const;
|
|
|
|
/** Returns the currently selected item index if any */
|
|
int32 GetSelectedItemIndex() const { return CurrentlySelectedItemIndex; }
|
|
|
|
private:
|
|
/** Called when the settings of the dialog are to be accepted*/
|
|
FReply OKClicked();
|
|
|
|
/** Called when the settings of the dialog are to be ignored*/
|
|
FReply CancelClicked();
|
|
|
|
/** Called to populate the dropdown */
|
|
TSharedRef<SWidget> GetSelectionContent();
|
|
|
|
/** Returns title of currently selected item */
|
|
FText GetSelectedItemTitle() const;
|
|
|
|
private:
|
|
bool bResult = false;
|
|
|
|
/** Pointer to the parent modal window */
|
|
TWeakPtr<SWindow> ParentWindow;
|
|
|
|
TSharedPtr< SMultiLineEditableTextBox> TextBox;
|
|
|
|
const TArray<SSourceControlDescriptionItem>* Items;
|
|
int32 CurrentlySelectedItemIndex;
|
|
};
|
|
|
|
bool GetChangelistDescription(
|
|
const TSharedPtr<SWidget>& ParentWidget,
|
|
const FText& InWindowTitle,
|
|
const FText& InLabel,
|
|
FText& OutDescription);
|
|
|
|
bool PickChangelistOrNewWithDescription(
|
|
const TSharedPtr<SWidget>& ParentWidget,
|
|
const FText& InWindowTitle,
|
|
const FText& InLabel,
|
|
const TArray<SSourceControlDescriptionItem>& Items,
|
|
int32& OutPickedIndex,
|
|
FText& OutDescription); |