You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
SourceControl: Added SourceControlCheckInPrompter module, which periodically reminds the user that submitting their files to SourceControl is a good idea to avoid losing work.
#rb manuel.lang, marco.anastasi #rnx [CL 27593190 by wouter burgers in ue5-main branch]
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "ISourceControlCheckInPromptModule.h"
|
||||
|
||||
class FSourceControlCheckInPrompter;
|
||||
class ISourceControlProvider;
|
||||
class SNotificationItem;
|
||||
|
||||
class FSourceControlCheckInPromptModule : public ISourceControlCheckInPromptModule
|
||||
{
|
||||
public:
|
||||
FSourceControlCheckInPromptModule();
|
||||
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
|
||||
/** ISourceControlCheckInPromptModule implementation */
|
||||
virtual void ShowModal(const FText& InMessage) override;
|
||||
virtual void ShowToast(const FText& InMessage) override;
|
||||
|
||||
/**
|
||||
* Gets a reference to the source control check in prompt module instance.
|
||||
*
|
||||
* @return A reference to the source control check in prompt module.
|
||||
*/
|
||||
static FSourceControlCheckInPromptModule& Get()
|
||||
{
|
||||
return FModuleManager::LoadModuleChecked<FSourceControlCheckInPromptModule>("SourceControlCheckInPrompt");
|
||||
}
|
||||
|
||||
static FSourceControlCheckInPromptModule* TryGet()
|
||||
{
|
||||
return FModuleManager::GetModulePtr<FSourceControlCheckInPromptModule>("SourceControlCheckInPrompt");
|
||||
}
|
||||
|
||||
protected:
|
||||
void OnNotificationCheckInClicked();
|
||||
void OnNotificationDismissClicked();
|
||||
|
||||
void OnProviderChanged(ISourceControlProvider& OldProvider, ISourceControlProvider& NewProvider);
|
||||
|
||||
private:
|
||||
/** The prompter which triggers a periodic prompt */
|
||||
TSharedPtr<FSourceControlCheckInPrompter> SourceControlCheckInPrompter;
|
||||
|
||||
/** The notification toast that a check-in is recommended */
|
||||
TWeakPtr<SNotificationItem> CheckInNotification;
|
||||
|
||||
/** The delegate handle for provider changes */
|
||||
FDelegateHandle ProviderChangedHandle;
|
||||
};
|
||||
Reference in New Issue
Block a user