You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Skein, the only provider that returns 'true' for 'UsesSnapshots()' requires the user to be at head when doing a check-in operation, or the check-in will fail. This is enforced within the plugin, not the CLI, by performing an FSync prior to doing an FCheckIn. It's not easy to do the sync within the CLI as part of the check-in as the editor doesn't release its file locks when doing an FCheckIn, causing syncs to fail. For this, a code path was introduced in SourceControlMenuHelpers that triggers a sync before triggering the check-in, when clicking the 'Check In Changes' button visible in the bottom right of the editor within UEFN. However, this approach fails if other code paths in the editor call ChoosePackagesToCheckIn directly. This is known to happen for the MainFrame's "Submit Content" action, which was therefore disabled for Skein in #26272334, but the issue could be more widespread. To provide a definitive fix for this issue, the sync is moved to within ChoosePackagesToCheckIn, triggered only when 'UsesSnapshots()' is true, which effectively means Skein only. #rnx [CL 27582511 by wouter burgers in ue5-main branch]
102 lines
2.8 KiB
C++
102 lines
2.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Framework/Commands/Commands.h"
|
|
#include "ISourceControlOperation.h"
|
|
#include "ISourceControlProvider.h"
|
|
|
|
class FUICommandList;
|
|
class FReply;
|
|
class SWidget;
|
|
|
|
class FSourceControlCommands : public TCommands<FSourceControlCommands>
|
|
{
|
|
public:
|
|
FSourceControlCommands();
|
|
|
|
/**
|
|
* Initialize commands
|
|
*/
|
|
virtual void RegisterCommands() override;
|
|
|
|
private:
|
|
|
|
static void ConnectToSourceControl_Clicked();
|
|
static bool ViewChangelists_CanExecute();
|
|
static bool ViewChangelists_IsVisible();
|
|
static bool SubmitContent_IsVisible();
|
|
static void ViewChangelists_Clicked();
|
|
static bool CheckOutModifiedFiles_CanExecute();
|
|
static void CheckOutModifiedFiles_Clicked();
|
|
static bool RevertAllModifiedFiles_CanExecute();
|
|
static void RevertAllModifiedFiles_Clicked();
|
|
|
|
public:
|
|
/**
|
|
* Source Control Commands
|
|
*/
|
|
TSharedPtr< FUICommandInfo > ConnectToSourceControl;
|
|
TSharedPtr< FUICommandInfo > ChangeSourceControlSettings;
|
|
TSharedPtr< FUICommandInfo > ViewChangelists;
|
|
TSharedPtr< FUICommandInfo > SubmitContent;
|
|
TSharedPtr< FUICommandInfo > CheckOutModifiedFiles;
|
|
TSharedPtr< FUICommandInfo > RevertAll;
|
|
|
|
static TSharedRef<FUICommandList> ActionList;
|
|
};
|
|
|
|
class FSourceControlMenuHelpers
|
|
{
|
|
friend class FSourceControlCommands;
|
|
public:
|
|
/**
|
|
* Static: Access singleton instance
|
|
*
|
|
* @return Reference to the singleton object
|
|
*/
|
|
static FSourceControlMenuHelpers& Get();
|
|
|
|
private:
|
|
enum EQueryState
|
|
{
|
|
NotQueried,
|
|
Querying,
|
|
Queried,
|
|
};
|
|
|
|
|
|
static EQueryState QueryState;
|
|
|
|
public:
|
|
static void CheckSourceControlStatus();
|
|
static TSharedRef<SWidget> MakeSourceControlStatusWidget();
|
|
|
|
private:
|
|
static void OnSourceControlOperationComplete(const FSourceControlOperationRef& InOperation, ECommandResult::Type InResult);
|
|
static TSharedRef<SWidget> GenerateSourceControlMenuContent();
|
|
static TSharedRef<SWidget> GenerateCheckInComboButtonContent();
|
|
static FText GetSourceControlStatusText();
|
|
static FText GetSourceControlTooltip();
|
|
static const FSlateBrush* GetSourceControlIconBadge();
|
|
|
|
/** Sync button */
|
|
static bool IsAtLatestRevision();
|
|
static bool CanSourceControlSync();
|
|
static EVisibility GetSourceControlSyncStatusVisibility();
|
|
static FText GetSourceControlSyncStatusText();
|
|
static FText GetSourceControlSyncStatusTooltipText();
|
|
static const FSlateBrush* GetSourceControlSyncStatusIcon();
|
|
static FReply OnSourceControlSyncClicked();
|
|
|
|
/** Check-in button */
|
|
static int GetNumLocalChanges();
|
|
static bool CanSourceControlCheckIn();
|
|
static EVisibility GetSourceControlCheckInStatusVisibility();
|
|
static FText GetSourceControlCheckInStatusText();
|
|
static FText GetSourceControlCheckInStatusTooltipText();
|
|
static const FSlateBrush* GetSourceControlCheckInStatusIcon();
|
|
static FReply OnSourceControlCheckInChangesClicked();
|
|
};
|
|
|