2005-01-20 23:22:22 +00:00
// Berkeley Open Infrastructure for Network Computing
// http://boinc.berkeley.edu
// Copyright (C) 2005 University of California
2004-05-17 22:15:10 +00:00
//
2005-01-20 23:22:22 +00:00
// 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.
2004-04-10 09:11:03 +00:00
//
2005-01-20 23:22:22 +00:00
// 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.
2004-05-17 22:15:10 +00:00
//
2005-01-20 23:22:22 +00:00
// 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
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"
# include "BOINCGUIApp.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
////@begin XPM images
2006-03-17 09:03:29 +00:00
# include "res/boincsm.xpm"
2005-04-01 22:17:44 +00:00
////@end XPM images
/*!
* 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
m_strVersion = BOINC_VERSION_STRING ;
2005-12-28 12:33:18 +00:00
m_AboutBOINCTitleCtrl = NULL ;
m_AboutBOINCLogoCtrl = NULL ;
m_AboutBOINCSloganCtrl = NULL ;
m_AboutBOINCURLCtrl = NULL ;
2005-04-01 22:17:44 +00:00
////@end CDlgAbout member initialisation
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
//
if ( wxGetApp ( ) . GetBrand ( ) - > IsBranded ( ) ) {
wxString buf = wxEmptyString ;
buf . Printf (
_ ( " About %s " ) ,
wxGetApp ( ) . GetBrand ( ) - > GetApplicationName ( ) . c_str ( )
) ;
SetTitle ( buf ) ;
buf . Printf (
_ ( " %s " ) ,
wxGetApp ( ) . GetBrand ( ) - > GetApplicationName ( ) . c_str ( )
) ;
m_AboutBOINCTitleCtrl - > SetLabel ( buf ) ;
2006-03-17 09:03:29 +00:00
wxBitmap bmp ;
if ( wxGetApp ( ) . GetBrand ( ) - > IsBranded ( ) ) {
bmp = wxBitmap ( * ( wxGetApp ( ) . GetBrand ( ) - > GetApplicationLogo ( ) ) ) ;
} else {
bmp = wxBitmap ( boincsm_xpm ) ;
}
m_AboutBOINCLogoCtrl - > SetBitmap ( bmp ) ;
2005-12-28 12:33:18 +00:00
m_AboutBOINCSloganCtrl - > SetLabel ( wxEmptyString ) ;
m_AboutBOINCURLCtrl - > SetLabel (
wxGetApp ( ) . GetBrand ( ) - > GetCompanyWebsite ( ) . c_str ( )
) ;
}
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 ) ;
m_AboutBOINCTitleCtrl - > SetFont ( wxFont ( 24 , wxDEFAULT , wxNORMAL , wxBOLD , false , _T ( " " ) ) ) ;
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 ;
m_AboutBOINCLogoCtrl - > Create ( itemDialog1 , wxID_STATIC , m_AboutBOINCLogoCtrlBitmap , wxDefaultPosition , wxSize ( 50 , 50 ) , 0 ) ;
itemBoxSizer5 - > Add ( m_AboutBOINCLogoCtrl , 0 , wxALIGN_LEFT | wxALL , 5 ) ;
2005-07-21 23:06:02 +00:00
2005-04-01 22:17:44 +00:00
wxFlexGridSizer * itemFlexGridSizer7 = new wxFlexGridSizer ( 0 , 2 , 0 , 0 ) ;
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 ;
2005-07-21 23:06:02 +00:00
itemStaticText9 - > Create ( itemDialog1 , wxID_STATIC , _T ( " " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText9 , 0 , wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText10 = new wxStaticText ;
itemStaticText10 - > Create ( itemDialog1 , wxID_STATIC , _ ( " Copyright: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemFlexGridSizer7 - > Add ( itemStaticText10 , 0 , wxALIGN_RIGHT | wxALIGN_TOP | wxLEFT | wxRIGHT , 5 ) ;
wxStaticText * itemStaticText11 = new wxStaticText ;
2006-01-09 14:03:13 +00:00
itemStaticText11 - > Create ( itemDialog1 , wxID_STATIC , _ ( " (C) 2003-2006 University of California at Berkeley. \n All Rights Reserved. " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2005-07-21 23:06:02 +00:00
itemFlexGridSizer7 - > Add ( itemStaticText11 , 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
2005-04-01 22:17:44 +00:00
wxStaticText * itemStaticText13 = new wxStaticText ;
2005-07-21 23:06:02 +00:00
itemStaticText13 - > Create ( itemDialog1 , wxID_STATIC , _ ( " A software platform for distributed computing using volunteered computer resources " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
itemBoxSizer2 - > Add ( itemStaticText13 , 0 , wxALIGN_CENTER_HORIZONTAL | wxALL , 5 ) ;
2004-04-10 09:11:03 +00:00
2005-12-28 12:33:18 +00:00
m_AboutBOINCURLCtrl = new wxHyperLink ;
m_AboutBOINCURLCtrl - > Create ( itemDialog1 , ID_ABOUTBOINCLINK , wxT ( " http://boinc.berkeley.edu/ " ) , wxDefaultPosition , wxDefaultSize , wxNO_BORDER ) ;
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 ) ) ;
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
2005-09-13 09:01:56 +00:00
const char * BOINC_RCSID_b40c2996e6 = " $Id$ " ;