Files
UnrealEngineUWP/Engine/Source/Developer/Virtualization/Private/SVirtualizationRevisionControlConnectionDialog.h
paul chipchase 4bb2e66a88 Tweak the text in the VA revision control connection error dialog based on feedback.
#rb trivial
#jira UE-191791
#rnx


- Removed direct references to perforce from the dialog code, those strings are now passed in by the caller. This should make the dialog more usable by other revision control providers at some point.
- Make it more obvious that the dialog is related to virtualized assets.
- Add more references to the revision control provider name so that people realize which settings they are supposed to be entering.
- Removed some debug code for launching the dialog from a console command.
- Fixed a bug where clicking the button to reset the ini file settings and use the default connection would reset the settings but then not try to reconnect.
- Make better use of the dialog space by increasing the size of the input boxes at the expense of white space, so that longer server addresses can fit on screen.

[CL 26769098 by paul chipchase in ue5-main branch]
2023-08-02 08:57:07 -04:00

95 lines
1.6 KiB
C++

// 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;
};
static FResult RunDialog(FStringView RevisionControlName, FStringView ConfigSectionName, FStringView CurrentPort, FStringView CurrentUsername);
SLATE_BEGIN_ARGS(SRevisionControlConnectionDialog) {}
SLATE_ARGUMENT(TSharedPtr<SWindow>, Window)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, FStringView RevisionControlName, FStringView ConfigSectionName, FStringView CurrentPort, FStringView CurrentUsername);
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();
void OnUrlClicked() const;
TWeakPtr<SWindow> WindowWidget;
TSharedPtr<SEditableTextBox> PortTextWidget;
TSharedPtr<SEditableTextBox> UsernameTextWidget;
EResult Result = EResult::Skip;
FString ConfigSectionName;
FString Port;
FString UserName;
};
} // namespace UE::Virtualization
#endif //UE_VA_WITH_SLATE