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

Project Window Interface Fixes #911

Merged
merged 7 commits into from
Oct 3, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ProjectWindowInterface : AssetPostprocessor
private static CacheUpdateEvent lastRepositoryStatusChangedEvent;
private static CacheUpdateEvent lastLocksChangedEvent;
private static IRepository Repository { get { return manager != null ? manager.Environment.Repository : null; } }
private static bool IsInitialized { get { return Repository != null && Repository.CurrentRemote.HasValue; } }
private static bool IsInitialized { get { return Repository != null; } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is used to determine whether to show lock/unlock menus. If you're going to change this logic, you need to also fix how we enable those menus, because we can't lock/unlock if there's no remote.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


public static void Initialize(IApplicationManager theManager)
{
Expand Down Expand Up @@ -67,6 +67,7 @@ private static void RepositoryOnStatusEntriesChanged(CacheUpdateEvent cacheUpdat
if (!lastRepositoryStatusChangedEvent.Equals(cacheUpdateEvent))
{
lastRepositoryStatusChangedEvent = cacheUpdateEvent;
AssetDatabase.Refresh();
entries.Clear();
entries.AddRange(Repository.CurrentChanges);
OnStatusUpdate();
Expand All @@ -88,6 +89,8 @@ private static bool ContextMenu_CanLock()
{
if (!EnsureInitialized())
return false;
if(!Repository.CurrentRemote.HasValue)
return false;
if (isBusy)
return false;
return Selection.objects.Any(IsObjectUnlocked);
Expand All @@ -98,6 +101,8 @@ private static bool ContextMenu_CanUnlock()
{
if (!EnsureInitialized())
return false;
if (!Repository.CurrentRemote.HasValue)
return false;
if (isBusy)
return false;
return Selection.objects.Any(IsObjectLocked);
Expand All @@ -108,6 +113,8 @@ private static bool ContextMenu_CanUnlockForce()
{
if (!EnsureInitialized())
return false;
if (!Repository.CurrentRemote.HasValue)
return false;
if (isBusy)
return false;
return Selection.objects.Any(IsObjectLocked);
Expand Down