@@ -26,6 +26,7 @@ class Window : BaseWindow
26
26
[ SerializeField ] private SubTab changeTab = SubTab . History ;
27
27
[ SerializeField ] private SubTab activeTab = SubTab . History ;
28
28
[ SerializeField ] private InitProjectView initProjectView = new InitProjectView ( ) ;
29
+ [ SerializeField ] private LoadingView loadingView = new LoadingView ( ) ;
29
30
[ SerializeField ] private BranchesView branchesView = new BranchesView ( ) ;
30
31
[ SerializeField ] private ChangesView changesView = new ChangesView ( ) ;
31
32
[ SerializeField ] private HistoryView historyView = new HistoryView ( ) ;
@@ -39,6 +40,7 @@ class Window : BaseWindow
39
40
40
41
[ SerializeField ] private CacheUpdateEvent lastCurrentBranchAndRemoteChangedEvent ;
41
42
[ NonSerialized ] private bool currentBranchAndRemoteHasUpdate ;
43
+ [ NonSerialized ] private bool gitExecutableIsSet ;
42
44
43
45
[ MenuItem ( LaunchMenu ) ]
44
46
public static void Window_GitHub ( )
@@ -84,9 +86,18 @@ public override void Initialize(IApplicationManager applicationManager)
84
86
{
85
87
base . Initialize ( applicationManager ) ;
86
88
87
- if ( ! HasRepository && activeTab != SubTab . InitProject && activeTab != SubTab . Settings )
89
+ gitExecutableIsSet = Environment . GitExecutablePath != null ;
90
+
91
+ if ( ! gitExecutableIsSet && activeTab != SubTab . Loading )
92
+ {
93
+ changeTab = activeTab = SubTab . Loading ;
94
+ }
95
+ else if ( ! HasRepository && activeTab != SubTab . InitProject && activeTab != SubTab . Settings )
96
+ {
88
97
changeTab = activeTab = SubTab . InitProject ;
98
+ }
89
99
100
+ LoadingView . InitializeView ( this ) ;
90
101
HistoryView . InitializeView ( this ) ;
91
102
ChangesView . InitializeView ( this ) ;
92
103
BranchesView . InitializeView ( this ) ;
@@ -165,12 +176,15 @@ public override void OnUI()
165
176
{
166
177
base . OnUI ( ) ;
167
178
168
- if ( HasRepository )
169
- {
170
- DoHeaderGUI ( ) ;
171
- }
179
+ if ( gitExecutableIsSet )
180
+ {
181
+ if ( HasRepository )
182
+ {
183
+ DoHeaderGUI ( ) ;
184
+ }
172
185
173
- DoToolbarGUI ( ) ;
186
+ DoToolbarGUI ( ) ;
187
+ }
174
188
175
189
// GUI for the active tab
176
190
if ( ActiveView != null )
@@ -442,6 +456,8 @@ private Subview ToView(SubTab tab)
442
456
{
443
457
switch ( tab )
444
458
{
459
+ case SubTab . Loading :
460
+ return loadingView ;
445
461
case SubTab . InitProject :
446
462
return initProjectView ;
447
463
case SubTab . History :
@@ -457,6 +473,11 @@ private Subview ToView(SubTab tab)
457
473
}
458
474
}
459
475
476
+ public LoadingView LoadingView
477
+ {
478
+ get { return loadingView ; }
479
+ }
480
+
460
481
public HistoryView HistoryView
461
482
{
462
483
get { return historyView ; }
@@ -495,6 +516,7 @@ public override bool IsBusy
495
516
private enum SubTab
496
517
{
497
518
None ,
519
+ Loading ,
498
520
InitProject ,
499
521
History ,
500
522
Changes ,
0 commit comments