Space Plunder
Loading...
Searching...
No Matches
FCopy_ApplicationRestartRequiredNotification Class Reference

#include <Copy_ApplicationRestartRequiredNotification.h>

Public Member Functions

void OnRestartRequired ()
 
void OnRestartRequired ()
 

Private Member Functions

void OnRestartClicked ()
 
void OnDismissClicked ()
 
void OnRestartClicked ()
 
void OnDismissClicked ()
 

Private Attributes

TWeakPtr< SNotificationItem > NotificationPtr
 

Detailed Description

Manages the notification for when the application needs to be restarted due to a settings change

Member Function Documentation

◆ OnDismissClicked() [1/2]

void FCopy_ApplicationRestartRequiredNotification::OnDismissClicked ( )
inlineprivate
72 {
73 TSharedPtr<SNotificationItem> NotificationPin = NotificationPtr.Pin();
74 if (NotificationPin.IsValid())
75 {
76 NotificationPin->SetText(LOCTEXT("RestartDismissed", "Restart Dismissed..."));
77 NotificationPin->SetCompletionState(SNotificationItem::CS_None);
78 NotificationPin->ExpireAndFadeout();
79 NotificationPtr.Reset();
80 }
81 }
TWeakPtr< SNotificationItem > NotificationPtr
Definition Copy_ApplicationRestartRequiredNotification.h:84

◆ OnDismissClicked() [2/2]

void FCopy_ApplicationRestartRequiredNotification::OnDismissClicked ( )
inlineprivate
72 {
73 TSharedPtr<SNotificationItem> NotificationPin = NotificationPtr.Pin();
74 if (NotificationPin.IsValid())
75 {
76 NotificationPin->SetText(LOCTEXT("RestartDismissed", "Restart Dismissed..."));
77 NotificationPin->SetCompletionState(SNotificationItem::CS_None);
78 NotificationPin->ExpireAndFadeout();
79 NotificationPtr.Reset();
80 }
81 }

◆ OnRestartClicked() [1/2]

void FCopy_ApplicationRestartRequiredNotification::OnRestartClicked ( )
inlineprivate
58 {
59 TSharedPtr<SNotificationItem> NotificationPin = NotificationPtr.Pin();
60 if (NotificationPin.IsValid())
61 {
62 NotificationPin->SetText(LOCTEXT("RestartingNow", "Restarting..."));
63 NotificationPin->SetCompletionState(SNotificationItem::CS_Success);
64 NotificationPin->ExpireAndFadeout();
65 NotificationPtr.Reset();
66 }
67
68 FUnrealEdMisc::Get().RestartEditor(false);
69 }

◆ OnRestartClicked() [2/2]

void FCopy_ApplicationRestartRequiredNotification::OnRestartClicked ( )
inlineprivate
58 {
59 TSharedPtr<SNotificationItem> NotificationPin = NotificationPtr.Pin();
60 if (NotificationPin.IsValid())
61 {
62 NotificationPin->SetText(LOCTEXT("RestartingNow", "Restarting..."));
63 NotificationPin->SetCompletionState(SNotificationItem::CS_Success);
64 NotificationPin->ExpireAndFadeout();
65 NotificationPtr.Reset();
66 }
67
68 FUnrealEdMisc::Get().RestartEditor(false);
69 }

◆ OnRestartRequired() [1/2]

void FCopy_ApplicationRestartRequiredNotification::OnRestartRequired ( )
inline
19 {
20 FNotificationInfo Info( LOCTEXT("RestartRequiredTitle", "Restart required to apply new settings") );
21
22 // Add the buttons with text, tooltip and callback
23 Info.ButtonDetails.Add(FNotificationButtonInfo(
24 LOCTEXT("RestartNow", "Restart Now"),
25 LOCTEXT("RestartNowToolTip", "Restart now to finish applying your new settings."),
27 );
28 Info.ButtonDetails.Add(FNotificationButtonInfo(
29 LOCTEXT("RestartLater", "Restart Later"),
30 LOCTEXT("RestartLaterToolTip", "Dismiss this notificaton without restarting. Some new settings will not be applied."),
32 );
33
34 // We will be keeping track of this ourselves
35 Info.bFireAndForget = false;
36
37 // Set the width so that the notification doesn't resize as its text changes
38 Info.WidthOverride = 300.0f;
39
40 Info.bUseLargeFont = false;
41 Info.bUseThrobber = false;
42 Info.bUseSuccessFailIcons = false;
43
44 // Launch notification
45 NotificationPtr = FSlateNotificationManager::Get().AddNotification(Info);
46 TSharedPtr<SNotificationItem> NotificationPin = NotificationPtr.Pin();
47
48 if (NotificationPin.IsValid())
49 {
50 NotificationPin->SetCompletionState(SNotificationItem::CS_Pending);
51 }
52 }
void OnRestartClicked()
Definition Copy_ApplicationRestartRequiredNotification.h:57
void OnDismissClicked()
Definition Copy_ApplicationRestartRequiredNotification.h:71

◆ OnRestartRequired() [2/2]

void FCopy_ApplicationRestartRequiredNotification::OnRestartRequired ( )
inline
19 {
20 FNotificationInfo Info( LOCTEXT("RestartRequiredTitle", "Restart required to apply new settings") );
21
22 // Add the buttons with text, tooltip and callback
23 Info.ButtonDetails.Add(FNotificationButtonInfo(
24 LOCTEXT("RestartNow", "Restart Now"),
25 LOCTEXT("RestartNowToolTip", "Restart now to finish applying your new settings."),
27 );
28 Info.ButtonDetails.Add(FNotificationButtonInfo(
29 LOCTEXT("RestartLater", "Restart Later"),
30 LOCTEXT("RestartLaterToolTip", "Dismiss this notificaton without restarting. Some new settings will not be applied."),
32 );
33
34 // We will be keeping track of this ourselves
35 Info.bFireAndForget = false;
36
37 // Set the width so that the notification doesn't resize as its text changes
38 Info.WidthOverride = 300.0f;
39
40 Info.bUseLargeFont = false;
41 Info.bUseThrobber = false;
42 Info.bUseSuccessFailIcons = false;
43
44 // Launch notification
45 NotificationPtr = FSlateNotificationManager::Get().AddNotification(Info);
46 TSharedPtr<SNotificationItem> NotificationPin = NotificationPtr.Pin();
47
48 if (NotificationPin.IsValid())
49 {
50 NotificationPin->SetCompletionState(SNotificationItem::CS_Pending);
51 }
52 }

Member Data Documentation

◆ NotificationPtr

TWeakPtr< SNotificationItem > FCopy_ApplicationRestartRequiredNotification::NotificationPtr
private

Used to reference to the active restart notification


The documentation for this class was generated from the following files: