MGR: If minimized: don't display alerts on Mac, display Connection Failed dialog when again maximized

svn path=/trunk/boinc/; revision=15520
This commit is contained in:
Charlie Fenton 2008-07-01 03:46:59 +00:00
parent 48394ceda4
commit ce02bedc57
3 changed files with 28 additions and 10 deletions

View File

@ -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

View File

@ -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"));
}

View File

@ -108,6 +108,8 @@ protected:
wxArrayString m_aSelectedComputerMRU;
bool m_bShowConnectionFailedAlert;
virtual bool SaveState();
virtual bool RestoreState();