2008-08-06 18:36:30 +00:00
// This file is part of BOINC.
2005-01-20 23:22:22 +00:00
// http://boinc.berkeley.edu
2008-08-06 18:36:30 +00:00
// Copyright (C) 2008 University of California
2004-05-17 22:15:10 +00:00
//
2008-08-06 18:36:30 +00:00
// BOINC 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 3 of the License, or (at your option) any later version.
2004-04-10 09:11:03 +00:00
//
2008-08-06 18:36:30 +00:00
// BOINC is distributed in the hope that it will be useful,
2005-01-20 23:22:22 +00:00
// 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.
2004-05-17 22:15:10 +00:00
//
2008-08-06 18:36:30 +00:00
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
2005-04-01 22:17:44 +00:00
//
2004-04-10 09:11:03 +00:00
# if defined(__GNUG__) && !defined(__APPLE__)
# pragma implementation "DlgAbout.h"
# endif
2005-07-06 09:14:43 +00:00
# include "stdwx.h"
2006-10-20 15:00:14 +00:00
# include "diagnostics.h"
# include "util.h"
# include "mfile.h"
# include "miofile.h"
# include "parse.h"
# include "LogBOINC.h"
2005-07-06 09:14:43 +00:00
# include "BOINCGUIApp.h"
2006-10-20 15:00:14 +00:00
# include "SkinManager.h"
2005-04-01 22:17:44 +00:00
////@begin includes
////@end includes
2004-04-10 09:11:03 +00:00
# include "DlgAbout.h"
2004-11-11 03:32:57 +00:00
# ifdef __WXMSW__
2005-10-03 23:14:39 +00:00
# include "../version.h"
2004-11-11 03:32:57 +00:00
# else
# include "config.h"
# endif
2004-10-22 22:55:29 +00:00
2005-04-01 22:17:44 +00:00
/*!
* CDlgAbout type definition
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
IMPLEMENT_DYNAMIC_CLASS ( CDlgAbout , wxDialog )
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
/*!
* CDlgAbout event table definition
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
BEGIN_EVENT_TABLE ( CDlgAbout , wxDialog )
2005-04-01 22:17:44 +00:00
////@begin CDlgAbout event table entries
////@end CDlgAbout event table entries
2004-04-10 09:11:03 +00:00
END_EVENT_TABLE ( )
2005-04-01 22:17:44 +00:00
/*!
* CDlgAbout constructors
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
CDlgAbout : : CDlgAbout ( ) { }
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
CDlgAbout : : CDlgAbout ( wxWindow * parent , wxWindowID id , const wxString & caption , const wxPoint & pos , const wxSize & size , long style ) {
2004-04-10 09:11:03 +00:00
Create ( parent , id , caption , pos , size , style ) ;
}
2005-04-01 22:17:44 +00:00
/*!
* CDlgHelpAbout creator
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
bool CDlgAbout : : Create ( wxWindow * parent , wxWindowID id , const wxString & caption , const wxPoint & pos , const wxSize & size , long style ) {
2005-04-01 22:17:44 +00:00
////@begin CDlgAbout member initialisation
2005-12-28 12:33:18 +00:00
m_AboutBOINCTitleCtrl = NULL ;
m_AboutBOINCLogoCtrl = NULL ;
m_AboutBOINCSloganCtrl = NULL ;
m_AboutBOINCURLCtrl = NULL ;
2010-10-04 17:12:36 +00:00
# if defined(_WIN64) && defined(_M_X64)
m_strVersion . Printf ( wxT ( " %s (x64) " ) , wxT ( BOINC_VERSION_STRING ) ) ;
# else
m_strVersion . Printf ( wxT ( " %s (x86) " ) , wxT ( BOINC_VERSION_STRING ) ) ;
# endif
2008-10-31 22:11:38 +00:00
m_strWidgetsVersion . Printf ( wxT ( " %d.%d.%d " ) , wxMAJOR_VERSION , wxMINOR_VERSION , wxRELEASE_NUMBER ) ;
2005-04-01 22:17:44 +00:00
////@end CDlgAbout member initialisation
2006-10-20 15:00:14 +00:00
CSkinAdvanced * pSkinAdvanced = wxGetApp ( ) . GetSkinManager ( ) - > GetAdvanced ( ) ;
wxASSERT ( pSkinAdvanced ) ;
wxASSERT ( wxDynamicCast ( pSkinAdvanced , CSkinAdvanced ) ) ;
2005-04-01 22:17:44 +00:00
SetExtraStyle ( GetExtraStyle ( ) | wxWS_EX_BLOCK_EVENTS ) ;
2005-07-21 23:06:02 +00:00
wxDialog : : Create ( parent , id , caption , pos , size , style ) ;
2004-04-10 09:11:03 +00:00
CreateControls ( ) ;
2005-12-28 12:33:18 +00:00
// Change the various dialog items for the branded manager
//
2006-04-06 19:54:02 +00:00
wxString buf = wxEmptyString ;
buf . Printf (
_ ( " About %s " ) ,
2006-10-20 15:00:14 +00:00
pSkinAdvanced - > GetApplicationName ( ) . c_str ( )
2006-04-06 19:54:02 +00:00
) ;
SetTitle ( buf ) ;
buf . Printf (
_ ( " %s " ) ,
2006-10-20 15:00:14 +00:00
pSkinAdvanced - > GetApplicationName ( ) . c_str ( )
2006-04-06 19:54:02 +00:00
) ;
m_AboutBOINCTitleCtrl - > SetLabel ( buf ) ;
2006-10-20 15:00:14 +00:00
m_AboutBOINCLogoCtrl - > SetBitmap ( wxBitmap ( * ( pSkinAdvanced - > GetApplicationLogo ( ) ) ) ) ;
2006-04-06 19:54:02 +00:00
m_AboutBOINCSloganCtrl - > SetLabel ( wxEmptyString ) ;
m_AboutBOINCURLCtrl - > SetLabel (
2007-08-16 18:53:42 +00:00
pSkinAdvanced - > GetOrganizationWebsite ( ) . c_str ( )
2006-04-06 19:54:02 +00:00
) ;
2006-01-09 14:03:13 +00:00
GetSizer ( ) - > Fit ( this ) ;
GetSizer ( ) - > SetSizeHints ( this ) ;
Centre ( ) ;
2004-04-10 09:11:03 +00:00
return TRUE ;
}
2005-04-01 22:17:44 +00:00
/*!
* Control creation for CDlgHelpAbout
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
void CDlgAbout : : CreateControls ( ) {
2005-04-01 22:17:44 +00:00
////@begin CDlgAbout content construction
CDlgAbout * itemDialog1 = this ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxBoxSizer * itemBoxSizer2 = new wxBoxSizer ( wxVERTICAL ) ;
itemDialog1 - > SetSizer ( itemBoxSizer2 ) ;
2004-04-10 09:11:03 +00:00
2005-12-28 12:33:18 +00:00
m_AboutBOINCTitleCtrl = new wxStaticText ;
m_AboutBOINCTitleCtrl - > Create ( itemDialog1 , wxID_STATIC , _ ( " BOINC Manager " ) , wxDefaultPosition , wxDefaultSize , wxALIGN_CENTRE ) ;
2007-03-30 03:33:57 +00:00
m_AboutBOINCTitleCtrl - > SetFont ( wxFont ( 16 , wxDEFAULT , wxNORMAL , wxBOLD , false , _T ( " " ) ) ) ;
2005-12-28 12:33:18 +00:00
itemBoxSizer2 - > Add ( m_AboutBOINCTitleCtrl , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxBoxSizer * itemBoxSizer4 = new wxBoxSizer ( wxHORIZONTAL ) ;
itemBoxSizer2 - > Add ( itemBoxSizer4 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxBoxSizer * itemBoxSizer5 = new wxBoxSizer ( wxVERTICAL ) ;
itemBoxSizer4 - > Add ( itemBoxSizer5 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-12-28 12:33:18 +00:00
wxBitmap m_AboutBOINCLogoCtrlBitmap ( wxNullBitmap ) ;
m_AboutBOINCLogoCtrl = new wxStaticBitmap ;
2007-08-02 20:03:21 +00:00
m_AboutBOINCLogoCtrl - > Create ( itemDialog1 , wxID_STATIC , m_AboutBOINCLogoCtrlBitmap , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-12-28 12:33:18 +00:00
itemBoxSizer5 - > Add ( m_AboutBOINCLogoCtrl , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2005-07-21 23:06:02 +00:00
2008-10-31 21:15:23 +00:00
wxFlexGridSizer * itemFlexGridSizer7 = new wxFlexGridSizer ( 3 , 2 , 0 , 0 ) ;
2005-04-01 22:17:44 +00:00
itemBoxSizer4 - > Add ( itemFlexGridSizer7 , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText8 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText8 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Version: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText8 , 0 , wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText9 = new wxStaticText ;
2008-10-31 21:28:01 +00:00
itemStaticText9 - > Create ( itemDialog1 , wxID_STATIC , wxT ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-07-21 23:06:02 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText9 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText10 = new wxStaticText ;
2008-10-31 21:15:23 +00:00
itemStaticText10 - > Create ( itemDialog1 , wxID_STATIC , _ ( " wxWidgets Version: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText10 , 0 , wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
2005-07-21 23:06:02 +00:00
wxStaticText * itemStaticText11 = new wxStaticText ;
2008-10-31 21:28:01 +00:00
itemStaticText11 - > Create ( itemDialog1 , wxID_STATIC , wxT ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2008-10-31 21:15:23 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText11 , 11 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText12 = new wxStaticText ;
itemStaticText12 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Copyright: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText12 , 0 , wxALIGN_RIGHT | wxALIGN_TOP | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText13 = new wxStaticText ;
2011-03-04 06:48:36 +00:00
itemStaticText13 - > Create ( itemDialog1 , wxID_STATIC , _ ( " (C) 2003-2011 University of California, Berkeley. \n All Rights Reserved. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2008-10-31 21:15:23 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText13 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-12-28 12:33:18 +00:00
m_AboutBOINCSloganCtrl = new wxStaticText ;
m_AboutBOINCSloganCtrl - > Create ( itemDialog1 , wxID_STATIC , _ ( " Berkeley Open Infrastructure for Network Computing " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer2 - > Add ( m_AboutBOINCSloganCtrl , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2008-10-31 21:15:23 +00:00
wxStaticText * itemStaticText14 = new wxStaticText ;
itemStaticText14 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Berkeley Open Infrastructure for Network Computing " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer2 - > Add ( itemStaticText14 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2009-12-19 05:16:41 +00:00
m_AboutBOINCURLCtrl = new wxHyperlinkCtrl ;
m_AboutBOINCURLCtrl - > Create ( itemDialog1 , ID_ABOUTBOINCLINK , wxT ( " http://boinc.berkeley.edu/ " ) , wxT ( " http://boinc.berkeley.edu/ " ) , wxDefaultPosition , wxDefaultSize , wxNO_BORDER | wxHL_ALIGN_CENTRE | wxHL_CONTEXTMENU ) ;
2005-12-28 12:33:18 +00:00
itemBoxSizer2 - > Add ( m_AboutBOINCURLCtrl , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-07-21 23:06:02 +00:00
wxStaticLine * itemStaticLine15 = new wxStaticLine ;
itemStaticLine15 - > Create ( itemDialog1 , wxID_STATIC , wxDefaultPosition , wxDefaultSize , wxLI_HORIZONTAL ) ;
itemBoxSizer2 - > Add ( itemStaticLine15 , 0 , wxGROW | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-07-21 23:06:02 +00:00
wxButton * itemButton16 = new wxButton ;
itemButton16 - > Create ( itemDialog1 , wxID_OK , _ ( " &OK " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemButton16 - > SetDefault ( ) ;
itemBoxSizer2 - > Add ( itemButton16 , 0 , wxALIGN_RIGHT | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-04-01 22:17:44 +00:00
// Set validators
2005-07-21 23:06:02 +00:00
itemStaticText9 - > SetValidator ( wxGenericValidator ( & m_strVersion ) ) ;
2008-10-31 21:28:01 +00:00
itemStaticText11 - > SetValidator ( wxGenericValidator ( & m_strWidgetsVersion ) ) ;
2005-04-01 22:17:44 +00:00
////@end CDlgAbout content construction
2004-04-10 09:11:03 +00:00
}
2005-04-01 22:17:44 +00:00
/*!
* Should we show tooltips ?
*/
2004-04-10 09:11:03 +00:00
2005-04-07 07:04:50 +00:00
bool CDlgAbout : : ShowToolTips ( ) {
2004-04-10 09:11:03 +00:00
return TRUE ;
}
2004-04-11 05:09:18 +00:00
2005-04-01 22:17:44 +00:00
/*!
* Get bitmap resources
*/
2004-12-08 00:40:19 +00:00
2006-03-17 09:03:29 +00:00
wxBitmap CDlgAbout : : GetBitmapResource ( const wxString & WXUNUSED ( name ) ) {
2005-04-01 22:17:44 +00:00
// Bitmap retrieval
////@begin CDlgAbout bitmap retrieval
return wxNullBitmap ;
////@end CDlgAbout bitmap retrieval
}
/*!
* Get icon resources
*/
2006-03-17 09:03:29 +00:00
wxIcon CDlgAbout : : GetIconResource ( const wxString & WXUNUSED ( name ) ) {
2005-04-01 22:17:44 +00:00
// Icon retrieval
////@begin CDlgAbout icon retrieval
return wxNullIcon ;
////@end CDlgAbout icon retrieval
}
2005-12-28 12:33:18 +00:00