Files
UnrealEngineUWP/Engine/Source/Programs/CrashReportClient/Private/SCrashReportClient.h
patrick laflamme 6f5ba2331d Added a command line option to CrashReportClient to disable the 'Submit and Restart' button in case the application doesn't want to be automaticaly restarted.
#rb Chris.Gagnon, Johan.Berg
#preflight 629f7017617cbe81d32add99

#ushell-cherrypick of 20541559 by Patrick.Laflamme
#preflight 629fbb4b521254896f6c2c43

#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 20546605 via CL 20546619 via CL 20546630 via CL 20546644 via CL 20546648
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20552343 by patrick laflamme in ue5-main branch]
2022-06-08 02:02:29 -04:00

82 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CrashReportClient.h"
#if !CRASH_REPORT_UNATTENDED_ONLY
#include "Widgets/SCompoundWidget.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/Input/SMultiLineEditableTextBox.h"
/**
* UI for the crash report client app
*/
class SCrashReportClient : public SCompoundWidget
{
public:
/**
* Slate arguments
*/
SLATE_BEGIN_ARGS(SCrashReportClient)
: _bHideSubmitAndRestart(false)
{
}
/** Should the Submit and Send button be hitten. This can be overriden by a platform settings in the crash report config ini file. */
SLATE_ARGUMENT(bool, bHideSubmitAndRestart)
SLATE_END_ARGS()
/**
* Construct this Slate ui
* @param InArgs Slate arguments, not used
* @param Client Crash report client implementation object
* @param bSimpleDialog Whether to use the simple dialog UI that implicitly sends the report
*/
void Construct(const FArguments& InArgs, const TSharedRef<FCrashReportClient>& Client, bool bSimpleDialog);
bool IsFinished() { return CrashReportClient->IsUploadComplete() && CrashReportClient->ShouldWindowBeHidden(); }
private:
/**
* Construct the detailed Slate ui with controls for sending the report and comments
* @param Client Crash report client implementation object
*/
void ConstructDetailedDialog(const TSharedRef<FCrashReportClient>& Client, const FText& CrashDetailedMessage);
/**
* Construct the minimal Slate ui with just a button to close
* @param Client Crash report client implementation object
*/
void ConstructSimpleDialog(const TSharedRef<FCrashReportClient>& Client, const FText& CrashDetailedMessage);
/**
* Keyboard short-cut handler
* @param InKeyEvent Which key was released, and which auxiliary keys were pressed
* @return Whether the event was handled
*/
FReply OnUnhandledKeyDown(const FKeyEvent& InKeyEvent);
/** Called if the multi line widget text changes */
void OnUserCommentTextChanged(const FText& NewText);
/** Whether the hint text should be visible. */
EVisibility IsHintTextVisible() const;
/** Whether the send buttons are enabled. */
bool IsSendEnabled() const;
/** Crash report client implementation object */
TSharedPtr<FCrashReportClient> CrashReportClient;
TSharedPtr<SMultiLineEditableTextBox> CrashDetailsInformation;
bool bHasUserCommentErrors;
bool bHideSubmitAndRestart;
};
#endif // !CRASH_REPORT_UNATTENDED_ONLY