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
3939 [ NonSerialized ] private int listID = - 1 ;
4040 [ NonSerialized ] private BranchesMode targetMode ;
4141
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 } ;
4444 [ SerializeField ] private BranchesMode mode = BranchesMode . Default ;
4545 [ SerializeField ] private string newBranchName ;
4646 [ SerializeField ] private Vector2 scroll ;
@@ -155,18 +155,6 @@ private void Render()
155155
156156 private void BuildTree ( )
157157 {
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-
170158 localBranches . Sort ( CompareBranches ) ;
171159 remoteBranches . Sort ( CompareBranches ) ;
172160
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class ChangesView : Subview
2828 [ SerializeField ] private string currentBranch = "[unknown]" ;
2929
3030 [ SerializeField ] private Vector2 treeScroll ;
31- [ SerializeField ] private ChangesTree treeChanges ;
31+ [ SerializeField ] private ChangesTree treeChanges = new ChangesTree { DisplayRootNode = false , IsCheckable = true } ;
3232
3333 [ SerializeField ] private HashSet < string > gitLocks ;
3434 [ SerializeField ] private List < GitStatusEntry > gitStatusEntries ;
@@ -212,17 +212,7 @@ private void MaybeUpdateData()
212212
213213 private void BuildTree ( )
214214 {
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 ( ) ;
226216 treeChanges . Load ( gitStatusEntries . Select ( entry => new GitStatusEntryTreeData ( entry , gitLocks . Contains ( entry . Path ) ) ) ) ;
227217 Redraw ( ) ;
228218 }
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ class HistoryView : Subview
342342 [ SerializeField ] private int statusAhead ;
343343 [ SerializeField ] private int statusBehind ;
344344
345- [ SerializeField ] private ChangesTree treeChanges ;
345+ [ SerializeField ] private ChangesTree treeChanges = new ChangesTree { IsSelectable = false , DisplayRootNode = false } ;
346346
347347 [ SerializeField ] private CacheUpdateEvent lastCurrentRemoteChangedEvent ;
348348 [ SerializeField ] private CacheUpdateEvent lastLogChangedEvent ;
@@ -716,17 +716,7 @@ private void Fetch()
716716
717717 private void BuildTree ( )
718718 {
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 ( ) ;
730720 treeChanges . Load ( selectedEntry . changes . Select ( entry => new GitStatusEntryTreeData ( entry ) ) ) ;
731721 Redraw ( ) ;
732722 }
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ class InitProjectView : Subview
1010 private const string NoRepoTitle = "To begin using GitHub, initialize a git repository" ;
1111 private const string NoUserOrEmailError = "Name and email not set in git. Go into the settings tab and enter the missing information" ;
1212
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 ;
1615
1716 [ SerializeField ] private CacheUpdateEvent lastCheckUserChangedEvent ;
17+
18+ [ NonSerialized ] private bool isBusy ;
1819 [ NonSerialized ] private bool userHasChanges ;
1920
2021 public override void OnEnable ( )
You can’t perform that action at this time.
0 commit comments