예제 #1
0
/*!
 * Runs the wizard.
 */
bool CWizardAttach::Run(
    wxString strProjectURL, bool bCredentialsCached
) {
    if (strProjectURL.Length()) {
        SetProjectURL(strProjectURL);
        SetCredentialsCached(bCredentialsCached);
    }

    // If credentials are not cached, then we should try one last place to look up the
    //   authenticator.  Some projects will set a "Setup" cookie off of their URL with a
    //   pretty short timeout.  Lets take a crack at detecting it.
    //
    if (!strProjectURL.IsEmpty() && !bCredentialsCached) {
        std::string url = std::string(strProjectURL.mb_str());
        std::string authenticator;

        if (detect_setup_authenticator(url, authenticator)) {
            SetCredentialsDetected(true);
            SetCloseWhenCompleted(true);
            SetProjectAuthenticator(wxString(authenticator.c_str(), wxConvUTF8));
        }
    }

    if (m_ProjectPropertiesPage || m_ProjectInfoPage) {
        IsAttachToProjectWizard = true;
        IsAccountManagerWizard = false;
        if (strProjectURL.Length()) {
            return RunWizard(m_ProjectPropertiesPage);
        } else {
            return RunWizard(m_ProjectInfoPage);
        }
    }

    return FALSE;
}
예제 #2
0
/*!
 * Runs the wizard.
 */
bool CWizardAttach::Run(
        wxString strProjectName,
        wxString strProjectURL,
        wxString strProjectAuthenticator, 
        wxString strProjectInstitution,
        wxString strProjectDescription,
        wxString strProjectKnown,
        wxString strProjectSetupCookie,
        bool     bAccountKeyDetected,
        bool     bEmbedded
){
    SetProjectName(strProjectName);
    if (strProjectURL.size()) {
        SetProjectURL(strProjectURL);
        SetCredentialsCached(bAccountKeyDetected);
    }
    SetProjectInstitution(strProjectInstitution);
    SetProjectDescription(strProjectDescription);
    if (strProjectAuthenticator.size()) {
        SetProjectAuthenticator(strProjectAuthenticator);
    }
    if (strProjectSetupCookie.size()) {
        SetProjectSetupCookie(strProjectSetupCookie);
    }
    SetProjectKnown(strProjectKnown.length() > 0);

    if (strProjectURL.size() && strProjectAuthenticator.size() && !bAccountKeyDetected) {
        SetCredentialsDetected(true);
        SetCloseWhenCompleted(true);
    }

    if (m_ProjectPropertiesPage && m_ProjectInfoPage && m_ProjectWelcomePage) {
        IsAttachToProjectWizard = true;
        IsAccountManagerWizard = false;
        if (strProjectName.size() && strProjectURL.size() && (strProjectSetupCookie.size() == 0)) {
            return RunWizard(m_ProjectWelcomePage);
        } else if (strProjectURL.size() && (IsCredentialsCached() || IsCredentialsDetected() || strProjectSetupCookie.size())) {
            return RunWizard(m_ProjectPropertiesPage);
        } else {
            return RunWizard(m_ProjectInfoPage);
        }
    }

    return FALSE;
}