private void UpdateStatusMessage()
        {
            var tab = m_PackageFiltering.currentFilterTab;

            var contentType = m_PageManager.GetCurrentPage().contentType ?? L10n.Tr("packages");

            if (m_PageManager.IsRefreshInProgress(tab))
            {
                SetStatusMessage(StatusType.Loading, string.Format(L10n.Tr("Refreshing {0}..."), contentType));
                return;
            }

            if (tab == PackageFilterTab.AssetStore && m_AssetStoreCallQueue.isCheckUpdateInProgress)
            {
                SetStatusMessage(StatusType.Loading, L10n.Tr("Checking for updates..."));
                return;
            }

            var errorMessage = string.Empty;
            var refreshError = m_PageManager.GetRefreshError(tab);

            if (!m_Application.isInternetReachable)
            {
                errorMessage = k_OfflineErrorMessage;
            }
            else if (refreshError != null)
            {
                var seeDetailInConsole = (UIError.Attribute.IsDetailInConsole & refreshError.attribute) != 0;
                errorMessage = seeDetailInConsole ?
                               string.Format(L10n.Tr("Error refreshing {0}, see console"), contentType) :
                               string.Format(L10n.Tr("Error refreshing {0}"), contentType);
            }

            if (!string.IsNullOrEmpty(errorMessage))
            {
                SetStatusMessage(StatusType.Error, errorMessage);
                return;
            }

            SetLastUpdateStatusMessage();
        }
Beispiel #2
0
        // Returns true if the list of packages is visible (either listView or scrollView), false otherwise
        private bool UpdateListVisibility(bool skipListRebuild = false)
        {
            if (m_PackageFiltering.currentFilterTab == PackageFilterTab.AssetStore && !m_UnityConnect.isUserLoggedIn)
            {
                HideListShowLogin();
                return(false);
            }

            var page                    = m_PageManager.GetCurrentPage();
            var isListEmpty             = !page.visualStates.Any(v => v.visible);
            var isInitialFetchingDone   = m_PageManager.IsInitialFetchingDone();
            var isCheckUpdateInProgress = m_PackageFiltering.currentFilterTab == PackageFilterTab.AssetStore &&
                                          m_AssetStoreCallQueue.isCheckUpdateInProgress && page.filters.updateAvailableOnly;

            if (isListEmpty || !isInitialFetchingDone || isCheckUpdateInProgress)
            {
                HideListShowMessage(m_PageManager.IsRefreshInProgress(), isInitialFetchingDone, isCheckUpdateInProgress);
                return(false);
            }

            HideEmptyAreaShowList(skipListRebuild);
            return(true);
        }