-
Notifications
You must be signed in to change notification settings - Fork 29
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 #97 from PlasticSCM/1004271-visualize-list-of-bran…
…ches Visualize the list of branches
- Loading branch information
Showing
20 changed files
with
1,432 additions
and
7 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Source/PlasticSourceControl/Private/PlasticSourceControlBranch.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,33 @@ | ||
// Copyright (c) 2023 Unity Technologies | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
||
class FPlasticSourceControlBranch | ||
{ | ||
public: | ||
FPlasticSourceControlBranch() = default; | ||
FPlasticSourceControlBranch(const FString& InName, const FString& InRepository, const FString& InCreatedBy, const FDateTime& InDate, const FString& InComment) | ||
: Name(InName) | ||
, Repository(InRepository) | ||
, CreatedBy(InCreatedBy) | ||
, Date(InDate) | ||
, Comment(InComment) | ||
{} | ||
FString Name; | ||
FString Repository; | ||
FString CreatedBy; | ||
FDateTime Date; | ||
FString Comment; | ||
|
||
void PopulateSearchString(TArray<FString>& OutStrings) const | ||
{ | ||
OutStrings.Emplace(Name); | ||
OutStrings.Emplace(CreatedBy); | ||
OutStrings.Emplace(Comment); | ||
} | ||
}; | ||
|
||
typedef TSharedRef<class FPlasticSourceControlBranch, ESPMode::ThreadSafe> FPlasticSourceControlBranchRef; | ||
typedef TSharedPtr<class FPlasticSourceControlBranch, ESPMode::ThreadSafe> FPlasticSourceControlBranchPtr; |
51 changes: 51 additions & 0 deletions
51
Source/PlasticSourceControl/Private/PlasticSourceControlBranchesWindow.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) 2023 Unity Technologies | ||
|
||
#include "PlasticSourceControlBranchesWindow.h" | ||
|
||
#include "Widgets/Docking/SDockTab.h" | ||
|
||
#include "PlasticSourceControlStyle.h" | ||
#include "SPlasticSourceControlBranchesWidget.h" | ||
|
||
#define LOCTEXT_NAMESPACE "PlasticSourceControlWindow" | ||
|
||
static const FName PlasticSourceControlWindowTabName("PlasticSourceControlWindow"); | ||
|
||
void FPlasticSourceControlBranchesWindow::Register() | ||
{ | ||
FPlasticSourceControlStyle::Initialize(); | ||
FPlasticSourceControlStyle::ReloadTextures(); | ||
|
||
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(PlasticSourceControlWindowTabName, FOnSpawnTab::CreateRaw(this, &FPlasticSourceControlBranchesWindow::OnSpawnTab)) | ||
.SetDisplayName(LOCTEXT("PlasticSourceControlWindowTabTitle", "View Branches")) | ||
.SetMenuType(ETabSpawnerMenuType::Hidden) | ||
.SetIcon(FSlateIcon(FPlasticSourceControlStyle::Get().GetStyleSetName(), "PlasticSourceControl.PluginIcon.Small")); | ||
} | ||
|
||
void FPlasticSourceControlBranchesWindow::Unregister() | ||
{ | ||
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(PlasticSourceControlWindowTabName); | ||
|
||
FPlasticSourceControlStyle::Shutdown(); | ||
} | ||
|
||
TSharedRef<SDockTab> FPlasticSourceControlBranchesWindow::OnSpawnTab(const FSpawnTabArgs& SpawnTabArgs) | ||
{ | ||
return SNew(SDockTab) | ||
.TabRole(ETabRole::NomadTab) | ||
[ | ||
CreateBranchesWidget().ToSharedRef() | ||
]; | ||
} | ||
|
||
void FPlasticSourceControlBranchesWindow::OpenTab() | ||
{ | ||
FGlobalTabmanager::Get()->TryInvokeTab(PlasticSourceControlWindowTabName); | ||
} | ||
|
||
TSharedPtr<SWidget> FPlasticSourceControlBranchesWindow::CreateBranchesWidget() | ||
{ | ||
return SNew(SPlasticSourceControlBranchesWidget); | ||
} | ||
|
||
#undef LOCTEXT_NAMESPACE |
20 changes: 20 additions & 0 deletions
20
Source/PlasticSourceControl/Private/PlasticSourceControlBranchesWindow.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) 2023 Unity Technologies | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
|
||
// Nomad tab window to hold the widget with the list of branches, see SPlasticSourceControlBranchesWidget | ||
class FPlasticSourceControlBranchesWindow | ||
{ | ||
public: | ||
void Register(); | ||
void Unregister(); | ||
|
||
void OpenTab(); | ||
|
||
private: | ||
TSharedRef<class SDockTab> OnSpawnTab(const class FSpawnTabArgs& SpawnTabArgs); | ||
|
||
TSharedPtr<SWidget> CreateBranchesWidget(); | ||
}; |
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
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.