bool CWizardAttach::SyncToAccountManager() { ACCT_MGR_INFO ami; CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); IsAttachToProjectWizard = false; IsAccountManagerWizard = true; pDoc->rpc.acct_mgr_info(ami); if (ami.acct_mgr_url.size()) { SetProjectName(wxString(ami.acct_mgr_name.c_str(), wxConvUTF8)); SetProjectURL(wxString(ami.acct_mgr_url.c_str(), wxConvUTF8)); SetCredentialsCached(ami.have_credentials); SetCookieRequired(ami.cookie_required); SetCookieFailureURL(wxString(ami.cookie_failure_url.c_str(), wxConvUTF8)); if (IsCredentialsCached()) { IsAccountManagerUpdateWizard = true; } } if (ami.acct_mgr_url.size() && !m_bCredentialsCached) { std::string login; std::string password_hash; std::string return_url; if (detect_account_manager_credentials(ami.acct_mgr_url, login, password_hash, return_url)) { wxString strLogin; wxString strPasswordHash; wxString strReturnURL; strLogin = wxURL::Unescape(wxString(login.c_str(), wxConvUTF8)); strPasswordHash = wxURL::Unescape(wxString(password_hash.c_str(), wxConvUTF8)); strReturnURL = wxURL::Unescape(wxString(return_url.c_str(), wxConvUTF8)); SetCredentialsDetected(true); SetReturnURL(strReturnURL); SetAccountEmailAddress(strLogin); SetAccountUsername(strLogin); SetAccountPassword( wxString(_T("hash:")) + strPasswordHash ); } } if (m_AccountManagerInfoPage || m_AccountManagerPropertiesPage) { IsAttachToProjectWizard = false; IsAccountManagerWizard = true; if (!ami.acct_mgr_url.size()) { return RunWizard(m_AccountManagerInfoPage); } else { return RunWizard(m_AccountManagerPropertiesPage); } } return FALSE; }
/*! * 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; }
/*! * 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; }
bool DictionaryWizard::Run() { if (GetChildren().GetCount() > 0) { wxWizardPage* startPage = wxDynamicCast(GetChildren().GetFirst()->GetData(), wxWizardPage); if (startPage) return RunWizard(startPage); } return FALSE; }
bool PluginWizard::Run(NewPluginData& pd) { bool res = RunWizard( GetFirstPage() ); if ( res ) { pd.SetCodelitePath( m_dirPickerCodeliteDir->GetPath() ); pd.SetPluginDescription( m_textCtrlDescription->GetValue() ); pd.SetPluginName( m_textCtrlName->GetValue() ); pd.SetProjectPath( m_textCtrlPreview->GetValue() ); } return res; }
//--------------------------------------------------------------------------------------- bool MidiWizard::Run() { wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); while (node) { wxWizardPage* startPage = wxDynamicCast(node->GetData(), wxWizardPage); if (startPage) return RunWizard(startPage); node = node->GetNext(); } return false; }
bool CUpdateWizard::Run() { COptions* pOptions = COptions::Get(); if (CBuildInfo::GetVersion() == _T("custom build")) return false; const wxString& newVersion = pOptions->GetOption(OPTION_UPDATECHECK_NEWVERSION); if (newVersion == _T("")) return RunWizard(m_pages.front()); if (CBuildInfo::ConvertToVersionNumber(newVersion) <= CBuildInfo::ConvertToVersionNumber(CBuildInfo::GetVersion())) { pOptions->SetOption(OPTION_UPDATECHECK_NEWVERSION, _T("")); return RunWizard(m_pages.front()); } // Force another check PrepareUpdateCheckPage(); m_start_check = true; m_currentPage = 0; return RunWizard(m_pages[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); }
bool PluginWizard::Run(NewPluginData &data) { wxSize sz1 = m_page1->GetSizer()->CalcMin(); wxSize sz2 = m_page2->GetSizer()->CalcMin(); wxSize maxSize = sz1; if(maxSize.GetWidth() < sz2.GetWidth()) maxSize = sz2; if(maxSize.GetWidth() < 400){ maxSize.SetWidth(400); } SetPageSize(maxSize); if(RunWizard(m_page1)){ data.SetPluginName(((PluginWizardPage1*) m_page1)->GetName()); data.SetPluginDescription(((PluginWizardPage1*) m_page1)->GetDescription()); data.SetProjectPath(((PluginWizardPage2*) m_page2)->GetProjectPath()); data.SetCodelitePath(((PluginWizardPage2*) m_page2)->GetCodelitePath()); return true; } return false; }
void ExtensionsWizard::run() { wxSizer *sizer = GetSizer(); if(sizer != nullptr) { // Il bordo della colonna principale nel wizard viene settato a 5px e, non essendo al momento // regolabile, viene qui modificato in questo modo... wxSizerItemList &sizerItems = sizer->GetChildren(); if(sizerItems.empty() == false) { sizerItems[0]->SetBorder(0); } } // Scorre tutte le pagine a partire da quella di welcome e adatta il wizard alla dimensione migliore FitToPage(m_pageGeneral); Layout(); // Avvia il wizard mostrando la pagina di welcome RunWizard(m_pageGeneral); }
bool ExportInstWizard::Start() { return RunWizard(enterInfoPage); }