first commit

This commit is contained in:
SimonSayeBabu
2025-01-17 13:10:20 +01:00
commit bd1057cec0
16967 changed files with 1048699 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using UnityEditor.IMGUI.Controls;
namespace Unity.PlasticSCM.Editor.Views.Branches
{
class BranchListViewItem : TreeViewItem
{
internal object ObjectInfo { get; private set; }
internal BranchListViewItem(int id, object objectInfo)
: base(id, 1)
{
ObjectInfo = objectInfo;
displayName = id.ToString();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ebbbce5f7ed39ab45b6f43340727ba5e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using PlasticGui;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Tree;
namespace Unity.PlasticSCM.Editor.Views.Branches
{
internal enum BranchesListColumn
{
Name,
Repository,
CreatedBy,
CreationDate,
Comment,
Branch,
Guid
}
[Serializable]
internal class BranchesListHeaderState : MultiColumnHeaderState, ISerializationCallbackReceiver
{
internal static BranchesListHeaderState GetDefault()
{
return new BranchesListHeaderState(BuildColumns());
}
internal static List<string> GetColumnNames()
{
List<string> result = new List<string>();
result.Add(PlasticLocalization.GetString(PlasticLocalization.Name.NameColumn));
result.Add(PlasticLocalization.GetString(PlasticLocalization.Name.RepositoryColumn));
result.Add(PlasticLocalization.GetString(PlasticLocalization.Name.CreatedByColumn));
result.Add(PlasticLocalization.GetString(PlasticLocalization.Name.CreationDateColumn));
result.Add(PlasticLocalization.GetString(PlasticLocalization.Name.CommentColumn));
return result;
}
internal static string GetColumnName(BranchesListColumn column)
{
switch (column)
{
case BranchesListColumn.Name:
return PlasticLocalization.GetString(PlasticLocalization.Name.NameColumn);
case BranchesListColumn.Repository:
return PlasticLocalization.GetString(PlasticLocalization.Name.RepositoryColumn);
case BranchesListColumn.CreatedBy:
return PlasticLocalization.GetString(PlasticLocalization.Name.CreatedByColumn);
case BranchesListColumn.CreationDate:
return PlasticLocalization.GetString(PlasticLocalization.Name.CreationDateColumn);
case BranchesListColumn.Comment:
return PlasticLocalization.GetString(PlasticLocalization.Name.CommentColumn);
default:
return null;
}
}
void ISerializationCallbackReceiver.OnAfterDeserialize()
{
if (mHeaderTitles != null)
TreeHeaderColumns.SetTitles(columns, mHeaderTitles);
if (mColumsAllowedToggleVisibility != null)
TreeHeaderColumns.SetVisibilities(columns, mColumsAllowedToggleVisibility);
}
void ISerializationCallbackReceiver.OnBeforeSerialize()
{
}
static Column[] BuildColumns()
{
return new Column[]
{
new Column()
{
width = UnityConstants.BranchesColumns.BRANCHES_NAME_WIDTH,
minWidth = UnityConstants.BranchesColumns.BRANCHES_NAME_MIN_WIDTH,
headerContent = new GUIContent(
GetColumnName(BranchesListColumn.Name)),
allowToggleVisibility = false,
sortingArrowAlignment = TextAlignment.Right
},
new Column()
{
width = UnityConstants.BranchesColumns.REPOSITORY_WIDTH,
minWidth = UnityConstants.BranchesColumns.REPOSITORY_MIN_WIDTH,
headerContent = new GUIContent(
GetColumnName(BranchesListColumn.Repository)),
allowToggleVisibility = true,
sortingArrowAlignment = TextAlignment.Right
},
new Column()
{
width = UnityConstants.BranchesColumns.CREATEDBY_WIDTH,
minWidth = UnityConstants.BranchesColumns.CREATEDBY_MIN_WIDTH,
headerContent = new GUIContent(
GetColumnName(BranchesListColumn.CreatedBy)),
sortingArrowAlignment = TextAlignment.Right
},
new Column()
{
width = UnityConstants.BranchesColumns.CREATION_DATE_WIDTH,
minWidth = UnityConstants.BranchesColumns.CREATION_DATE_MIN_WIDTH,
headerContent = new GUIContent(
GetColumnName(BranchesListColumn.CreationDate)),
sortingArrowAlignment = TextAlignment.Right
},
new Column()
{
width = UnityConstants.BranchesColumns.COMMENT_WIDTH,
minWidth = UnityConstants.BranchesColumns.COMMENT_MIN_WIDTH,
headerContent = new GUIContent(
GetColumnName(BranchesListColumn.Comment)),
sortingArrowAlignment = TextAlignment.Right
}
};
}
BranchesListHeaderState(Column[] columns)
: base(columns)
{
if (mHeaderTitles == null)
mHeaderTitles = TreeHeaderColumns.GetTitles(columns);
if (mColumsAllowedToggleVisibility == null)
mColumsAllowedToggleVisibility = TreeHeaderColumns.GetVisibilities(columns);
}
[SerializeField]
string[] mHeaderTitles;
[SerializeField]
bool[] mColumsAllowedToggleVisibility;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f4a41e458bcb22946bcfa6b165c90288
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,418 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using Codice.CM.Common;
using PlasticGui;
using PlasticGui.WorkspaceWindow.QueryViews;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Avatar;
using Unity.PlasticSCM.Editor.UI.Tree;
namespace Unity.PlasticSCM.Editor.Views.Branches
{
internal class BranchesListView : TreeView
{
internal GenericMenu Menu { get { return mMenu.Menu; } }
internal BranchesListView(
BranchesListHeaderState headerState,
List<string> columnNames,
BranchesViewMenu menu,
Action sizeChangedAction)
: base(new TreeViewState())
{
mColumnNames = columnNames;
mMenu = menu;
mSizeChangedAction = sizeChangedAction;
multiColumnHeader = new MultiColumnHeader(headerState);
multiColumnHeader.canSort = true;
multiColumnHeader.sortingChanged += SortingChanged;
rowHeight = UnityConstants.TREEVIEW_ROW_HEIGHT;
showAlternatingRowBackgrounds = false;
mCooldownFilterAction = new CooldownWindowDelayer(
DelayedSearchChanged, UnityConstants.SEARCH_DELAYED_INPUT_ACTION_INTERVAL);
}
public override IList<TreeViewItem> GetRows()
{
return mRows;
}
internal void SetLoadedBranchId(long loadedBranchId)
{
mLoadedBranchId = loadedBranchId;
}
protected override TreeViewItem BuildRoot()
{
return new TreeViewItem(0, -1, string.Empty);
}
protected override IList<TreeViewItem> BuildRows(
TreeViewItem rootItem)
{
if (mQueryResult == null)
{
ClearRows(rootItem, mRows);
return mRows;
}
RegenerateRows(
mListViewItemIds,
mQueryResult.GetObjects(),
rootItem, mRows);
return mRows;
}
protected override void SearchChanged(string newSearch)
{
mCooldownFilterAction.Ping();
}
protected override void ContextClickedItem(int id)
{
mMenu.Popup();
Repaint();
}
public override void OnGUI(Rect rect)
{
if (Event.current.type == EventType.Layout)
{
if (IsSizeChanged(treeViewRect, mLastRect))
mSizeChangedAction();
}
mLastRect = treeViewRect;
base.OnGUI(rect);
Event e = Event.current;
if (e.type != EventType.KeyDown)
return;
bool isProcessed = mMenu.ProcessKeyActionIfNeeded(e);
if (isProcessed)
e.Use();
}
protected override void BeforeRowsGUI()
{
int firstRowVisible;
int lastRowVisible;
GetFirstAndLastVisibleRows(out firstRowVisible, out lastRowVisible);
GUI.DrawTexture(new Rect(0,
firstRowVisible * rowHeight,
GetRowRect(0).width,
(lastRowVisible * rowHeight) + 1000),
Images.GetTreeviewBackgroundTexture());
DrawTreeViewItem.InitializeStyles();
base.BeforeRowsGUI();
}
protected override void RowGUI(RowGUIArgs args)
{
if (args.item is BranchListViewItem)
{
BranchListViewItem branchListViewItem = (BranchListViewItem)args.item;
BranchInfo branchInfo = (BranchInfo)branchListViewItem.ObjectInfo;
BranchesListViewItemGUI(
mQueryResult,
rowHeight,
branchListViewItem,
args,
branchInfo.BranchId == mLoadedBranchId,
Repaint);
return;
}
base.RowGUI(args);
}
internal void BuildModel(
ViewQueryResult queryResult,
long loadedBranchId)
{
mListViewItemIds.Clear();
mQueryResult = queryResult;
mLoadedBranchId = loadedBranchId;
}
internal void Refilter()
{
if (mQueryResult == null)
return;
Filter filter = new Filter(searchString);
mQueryResult.ApplyFilter(filter, mColumnNames);
}
internal void Sort()
{
if (mQueryResult == null)
return;
int sortedColumnIdx = multiColumnHeader.state.sortedColumnIndex;
bool sortAscending = multiColumnHeader.IsSortedAscending(sortedColumnIdx);
mQueryResult.Sort(
mColumnNames[sortedColumnIdx],
sortAscending);
}
internal List<RepositorySpec> GetSelectedRepositories()
{
List<RepositorySpec> result = new List<RepositorySpec>();
IList<int> selectedIds = GetSelection();
if (selectedIds.Count == 0)
return result;
foreach (KeyValuePair<object, int> item
in mListViewItemIds.GetInfoItems())
{
if (!selectedIds.Contains(item.Value))
continue;
RepositorySpec repSpec =
mQueryResult.GetRepositorySpec(item.Key);
result.Add(repSpec);
}
return result;
}
internal List<RepObjectInfo> GetSelectedRepObjectInfos()
{
List<RepObjectInfo> result = new List<RepObjectInfo>();
IList<int> selectedIds = GetSelection();
if (selectedIds.Count == 0)
return result;
foreach (KeyValuePair<object, int> item
in mListViewItemIds.GetInfoItems())
{
if (!selectedIds.Contains(item.Value))
continue;
RepObjectInfo repObjectInfo =
mQueryResult.GetRepObjectInfo(item.Key);
result.Add(repObjectInfo);
}
return result;
}
internal void SelectRepObjectInfos(
List<RepObjectInfo> repObjectsToSelect)
{
List<int> idsToSelect = new List<int>();
foreach (RepObjectInfo repObjectInfo in repObjectsToSelect)
{
int repObjectInfoId = GetTreeIdForItem(repObjectInfo);
if (repObjectInfoId == -1)
continue;
idsToSelect.Add(repObjectInfoId);
}
TableViewOperations.SetSelectionAndScroll(this, idsToSelect);
}
int GetTreeIdForItem(RepObjectInfo repObjectInfo)
{
foreach (KeyValuePair<object, int> item in mListViewItemIds.GetInfoItems())
{
RepObjectInfo currentRepObjectInfo =
mQueryResult.GetRepObjectInfo(item.Key);
if (!currentRepObjectInfo.Equals(repObjectInfo))
continue;
if (!currentRepObjectInfo.GUID.Equals(repObjectInfo.GUID))
continue;
return item.Value;
}
return -1;
}
void DelayedSearchChanged()
{
Refilter();
Sort();
Reload();
TableViewOperations.ScrollToSelection(this);
}
void SortingChanged(MultiColumnHeader multiColumnHeader)
{
Sort();
Reload();
}
static void RegenerateRows(
ListViewItemIds<object> listViewItemIds,
List<object> objectInfos,
TreeViewItem rootItem,
List<TreeViewItem> rows)
{
ClearRows(rootItem, rows);
if (objectInfos.Count == 0)
return;
foreach (object objectInfo in objectInfos)
{
int objectId;
if (!listViewItemIds.TryGetInfoItemId(objectInfo, out objectId))
objectId = listViewItemIds.AddInfoItem(objectInfo);
BranchListViewItem branchListViewItem =
new BranchListViewItem(objectId, objectInfo);
rootItem.AddChild(branchListViewItem);
rows.Add(branchListViewItem);
}
}
static void ClearRows(
TreeViewItem rootItem,
List<TreeViewItem> rows)
{
if (rootItem.hasChildren)
rootItem.children.Clear();
rows.Clear();
}
static void BranchesListViewItemGUI(
ViewQueryResult queryResult,
float rowHeight,
BranchListViewItem item,
RowGUIArgs args,
bool isBoldText,
Action avatarLoadedAction)
{
for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++)
{
Rect cellRect = args.GetCellRect(visibleColumnIdx);
if (visibleColumnIdx == 0)
{
cellRect.x += UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT;
cellRect.width -= UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT;
}
BranchesListColumn column =
(BranchesListColumn)args.GetColumn(visibleColumnIdx);
BranchesListViewItemCellGUI(
cellRect,
rowHeight,
queryResult,
item,
column,
avatarLoadedAction,
args.selected,
args.focused,
isBoldText);
}
}
static void BranchesListViewItemCellGUI(
Rect rect,
float rowHeight,
ViewQueryResult queryResult,
BranchListViewItem item,
BranchesListColumn column,
Action avatarLoadedAction,
bool isSelected,
bool isFocused,
bool isBoldText)
{
string columnText = RepObjectInfoView.GetColumnText(
queryResult.GetRepositorySpec(item.ObjectInfo),
queryResult.GetRepObjectInfo(item.ObjectInfo),
BranchesListHeaderState.GetColumnName(column));
if (column == BranchesListColumn.CreatedBy)
{
DrawTreeViewItem.ForItemCell(
rect,
rowHeight,
-1,
GetAvatar.ForEmail(columnText, avatarLoadedAction),
null,
columnText,
isSelected,
isFocused,
isBoldText,
false);
return;
}
if (column == BranchesListColumn.Branch ||
column == BranchesListColumn.Repository ||
column == BranchesListColumn.Guid)
{
DrawTreeViewItem.ForSecondaryLabel(
rect, columnText, isSelected, isFocused, isBoldText);
return;
}
DrawTreeViewItem.ForLabel(
rect, columnText, isSelected, isFocused, isBoldText);
}
static bool IsSizeChanged(
Rect currentRect, Rect lastRect)
{
if (currentRect.width != lastRect.width)
return true;
if (currentRect.height != lastRect.height)
return true;
return false;
}
Rect mLastRect;
ListViewItemIds<object> mListViewItemIds = new ListViewItemIds<object>();
List<TreeViewItem> mRows = new List<TreeViewItem>();
ViewQueryResult mQueryResult;
long mLoadedBranchId;
readonly CooldownWindowDelayer mCooldownFilterAction;
readonly Action mSizeChangedAction;
readonly BranchesViewMenu mMenu;
readonly List<string> mColumnNames;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1b909cb14b9a08c45b5d03f0b61feecb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,81 @@
using System.Collections.Generic;
using System.Linq;
using Codice.CM.Common;
using Unity.PlasticSCM.Editor.UI.Tree;
namespace Unity.PlasticSCM.Editor.Views.Branches
{
internal static class BranchesSelection
{
internal static void SelectBranches(
BranchesListView listView,
List<RepObjectInfo> branchesToSelect,
int defaultRow)
{
if (branchesToSelect == null || branchesToSelect.Count == 0)
{
TableViewOperations.SelectFirstRow(listView);
return;
}
listView.SelectRepObjectInfos(branchesToSelect);
if (listView.HasSelection())
return;
TableViewOperations.SelectDefaultRow(listView, defaultRow);
if (listView.HasSelection())
return;
TableViewOperations.SelectFirstRow(listView);
}
internal static List<RepObjectInfo> GetSelectedRepObjectInfos(
BranchesListView listView)
{
return listView.GetSelectedRepObjectInfos();
}
internal static int GetSelectedBranchesCount(
BranchesListView listView)
{
return listView.GetSelection().Count;
}
internal static BranchInfo GetSelectedBranch(
BranchesListView listView)
{
List<RepObjectInfo> selectedRepObjectsInfos = listView.GetSelectedRepObjectInfos();
if (selectedRepObjectsInfos.Count == 0)
return null;
return (BranchInfo)selectedRepObjectsInfos[0];
}
internal static List<BranchInfo> GetSelectedBranches(
BranchesListView listView)
{
return listView.GetSelectedRepObjectInfos().Cast<BranchInfo>().ToList();
}
internal static RepositorySpec GetSelectedRepository(
BranchesListView listView)
{
List<RepositorySpec> selectedRepositories = listView.GetSelectedRepositories();
if (selectedRepositories.Count == 0)
return null;
return selectedRepositories[0];
}
internal static List<RepositorySpec> GetSelectedRepositories(
BranchesListView listView)
{
return listView.GetSelectedRepositories();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 73306fe71bf092d4495ff28ee02b766b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,466 @@
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using Codice.Client.Common.Threading;
using Codice.CM.Common;
using PlasticGui;
using PlasticGui.WorkspaceWindow;
using PlasticGui.WorkspaceWindow.QueryViews;
using PlasticGui.WorkspaceWindow.QueryViews.Branches;
using PlasticGui.WorkspaceWindow.Update;
using Unity.PlasticSCM.Editor.AssetUtils;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Progress;
using Unity.PlasticSCM.Editor.UI.Tree;
using Unity.PlasticSCM.Editor.Views.Branches.Dialogs;
using Unity.PlasticSCM.Editor.Views.Changesets;
using GluonNewIncomingChangesUpdater = PlasticGui.Gluon.WorkspaceWindow.NewIncomingChangesUpdater;
namespace Unity.PlasticSCM.Editor.Views.Branches
{
internal class BranchesTab :
IRefreshableView,
IQueryRefreshableView,
IBranchMenuOperations
{
internal BranchesListView Table { get { return mBranchesListView; } }
internal IBranchMenuOperations Operations { get { return this; } }
internal BranchesTab(
WorkspaceInfo wkInfo,
IWorkspaceWindow workspaceWindow,
IViewSwitcher viewSwitcher,
IMergeViewLauncher mergeViewLauncher,
IUpdateReport updateReport,
NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
GluonNewIncomingChangesUpdater gluonNewIncomingChangesUpdater,
EditorWindow parentWindow)
{
mWkInfo = wkInfo;
mParentWindow = parentWindow;
mProgressControls = new ProgressControlsForViews();
mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
mGluonNewIncomingChangesUpdater = gluonNewIncomingChangesUpdater;
BuildComponents(
wkInfo,
workspaceWindow,
viewSwitcher,
mergeViewLauncher,
updateReport,
developerNewIncomingChangesUpdater,
parentWindow);
((IRefreshableView)this).Refresh();
}
internal void OnEnable()
{
mSearchField.downOrUpArrowKeyPressed +=
SearchField_OnDownOrUpArrowKeyPressed;
}
internal void OnDisable()
{
mSearchField.downOrUpArrowKeyPressed -=
SearchField_OnDownOrUpArrowKeyPressed;
TreeHeaderSettings.Save(
mBranchesListView.multiColumnHeader.state,
UnityConstants.BRANCHES_TABLE_SETTINGS_NAME);
}
internal void Update()
{
mProgressControls.UpdateProgress(mParentWindow);
}
internal void OnGUI()
{
DoActionsToolbar(mProgressControls);
DoBranchesArea(
mBranchesListView,
mProgressControls.IsOperationRunning());
}
internal void DrawSearchFieldForBranchesTab()
{
DrawSearchField.For(
mSearchField,
mBranchesListView,
UnityConstants.SEARCH_FIELD_WIDTH);
}
internal void DrawDateFilter()
{
GUI.enabled = !mProgressControls.IsOperationRunning();
EditorGUI.BeginChangeCheck();
mDateFilter.FilterType = (DateFilter.Type)
EditorGUILayout.EnumPopup(
mDateFilter.FilterType,
EditorStyles.toolbarDropDown,
GUILayout.Width(100));
if (EditorGUI.EndChangeCheck())
{
EnumPopupSetting<DateFilter.Type>.Save(
mDateFilter.FilterType,
UnityConstants.BRANCHES_DATE_FILTER_SETTING_NAME);
((IRefreshableView)this).Refresh();
}
GUI.enabled = true;
}
internal void SetWorkingObjectInfo(WorkingObjectInfo homeInfo)
{
lock(mLock)
{
mLoadedBranchId = homeInfo.BranchInfo.BranchId;
}
mBranchesListView.SetLoadedBranchId(mLoadedBranchId);
}
void IRefreshableView.Refresh()
{
// VCS-1005209 - There are scenarios where the list of branches need to check for incoming changes.
// For example, deleting the active branch will automatically switch your workspace to the parent changeset,
// which might have incoming changes.
if (mDeveloperNewIncomingChangesUpdater != null)
mDeveloperNewIncomingChangesUpdater.Update(DateTime.Now);
if (mGluonNewIncomingChangesUpdater != null)
mGluonNewIncomingChangesUpdater.Update(DateTime.Now);
string query = GetBranchesQuery(mDateFilter);
FillBranches(mWkInfo, query, BranchesSelection.
GetSelectedRepObjectInfos(mBranchesListView));
}
//IQueryRefreshableView
public void RefreshAndSelect(RepObjectInfo repObj)
{
string query = GetBranchesQuery(mDateFilter);
FillBranches(mWkInfo, query, new List<RepObjectInfo> { repObj });
}
int IBranchMenuOperations.GetSelectedBranchesCount()
{
return BranchesSelection.GetSelectedBranchesCount(mBranchesListView);
}
void IBranchMenuOperations.CreateBranch()
{
RepositorySpec repSpec = BranchesSelection.GetSelectedRepository(mBranchesListView);
BranchInfo branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);
BranchCreationData branchCreationData = CreateBranchDialog.CreateBranchFromLastParentBranchChangeset(
mParentWindow,
repSpec,
branchInfo);
mBranchOperations.CreateBranch(
branchCreationData,
RefreshAsset.BeforeLongAssetOperation,
RefreshAsset.AfterLongAssetOperation);
}
void IBranchMenuOperations.CreateTopLevelBranch() { }
void IBranchMenuOperations.SwitchToBranch()
{
RepositorySpec repSpec = BranchesSelection.GetSelectedRepository(mBranchesListView);
BranchInfo branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);
mBranchOperations.SwitchToBranch(
repSpec,
branchInfo,
RefreshAsset.BeforeLongAssetOperation,
RefreshAsset.AfterLongAssetOperation);
}
void IBranchMenuOperations.MergeBranch() { }
void IBranchMenuOperations.CherrypickBranch() { }
void IBranchMenuOperations.MergeToBranch() { }
void IBranchMenuOperations.PullBranch() { }
void IBranchMenuOperations.PullRemoteBranch() { }
void IBranchMenuOperations.SyncWithGit() { }
void IBranchMenuOperations.PushBranch() { }
void IBranchMenuOperations.DiffBranch() { }
void IBranchMenuOperations.DiffWithAnotherBranch() { }
void IBranchMenuOperations.ViewChangesets() { }
void IBranchMenuOperations.RenameBranch()
{
RepositorySpec repSpec = BranchesSelection.GetSelectedRepository(mBranchesListView);
BranchInfo branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);
BranchRenameData branchRenameData = RenameBranchDialog.GetBranchRenameData(
repSpec,
branchInfo,
mParentWindow);
mBranchOperations.RenameBranch(branchRenameData);
}
void IBranchMenuOperations.DeleteBranch()
{
var branchesToDelete = BranchesSelection.GetSelectedBranches(mBranchesListView);
if (!DeleteBranchDialog.ConfirmDelete(branchesToDelete))
return;
mBranchOperations.DeleteBranch(
BranchesSelection.GetSelectedRepositories(mBranchesListView),
branchesToDelete,
DeleteBranchOptions.IncludeChangesets);
}
void IBranchMenuOperations.CreateCodeReview() { }
void IBranchMenuOperations.ViewPermissions() { }
void SearchField_OnDownOrUpArrowKeyPressed()
{
mBranchesListView.SetFocusAndEnsureSelectedItem();
}
void OnBranchesListViewSizeChanged()
{
if (!mShouldScrollToSelection)
return;
mShouldScrollToSelection = false;
TableViewOperations.ScrollToSelection(mBranchesListView);
}
void FillBranches(
WorkspaceInfo wkInfo,
string query,
List<RepObjectInfo> branchesToSelect)
{
if (mIsRefreshing)
return;
mIsRefreshing = true;
int defaultRow = TableViewOperations.
GetFirstSelectedRow(mBranchesListView);
((IProgressControls)mProgressControls).ShowProgress(
PlasticLocalization.GetString(
PlasticLocalization.Name.LoadingBranches));
ViewQueryResult queryResult = null;
IThreadWaiter waiter = ThreadWaiter.GetWaiter();
waiter.Execute(
/*threadOperationDelegate*/ delegate
{
long loadedBranchId = GetLoadedBranchId(wkInfo);
lock(mLock)
{
mLoadedBranchId = loadedBranchId;
}
queryResult = new ViewQueryResult(
PlasticGui.Plastic.API.FindQuery(wkInfo, query));
},
/*afterOperationDelegate*/ delegate
{
try
{
if (waiter.Exception != null)
{
ExceptionsHandler.DisplayException(waiter.Exception);
return;
}
UpdateBranchesList(
mBranchesListView,
queryResult,
mLoadedBranchId);
int branchesCount = GetBranchesCount(queryResult);
if (branchesCount == 0)
{
return;
}
BranchesSelection.SelectBranches(
mBranchesListView, branchesToSelect, defaultRow);
}
finally
{
((IProgressControls)mProgressControls).HideProgress();
mIsRefreshing = false;
}
});
}
static void UpdateBranchesList(
BranchesListView branchesListView,
ViewQueryResult queryResult,
long loadedBranchId)
{
branchesListView.BuildModel(
queryResult, loadedBranchId);
branchesListView.Refilter();
branchesListView.Sort();
branchesListView.Reload();
}
static long GetLoadedBranchId(WorkspaceInfo wkInfo)
{
BranchInfo brInfo = PlasticGui.Plastic.API.GetWorkingBranch(wkInfo);
if (brInfo != null)
return brInfo.BranchId;
return -1;
}
static int GetBranchesCount(
ViewQueryResult queryResult)
{
if (queryResult == null)
return 0;
return queryResult.Count();
}
static string GetBranchesQuery(DateFilter dateFilter)
{
if (dateFilter.FilterType == DateFilter.Type.AllTime)
return QueryConstants.BranchesBeginningQuery;
string whereClause = QueryConstants.GetDateWhereClause(
dateFilter.GetTimeAgo());
return string.Format("{0} {1}",
QueryConstants.BranchesBeginningQuery,
whereClause);
}
static void DoActionsToolbar(ProgressControlsForViews progressControls)
{
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
if (progressControls.IsOperationRunning())
{
DrawProgressForViews.ForIndeterminateProgress(
progressControls.ProgressData);
}
GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();
}
static void DoBranchesArea(
BranchesListView branchesListView,
bool isOperationRunning)
{
EditorGUILayout.BeginVertical();
GUI.enabled = !isOperationRunning;
Rect rect = GUILayoutUtility.GetRect(0, 100000, 0, 100000);
branchesListView.OnGUI(rect);
GUI.enabled = true;
EditorGUILayout.EndVertical();
}
void BuildComponents(
WorkspaceInfo wkInfo,
IWorkspaceWindow workspaceWindow,
IViewSwitcher viewSwitcher,
IMergeViewLauncher mergeViewLauncher,
IUpdateReport updateReport,
NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
EditorWindow parentWindow)
{
mSearchField = new SearchField();
mSearchField.downOrUpArrowKeyPressed += SearchField_OnDownOrUpArrowKeyPressed;
DateFilter.Type dateFilterType =
EnumPopupSetting<DateFilter.Type>.Load(
UnityConstants.BRANCHES_DATE_FILTER_SETTING_NAME,
DateFilter.Type.LastMonth);
mDateFilter = new DateFilter(dateFilterType);
BranchesListHeaderState headerState =
BranchesListHeaderState.GetDefault();
TreeHeaderSettings.Load(headerState,
UnityConstants.BRANCHES_TABLE_SETTINGS_NAME,
(int)BranchesListColumn.CreationDate, false);
mBranchesListView = new BranchesListView(
headerState,
BranchesListHeaderState.GetColumnNames(),
new BranchesViewMenu(this),
sizeChangedAction: OnBranchesListViewSizeChanged);
mBranchesListView.Reload();
mBranchOperations = new BranchOperations(
wkInfo,
workspaceWindow,
viewSwitcher,
mergeViewLauncher,
this,
ViewType.BranchesView,
mProgressControls,
updateReport,
new ContinueWithPendingChangesQuestionerBuilder(viewSwitcher, parentWindow),
developerNewIncomingChangesUpdater);
}
SearchField mSearchField;
bool mIsRefreshing;
DateFilter mDateFilter;
bool mShouldScrollToSelection;
BranchesListView mBranchesListView;
BranchOperations mBranchOperations;
long mLoadedBranchId = -1;
object mLock = new object();
readonly WorkspaceInfo mWkInfo;
readonly ProgressControlsForViews mProgressControls;
readonly EditorWindow mParentWindow;
readonly NewIncomingChangesUpdater mDeveloperNewIncomingChangesUpdater;
readonly GluonNewIncomingChangesUpdater mGluonNewIncomingChangesUpdater;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2350e7d7f6d79024da24dea8f15a6881
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,166 @@
using UnityEditor;
using UnityEngine;
using PlasticGui;
using PlasticGui.WorkspaceWindow.QueryViews.Branches;
using Unity.PlasticSCM.Editor.UI;
namespace Unity.PlasticSCM.Editor.Views.Branches
{
internal class BranchesViewMenu
{
internal GenericMenu Menu { get { return mMenu; } }
internal BranchesViewMenu(
IBranchMenuOperations branchMenuOperations)
{
mBranchMenuOperations = branchMenuOperations;
BuildComponents();
}
internal void Popup()
{
mMenu = new GenericMenu();
UpdateMenuItems(mMenu);
mMenu.ShowAsContext();
}
internal bool ProcessKeyActionIfNeeded(Event e)
{
BranchMenuOperations operationToExecute = GetMenuOperations(e);
if (operationToExecute == BranchMenuOperations.None)
return false;
BranchMenuOperations operations =
BranchMenuUpdater.GetAvailableMenuOperations(
mBranchMenuOperations.GetSelectedBranchesCount(),
false);
if (!operations.HasFlag(operationToExecute))
return false;
ProcessMenuOperation(operationToExecute, mBranchMenuOperations);
return true;
}
void CreateBranchMenuItem_Click()
{
mBranchMenuOperations.CreateBranch();
}
void SwitchToBranchMenuItem_Click()
{
mBranchMenuOperations.SwitchToBranch();
}
void RenameBranchMenuItem_Click()
{
mBranchMenuOperations.RenameBranch();
}
void DeleteBranchMenuItem_Click()
{
mBranchMenuOperations.DeleteBranch();
}
internal void UpdateMenuItems(GenericMenu menu)
{
BranchMenuOperations operations = BranchMenuUpdater.GetAvailableMenuOperations(
mBranchMenuOperations.GetSelectedBranchesCount(), false);
AddBranchMenuItem(
mCreateBranchMenuItemContent,
menu,
operations,
BranchMenuOperations.CreateBranch,
CreateBranchMenuItem_Click);
AddBranchMenuItem(
mSwitchToBranchMenuItemContent,
menu,
operations,
BranchMenuOperations.SwitchToBranch,
SwitchToBranchMenuItem_Click);
menu.AddSeparator(string.Empty);
AddBranchMenuItem(
mRenameBranchMenuItemContent,
menu,
operations,
BranchMenuOperations.Rename,
RenameBranchMenuItem_Click);
AddBranchMenuItem(
mDeleteBranchMenuItemContent,
menu,
operations,
BranchMenuOperations.Delete,
DeleteBranchMenuItem_Click);
}
static void AddBranchMenuItem(
GUIContent menuItemContent,
GenericMenu menu,
BranchMenuOperations operations,
BranchMenuOperations operationsToCheck,
GenericMenu.MenuFunction menuFunction)
{
if (operations.HasFlag(operationsToCheck))
{
menu.AddItem(
menuItemContent,
false,
menuFunction);
return;
}
menu.AddDisabledItem(menuItemContent);
}
static void ProcessMenuOperation(
BranchMenuOperations operationToExecute,
IBranchMenuOperations branchMenuOperations)
{
if (operationToExecute == BranchMenuOperations.Delete)
{
branchMenuOperations.DeleteBranch();
return;
}
}
static BranchMenuOperations GetMenuOperations(Event e)
{
if (Keyboard.IsKeyPressed(e, KeyCode.Delete))
return BranchMenuOperations.Delete;
return BranchMenuOperations.None;
}
void BuildComponents()
{
mCreateBranchMenuItemContent = new GUIContent(
PlasticLocalization.GetString(PlasticLocalization.Name.BranchMenuItemCreateBranch));
mSwitchToBranchMenuItemContent = new GUIContent(
PlasticLocalization.GetString(PlasticLocalization.Name.BranchMenuItemSwitchToBranch));
mRenameBranchMenuItemContent = new GUIContent(
PlasticLocalization.GetString(PlasticLocalization.Name.BranchMenuItemRenameBranch));
mDeleteBranchMenuItemContent = new GUIContent(string.Format("{0} {1}",
PlasticLocalization.GetString(PlasticLocalization.Name.BranchMenuItemDeleteBranch),
GetPlasticShortcut.ForDelete()));
}
GenericMenu mMenu;
GUIContent mCreateBranchMenuItemContent;
GUIContent mSwitchToBranchMenuItemContent;
GUIContent mRenameBranchMenuItemContent;
GUIContent mDeleteBranchMenuItemContent;
readonly IBranchMenuOperations mBranchMenuOperations;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a1f5156c89fd104459e8ec0cc3098899
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 16e16045695760047a9bd172458c5d6b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,193 @@
using UnityEditor;
using UnityEngine;
using Codice.CM.Common;
using PlasticGui;
using PlasticGui.WorkspaceWindow.QueryViews.Branches;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Progress;
namespace Unity.PlasticSCM.Editor.Views.Branches.Dialogs
{
class CreateBranchDialog : PlasticDialog
{
protected override Rect DefaultRect
{
get
{
var baseRect = base.DefaultRect;
return new Rect(baseRect.x, baseRect.y, 710, 290);
}
}
protected override string GetTitle()
{
return PlasticLocalization.GetString(PlasticLocalization.Name.CreateChildBranchTitle);
}
protected override void OnModalGUI()
{
DoTitleArea();
DoFieldsArea();
DoButtonsArea();
}
internal static BranchCreationData CreateBranchFromLastParentBranchChangeset(
EditorWindow parentWindow,
RepositorySpec repSpec,
BranchInfo parentBranchInfo )
{
string changesetStr = PlasticLocalization.GetString(
PlasticLocalization.Name.LastChangeset);
string explanation = BranchCreationUserInfo.GetFromObjectString(
repSpec, parentBranchInfo, changesetStr);
CreateBranchDialog dialog = Create(repSpec, parentBranchInfo, explanation);
ResponseType dialogueResult = dialog.RunModal(parentWindow);
BranchCreationData result = dialog.BuildCreationData();
result.Result = dialogueResult == ResponseType.Ok;
return result;
}
void DoTitleArea()
{
GUILayout.BeginVertical();
Title(PlasticLocalization.GetString(PlasticLocalization.Name.CreateChildBranchTitle));
GUILayout.Space(5);
Paragraph(string.Format("{0} {1}", PlasticLocalization.GetString(
PlasticLocalization.Name.CreateChildBranchExplanation), mExplanation));
GUILayout.EndVertical();
}
void DoFieldsArea()
{
GUILayout.BeginVertical();
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Label(
PlasticLocalization.GetString(PlasticLocalization.Name.BranchNameEntry),
GUILayout.Width(100));
GUI.SetNextControlName(NAME_FIELD_CONTROL_NAME);
mNewBranchName = GUILayout.TextField(mNewBranchName);
if (!mWasNameFieldFocused)
{
EditorGUI.FocusTextInControl(NAME_FIELD_CONTROL_NAME);
mWasNameFieldFocused = true;
}
GUILayout.Space(5);
}
GUILayout.Space(5);
using (new EditorGUILayout.HorizontalScope())
{
using (new EditorGUILayout.VerticalScope(GUILayout.Width(100)))
{
GUILayout.Space(49);
GUILayout.Label(
PlasticLocalization.GetString(PlasticLocalization.Name.CommentsEntry),
GUILayout.Width(100));
}
mComment = GUILayout.TextArea(mComment, GUILayout.Height(100));
GUILayout.Space(5);
}
GUILayout.Space(5);
mSwitchToBranch = GUILayout.Toggle(mSwitchToBranch, PlasticLocalization.GetString(PlasticLocalization.Name.SwitchToBranchCheckButton));
GUILayout.Space(5);
GUILayout.EndVertical();
}
void DoButtonsArea()
{
using (new EditorGUILayout.HorizontalScope())
{
using (new EditorGUILayout.HorizontalScope(GUILayout.MinWidth(500)))
{
GUILayout.Space(2);
DrawProgressForDialogs.For(
mProgressControls.ProgressData);
GUILayout.Space(2);
}
GUILayout.FlexibleSpace();
DoCreateButton();
DoCancelButton();
}
}
void DoCancelButton()
{
if (NormalButton(PlasticLocalization.GetString(
PlasticLocalization.Name.CancelButton)))
{
CancelButtonAction();
}
}
void DoCreateButton()
{
if (!NormalButton(PlasticLocalization.GetString(PlasticLocalization.Name.CreateButton)))
return;
BranchCreationValidation.AsyncValidation(
BuildCreationData(), this, mProgressControls);
}
static CreateBranchDialog Create(RepositorySpec repSpec, BranchInfo parentBranchInfo, string explanation)
{
var instance = CreateInstance<CreateBranchDialog>();
instance.IsResizable = false;
instance.mEscapeKeyAction = instance.CloseButtonAction;
instance.mRepositorySpec = repSpec;
instance.mParentBranchInfo = parentBranchInfo;
instance.mNewBranchName = "";
instance.mComment = "";
instance.mSwitchToBranch = true;
instance.mProgressControls = new ProgressControlsForDialogs();
instance.mExplanation = explanation;
return instance;
}
BranchCreationData BuildCreationData()
{
return new BranchCreationData(
mRepositorySpec,
mParentBranchInfo,
mParentBranchInfo.Changeset,
mNewBranchName,
mComment,
null,
mSwitchToBranch);
}
ProgressControlsForDialogs mProgressControls;
RepositorySpec mRepositorySpec;
BranchInfo mParentBranchInfo;
string mNewBranchName;
string mComment;
bool mSwitchToBranch;
string mExplanation;
bool mWasNameFieldFocused;
const string NAME_FIELD_CONTROL_NAME = "CreateBranchNameField";
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a0fc5252a48d8b34f945b4ae3ad45030
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Codice.CM.Common;
using PlasticGui;
using Unity.PlasticSCM.Editor.UI;
using UnityEditor;
using UnityEngine;
namespace Unity.PlasticSCM.Editor.Views.Branches.Dialogs
{
internal class DeleteBranchDialog : PlasticDialog
{
protected override Rect DefaultRect
{
get
{
var baseRect = base.DefaultRect;
var increaseFactor = mNumberOfBranches <= MAX_ITEMS_TO_SHOW ?
TEXT_LINE_HEIGHT * mNumberOfBranches :
TEXT_LINE_HEIGHT * (MAX_ITEMS_TO_SHOW + 1);
return new Rect(baseRect.x, baseRect.y, baseRect.width, baseRect.height + increaseFactor);
}
}
internal static bool ConfirmDelete(IList<BranchInfo> branches)
{
DeleteBranchDialog dialog = Create(branches);
return dialog.RunModal(null) == ResponseType.Ok;
}
protected override string GetTitle()
{
return mTitle;
}
protected override void OnModalGUI()
{
Paragraph(mMessage);
GUILayout.Space(5);
DoButtonsArea();
}
void DoButtonsArea()
{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
mConfirmDelete = ToggleEntry(
PlasticLocalization.Name.ConfirmationCheckBox.GetString(),
mConfirmDelete);
GUILayout.Space(10);
if (Application.platform == RuntimePlatform.WindowsEditor)
{
DoDeleteButton();
DoCancelButton();
return;
}
DoCancelButton();
DoDeleteButton();
}
}
void DoCancelButton()
{
if (!NormalButton(PlasticLocalization.Name.NoButton.GetString()))
return;
CancelButtonAction();
}
void DoDeleteButton()
{
GUI.enabled = mConfirmDelete;
if (NormalButton(PlasticLocalization.Name.DeleteButton.GetString()))
{
OkButtonAction();
}
GUI.enabled = true;
}
static DeleteBranchDialog Create(IList<BranchInfo> branches)
{
var instance = CreateInstance<DeleteBranchDialog>();
instance.mMessage = BuildDeleteBranchesConfirmationMessage(branches);
instance.mNumberOfBranches = branches.Count;
instance.mTitle = PlasticLocalization.Name.ConfirmDeleteTitle.GetString();
return instance;
}
static string BuildDeleteBranchesConfirmationMessage(IList<BranchInfo> branchToDelete)
{
string[] itemNames = branchToDelete.Select(x => x.Name).ToArray();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine(PlasticLocalization.Name.DeleteBranchesExplanation.GetString());
stringBuilder.AppendLine();
int num = Math.Min(itemNames.Length, MAX_ITEMS_TO_SHOW);
for (int i = 0; i < num; i++)
{
stringBuilder.AppendLine(" " + (i + 1) + ". " + itemNames[i]);
}
if (itemNames.Length > MAX_ITEMS_TO_SHOW)
{
stringBuilder.AppendLine(PlasticLocalization.Name.DeleteOthersMessage.GetString(itemNames.Length - MAX_ITEMS_TO_SHOW));
}
stringBuilder.AppendLine();
stringBuilder.AppendLine(PlasticLocalization.Name.DeleteBranchesConfirmation.GetString());
return stringBuilder.ToString();
}
const int TEXT_LINE_HEIGHT = 15;
const int MAX_ITEMS_TO_SHOW = 10;
string mMessage;
string mTitle;
int mNumberOfBranches;
bool mConfirmDelete;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6780ea954e283bd4f82686f6e5ebafee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,164 @@
using UnityEditor;
using UnityEngine;
using Codice.CM.Common;
using PlasticGui;
using PlasticGui.WorkspaceWindow.QueryViews.Branches;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.Progress;
namespace Unity.PlasticSCM.Editor.Views.Branches.Dialogs
{
internal class RenameBranchDialog : PlasticDialog
{
protected override Rect DefaultRect
{
get
{
var baseRect = base.DefaultRect;
return new Rect(baseRect.x, baseRect.y, 500, 200);
}
}
internal static BranchRenameData GetBranchRenameData(
RepositorySpec repSpec,
BranchInfo branchInfo,
EditorWindow parentWindow)
{
RenameBranchDialog dialog = Create(
repSpec,
branchInfo,
new ProgressControlsForDialogs());
ResponseType dialogResult = dialog.RunModal(parentWindow);
BranchRenameData result = dialog.BuildRenameData();
result.Result = dialogResult == ResponseType.Ok;
return result;
}
static RenameBranchDialog Create(
RepositorySpec repSpec,
BranchInfo branchInfo,
ProgressControlsForDialogs progressControls)
{
var instance = CreateInstance<RenameBranchDialog>();
instance.mRepSpec = repSpec;
instance.mBranchInfo = branchInfo;
instance.mBranchName = BranchRenameUserInfo.GetShortBranchName(branchInfo.BranchName);
instance.mTitle = PlasticLocalization.GetString(
PlasticLocalization.Name.RenameBranchTitle);
instance.mProgressControls = progressControls;
return instance;
}
protected override string GetTitle()
{
return mTitle;
}
protected override void OnModalGUI()
{
Title(mTitle);
GUILayout.Space(10f);
DoInputArea();
GUILayout.Space(10f);
DrawProgressForDialogs.For(mProgressControls.ProgressData);
GUILayout.Space(10f);
DoButtonsArea();
}
void DoInputArea()
{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Label(
PlasticLocalization.GetString(PlasticLocalization.Name.NewName),
GUILayout.ExpandWidth(false));
GUILayout.Space(10f);
GUI.SetNextControlName(RENAME_BRANCH_TEXTAREA_NAME);
mBranchName = GUILayout.TextField(
mBranchName,
GUILayout.ExpandWidth(true));
if (!mTextAreaFocused)
{
EditorGUI.FocusTextInControl(RENAME_BRANCH_TEXTAREA_NAME);
mTextAreaFocused = true;
}
}
}
void DoButtonsArea()
{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
if (Application.platform == RuntimePlatform.WindowsEditor)
{
DoOkButton();
DoCancelButton();
return;
}
DoCancelButton();
DoOkButton();
}
}
void DoOkButton()
{
if (!NormalButton(PlasticLocalization.GetString(
PlasticLocalization.Name.RenameButton)))
return;
OkButtonWithValidationAction();
}
void DoCancelButton()
{
if (!NormalButton(PlasticLocalization.GetString(
PlasticLocalization.Name.CancelButton)))
return;
CancelButtonAction();
}
void OkButtonWithValidationAction()
{
BranchRenameValidation.AsyncValidation(
BuildRenameData(),
this,
mProgressControls);
}
BranchRenameData BuildRenameData()
{
return new BranchRenameData(mRepSpec, mBranchInfo, mBranchName);
}
string mTitle;
string mBranchName;
bool mTextAreaFocused;
RepositorySpec mRepSpec;
BranchInfo mBranchInfo;
ProgressControlsForDialogs mProgressControls;
const string RENAME_BRANCH_TEXTAREA_NAME = "rename_branch_textarea";
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1de62e30afcba544e8e8da4b93a4fa39
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: