Esempio n. 1
0
        void DoConfigureButton(ProgressControlsForViews configureProgress)
        {
            bool isAutoLoginRunning = autoLoginState > AutoLogin.State.Running && autoLoginState <= AutoLogin.State.InitializingPlastic;

            GUI.enabled = !(configureProgress.ProgressData.IsOperationRunning || isAutoLoginRunning);

            if (GUILayout.Button(PlasticLocalization.GetString(
                                     PlasticLocalization.Name.LoginOrSignUp),
                                 GUILayout.Width(BUTTON_WIDTH)))
            {
                if (autoLoginState > AutoLogin.State.Off && autoLoginState <= AutoLogin.State.InitializingPlastic)
                {
                    autoLoginState = AutoLogin.State.Running;
                    AutoLogin autoLogin = new AutoLogin();
                    autoLogin.Run();
                    return;
                }

                ((IProgressControls)configureProgress).ShowProgress(string.Empty);

                // Login button defaults to Cloud sign up
                CloudEditionWelcomeWindow.ShowWindow(
                    mPlasticWebRestApi,
                    mCmConnection,
                    this);

                GUIUtility.ExitGUI();
            }

            // If client configuration cannot be determined, keep login button default as Cloud
            // sign in window, but show Enterprise option as well
            if (EditionToken.IsCloudEdition())
            {
                GUILayout.FlexibleSpace();

                var anchorStyle = new GUIStyle(GUI.skin.label);
                anchorStyle.normal.textColor = new Color(0.129f, 0.588f, 0.953f);
                anchorStyle.hover.textColor  = new Color(0.239f, 0.627f, 0.949f);
                anchorStyle.active.textColor = new Color(0.239f, 0.627f, 0.949f);

                if (GUILayout.Button(
                        PlasticLocalization.GetString(
                            PlasticLocalization.Name.NeedEnterprise),
                        anchorStyle,
                        GUILayout.Width(BUTTON_WIDTH),
                        GUILayout.Height(20)))
                {
                    TeamEditionConfigurationWindow.ShowWindow(mPlasticWebRestApi, this);
                }

                GUILayout.Space(BUTTON_MARGIN);
            }

            GUI.enabled = true;
        }
Esempio n. 2
0
        private AskCredentialsToUser.DialogData RunCredentialsRequest(string cloudServer)
        {
            AutoLogin autoLogin = new AutoLogin();
            var       response  = autoLogin.Run();

            if (response != ResponseType.None)
            {
                return(autoLogin.BuildCredentialsDialogData(response));
            }
            else
            {
                return(SSOCredentialsDialog.RequestCredentials(cloudServer, ParentWindow.Get()));
            }
        }