This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ class GitPathView : Subview
30
30
31
31
[ NonSerialized ] private bool isBusy ;
32
32
[ NonSerialized ] private bool gitExecHasChanged ;
33
+ [ NonSerialized ] private bool gitExecutableIsSet ;
34
+
35
+ public override void InitializeView ( IView parent )
36
+ {
37
+ base . InitializeView ( parent ) ;
38
+ gitExecutableIsSet = Environment . GitExecutablePath != null ;
39
+ }
33
40
34
41
public override void OnEnable ( )
35
42
{
@@ -48,7 +55,7 @@ public override void OnGUI()
48
55
// Install path
49
56
GUILayout . Label ( GitInstallTitle , EditorStyles . boldLabel ) ;
50
57
51
- EditorGUI . BeginDisabledGroup ( IsBusy || Parent . IsBusy ) ;
58
+ EditorGUI . BeginDisabledGroup ( ! gitExecutableIsSet || IsBusy || Parent . IsBusy ) ;
52
59
{
53
60
// Install path field
54
61
GUILayout . BeginHorizontal ( ) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ class InitProjectView : Subview
17
17
18
18
[ NonSerialized ] private bool isBusy ;
19
19
[ NonSerialized ] private bool userHasChanges ;
20
+ [ NonSerialized ] private bool gitExecutableIsSet ;
21
+
22
+ public override void InitializeView ( IView parent )
23
+ {
24
+ base . InitializeView ( parent ) ;
25
+ gitExecutableIsSet = Environment . GitExecutablePath != null ;
26
+ }
20
27
21
28
public override void OnEnable ( )
22
29
{
@@ -54,7 +61,7 @@ public override void OnGUI()
54
61
{
55
62
GUILayout . FlexibleSpace ( ) ;
56
63
57
- EditorGUI . BeginDisabledGroup ( IsBusy || ! isUserDataPresent ) ;
64
+ EditorGUI . BeginDisabledGroup ( ! gitExecutableIsSet || IsBusy || ! isUserDataPresent ) ;
58
65
{
59
66
if ( GUILayout . Button ( Localization . InitializeRepositoryButtonText , "Button" ) )
60
67
{
@@ -70,7 +77,7 @@ public override void OnGUI()
70
77
}
71
78
GUILayout . EndHorizontal ( ) ;
72
79
73
- if ( hasCompletedInitialCheck && ! isUserDataPresent )
80
+ if ( gitExecutableIsSet && hasCompletedInitialCheck && ! isUserDataPresent )
74
81
{
75
82
EditorGUILayout . Space ( ) ;
76
83
EditorGUILayout . HelpBox ( NoUserOrEmailError , MessageType . Error ) ;
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ namespace GitHub.Unity
7
7
[ Serializable ]
8
8
class UserSettingsView : Subview
9
9
{
10
- private static readonly Vector2 viewSize = new Vector2 ( 325 , 125 ) ;
11
- private const string WindowTitle = "User Settings" ;
12
-
13
10
private const string GitConfigTitle = "Git Configuration" ;
14
11
private const string GitConfigNameLabel = "Name" ;
15
12
private const string GitConfigEmailLabel = "Email" ;
@@ -24,12 +21,12 @@ class UserSettingsView : Subview
24
21
25
22
[ NonSerialized ] private bool isBusy ;
26
23
[ NonSerialized ] private bool userHasChanges ;
24
+ [ NonSerialized ] private bool gitExecutableIsSet ;
27
25
28
26
public override void InitializeView ( IView parent )
29
27
{
30
28
base . InitializeView ( parent ) ;
31
- Title = WindowTitle ;
32
- Size = viewSize ;
29
+ gitExecutableIsSet = Environment . GitExecutablePath != null ;
33
30
}
34
31
35
32
public override void OnDataUpdate ( )
@@ -42,7 +39,7 @@ public override void OnGUI()
42
39
{
43
40
GUILayout . Label ( GitConfigTitle , EditorStyles . boldLabel ) ;
44
41
45
- EditorGUI . BeginDisabledGroup ( IsBusy || Parent . IsBusy ) ;
42
+ EditorGUI . BeginDisabledGroup ( ! gitExecutableIsSet || IsBusy || Parent . IsBusy ) ;
46
43
{
47
44
EditorGUI . BeginChangeCheck ( ) ;
48
45
{
You can’t perform that action at this time.
0 commit comments