Manager: clean up "Welcome page"

This commit is contained in:
davidpanderson 2020-08-01 21:23:49 -07:00
parent b68edc9589
commit 75f463aa2a
3 changed files with 11 additions and 46 deletions

View File

@ -323,7 +323,10 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) {
wxString str;
wxString name = wxString(pc.name.c_str(), wxConvUTF8);
str.Printf(_("Identify your account at %s"), name.c_str());
str.Printf(_("Identify your account at %s"),
name.empty()? pWA->GetProjectName().c_str() : name.c_str()
// one or the other is populated depending on how project was selected
);
m_pTitleStaticCtrl->SetLabel(str);
if (!IS_ACCOUNTMANAGERWIZARD() && !IS_ACCOUNTMANAGERUPDATEWIZARD()) {

View File

@ -15,6 +15,12 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
//
// show a "welcome" dialog showing the user what project they're about to run,
// in the case where a project_init.xml was present on startup
//
// AFAIK no one uses this mechanism, so this may not be needed
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "ProjectWelcomePage.h"
#endif
@ -129,22 +135,6 @@ void CProjectWelcomePage::CreateControls()
project_name2_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_name2_ctrl, 0, wxALIGN_LEFT|wxALL|wxEXPAND, 5);
project_inst1_ctrl = new wxStaticText;
project_inst1_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_inst1_ctrl, 0, wxALIGN_LEFT|wxALL, 5);
project_inst2_ctrl = new wxStaticText;
project_inst2_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_inst2_ctrl, 0, wxALIGN_LEFT|wxALL|wxEXPAND, 5);
project_desc1_ctrl = new wxStaticText;
project_desc1_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_desc1_ctrl, 0, wxALIGN_LEFT|wxALL, 5);
project_desc2_ctrl = new wxStaticText;
project_desc2_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_desc2_ctrl, 0, wxALIGN_LEFT|wxALL|wxEXPAND, 5);
project_url1_ctrl = new wxStaticText;
project_url1_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_url1_ctrl, 0, wxALIGN_LEFT|wxALL, 5);
@ -153,18 +143,6 @@ void CProjectWelcomePage::CreateControls()
project_url2_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(project_url2_ctrl, 0, wxALIGN_LEFT|wxALL|wxEXPAND, 5);
user_name1_ctrl = new wxStaticText;
user_name1_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(user_name1_ctrl, 0, wxALIGN_LEFT|wxALL, 5);
user_name2_ctrl = new wxStaticText;
user_name2_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
grid->Add(user_name2_ctrl, 0, wxALIGN_LEFT|wxALL|wxEXPAND, 5);
warning_ctrl = new wxStaticText;
warning_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add(warning_ctrl, 0, wxALIGN_LEFT|wxALL|wxEXPAND, 5);
continue_ctrl = new wxStaticText;
continue_ctrl->Create( itemWizardPage2, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer3->Add(continue_ctrl, 0, wxALIGN_LEFT|wxALL, 5);
@ -253,25 +231,9 @@ void CProjectWelcomePage::OnPageChanged( wxWizardExEvent& event ) {
intro_ctrl->SetLabel(_("You have volunteered to compute for this project:"));
project_name1_ctrl->SetLabel(_("Name:"));
project_name2_ctrl->SetLabel(pWA->GetProjectName());
if (!pWA->GetProjectInstitution().IsEmpty()) {
project_inst1_ctrl->SetLabel(_("Home:"));
project_inst2_ctrl->SetLabel(pWA->GetProjectInstitution());
}
if (!pWA->GetProjectDescription().IsEmpty()) {
project_desc1_ctrl->SetLabel(_("Description:"));
project_desc2_ctrl->SetLabel(pWA->GetProjectDescription());
}
project_url1_ctrl->SetLabel(_("URL:"));
project_url2_ctrl->SetLabel(pWA->GetProjectURL());
if (!pWA->GetProjectUserName().IsEmpty()) {
user_name1_ctrl->SetLabel(_("User:"));
user_name2_ctrl->SetLabel(pWA->GetProjectUserName());
}
if (!pWA->IsProjectKnown()) {
warning_ctrl->SetLabel(_("WARNING: This project is not registered with BOINC. Make sure you trust it before continuing."));
}
continue_ctrl->SetLabel(
_("To continue, click Next.")
);

View File

@ -285,7 +285,7 @@ bool CWizardAttach::Run(
if (m_ProjectPropertiesPage && m_ProjectInfoPage && m_ProjectWelcomePage) {
IsAttachToProjectWizard = true;
IsAccountManagerWizard = false;
if ((strProjectName.size() && strProjectURL.size()) || !bEmbedded) {
if ((strProjectName.size() && strProjectURL.size())) {
return RunWizard(m_ProjectWelcomePage);
} else if (strProjectURL.size() && (IsCredentialsCached() || IsCredentialsDetected())) {
return RunWizard(m_ProjectPropertiesPage);