This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +10
-41
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 4 files changed +10
-41
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ class BranchesView : Subview
39
39
[ NonSerialized ] private int listID = - 1 ;
40
40
[ NonSerialized ] private BranchesMode targetMode ;
41
41
42
- [ SerializeField ] private BranchesTree treeLocals ;
43
- [ SerializeField ] private BranchesTree treeRemotes ;
42
+ [ SerializeField ] private BranchesTree treeLocals = new BranchesTree { Title = LocalTitle } ;
43
+ [ SerializeField ] private BranchesTree treeRemotes = new BranchesTree { Title = RemoteTitle , IsRemote = true } ;
44
44
[ SerializeField ] private BranchesMode mode = BranchesMode . Default ;
45
45
[ SerializeField ] private string newBranchName ;
46
46
[ SerializeField ] private Vector2 scroll ;
@@ -155,18 +155,6 @@ private void Render()
155
155
156
156
private void BuildTree ( )
157
157
{
158
- if ( treeLocals == null )
159
- {
160
- treeLocals = new BranchesTree ( ) ;
161
- treeLocals . Title = LocalTitle ;
162
-
163
- treeRemotes = new BranchesTree ( ) ;
164
- treeRemotes . Title = RemoteTitle ;
165
- treeRemotes . IsRemote = true ;
166
-
167
- TreeOnEnable ( ) ;
168
- }
169
-
170
158
localBranches . Sort ( CompareBranches ) ;
171
159
remoteBranches . Sort ( CompareBranches ) ;
172
160
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class ChangesView : Subview
28
28
[ SerializeField ] private string currentBranch = "[unknown]" ;
29
29
30
30
[ SerializeField ] private Vector2 treeScroll ;
31
- [ SerializeField ] private ChangesTree treeChanges ;
31
+ [ SerializeField ] private ChangesTree treeChanges = new ChangesTree { DisplayRootNode = false , IsCheckable = true } ;
32
32
33
33
[ SerializeField ] private HashSet < string > gitLocks ;
34
34
[ SerializeField ] private List < GitStatusEntry > gitStatusEntries ;
@@ -212,17 +212,7 @@ private void MaybeUpdateData()
212
212
213
213
private void BuildTree ( )
214
214
{
215
- if ( treeChanges == null )
216
- {
217
- treeChanges = new ChangesTree ( ) ;
218
- treeChanges . Title = "Changes" ;
219
- treeChanges . DisplayRootNode = false ;
220
- treeChanges . IsCheckable = true ;
221
- treeChanges . PathSeparator = Environment . FileSystem . DirectorySeparatorChar . ToString ( ) ;
222
-
223
- TreeOnEnable ( ) ;
224
- }
225
-
215
+ treeChanges . PathSeparator = Environment . FileSystem . DirectorySeparatorChar . ToString ( ) ;
226
216
treeChanges . Load ( gitStatusEntries . Select ( entry => new GitStatusEntryTreeData ( entry , gitLocks . Contains ( entry . Path ) ) ) ) ;
227
217
Redraw ( ) ;
228
218
}
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ class HistoryView : Subview
342
342
[ SerializeField ] private int statusAhead ;
343
343
[ SerializeField ] private int statusBehind ;
344
344
345
- [ SerializeField ] private ChangesTree treeChanges ;
345
+ [ SerializeField ] private ChangesTree treeChanges = new ChangesTree { IsSelectable = false , DisplayRootNode = false } ;
346
346
347
347
[ SerializeField ] private CacheUpdateEvent lastCurrentRemoteChangedEvent ;
348
348
[ SerializeField ] private CacheUpdateEvent lastLogChangedEvent ;
@@ -716,17 +716,7 @@ private void Fetch()
716
716
717
717
private void BuildTree ( )
718
718
{
719
- if ( treeChanges == null )
720
- {
721
- treeChanges = new ChangesTree ( ) ;
722
- treeChanges . Title = "Changes" ;
723
- treeChanges . IsSelectable = false ;
724
- treeChanges . DisplayRootNode = false ;
725
- treeChanges . PathSeparator = Environment . FileSystem . DirectorySeparatorChar . ToString ( ) ;
726
-
727
- TreeOnEnable ( ) ;
728
- }
729
-
719
+ treeChanges . PathSeparator = Environment . FileSystem . DirectorySeparatorChar . ToString ( ) ;
730
720
treeChanges . Load ( selectedEntry . changes . Select ( entry => new GitStatusEntryTreeData ( entry ) ) ) ;
731
721
Redraw ( ) ;
732
722
}
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ class InitProjectView : Subview
10
10
private const string NoRepoTitle = "To begin using GitHub, initialize a git repository" ;
11
11
private const string NoUserOrEmailError = "Name and email not set in git. Go into the settings tab and enter the missing information" ;
12
12
13
- [ NonSerialized ] private bool isBusy ;
14
- [ NonSerialized ] private bool isUserDataPresent ;
15
- [ NonSerialized ] private bool hasCompletedInitialCheck ;
13
+ [ SerializeField ] private bool hasCompletedInitialCheck ;
14
+ [ SerializeField ] private bool isUserDataPresent ;
16
15
17
16
[ SerializeField ] private CacheUpdateEvent lastCheckUserChangedEvent ;
17
+
18
+ [ NonSerialized ] private bool isBusy ;
18
19
[ NonSerialized ] private bool userHasChanges ;
19
20
20
21
public override void OnEnable ( )
You can’t perform that action at this time.
0 commit comments