@@ -22,18 +22,13 @@ class SettingsView : Subview
2222 private const string MetricsOptInLabel = "Help us improve by sending anonymous usage data" ;
2323 private const string DefaultRepositoryRemoteName = "origin" ;
2424
25- [ NonSerialized ] private bool currentLocksHasUpdate ;
2625 [ NonSerialized ] private bool currentRemoteHasUpdate ;
2726 [ NonSerialized ] private bool isBusy ;
2827 [ NonSerialized ] private bool metricsHasChanged ;
2928
3029 [ SerializeField ] private GitPathView gitPathView = new GitPathView ( ) ;
3130 [ SerializeField ] private bool hasRemote ;
3231 [ SerializeField ] private CacheUpdateEvent lastCurrentRemoteChangedEvent ;
33- [ SerializeField ] private CacheUpdateEvent lastLocksChangedEvent ;
34- [ SerializeField ] private List < GitLock > lockedFiles = new List < GitLock > ( ) ;
35- [ SerializeField ] private int lockedFileSelection = - 1 ;
36- [ SerializeField ] private Vector2 lockScrollPos ;
3732 [ SerializeField ] private bool metricsEnabled ;
3833 [ SerializeField ] private string newRepositoryRemoteUrl ;
3934 [ SerializeField ] private string repositoryRemoteName ;
@@ -64,7 +59,6 @@ public override void OnEnable()
6459 metricsHasChanged = true ;
6560 }
6661
67-
6862 public override void OnDisable ( )
6963 {
7064 base . OnDisable ( ) ;
@@ -100,11 +94,6 @@ public override void OnGUI()
10094 if ( Repository != null )
10195 {
10296 OnRepositorySettingsGUI ( ) ;
103-
104- GUILayout . Space ( EditorGUIUtility . standardVerticalSpacing ) ;
105-
106- OnGitLfsLocksGUI ( ) ;
107-
10897 GUILayout . Space ( EditorGUIUtility . standardVerticalSpacing ) ;
10998 }
11099
@@ -125,17 +114,6 @@ private void AttachHandlers(IRepository repository)
125114 }
126115
127116 repository . CurrentRemoteChanged += RepositoryOnCurrentRemoteChanged ;
128- repository . LocksChanged += RepositoryOnLocksChanged ;
129- }
130-
131- private void RepositoryOnLocksChanged ( CacheUpdateEvent cacheUpdateEvent )
132- {
133- if ( ! lastLocksChangedEvent . Equals ( cacheUpdateEvent ) )
134- {
135- lastLocksChangedEvent = cacheUpdateEvent ;
136- currentLocksHasUpdate = true ;
137- Redraw ( ) ;
138- }
139117 }
140118
141119 private void RepositoryOnCurrentRemoteChanged ( CacheUpdateEvent cacheUpdateEvent )
@@ -156,13 +134,11 @@ private void DetachHandlers(IRepository repository)
156134 }
157135
158136 repository . CurrentRemoteChanged -= RepositoryOnCurrentRemoteChanged ;
159- repository . LocksChanged -= RepositoryOnLocksChanged ;
160137 }
161138
162139 private void ValidateCachedData ( IRepository repository )
163140 {
164141 repository . CheckAndRaiseEventsIfCacheNewer ( CacheType . RepositoryInfo , lastCurrentRemoteChangedEvent ) ;
165- repository . CheckAndRaiseEventsIfCacheNewer ( CacheType . GitLocks , lastLocksChangedEvent ) ;
166142 }
167143
168144 private void MaybeUpdateData ( )
@@ -173,9 +149,6 @@ private void MaybeUpdateData()
173149 metricsHasChanged = false ;
174150 }
175151
176- if ( lockedFiles == null )
177- lockedFiles = new List < GitLock > ( ) ;
178-
179152 if ( Repository == null )
180153 return ;
181154
@@ -195,16 +168,6 @@ private void MaybeUpdateData()
195168 newRepositoryRemoteUrl = repositoryRemoteUrl = currentRemote . Value . Url ;
196169 }
197170 }
198-
199- if ( currentLocksHasUpdate )
200- {
201- currentLocksHasUpdate = false ;
202- var repositoryCurrentLocks = Repository . CurrentLocks ;
203- lockedFileSelection = - 1 ;
204- lockedFiles = repositoryCurrentLocks != null
205- ? repositoryCurrentLocks . ToList ( )
206- : new List < GitLock > ( ) ;
207- }
208171 }
209172
210173 private void OnRepositorySettingsGUI ( )
@@ -241,75 +204,6 @@ private void OnRepositorySettingsGUI()
241204 EditorGUI . EndDisabledGroup ( ) ;
242205 }
243206
244- private void OnGitLfsLocksGUI ( )
245- {
246- EditorGUI . BeginDisabledGroup ( IsBusy || Repository == null ) ;
247- {
248- GUILayout . BeginVertical ( ) ;
249- {
250- GUILayout . Label ( "Locked files" , EditorStyles . boldLabel ) ;
251-
252- lockScrollPos = EditorGUILayout . BeginScrollView ( lockScrollPos , Styles . GenericTableBoxStyle ,
253- GUILayout . Height ( 125 ) ) ;
254- {
255- GUILayout . BeginVertical ( ) ;
256- {
257- var lockedFilesCount = lockedFiles . Count ;
258- for ( var index = 0 ; index < lockedFilesCount ; ++ index )
259- {
260- GUIStyle rowStyle = ( lockedFileSelection == index )
261- ? Styles . LockedFileRowSelectedStyle
262- : Styles . LockedFileRowStyle ;
263- GUILayout . Box ( lockedFiles [ index ] . Path , rowStyle ) ;
264-
265- if ( Event . current . type == EventType . MouseDown &&
266- GUILayoutUtility . GetLastRect ( ) . Contains ( Event . current . mousePosition ) )
267- {
268- var currentEvent = Event . current ;
269-
270- if ( currentEvent . button == 0 )
271- {
272- lockedFileSelection = index ;
273- }
274-
275- Event . current . Use ( ) ;
276- }
277- }
278- }
279-
280- GUILayout . EndVertical ( ) ;
281- }
282-
283- EditorGUILayout . EndScrollView ( ) ;
284-
285- if ( lockedFileSelection > - 1 )
286- {
287- GUILayout . BeginVertical ( ) ;
288- {
289- var lck = lockedFiles [ lockedFileSelection ] ;
290- GUILayout . Label ( lck . Path , EditorStyles . boldLabel ) ;
291-
292- GUILayout . BeginHorizontal ( ) ;
293- {
294- GUILayout . Label ( "Locked by " + lck . User ) ;
295- GUILayout . FlexibleSpace ( ) ;
296- if ( GUILayout . Button ( "Unlock" ) )
297- {
298- Repository . ReleaseLock ( lck . Path , true ) . Start ( ) ;
299- }
300- }
301- GUILayout . EndHorizontal ( ) ;
302- }
303- GUILayout . EndVertical ( ) ;
304- }
305- }
306-
307- GUILayout . EndVertical ( ) ;
308-
309- }
310- EditorGUI . EndDisabledGroup ( ) ;
311- }
312-
313207 private void OnPrivacyGui ( )
314208 {
315209 GUILayout . Label ( PrivacyTitle , EditorStyles . boldLabel ) ;
@@ -371,7 +265,6 @@ private void OnGeneralSettingsGui()
371265 EditorGUI . EndDisabledGroup ( ) ;
372266 }
373267
374-
375268 public override bool IsBusy
376269 {
377270 get { return isBusy || userSettingsView . IsBusy || gitPathView . IsBusy ; }
0 commit comments