2023-06-20 04:26:06 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#if UE_VA_WITH_SLATE
|
|
|
|
|
|
|
|
|
|
#include "Input/Reply.h"
|
|
|
|
|
#include "Widgets/SCompoundWidget.h"
|
|
|
|
|
|
|
|
|
|
class SEditableTextBox;
|
|
|
|
|
class SWindow;
|
|
|
|
|
|
|
|
|
|
namespace UE::Virtualization
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class SRevisionControlConnectionDialog : public SCompoundWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
struct FResult
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FResult() = default;
|
|
|
|
|
FResult(const FString& InPort, const FString& InUserName)
|
|
|
|
|
: bShouldRetry(true)
|
|
|
|
|
, Port(InPort)
|
|
|
|
|
, UserName(InUserName)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~FResult() = default;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
bool bShouldRetry = false;
|
|
|
|
|
|
|
|
|
|
FString Port;
|
|
|
|
|
FString UserName;
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-23 08:22:30 -04:00
|
|
|
static FResult RunDialog(FStringView RevisionControlName, FStringView ConfigSectionName, FStringView CurrentPort, FStringView CurrentUsername, const FText& ErrorMessage);
|
2023-06-20 04:26:06 -04:00
|
|
|
|
|
|
|
|
SLATE_BEGIN_ARGS(SRevisionControlConnectionDialog) {}
|
|
|
|
|
SLATE_ARGUMENT(TSharedPtr<SWindow>, Window)
|
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
2023-08-23 08:22:30 -04:00
|
|
|
void Construct(const FArguments& InArgs, FStringView RevisionControlName, FStringView ConfigSectionName, FStringView CurrentPort, FStringView CurrentUsername, const FText& ErrorMessage);
|
2023-06-20 04:26:06 -04:00
|
|
|
|
|
|
|
|
enum class EResult : uint8
|
|
|
|
|
{
|
|
|
|
|
Retry,
|
|
|
|
|
Skip
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
EResult GetResult() const
|
|
|
|
|
{
|
|
|
|
|
return Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FString& GetPort() const
|
|
|
|
|
{
|
|
|
|
|
return Port;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FString& GetUserName() const
|
|
|
|
|
{
|
|
|
|
|
return UserName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
void CloseModalDialog();
|
|
|
|
|
|
|
|
|
|
FReply OnResetToDefaults();
|
|
|
|
|
FReply OnRetryConnection();
|
|
|
|
|
FReply OnSkip();
|
|
|
|
|
|
2023-06-21 06:43:40 -04:00
|
|
|
void OnUrlClicked() const;
|
|
|
|
|
|
2023-06-20 04:26:06 -04:00
|
|
|
TWeakPtr<SWindow> WindowWidget;
|
|
|
|
|
|
|
|
|
|
TSharedPtr<SEditableTextBox> PortTextWidget;
|
|
|
|
|
TSharedPtr<SEditableTextBox> UsernameTextWidget;
|
|
|
|
|
|
|
|
|
|
EResult Result = EResult::Skip;
|
|
|
|
|
|
2023-08-02 08:57:07 -04:00
|
|
|
FString ConfigSectionName;
|
|
|
|
|
|
2023-06-20 04:26:06 -04:00
|
|
|
FString Port;
|
|
|
|
|
FString UserName;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace UE::Virtualization
|
|
|
|
|
|
|
|
|
|
#endif //UE_VA_WITH_SLATE
|