diff --git a/checkin_notes b/checkin_notes index b131cff6f1..d36f3272d3 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5277,6 +5277,11 @@ Charlie 30 June 2008 bugs: stale messages if client on remote host was stopped and restarted while local manager was connected to it but minimized, and stale messages when local client exited and was automatically restarted by Manager. + - MGR: On Mac, don't display alerts when minimized, as they hang Manager. On + Windows and Mac, if minimized when trying to display the Connection Failed + dialog, set a flag to display it when the user maximizes the application, + so the user can respond. In addition, Windows still immediately displays + a Connection Failed balloon if minimized. clientgui/ - MainDocument.cpp + BOINCBaseFrame.cpp,h diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp index 56d19057e4..4426bfd7eb 100644 --- a/clientgui/BOINCBaseFrame.cpp +++ b/clientgui/BOINCBaseFrame.cpp @@ -80,6 +80,7 @@ CBOINCBaseFrame::CBOINCBaseFrame(wxWindow* parent, const wxWindowID id, const wx m_aSelectedComputerMRU.Clear(); + m_bShowConnectionFailedAlert = false; m_pDialupManager = new CBOINCDialUpManager(); wxASSERT(m_pDialupManager->IsOk()); @@ -171,6 +172,11 @@ void CBOINCBaseFrame::OnAlertPoll(wxTimerEvent& WXUNUSED(event)) { } } + if (m_bShowConnectionFailedAlert && IsShown()) { + m_bShowConnectionFailedAlert = false; + ShowConnectionFailedAlert(); + } + bAlreadyRunningLoop = false; } } @@ -232,16 +238,16 @@ void CBOINCBaseFrame::OnAlert(CFrameAlertEvent& event) { ); } #elif defined (__WXMAC__) - // Notification only events on platforms other than Windows and Mac are - // currently discarded. On Linux the application is restored and - // input focus is set on the notification which interrupts whatever - // the user was up to. - if (!event.m_notification_only) { - int retval = 0; + // wxMessageBox() / ProcessResponse() hangs the Manager if hidden. + // Currently, the only non-notification-only alert is Connection Failed, + // which is now has logic to be displayed when Manager is maximized. -// if (!IsShown()) { -// Show(); -// } + // Notification only events on platforms other than Windows are + // currently discarded. Otherwise the application would be restored + // and input focus set on the notification which interrupts whatever + // the user was doing. + if (IsShown() && !event.m_notification_only) { + int retval = 0; retval = ::wxMessageBox(event.m_message, event.m_title, event.m_style, this); if (event.m_alert_event_type == AlertProcessResponse) { @@ -439,6 +445,11 @@ void CBOINCBaseFrame::ShowConnectionFailedAlert() { AlertProcessResponse ); + // If we are minimized, set flag to show alert when maximized + if (!IsShown()) { + m_bShowConnectionFailedAlert = true; + } + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowConnectionFailedAlert - Function End")); } diff --git a/clientgui/BOINCBaseFrame.h b/clientgui/BOINCBaseFrame.h index 9fc8e6640f..b6fb5708ca 100644 --- a/clientgui/BOINCBaseFrame.h +++ b/clientgui/BOINCBaseFrame.h @@ -108,6 +108,8 @@ protected: wxArrayString m_aSelectedComputerMRU; + bool m_bShowConnectionFailedAlert; + virtual bool SaveState(); virtual bool RestoreState();