From fd0fd3d3c6def9bbbcf9df2920cdc9f6486abdf1 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 24 Jan 2006 11:27:26 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=9300 --- checkin_notes | 14 ++ clientgui/AccountInfoPage.cpp | 3 +- clientgui/BOINCGUIApp.cpp | 29 ++-- clientgui/BOINCGUIApp.rc | 4 + clientgui/Makefile.am | 1 + clientgui/ValidateEmailAddress.cpp | 148 ++++++++++++++++++ clientgui/ValidateEmailAddress.h | 57 +++++++ win_build/boincmgr_curl.vcproj | 27 ++++ win_build/cpdnbbc_boinc_dll.vcproj | 204 +++++++++++++------------ win_build/cpdnbbc_boincmgr_curl.vcproj | 36 +++++ win_build/installerv2/CPDNBBC.ism | Bin 205848 -> 205848 bytes 11 files changed, 413 insertions(+), 110 deletions(-) create mode 100644 clientgui/ValidateEmailAddress.cpp create mode 100644 clientgui/ValidateEmailAddress.h diff --git a/checkin_notes b/checkin_notes index 05f1f1ce70..b241ce6e28 100755 --- a/checkin_notes +++ b/checkin_notes @@ -871,3 +871,17 @@ Charlie 23 Jan 2006 mac_build/ boinc.xcodeproj/ project.pbxproj + +Rom 24 Jan 2006 + - String and graphics changes for CPDNBBC. + - Add email address validation to the wizards. + + clientgui/ + AccountInfoPage.cpp + BOINCGUIApp.cpp + BOINCGUIApp.rc + ValidateEmailAddress.cpp, .h (Added) + +Rom 24 Jan 2006 (HEAD) + - Tag for 5.3.14 release, all platforms + boinc_core_release_5_3_14 diff --git a/clientgui/AccountInfoPage.cpp b/clientgui/AccountInfoPage.cpp index a21cb86ace..0a0ea4456b 100644 --- a/clientgui/AccountInfoPage.cpp +++ b/clientgui/AccountInfoPage.cpp @@ -27,6 +27,7 @@ #include "BOINCGUIApp.h" #include "wx/valgen.h" #include "wx/valtext.h" +#include "ValidateEmailAddress.h" #include "BOINCWizards.h" #include "BOINCBaseWizard.h" #include "AccountInfoPage.h" @@ -191,7 +192,7 @@ void CAccountInfoPage::CreateControls() } // Set validators - m_AccountEmailAddressCtrl->SetValidator( wxGenericValidator(& m_strAccountEmailAddress) ); + m_AccountEmailAddressCtrl->SetValidator( CValidateEmailAddress(& m_strAccountEmailAddress) ); m_AccountPasswordCtrl->SetValidator( wxTextValidator(wxFILTER_ASCII, &m_strAccountPassword) ); if (!IS_ACCOUNTMANAGERWIZARD()) { m_AccountConfirmPasswordCtrl->SetValidator( wxTextValidator(wxFILTER_ASCII, &m_strAccountConfirmPassword) ); diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index ce7a7e90e4..5c1a127338 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -41,11 +41,14 @@ #else #include "res/boinc.xpm" #include "res/gridrepublic.xpm" +#include "res/cpdnbbc16.xpm" +#include "res/cpdnbbc32.xpm" #endif #include "res/boincsm.xpm" #include "res/attachprojectwizard.xpm" #include "res/gridrepublicamwizard.xpm" +#include "res/cpdnbbcapwizard.xpm" ////@end XPM images @@ -132,33 +135,33 @@ bool CBrandingScheme::OnInit( wxConfigBase *pConfig ) { case 2: // Running as a CPDNBBC client. m_strApplicationName = wxT("The BOINC Manager for the BBC Climate Change Experiment"); - m_iconApplicationIcon = wxIcon(boinc_xpm); - m_bitmapApplicationLogo = wxBitmap(boincsm_xpm); + m_iconApplicationIcon = wxIcon(cpdnbbc16_xpm); + m_bitmapApplicationLogo = wxBitmap(cpdnbbc32_xpm); m_strCompanyName = wxT("ClimatePrediction.net"); m_strCompanyWebsite = wxT("http://bbc.cpdn.org/beta/"); m_strProjectName = wxT("BBC Climate Change Experiment"); m_bDefaultTabSpecified = true; m_iDefaultTab = ID_LIST_WORKVIEW - ID_LIST_BASE; m_strAPWizardTitle = _("Start Project"); - m_bitmapAPWizardLogo = wxBitmap(attachprojectwizard_xpm); + m_bitmapAPWizardLogo = wxBitmap(cpdnbbcapwizard_xpm); m_strAPWizardAccountInfoText = - _("Please enter an e-mail address and password to participate in our\n" - "interactive user forum and receive occasional project announcements.\n" - "You can block all e-mails from the project on your \"preferences\"\n" - "page whenever you like, and we will not pass on your e-mail address\n" - "to any third party. You can still run the experiment if you enter a\n" - "dummy address, but you will not be able to join in the user forum."); + _("Please enter an email address and password.\n" + "\n" + "You will need your email address if you want to change your account\n" + "options or use our message boards.\n" + "\n" + "We will send you occasional emails. You can stop these at aynt time.\n" + "We will not pass your email address on to others.\n"); m_strAPWizardCompletionTitle = _("Project Started"); m_strAPWizardCompletionBrandedMessage = _("Congratulations, you have now successfully started your Climate\n" "Change Experiment.\n"); m_strAPWizardCompletionMessage = - _("Click Finish to close. This will automatically launch a web browser\n" - "that will tell more about your experiment and how to customize your\n" - "settings."); + _("Click finish to exit. You will be taken to a web page which tells\n" + "you more about your model.\n"); m_strAMWizardTitle = wxEmptyString; - m_bitmapAMWizardLogo = wxBitmap(attachprojectwizard_xpm); + m_bitmapAMWizardLogo = wxBitmap(cpdnbbcapwizard_xpm); m_strAMWizardAttachMessage = wxEmptyString; m_strExitMessage = _("This will shut down your experiment until it restarts automatically\n" diff --git a/clientgui/BOINCGUIApp.rc b/clientgui/BOINCGUIApp.rc index 07b10330e6..f6950cbb71 100644 --- a/clientgui/BOINCGUIApp.rc +++ b/clientgui/BOINCGUIApp.rc @@ -34,6 +34,10 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL APP_ICON ICON "res\\gridrepublic.ico" APP_ICON2 ICON "res\\gridrepublic2.ico" +#elif defined(_CPDNBBC) + +APP_ICON ICON "res\\cpdnbbc.ico" + #else APP_ICON ICON "res\\boincguiApp.ico" diff --git a/clientgui/Makefile.am b/clientgui/Makefile.am index 4cd11b37b9..20d281c992 100644 --- a/clientgui/Makefile.am +++ b/clientgui/Makefile.am @@ -36,6 +36,7 @@ boinc_gui_SOURCES = \ MainFrame.cpp \ stdwx.cpp \ ValidateAccountKey.cpp \ + ValidateEmailAddress.cpp \ ValidateURL.cpp \ ViewMessages.cpp \ ViewProjects.cpp \ diff --git a/clientgui/ValidateEmailAddress.cpp b/clientgui/ValidateEmailAddress.cpp new file mode 100644 index 0000000000..f510a90391 --- /dev/null +++ b/clientgui/ValidateEmailAddress.cpp @@ -0,0 +1,148 @@ +// Berkeley Open Infrastructure for Network Computing +// http://boinc.berkeley.edu +// Copyright (C) 2005 University of California +// +// This is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; +// either version 2.1 of the License, or (at your option) any later version. +// +// This software is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Lesser General Public License for more details. +// +// To view the GNU Lesser General Public License visit +// http://www.gnu.org/copyleft/lesser.html +// or write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +#if defined(__GNUG__) && !defined(__APPLE__) +#pragma implementation "ValidateEmailAddress.h" +#endif + +#include "stdwx.h" +#include "ValidateEmailAddress.h" + + +IMPLEMENT_DYNAMIC_CLASS(CValidateEmailAddress, wxValidator) + + +CValidateEmailAddress::CValidateEmailAddress(wxString *val) { + m_stringValue = val ; +} + + +CValidateEmailAddress::CValidateEmailAddress(const CValidateEmailAddress& val) + : wxValidator() +{ + Copy(val); +} + + +CValidateEmailAddress::~CValidateEmailAddress() {} + + +bool CValidateEmailAddress::Copy(const CValidateEmailAddress& val) { + wxValidator::Copy(val); + + m_stringValue = val.m_stringValue ; + + return TRUE; +} + + +bool CValidateEmailAddress::Validate(wxWindow *parent) { + if(!CheckValidator()) + return FALSE; + + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; + + if (!control->IsEnabled()) + return TRUE; + + bool ok = TRUE; + wxString val(control->GetValue().Trim().Trim(false)); // trim spaces before and after + + // Regular Expression found here: + // http://www.regexlib.com/REDetails.aspx?regexp_id=284 + wxRegEx reEmail = + wxT("^([a-zA-Z0-9_\\-])+(\\.([a-zA-Z0-9_\\-])+)*@((\\[(((([0-1])?([0-9])?[0-9])|" + "(2[0-4][0-9])|(2[0-5][0-5])))\\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[" + "0-5][0-5])))\\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\\.((" + "(([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\\]))|((([a-zA-Z0-9])+(" + "([\\-])+([a-zA-Z0-9])+)*\\.)+([a-zA-Z])+(([\\-])+([a-zA-Z0-9])+)*))$"); + + if (val.Length() == 0) { + ok = FALSE; + m_errormsg = _("Please specify an account key to continue."); + } else if (!reEmail.Matches(val)) { + ok = FALSE; + m_errormsg = _("Invalid email address; please enter a valid email address"); + } + + if (!ok) { + wxASSERT_MSG(!m_errormsg.empty(), _T("you forgot to set errormsg")); + + m_validatorWindow->SetFocus(); + + wxString buf; + buf.Printf(m_errormsg, control->GetValue().c_str()); + + wxMessageBox(buf, _("Validation conflict"), + wxOK | wxICON_EXCLAMATION, parent + ); + } + + return ok; +} + + +bool CValidateEmailAddress::TransferToWindow(void) { + if(!CheckValidator()) + return FALSE; + + if (!m_stringValue) + return TRUE; + + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; + control->SetValue(* m_stringValue) ; + + return TRUE; +} + + +bool CValidateEmailAddress::TransferFromWindow(void) { + if(!CheckValidator()) + return FALSE; + + if (!m_stringValue) + return TRUE; + + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; + * m_stringValue = control->GetValue() ; + + return TRUE; +} + + +bool CValidateEmailAddress::wxIsAlphaNumeric(const wxString& val) { + int i; + for (i = 0; i < (int)val.Length(); i++) { + if (!wxIsalnum(val[i])) + return FALSE; + } + return TRUE; +} + + +bool CValidateEmailAddress::CheckValidator() const { + wxCHECK_MSG(m_validatorWindow, FALSE, + _T("No window associated with validator")); + wxCHECK_MSG(m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)), FALSE, + _T("wxTextValidator is only for wxTextCtrl's")); + wxCHECK_MSG(m_stringValue, FALSE, + _T("No variable storage for validator")); + + return TRUE; +} diff --git a/clientgui/ValidateEmailAddress.h b/clientgui/ValidateEmailAddress.h new file mode 100644 index 0000000000..90e13006c6 --- /dev/null +++ b/clientgui/ValidateEmailAddress.h @@ -0,0 +1,57 @@ +// Berkeley Open Infrastructure for Network Computing +// http://boinc.berkeley.edu +// Copyright (C) 2005 University of California +// +// This is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; +// either version 2.1 of the License, or (at your option) any later version. +// +// This software is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Lesser General Public License for more details. +// +// To view the GNU Lesser General Public License visit +// http://www.gnu.org/copyleft/lesser.html +// or write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +#ifndef _VALIDATEEMAILADDRESS_H_ +#define _VALIDATEEMAILADDRESS_H_ + +#if defined(__GNUG__) && !defined(__APPLE__) +#pragma interface "ValidateEmailAddress.cpp" +#endif + + +class CValidateEmailAddress : public wxValidator +{ + DECLARE_DYNAMIC_CLASS( CValidateEmailAddress ) + +public: + + CValidateEmailAddress( wxString *val = 0 ); + CValidateEmailAddress( const CValidateEmailAddress& val ); + + ~CValidateEmailAddress(); + + virtual wxObject* Clone() const { return new CValidateEmailAddress(*this); } + virtual bool Copy( const CValidateEmailAddress& val ); + + virtual bool Validate(wxWindow *parent); + virtual bool TransferToWindow(); + virtual bool TransferFromWindow(); + +protected: + wxString* m_stringValue; + wxString m_errormsg; + + bool wxIsAlphaNumeric(const wxString& val); + virtual bool CheckValidator() const; + +}; + + +#endif + diff --git a/win_build/boincmgr_curl.vcproj b/win_build/boincmgr_curl.vcproj index 3987150ec2..0f13daa709 100644 --- a/win_build/boincmgr_curl.vcproj +++ b/win_build/boincmgr_curl.vcproj @@ -291,6 +291,27 @@ + + + + + + + + + + + + + + @@ -503,6 +524,12 @@ + + + + diff --git a/win_build/cpdnbbc_boinc_dll.vcproj b/win_build/cpdnbbc_boinc_dll.vcproj index 20375fb3a0..249d6c57b2 100644 --- a/win_build/cpdnbbc_boinc_dll.vcproj +++ b/win_build/cpdnbbc_boinc_dll.vcproj @@ -3,9 +3,9 @@ ProjectType="Visual C++" Version="7.10" Name="boinc_dll" - ProjectGUID="{B06280CB-82A4-46DE-8956-602643078BDF}" - SccProjectName="" - SccLocalPath=""> + ProjectGUID="{ADA6451B-CFEA-402A-9681-227CD1FDE08C}" + RootNamespace="boinc" + Keyword="AtlProj"> @@ -16,63 +16,57 @@ OutputDirectory=".\Build\Debug" IntermediateDirectory=".\Build\Debug\boinc_dll\obj" ConfigurationType="2" - UseOfMFC="0" + UseOfATL="1" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="4"/> + GenerateStublessProxies="TRUE" + TypeLibraryName="$(IntDir)/boinc_dll.tlb" + HeaderFileName="boinc_dll.h" + DLLDataFileName="" + InterfaceIdentifierFileName="boinc_dll_i.c" + ProxyFileName="boinc_dll_p.c"/> + Name="VCPostBuildEventTool" + Description="Performing registration" + CommandLine="regsvr32 /s /c "$(TargetPath)""/> + AdditionalIncludeDirectories=""$(IntDir)";../"/> + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="3"/> + GenerateStublessProxies="TRUE" + TypeLibraryName="$(IntDir)/boinc_dll.tlb" + HeaderFileName="boinc_dll.h" + DLLDataFileName="" + InterfaceIdentifierFileName="boinc_dll_i.c" + ProxyFileName="boinc_dll_p.c"/> + Name="VCPostBuildEventTool" + Description="Performing registration" + CommandLine="regsvr32 /s /c "$(TargetPath)""/> + AdditionalIncludeDirectories=""$(IntDir)";../"/> + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + RelativePath="..\clientlib\win\boinc_dll.cpp"> + + + + + + + + + + + UsePrecompiledHeader="1"/> + UsePrecompiledHeader="1"/> - - + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + RelativePath="..\clientlib\win\boinc_dll.h"> + RelativePath="..\clientlib\win\BOINCSENSSink.h"> + + + + + + + + + + + + + + + + + + + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> - - - - - - + RelativePath="..\clientlib\win\boinc_dll.rc"> + + diff --git a/win_build/cpdnbbc_boincmgr_curl.vcproj b/win_build/cpdnbbc_boincmgr_curl.vcproj index af746f580d..c80cb7d79a 100644 --- a/win_build/cpdnbbc_boincmgr_curl.vcproj +++ b/win_build/cpdnbbc_boincmgr_curl.vcproj @@ -310,6 +310,30 @@ + + + + + + + + + + + + + + + + @@ -522,6 +546,12 @@ + + + + @@ -590,6 +620,12 @@ + + + + diff --git a/win_build/installerv2/CPDNBBC.ism b/win_build/installerv2/CPDNBBC.ism index c2021a0f6ca300b530ce6deb662607a2e4d0ee1c..988eae5d0dd238a5da7a13f682f7bb85bb100caa 100644 GIT binary patch delta 883 zcmYjQZAep57{2E{cb`t(THxkaSEcK+rkl+vL^?MarPu`VPboImC6zgI-abSsmHq?~ z*o}KE`q3BK2Z1v1{P9O5l+7rSB3e*?3L>Z zX(q~RmV2ihFB60O3K%#$$8jbGa_SOtD6%eOK&8y}X0{Tmx)6}S8n_kN7}_9-Rbz<% z!{po$G9WVxUT3zUkytgK0o0xtwmQ!uNK9X`4`Oys7qU?Y(0Vg^P(lWGAv?MH0u1~< zNj|PtqdQ1L?^dG@OhqqBSyeNLbIs^tvE9OPqZ167HN!3RUJp93-|#pmS8vh(%vqt9 z1!T?FC)riM(y90WKUd$NPL!lwZ_rIQE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