Пример #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;
}
/*!
 * Runs the wizard.
 */
bool CWizardAttach::Run(
    wxString& WXUNUSED(strName), wxString& strURL, wxString& strTeamName,
    bool bCredentialsCached
) {
    m_strTeamName = strTeamName;

    if (strURL.Length()) {
        m_ProjectInfoPage->SetProjectURL( strURL );
        m_bCredentialsCached = 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 (!strURL.IsEmpty() && !bCredentialsCached) {
        std::string url = std::string(strURL.mb_str());
        std::string authenticator;

        if (detect_setup_authenticator(url, authenticator)) {
            m_bCredentialsDetected = true;
            close_when_completed = true;
            SetProjectAuthenticator(wxString(authenticator.c_str(), wxConvUTF8));
        }
    }

    if (strURL.Length() && m_ProjectPropertiesPage) {
        return RunWizard(m_ProjectPropertiesPage);
    } else if (m_WelcomePage) {
        return RunWizard(m_WelcomePage);
    }

    return FALSE;
}
Пример #3
0
bool CWizardAttach::RunSimpleProjectAttach(
    wxString strName, wxString strURL, wxString strAuthenticator, wxString strInstitution, wxString strDescription, wxString strKnown
) {
    SetProjectName(strName);
    SetProjectURL(strURL);
    SetProjectInstitution(strInstitution);
    SetProjectDescription(strDescription);
    if (strAuthenticator.size()) {
        SetProjectAuthenticator(strAuthenticator);
    }
    SetProjectKnown(strKnown.length() > 0);

    IsAttachToProjectWizard = true;
    IsAccountManagerWizard = false;
    return RunWizard(m_ProjectWelcomePage);
}
Пример #4
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;
}