From 5a20c54533df0eb8bcaf2c2304c8d168d6d88d88 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 2 Aug 2010 17:29:19 +0000 Subject: [PATCH] - MGR: Remove connection needed type sys tray notifications from the manager, lets the CC inform via a notice instead. clientgui/ BOINCDialupManager.cpp, .h svn path=/trunk/boinc/; revision=22094 --- checkin_notes | 7 +++ clientgui/BOINCDialupManager.cpp | 87 +------------------------------- clientgui/BOINCDialupManager.h | 3 -- 3 files changed, 8 insertions(+), 89 deletions(-) diff --git a/checkin_notes b/checkin_notes index 198f3063fa..e863e564a2 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5697,3 +5697,10 @@ Rom 2 Aug 2010 clientgui/ + +Rom 2 Aug 2010 + - MGR: Remove connection needed type sys tray notifications from the manager, + lets the CC inform via a notice instead. + + clientgui/ + BOINCDialupManager.cpp, .h diff --git a/clientgui/BOINCDialupManager.cpp b/clientgui/BOINCDialupManager.cpp index 528199b33a..47336f254f 100644 --- a/clientgui/BOINCDialupManager.cpp +++ b/clientgui/BOINCDialupManager.cpp @@ -149,33 +149,10 @@ void CBOINCDialUpManager::OnPoll() { ); */ -#ifndef __WXMSW__ // notification logic for non MS-Windows systems - if (!bIsOnline && bWantConnection) { - // Make sure window is visable and active, don't want the message box - // to pop up on top of anything else - wxLogTrace(wxT("Function Status"), wxT("CBOINCDialUpManager::poll - Notify need Internet Connection")); - if (pFrame->IsShown() && wxGetApp().IsActive()) { - NotifyUserNeedConnection(false); - } -/* -// this section commented out until taskbar/systray notification alerts are implemented - else { - // window is not visible, show alert - if (pTaskbar && pTaskbar->IsBalloonsSupported()) { - NotifyUserNeedConnection(true); - } - } -*/ - } -#else // dialer stuff for MS-Windows systems bool bIsDialing = m_pDialupManager->IsDialing(); if (!bIsOnline && !bIsDialing && !m_bWasDialing && bWantConnection) { wxLogTrace(wxT("Function Status"), wxT("CBOINCDialUpManager::poll - !bIsOnline && !bIsDialing && !m_bWasDialing && bWantConnection")); - if (!pFrame->IsShown()) { - // BOINC Manager is hidden and displaying a dialog might interupt what they - // are doing. - NotifyUserNeedConnection(true); - } else { + if (pFrame->IsShown()) { // BOINC Manager is visable and can process user input. m_bSetConnectionTimer = true; Connect(); @@ -224,58 +201,11 @@ void CBOINCDialUpManager::OnPoll() { wxLogTrace(wxT("Function Status"), wxT("CBOINCDialUpManager::poll - bIsDialing && !m_bWasDialing")); m_bWasDialing = true; } -#endif bAlreadyRunningLoop = false; } } -int CBOINCDialUpManager::NotifyUserNeedConnection(bool bNotificationOnly) { - CBOINCBaseFrame* pFrame = wxGetApp().GetFrame(); - CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); - wxTimeSpan tsLastDialupAlertSent; - wxString strDialogMessage = wxEmptyString; - - wxASSERT(pFrame); - wxASSERT(pSkinAdvanced); - wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame)); - wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); - - tsLastDialupAlertSent = wxDateTime::Now() - m_dtLastDialupAlertSent; - if ((tsLastDialupAlertSent.GetMinutes() >= pFrame->GetReminderFrequency()) && (pFrame->GetReminderFrequency() != 0)) { - wxLogTrace(wxT("Function Status"), wxT("CBOINCDialUpManager::NotifyUserNeedConnection - Manager not shown, notify instead")); - m_dtLastDialupAlertSent = wxDateTime::Now(); - -#ifdef __WXWIN__ - // 1st %s is the project name - // i.e. 'BOINC', 'GridRepublic' - // 2st %s is the application name - // i.e. 'BOINC Manager', 'GridRepublic Manager' - strDialogMessage.Printf( - _("%s needs to connect to the Internet. Please click to open %s."), - pSkinAdvanced->GetApplicationShortName().c_str(), - pSkinAdvanced->GetApplicationName().c_str() - ); -#else - // %s is the project name - // i.e. 'BOINC', 'GridRepublic' - strDialogMessage.Printf( - _("%s is unable to communicate with a project and needs an Internet connection.\nPlease connect to the Internet, then select the 'Do network communications' item from the Advanced menu."), - pSkinAdvanced->GetApplicationShortName().c_str() - ); -#endif - pFrame->ShowAlert( - m_strDialogTitle, - strDialogMessage, - wxOK | wxICON_INFORMATION, - bNotificationOnly - ); - } - - return 0; -} - - int CBOINCDialUpManager::Connect() { CMainDocument* pDoc = wxGetApp().GetDocument(); CBOINCBaseFrame* pFrame = wxGetApp().GetFrame(); @@ -347,20 +277,6 @@ int CBOINCDialUpManager::Connect() { // The user hasn't given us a valid connection to dial. Inform them // that we need a connection and that they may need to set a default // connection. - - // %s is the project name - // i.e. 'BOINC', 'GridRepublic' - strDialogMessage.Printf( - _("%s couldn't do Internet communication, and no default connection is selected.\nPlease connect to the Internet, or select a default connection\nusing Advanced/Options/Connections."), - pSkinAdvanced->GetApplicationShortName().c_str() - ); - - pFrame->ShowAlert( - m_strDialogTitle, - strDialogMessage, - wxOK | wxICON_INFORMATION, - false - ); } } @@ -529,7 +445,6 @@ int CBOINCDialUpManager::Disconnect() { void CBOINCDialUpManager::ResetReminderTimers() { - m_dtLastDialupAlertSent = wxDateTime((time_t)0); m_dtLastDialupRequest = wxDateTime((time_t)0); m_dtDialupConnectionTimeout = wxDateTime((time_t)0); } diff --git a/clientgui/BOINCDialupManager.h b/clientgui/BOINCDialupManager.h index 906a3e130f..ec46f63a40 100644 --- a/clientgui/BOINCDialupManager.h +++ b/clientgui/BOINCDialupManager.h @@ -35,8 +35,6 @@ public: void OnPoll(); - int NotifyUserNeedConnection(bool bNotificationOnly); - int Connect(); int ConnectionSucceeded(); int ConnectionFailed(); @@ -49,7 +47,6 @@ public: protected: wxDialUpManager* m_pDialupManager; - wxDateTime m_dtLastDialupAlertSent; wxDateTime m_dtLastDialupRequest; wxDateTime m_dtDialupConnectionTimeout; bool m_bSetConnectionTimer;