Esempio n. 1
0
        private void OnRefreshOperationError(UIError error)
        {
            Debug.Log("[PackageManager] Error " + error.message);

            packageManagerToolbar.SetEnabled(true);
            packageDetails.packageToolbarContainer.SetEnabled(true);
        }
Esempio n. 2
0
            public void AddPackageError(IPackage package, UIError error)
            {
                var packagePreUpdate = package.Clone();

                package.AddError(error);
                onPackagesChanged?.Invoke(k_EmptyList, k_EmptyList, new[] { packagePreUpdate }, new[] { package });
            }
        private void OnRefreshOperationError(UIError error)
        {
            Debug.Log(string.Format(ApplicationUtil.instance.GetTranslationForText("[PackageManager] Error {0}"), error.message));

            packageManagerToolbar.SetEnabled(true);
            packageDetails.packageToolbarContainer.SetEnabled(true);
        }
Esempio n. 4
0
 private void OnProcessExtraFetchError(UIError error, string productId = null)
 {
     if (!string.IsNullOrEmpty(productId))
     {
         onProductPackageFetchError?.Invoke(productId, error);
     }
 }
Esempio n. 5
0
        private void OnRefreshOperationError(UIError error)
        {
            Debug.Log(string.Format(L10n.Tr("[PackageManager] Error {0}"), error.message));

            packageManagerToolbar.SetEnabled(true);
            packageDetails.packageToolbarContainer.SetEnabled(true);
        }
Esempio n. 6
0
        public void SetError(UIError error)
        {
            var message = string.IsNullOrEmpty(error.message) ?
                          L10n.Tr("An error occurred. See console for more details.") :
                          string.Format(L10n.Tr("An error occurred ({0}). See console for more details."), error.message);

            alertMessage.text = message;
            UIUtils.SetElementDisplay(this, true);
        }
Esempio n. 7
0
        public void SetError(UIError error)
        {
            var message = string.IsNullOrEmpty(error.message) ?
                          ApplicationUtil.instance.GetTranslationForText("An error occurred. See console for more details.") :
                          string.Format(ApplicationUtil.instance.GetTranslationForText("An error occurred ({0}). See console for more details."), error.message);

            alertMessage.text = message;
            UIUtils.SetElementDisplay(this, true);
        }
Esempio n. 8
0
            private void OnUpmOperationError(IOperation operation, UIError error)
            {
                var package = GetPackage(operation.packageUniqueId);

                if (package != null)
                {
                    AddPackageError(package, error);
                }
            }
        private void OnDownloadError(IOperation operation, UIError error)
        {
            var package = GetPackage(operation.packageUniqueId);

            if (package == null)
            {
                return;
            }

            AddPackageError(package, error);
        }
Esempio n. 10
0
        public void SetError(UIError error)
        {
            var message = ApplicationUtil.instance.GetTranslationForText("An error occurred.");

            if (error != null)
            {
                message = error.message ?? string.Format(ApplicationUtil.instance.GetTranslationForText("An error occurred ({0})"), error.errorCode.ToString());
            }

            alertMessage.text = message;
            UIUtils.SetElementDisplay(this, true);
        }
Esempio n. 11
0
        public void SetError(UIError error)
        {
            var message = "An error occurred.";

            if (error != null)
            {
                message = error.message ?? $"An error occurred ({error.errorCode.ToString()})";
            }

            alertMessage.text = message;
            UIUtils.SetElementDisplay(this, true);
        }
Esempio n. 12
0
        private void OnProductPackageFetchError(string productId, UIError error)
        {
            var purchaseInfo = m_AssetStoreCache.GetPurchaseInfo(productId);
            var productInfo  = m_AssetStoreCache.GetProductInfo(productId);

            if (productInfo != null)
            {
                var assetStorePackage        = new AssetStorePackage(m_AssetStoreUtils, m_IOProxy, purchaseInfo, productInfo);
                var assetStorePackageVersion = assetStorePackage.versions.primary as AssetStorePackageVersion;
                assetStorePackageVersion.SetUpmPackageFetchError(error);
                onPackagesChanged?.Invoke(new[] { assetStorePackage });
            }
        }
Esempio n. 13
0
        public void SetError(UIError error)
        {
            var message = string.IsNullOrEmpty(error.message) ? L10n.Tr("An error occurred.")
                : string.Format(L10n.Tr("An error occurred: {0}"), error.message);

            if ((UIError.Attribute.IsDetailInConsole & error.attribute) != 0)
            {
                message = string.Format(L10n.Tr("{0} See console for more details."), message);
            }

            alertMessage.text = message;
            UIUtils.SetElementDisplay(this, true);
        }
        public AssetStorePackage(string productId, UIError error)
        {
            m_Errors = new List <UIError> {
                error
            };
            m_Progress  = PackageProgress.None;
            m_Type      = PackageType.AssetStore;
            m_Name      = string.Empty;
            m_ProductId = productId;

            m_Images         = new List <PackageImage>();
            m_Links          = new List <PackageLink>();
            m_VersionList    = new AssetStoreVersionList();
            m_UpmVersionList = new UpmVersionList();

            m_Labels             = new List <string>();
            m_PurchasedTimeTicks = 0;
        }
Esempio n. 15
0
        public AssetStorePackage(AssetStoreUtils assetStoreUtils, IOProxy ioProxy, string productId, UIError error)
        {
            ResolveDependencies(assetStoreUtils, ioProxy);

            m_Errors = new List <UIError> {
                error
            };
            m_Progress  = PackageProgress.None;
            m_Type      = PackageType.AssetStore;
            m_Name      = string.Empty;
            m_ProductId = productId;

            m_Images         = new List <PackageImage>();
            m_Links          = new List <PackageLink>();
            m_VersionList    = new AssetStoreVersionList(assetStoreUtils, ioProxy);
            m_UpmVersionList = new UpmVersionList(ioProxy);

            m_Labels             = new List <string>();
            m_PurchasedTimeTicks = 0;
        }
Esempio n. 16
0
 private void OnRefreshOperationError(UIError error)
 {
     // if Load More operation fails, check if the Load More label should be displayed again
     UIUtils.SetElementDisplay(loadMoreContainer, PageManager.instance.GetCurrentPage().morePackagesToFetch);
 }
Esempio n. 17
0
 public PlaceholderPackageVersion(string packageUniqueId, string uniqueId, string displayName, PackageTag tag = PackageTag.None, UIError error = null)
 {
     m_PackageUniqueId = packageUniqueId;
     m_UniqueId        = uniqueId;
     m_DisplayName     = displayName;
     m_Tag             = tag;
     m_Version         = new SemVersion(0);
     m_Errors          = error != null ? new UIError[] { error } : new UIError[0];
 }
Esempio n. 18
0
 private void OnRefreshOperationError(UIError error)
 {
     UpdateStatusMessage();
 }
Esempio n. 19
0
        public virtual void FetchDetails(IEnumerable <long> productIds)
        {
            var countProduct = productIds.Count();

            if (countProduct == 0)
            {
                return;
            }

            onFetchDetailsStart?.Invoke();

            foreach (var id in productIds)
            {
                m_AssetStoreRestAPI.GetProductDetail(id, productDetail =>
                {
                    IPackage package = null;
                    var error        = productDetail.GetString("errorMessage");
                    var idString     = id.ToString();
                    if (string.IsNullOrEmpty(error))
                    {
                        var productInfo = AssetStoreProductInfo.ParseProductInfo(m_AssetStoreUtils, idString, productDetail);
                        if (productInfo == null)
                        {
                            package = new AssetStorePackage(m_AssetStoreUtils, m_IOProxy, idString, new UIError(UIErrorCode.AssetStoreClientError, L10n.Tr("Error parsing product details.")));
                        }
                        else
                        {
                            var oldProductInfo = m_AssetStoreCache.GetProductInfo(idString);
                            if (oldProductInfo == null || oldProductInfo.versionId != productInfo.versionId || oldProductInfo.versionString != productInfo.versionString)
                            {
                                if (string.IsNullOrEmpty(productInfo.packageName))
                                {
                                    package = new AssetStorePackage(m_AssetStoreUtils, m_IOProxy, m_AssetStoreCache.GetPurchaseInfo(idString), productInfo, m_AssetStoreCache.GetLocalInfo(idString));
                                }
                                else
                                {
                                    m_UpmClient.FetchForProduct(idString, productInfo.packageName);
                                }
                                m_AssetStoreCache.SetProductInfo(productInfo);
                            }
                        }
                    }
                    else
                    {
                        var purchaseInfo = m_AssetStoreCache.GetPurchaseInfo(idString);
                        m_AssetStoreCache.RemoveProductInfo(idString);
                        var uiError = new UIError(UIErrorCode.AssetStoreClientError, error);
                        package     = new PlaceholderPackage(idString, purchaseInfo?.displayName ?? string.Empty, PackageType.AssetStore, PackageTag.None, PackageProgress.None, uiError);
                    }

                    if (package != null)
                    {
                        onPackagesChanged?.Invoke(new[] { package });
                    }

                    countProduct--;
                    if (countProduct == 0)
                    {
                        onFetchDetailsFinish?.Invoke();
                    }
                });
            }
        }
Esempio n. 20
0
 public void AddError(UIError error)
 {
     m_Errors.Add(error);
 }
Esempio n. 21
0
 private void OnRefreshOperationError(IOperation operation, UIError error)
 {
     m_RefreshErrors[operation.refreshOptions] = error;
     onRefreshOperationError?.Invoke(error);
 }
Esempio n. 22
0
 private void OnOperationError(UIError error)
 {
     onOperationError?.Invoke(this, error);
     FinalizedOperation();
 }
Esempio n. 23
0
 public PlaceholderPackage(string uniqueId, string displayName, PackageType type = PackageType.None, PackageTag tag = PackageTag.None, PackageProgress progress = PackageProgress.None, UIError error = null)
 {
     m_Type        = type;
     m_UniqueId    = uniqueId;
     m_Progress    = progress;
     m_VersionList = new PlaceholderVersionList(new PlaceholderPackageVersion(uniqueId, uniqueId, displayName, tag, error));
     m_Errors      = new List <UIError>();
 }
 public void SetUpmPackageFetchError(UIError error)
 {
     m_Errors.Add(error);
     m_Tag &= ~(PackageTag.Downloadable | PackageTag.Importable);
 }
 private void OnRefreshOperationError(UIError error)
 {
     packageManagerToolbar.SetEnabled(true);
     packageDetails.packageToolbarContainer.SetEnabled(true);
 }