2020-05-20 12:48:17 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-05-20 13:04:13 -04:00
|
|
|
#include "Framework/Commands/Commands.h"
|
|
|
|
|
#include "ISourceControlOperation.h"
|
|
|
|
|
#include "ISourceControlProvider.h"
|
|
|
|
|
|
|
|
|
|
class FUICommandList;
|
|
|
|
|
class SWidget;
|
2020-05-20 12:48:17 -04:00
|
|
|
|
|
|
|
|
class FSourceControlCommands : public TCommands<FSourceControlCommands>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FSourceControlCommands();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initialize commands
|
|
|
|
|
*/
|
|
|
|
|
virtual void RegisterCommands() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
static void ConnectToSourceControl_Clicked();
|
2021-01-11 15:31:58 -04:00
|
|
|
static bool ViewChangelists_CanExecute();
|
|
|
|
|
static void ViewChangelists_Clicked();
|
2020-05-20 12:48:17 -04:00
|
|
|
static bool CheckOutModifiedFiles_CanExecute();
|
|
|
|
|
static void CheckOutModifiedFiles_Clicked();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Source Control Commands
|
|
|
|
|
*/
|
|
|
|
|
TSharedPtr< FUICommandInfo > ConnectToSourceControl;
|
|
|
|
|
TSharedPtr< FUICommandInfo > ChangeSourceControlSettings;
|
2021-01-11 15:31:58 -04:00
|
|
|
TSharedPtr< FUICommandInfo > ViewChangelists;
|
2021-10-20 14:15:53 -04:00
|
|
|
TSharedPtr< FUICommandInfo > SubmitContent;
|
2020-05-20 12:48:17 -04:00
|
|
|
TSharedPtr< FUICommandInfo > CheckOutModifiedFiles;
|
|
|
|
|
|
|
|
|
|
static TSharedRef<FUICommandList> ActionList;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct FSourceControlMenuHelpers
|
|
|
|
|
{
|
|
|
|
|
enum EQueryState
|
|
|
|
|
{
|
|
|
|
|
NotQueried,
|
|
|
|
|
Querying,
|
|
|
|
|
Queried,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static EQueryState QueryState;
|
|
|
|
|
|
|
|
|
|
static void CheckSourceControlStatus();
|
|
|
|
|
static void OnSourceControlOperationComplete(const FSourceControlOperationRef& InOperation, ECommandResult::Type InResult);
|
|
|
|
|
static TSharedRef<SWidget> GenerateSourceControlMenuContent();
|
|
|
|
|
static FText GetSourceControlStatusText();
|
|
|
|
|
static FText GetSourceControlTooltip();
|
|
|
|
|
static const FSlateBrush* GetSourceControlIcon();
|
|
|
|
|
static TSharedRef<SWidget> MakeSourceControlStatusWidget();
|
|
|
|
|
};
|
|
|
|
|
|