From 0e02305b34434d11e9930cf16e5d41d01327a125 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 25 Oct 2004 20:58:06 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4424 --- clientgui/BOINCGUIApp.cpp | 1 + clientgui/MainDocument.cpp | 167 ++++++++++++++++++++++++++++++++++++- clientgui/MainDocument.h | 40 +++++---- clientgui/TaskBarIcon.cpp | 21 ++++- clientgui/stdwx.h | 1 + 5 files changed, 210 insertions(+), 20 deletions(-) diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index ffcc685f36..93fcaa8720 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -79,6 +79,7 @@ bool CBOINCGUIApp::OnInit() wxASSERT(NULL != m_pTaskBarIcon); SetTopWindow(m_pFrame); + m_pFrame->Show(); return true; } diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index dc67c2dae2..76aa71db2e 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -1379,7 +1379,7 @@ wxInt32 CMainDocument::GetResourceDiskspace( wxInt32 iIndex, float& fBuffer ) } -wxInt32 CMainDocument::GetProxyInfo() +wxInt32 CMainDocument::GetProxyConfiguration() { wxInt32 retval = 0; @@ -1394,7 +1394,91 @@ wxInt32 CMainDocument::GetProxyInfo() } -wxInt32 CMainDocument::SetProxyInfo() +wxInt32 CMainDocument::GetProxyHTTPProxyEnabled( bool& bEnabled ) +{ + bEnabled = proxy_info.use_http_authentication; + return 0; +} + + +wxInt32 CMainDocument::GetProxyHTTPAuthenticationEnabled( bool& bEnabled ) +{ + bEnabled = proxy_info.use_http_authentication; + return 0; +} + + +wxInt32 CMainDocument::GetProxyHTTPServerName( wxString& strServerName ) +{ + strServerName = proxy_info.http_server_name.c_str(); + return 0; +} + + +wxInt32 CMainDocument::GetProxyHTTPServerPort( wxInt32& iPortNumber ) +{ + iPortNumber = proxy_info.http_server_port; + return 0; +} + + +wxInt32 CMainDocument::GetProxyHTTPUserName( wxString& strUserName ) +{ + strUserName = proxy_info.http_user_name.c_str(); + return 0; +} + + +wxInt32 CMainDocument::GetProxyHTTPPassword( wxString& strPassword ) +{ + strPassword = proxy_info.http_user_passwd.c_str(); + return 0; +} + + +wxInt32 CMainDocument::GetProxySOCKSProxyEnabled( bool& bEnabled ) +{ + bEnabled = proxy_info.use_socks_proxy; + return 0; +} + + +wxInt32 CMainDocument::GetProxySOCKSVersion( wxInt32& iVersion ) +{ + iVersion = proxy_info.socks_version; + return 0; +} + + +wxInt32 CMainDocument::GetProxySOCKSServerName( wxString& strServerName ) +{ + strServerName = proxy_info.socks_server_name.c_str(); + return 0; +} + + +wxInt32 CMainDocument::GetProxySOCKSServerPort( wxInt32& iPortNumber ) +{ + iPortNumber = proxy_info.socks_server_port; + return 0; +} + + +wxInt32 CMainDocument::GetProxySOCKSUserName( wxString& strUserName ) +{ + strUserName = proxy_info.socks5_user_name.c_str(); + return 0; +} + + +wxInt32 CMainDocument::GetProxySOCKSPassword( wxString& strPassword ) +{ + strPassword = proxy_info.socks5_user_passwd.c_str(); + return 0; +} + + +wxInt32 CMainDocument::SetProxyConfiguration() { wxInt32 retval = 0; @@ -1409,7 +1493,86 @@ wxInt32 CMainDocument::SetProxyInfo() } +wxInt32 CMainDocument::SetProxyHTTPProxyEnabled( const bool bEnabled ) +{ + proxy_info.use_http_authentication = bEnabled; + return 0; +} +wxInt32 CMainDocument::SetProxyHTTPAuthenticationEnabled( const bool bEnabled ) +{ + proxy_info.use_http_authentication = bEnabled; + return 0; +} +wxInt32 CMainDocument::SetProxyHTTPServerName( const wxString& strServerName ) +{ + proxy_info.http_server_name = strServerName.c_str(); + return 0; +} + + +wxInt32 CMainDocument::SetProxyHTTPServerPort( const wxInt32 iPortNumber ) +{ + proxy_info.http_server_port = iPortNumber; + return 0; +} + + +wxInt32 CMainDocument::SetProxyHTTPUserName( const wxString& strUserName ) +{ + proxy_info.http_user_name = strUserName.c_str(); + return 0; +} + + +wxInt32 CMainDocument::SetProxyHTTPPassword( const wxString& strPassword ) +{ + proxy_info.http_user_passwd = strPassword.c_str(); + return 0; +} + + +wxInt32 CMainDocument::SetProxySOCKSProxyEnabled( const bool bEnabled ) +{ + proxy_info.use_socks_proxy = bEnabled; + return 0; +} + + +wxInt32 CMainDocument::SetProxySOCKSVersion( const wxInt32 iVersion ) +{ + proxy_info.socks_version = iVersion; + return 0; +} + + +wxInt32 CMainDocument::SetProxySOCKSServerName( const wxString& strServerName ) +{ + proxy_info.socks_server_name = strServerName.c_str(); + return 0; +} + + +wxInt32 CMainDocument::SetProxySOCKSServerPort( const wxInt32 iPortNumber ) +{ + proxy_info.socks_server_port = iPortNumber; + return 0; +} + + +wxInt32 CMainDocument::SetProxySOCKSUserName( const wxString& strUserName ) +{ + proxy_info.socks5_user_name = strUserName.c_str(); + return 0; +} + + +wxInt32 CMainDocument::SetProxySOCKSPassword( const wxString& strPassword ) +{ + proxy_info.socks5_user_passwd = strPassword.c_str(); + return 0; +} + diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index 648cb12b96..54ad1bc344 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -243,21 +243,33 @@ private: public: - wxInt32 GetProxyInfo(); - wxInt32 SetProxyInfo(); + wxInt32 GetProxyConfiguration(); + wxInt32 GetProxyHTTPProxyEnabled( bool& bEnabled ); + wxInt32 GetProxyHTTPAuthenticationEnabled( bool& bEnabled ); + wxInt32 GetProxyHTTPServerName( wxString& strServerName ); + wxInt32 GetProxyHTTPServerPort( wxInt32& iPortNumber ); + wxInt32 GetProxyHTTPUserName( wxString& strUserName ); + wxInt32 GetProxyHTTPPassword( wxString& strPassword ); + wxInt32 GetProxySOCKSProxyEnabled( bool& bEnabled ); + wxInt32 GetProxySOCKSVersion( wxInt32& iVersion ); + wxInt32 GetProxySOCKSServerName( wxString& strServerName ); + wxInt32 GetProxySOCKSServerPort( wxInt32& iPortNumber ); + wxInt32 GetProxySOCKSUserName( wxString& strUserName ); + wxInt32 GetProxySOCKSPassword( wxString& strPassword ); - bool use_http_proxy; - bool use_socks_proxy; - bool use_http_authentication; - int socks_version; - std::string socks_server_name; - std::string http_server_name; - int socks_server_port; - int http_server_port; - std::string http_user_name; - std::string http_user_passwd; - std::string socks5_user_name; - std::string socks5_user_passwd; + wxInt32 SetProxyConfiguration(); + wxInt32 SetProxyHTTPProxyEnabled( const bool bEnabled ); + wxInt32 SetProxyHTTPAuthenticationEnabled( const bool bEnabled ); + wxInt32 SetProxyHTTPServerName( const wxString& strServerName ); + wxInt32 SetProxyHTTPServerPort( const wxInt32 iPortNumber ); + wxInt32 SetProxyHTTPUserName( const wxString& strUserName ); + wxInt32 SetProxyHTTPPassword( const wxString& strPassword ); + wxInt32 SetProxySOCKSProxyEnabled( const bool bEnabled ); + wxInt32 SetProxySOCKSVersion( const wxInt32 iVersion ); + wxInt32 SetProxySOCKSServerName( const wxString& strServerName ); + wxInt32 SetProxySOCKSServerPort( const wxInt32 iPortNumber ); + wxInt32 SetProxySOCKSUserName( const wxString& strUserName ); + wxInt32 SetProxySOCKSPassword( const wxString& strPassword ); }; diff --git a/clientgui/TaskBarIcon.cpp b/clientgui/TaskBarIcon.cpp index 81eda55227..500d828e72 100644 --- a/clientgui/TaskBarIcon.cpp +++ b/clientgui/TaskBarIcon.cpp @@ -184,7 +184,6 @@ void CTaskBarIcon::OnMouseMove( wxTaskBarIconEvent& event ) wxString strMessage = wxEmptyString; wxString strBuffer = wxEmptyString; wxString strProjectName = wxEmptyString; - wxString strResultName = wxEmptyString; float fProgress = 0; bool bIsActive = false; bool bIsExecuting = false; @@ -206,10 +205,9 @@ void CTaskBarIcon::OnMouseMove( wxTaskBarIconEvent& event ) if ( !( bIsActive ) || !( bIsDownloaded ) || !( bIsExecuting ) ) continue; pDoc->GetWorkProjectName( iIndex, strProjectName ); - pDoc->GetWorkName( iIndex, strResultName ); pDoc->GetWorkFractionDone( iIndex, fProgress ); - strBuffer.Printf(wxT( "%s: %s: %.2f%%\n"), strProjectName.c_str(), strResultName.c_str(), fProgress * 100 ); + strBuffer.Printf(wxT( "%s: %.2f%%\n"), strProjectName.c_str(), fProgress * 100 ); strMessage += strBuffer; } @@ -224,6 +222,7 @@ void CTaskBarIcon::OnRButtonDown( wxTaskBarIconEvent& event ) CMainDocument* pDoc = wxGetApp().GetDocument(); wxMenu* menu = new wxMenu; + wxMenuItem* menuItem = NULL; wxInt32 iActivityMode = -1; wxInt32 iNetworkMode = -1; @@ -231,7 +230,21 @@ void CTaskBarIcon::OnRButtonDown( wxTaskBarIconEvent& event ) wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(NULL != menu); - menu->Append( wxID_OPEN, _("&Open"), wxEmptyString ); +#ifdef __WXMSW__ + + wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); + font.SetWeight( wxBOLD ); + + menuItem = new wxMenuItem( menu, wxID_OPEN, _("&Open BOINC Manager..."), wxEmptyString ); + menuItem->SetFont( font ); + + menu->Append( menuItem ); + +#else + + menu->Append( wxID_OPEN, _("&Open BOINC Manager..."), wxEmptyString ); + +#endif menu->AppendSeparator(); menu->AppendRadioItem( ID_TB_ACTIVITYRUNALWAYS, _("&Run always"), wxEmptyString ); menu->AppendRadioItem( ID_TB_ACTIVITYRUNBASEDONPREPERENCES, _("Run based on &preferences"), wxEmptyString ); diff --git a/clientgui/stdwx.h b/clientgui/stdwx.h index 6d92c132d7..5061aa18a8 100644 --- a/clientgui/stdwx.h +++ b/clientgui/stdwx.h @@ -80,6 +80,7 @@ #include #include #include +#include #include // Standard Libraries