public override void EnterState()
            {
                CloudBuildPoller.instance.Disable(true);
                var generalTemplate = EditorGUIUtility.Load(k_CloudBuildDisabledUxmlPath) as VisualTreeAsset;
                var scrollContainer = m_Provider.rootVisualElement.Q(className: k_ServiceScrollContainerClassName);

                scrollContainer.Clear();
                if (generalTemplate != null)
                {
                    var disabledStateContent = generalTemplate.CloneTree().contentContainer;
                    ServicesUtils.TranslateStringsInTree(disabledStateContent);
                    scrollContainer.Add(disabledStateContent);
                }

                var startUsing = m_Provider.rootVisualElement.Q(k_StartUsingCloudBuildLink);

                if (startUsing != null)
                {
                    var clickable = new Clickable(() =>
                    {
                        Application.OpenURL(ServicesConfiguration.instance.GetCloudBuildTutorialUrl());
                    });
                    startUsing.AddManipulator(clickable);
                }

                m_Provider.HandlePermissionRestrictedControls();
            }
Exemple #2
0
            public override void EnterState()
            {
                // If we haven't received new bound info, fetch them
                var generalTemplate     = EditorGUIUtility.Load(k_CloudBuildEnabledUxmlPath) as VisualTreeAsset;
                var scrollContainer     = m_Provider.rootVisualElement.Q(className: k_ServiceScrollContainerClassName);
                var enabledStateContent = generalTemplate.CloneTree().contentContainer;

                ServicesUtils.TranslateStringsInTree(enabledStateContent);
                scrollContainer.Clear();
                scrollContainer.Add(enabledStateContent);

                m_Provider.rootVisualElement.Q(className: k_ServiceCloudBuildContainerClassName).style.display = DisplayStyle.None;
                m_Provider.rootVisualElement.Q(k_PollFooterSectionName).style.display = DisplayStyle.None;

                var historyButton = m_Provider.rootVisualElement.Q <Button>(k_HistoryButtonName);

                if (historyButton != null)
                {
                    historyButton.clicked += () =>
                    {
                        Application.OpenURL(ServicesConfiguration.instance.GetCurrentCloudBuildProjectHistoryUrl());
                    };
                }

                var uploadButton = m_Provider.rootVisualElement.Q <Button>(k_UploadButtonName);

                if (uploadButton != null)
                {
                    uploadButton.clicked += () =>
                    {
                        Application.OpenURL(ServicesConfiguration.instance.GetCurrentCloudBuildProjectUploadUrl());
                    };
                }

                var manageTargetButton = m_Provider.rootVisualElement.Q <Button>(k_ManageTargetButton);

                if (manageTargetButton != null)
                {
                    manageTargetButton.clicked += () =>
                    {
                        Application.OpenURL(ServicesConfiguration.instance.GetCurrentCloudBuildProjectTargetUrl());
                    };
                    manageTargetButton.style.display = DisplayStyle.None;
                }
                var addTargetButton = m_Provider.rootVisualElement.Q <Button>(k_AddTargetButton);

                if (addTargetButton != null)
                {
                    addTargetButton.clicked += () =>
                    {
                        Application.OpenURL(ServicesConfiguration.instance.GetCloudBuildAddTargetUrl());
                    };
                }

                ResetData();
                GetProjectInfo();

                m_Provider.HandlePermissionRestrictedControls();
            }