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

Commit fa6bc90

Browse files
authored
Merge pull request #761 from github-for-unity/fixes/gitpath-buttons-state-nitpick
Capturing when the GitPathView has changes in a property
2 parents 4ee93ee + 193a484 commit fa6bc90

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public override void OnGUI()
9696
}
9797
if (EditorGUI.EndChangeCheck())
9898
{
99-
changingManually = gitPath != installationState.GitExecutablePath || gitLfsPath != installationState.GitLfsExecutablePath;
99+
changingManually = ViewHasChanges;
100100
}
101101
}
102102
GUILayout.EndHorizontal();
@@ -123,7 +123,7 @@ public override void OnGUI()
123123
}
124124
if (EditorGUI.EndChangeCheck())
125125
{
126-
changingManually = gitPath != installationState.GitExecutablePath || gitLfsPath != installationState.GitLfsExecutablePath;;
126+
changingManually = ViewHasChanges;
127127
errorMessage = "";
128128
}
129129
}
@@ -160,7 +160,7 @@ public override void OnGUI()
160160
if (Environment.IsWindows)
161161
gitPath = installDetails.GitExecutablePath;
162162
gitLfsPath = installDetails.GitLfsExecutablePath;
163-
resetToBundled = gitPath != installationState.GitExecutablePath || gitLfsPath != installationState.GitLfsExecutablePath;
163+
resetToBundled = ViewHasChanges;
164164
resetToSystem = false;
165165
changingManually = false;
166166
errorMessage = "";
@@ -197,7 +197,7 @@ public override void OnGUI()
197197
}
198198
isBusy = false;
199199
resetToBundled = false;
200-
resetToSystem = gitPath != installationState.GitExecutablePath || gitLfsPath != installationState.GitLfsExecutablePath;
200+
resetToSystem = ViewHasChanges;
201201
changingManually = false;
202202
errorMessage = "";
203203
Redraw();
@@ -338,6 +338,14 @@ private void ValidateAndSetGitInstallPath()
338338
}
339339
}
340340

341+
public bool ViewHasChanges
342+
{
343+
get
344+
{
345+
return gitPath != installationState.GitExecutablePath || gitLfsPath != installationState.GitLfsExecutablePath;
346+
}
347+
}
348+
341349
public override bool IsBusy
342350
{
343351
get { return isBusy; }

0 commit comments

Comments
 (0)