Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f37d5f9

Browse files
Merge branch 'master' into enhancements/user-settings-view
2 parents 29d9b1c + 1868d98 commit f37d5f9

File tree

8 files changed

+73
-61
lines changed

8 files changed

+73
-61
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/AuthenticationView.cs

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,8 @@ class AuthenticationView : Subview
2929
[NonSerialized] private string errorMessage;
3030
[NonSerialized] private bool enterPressed;
3131
[NonSerialized] private string password = "";
32-
3332
[NonSerialized] private AuthenticationService authenticationService;
34-
private AuthenticationService AuthenticationService
35-
{
36-
get
37-
{
38-
if (authenticationService == null)
39-
{
40-
UriString host;
41-
if (Repository != null && Repository.CloneUrl != null && Repository.CloneUrl.IsValidUri)
42-
{
43-
host = new UriString(Repository.CloneUrl.ToRepositoryUri()
44-
.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
45-
}
46-
else
47-
{
48-
host = UriString.ToUriString(HostAddress.GitHubDotComHostAddress.WebUri);
49-
}
5033

51-
AuthenticationService = new AuthenticationService(host, Platform.Keychain);
52-
}
53-
return authenticationService;
54-
}
55-
set
56-
{
57-
authenticationService = value;
58-
}
59-
}
6034

6135
public override void InitializeView(IView parent)
6236
{
@@ -124,11 +98,6 @@ public override void OnGUI()
12498
GUILayout.EndScrollView();
12599
}
126100

127-
public override bool IsBusy
128-
{
129-
get { return isBusy; }
130-
}
131-
132101
private void HandleEnterPressed()
133102
{
134103
if (Event.current.type != EventType.KeyDown)
@@ -255,5 +224,37 @@ private void ShowErrorMessage()
255224
GUILayout.Label(errorMessage, Styles.ErrorLabel);
256225
}
257226
}
227+
228+
private AuthenticationService AuthenticationService
229+
{
230+
get
231+
{
232+
if (authenticationService == null)
233+
{
234+
UriString host;
235+
if (Repository != null && Repository.CloneUrl != null && Repository.CloneUrl.IsValidUri)
236+
{
237+
host = new UriString(Repository.CloneUrl.ToRepositoryUri()
238+
.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
239+
}
240+
else
241+
{
242+
host = UriString.ToUriString(HostAddress.GitHubDotComHostAddress.WebUri);
243+
}
244+
245+
AuthenticationService = new AuthenticationService(host, Platform.Keychain);
246+
}
247+
return authenticationService;
248+
}
249+
set
250+
{
251+
authenticationService = value;
252+
}
253+
}
254+
255+
public override bool IsBusy
256+
{
257+
get { return isBusy; }
258+
}
258259
}
259260
}

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ public override void OnGUI()
146146
OnEmbeddedGUI();
147147
}
148148

149-
public override bool IsBusy
150-
{
151-
get { return false; }
152-
}
153-
154149
public void OnEmbeddedGUI()
155150
{
156151
scroll = GUILayout.BeginScrollView(scroll);
@@ -756,6 +751,11 @@ private void OnTreeNodeChildrenGUI(BranchTreeNode node)
756751
}
757752
}
758753

754+
public override bool IsBusy
755+
{
756+
get { return false; }
757+
}
758+
759759
private enum NodeType
760760
{
761761
Folder,

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ public override void OnDisable()
5252
Repository.OnStatusUpdated -= RunStatusUpdateOnMainThread;
5353
}
5454

55-
public override bool IsBusy
56-
{
57-
get { return isBusy; }
58-
}
59-
6055
private void RunStatusUpdateOnMainThread(GitStatus status)
6156
{
6257
new ActionTask(TaskManager.Token, _ => OnStatusUpdate(status))
@@ -217,5 +212,10 @@ private void Commit()
217212
isBusy = false;
218213
}).Start();
219214
}
215+
216+
public override bool IsBusy
217+
{
218+
get { return isBusy; }
219+
}
220220
}
221221
}

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesetTreeView.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ public override void OnGUI()
8686
GUILayout.EndVertical();
8787
}
8888

89-
public override bool IsBusy
90-
{
91-
get { return false; }
92-
}
93-
94-
private void OnCommitTreeChange()
95-
{
96-
Height = 0f;
97-
Redraw();
98-
}
99-
10089
public void UpdateEntries(IList<GitStatusEntry> newEntries)
10190
{
10291
// Handle the empty list scenario
@@ -117,6 +106,12 @@ public void UpdateEntries(IList<GitStatusEntry> newEntries)
117106
OnCommitTreeChange();
118107
}
119108

109+
private void OnCommitTreeChange()
110+
{
111+
Height = 0f;
112+
Redraw();
113+
}
114+
120115
private void TreeNode(FileTreeNode node)
121116
{
122117
GUILayout.Space(Styles.TreeVerticalSpacing);
@@ -280,6 +275,11 @@ private void TreeNode(FileTreeNode node)
280275
GUILayout.EndHorizontal();
281276
}
282277

278+
public override bool IsBusy
279+
{
280+
get { return false; }
281+
}
282+
283283
public float Height { get; protected set; }
284284

285285
public bool Readonly { get; set; }

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ public override void OnGUI()
125125
OnEmbeddedGUI();
126126
}
127127

128-
public override bool IsBusy
129-
{
130-
get { return isBusy; }
131-
}
132128
private void AttachHandlers(IRepository repository)
133129
{
134130
if (repository == null)
@@ -750,6 +746,11 @@ private void DrawTimelineRectAroundIconRect(Rect parentRect, Rect iconRect)
750746
EditorGUI.DrawRect(bottomTimelineRect, timelineBarColor);
751747
}
752748

749+
public override bool IsBusy
750+
{
751+
get { return isBusy; }
752+
}
753+
753754
private float EntryHeight
754755
{
755756
get { return Styles.HistoryEntryHeight + Styles.HistoryEntryPadding; }

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PopupWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ public override void OnDestroy()
113113
OnClose = null;
114114
}
115115

116+
public override bool IsBusy
117+
{
118+
get { return ActiveView.IsBusy; }
119+
}
120+
116121
private Subview ActiveView
117122
{
118123
get

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/SettingsView.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,5 +464,10 @@ private void OnLoggingSettingsGui()
464464
}
465465
EditorGUI.EndDisabledGroup();
466466
}
467+
468+
public override bool IsBusy
469+
{
470+
get { return isBusy; }
471+
}
467472
}
468473
}

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ public override void OnSelectionChange()
139139
ActiveView.OnSelectionChange();
140140
}
141141

142-
public override bool IsBusy
143-
{
144-
get { return false; }
145-
}
146-
147142
public override void Refresh()
148143
{
149144
base.Refresh();
@@ -405,6 +400,11 @@ public SettingsView SettingsView
405400
get { return settingsView; }
406401
}
407402

403+
public override bool IsBusy
404+
{
405+
get { return false; }
406+
}
407+
408408
private Subview ActiveView
409409
{
410410
get

0 commit comments

Comments
 (0)