MGR: Fix a Mac-only bug which showed Event Log if About BOINC is selected from task bar menu when BOINC is hidden

svn path=/trunk/boinc/; revision=25281
This commit is contained in:
Charlie Fenton 2012-02-17 13:59:57 +00:00
parent be8e6ca82c
commit d8bff2cb64
3 changed files with 30 additions and 9 deletions

View File

@ -1814,3 +1814,11 @@ Charlie 17 Feb 2012
client/
coproc_detect.cpp
Charlie 18 Feb 2012
- MGR: Fix a Mac-only bug which showed Event Log if About BOINC is selected
from task bar menu when BOINC is hidden.
clientgui/
BOINCGUIApp.cpp
BOINCTaskBar.cpp

View File

@ -789,18 +789,19 @@ int CBOINCGUIApp::IdleTrackerDetach() {
void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) {
#ifdef __WXMAC__
// Make sure any modal dialog (such as Attach Wizard) ends up in front.
if (IsModalDialogDisplayed()) {
event.Skip();
return;
}
#endif
if (event.GetActive()) {
if (m_pEventLog && !m_pEventLog->IsIconized()) {
m_pEventLog->Raise();
}
m_pFrame->Raise();
#ifdef __WXMAC__
// Make sure any modal dialog (such as Attach Wizard) ends up in front.
if (IsModalDialogDisplayed()) {
wxDynamicCast(wxWindow::FindWindowById(ID_ANYDIALOG), wxDialog)->Raise();
}
#endif
}
event.Skip();
}

View File

@ -248,9 +248,17 @@ void CTaskBarIcon::OnSuspendResumeGPU(wxCommandEvent& WXUNUSED(event)) {
}
void CTaskBarIcon::OnAbout(wxCommandEvent& WXUNUSED(event)) {
bool bWasVisible;
bool bWasVisible = wxGetApp().IsApplicationVisible();
#ifdef __WXMAC__
bool bEventLogWasShown = false;
bWasVisible = wxGetApp().IsApplicationVisible();
CDlgEventLog* eventLog = wxGetApp().GetEventLog();
if (eventLog) {
bEventLogWasShown = eventLog->IsShown();
if (bEventLogWasShown && !bWasVisible) eventLog->Show(false);
}
#endif
wxGetApp().ShowApplication(true);
ResetTaskBar();
@ -261,6 +269,10 @@ void CTaskBarIcon::OnAbout(wxCommandEvent& WXUNUSED(event)) {
if (!bWasVisible) {
wxGetApp().ShowApplication(false);
}
#ifdef __WXMAC__
if (bEventLogWasShown) eventLog->Show(true);
#endif
}