forked from SRombauts/UEPlasticPlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from PlasticSCM/1004409-view-locks-window
Add a new View Locks window similar to the recent View Branches
- Loading branch information
Showing
35 changed files
with
1,621 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Source/PlasticSourceControl/Private/PlasticSourceControlLock.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) 2024 Unity Technologies | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
||
#include "ISourceControlState.h" | ||
|
||
class FPlasticSourceControlLock | ||
{ | ||
public: | ||
int32 ItemId = ISourceControlState::INVALID_REVISION; | ||
FString Path; | ||
FString Status; | ||
bool bIsLocked = false; | ||
FDateTime Date; | ||
FString Owner; | ||
FString DestinationBranch; | ||
FString Branch; | ||
FString Workspace; | ||
|
||
void PopulateSearchString(TArray<FString>& OutStrings) const | ||
{ | ||
OutStrings.Emplace(Path); | ||
OutStrings.Emplace(Owner); | ||
OutStrings.Emplace(Branch); | ||
OutStrings.Emplace(Workspace); | ||
} | ||
}; | ||
|
||
typedef TSharedRef<class FPlasticSourceControlLock, ESPMode::ThreadSafe> FPlasticSourceControlLockRef; | ||
typedef TSharedPtr<class FPlasticSourceControlLock, ESPMode::ThreadSafe> FPlasticSourceControlLockPtr; |
51 changes: 51 additions & 0 deletions
51
Source/PlasticSourceControl/Private/PlasticSourceControlLocksWindow.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) 2024 Unity Technologies | ||
|
||
#include "PlasticSourceControlLocksWindow.h" | ||
|
||
#include "Widgets/Docking/SDockTab.h" | ||
|
||
#include "PlasticSourceControlStyle.h" | ||
#include "SPlasticSourceControlLocksWidget.h" | ||
|
||
#define LOCTEXT_NAMESPACE "PlasticSourceControlLocksWindow" | ||
|
||
static const FName PlasticSourceControlLocksWindowTabName("PlasticSourceControlLocksWindow"); | ||
|
||
void FPlasticSourceControlLocksWindow::Register() | ||
{ | ||
FPlasticSourceControlStyle::Initialize(); | ||
FPlasticSourceControlStyle::ReloadTextures(); | ||
|
||
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(PlasticSourceControlLocksWindowTabName, FOnSpawnTab::CreateRaw(this, &FPlasticSourceControlLocksWindow::OnSpawnTab)) | ||
.SetDisplayName(LOCTEXT("PlasticSourceControlLocksWindowTabTitle", "View Locks")) | ||
.SetMenuType(ETabSpawnerMenuType::Hidden) | ||
.SetIcon(FSlateIcon(FPlasticSourceControlStyle::Get().GetStyleSetName(), "PlasticSourceControl.PluginIcon.Small")); | ||
} | ||
|
||
void FPlasticSourceControlLocksWindow::Unregister() | ||
{ | ||
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(PlasticSourceControlLocksWindowTabName); | ||
|
||
FPlasticSourceControlStyle::Shutdown(); | ||
} | ||
|
||
TSharedRef<SDockTab> FPlasticSourceControlLocksWindow::OnSpawnTab(const FSpawnTabArgs& SpawnTabArgs) | ||
{ | ||
return SNew(SDockTab) | ||
.TabRole(ETabRole::NomadTab) | ||
[ | ||
CreateLocksWidget().ToSharedRef() | ||
]; | ||
} | ||
|
||
void FPlasticSourceControlLocksWindow::OpenTab() | ||
{ | ||
FGlobalTabmanager::Get()->TryInvokeTab(PlasticSourceControlLocksWindowTabName); | ||
} | ||
|
||
TSharedPtr<SWidget> FPlasticSourceControlLocksWindow::CreateLocksWidget() | ||
{ | ||
return SNew(SPlasticSourceControlLocksWidget); | ||
} | ||
|
||
#undef LOCTEXT_NAMESPACE |
20 changes: 20 additions & 0 deletions
20
Source/PlasticSourceControl/Private/PlasticSourceControlLocksWindow.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2024 Unity Technologies | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
||
// Nomad tab window to hold the widget with the list of Locks, see SPlasticSourceControlLocksWidget | ||
class FPlasticSourceControlLocksWindow | ||
{ | ||
public: | ||
void Register(); | ||
void Unregister(); | ||
|
||
void OpenTab(); | ||
|
||
private: | ||
TSharedRef<class SDockTab> OnSpawnTab(const class FSpawnTabArgs& SpawnTabArgs); | ||
|
||
TSharedPtr<SWidget> CreateLocksWidget(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.