MGR: On Mac only, Close Window menu item (or its shortcut Command-w) closes the Event Log if it is the front window

svn path=/trunk/boinc/; revision=22292
This commit is contained in:
Charlie Fenton 2010-08-26 10:09:11 +00:00
parent 12360ca0a5
commit 2381583668
2 changed files with 24 additions and 0 deletions

View File

@ -6216,3 +6216,10 @@ Charlie 23 Aug 2010
BOINCClientManager.cpp
BOINCGUIApp.cpp
MainDocument.cpp
Charlie 26 Aug 2010
- MGR: On Mac only, Close Window menu item (or its shortcut Command-w)
closes the Event Log if it is the front window.
clientgui/
BOINCBaseFrame.cpp

View File

@ -320,6 +320,23 @@ void CBOINCBaseFrame::OnClose(wxCloseEvent& event) {
void CBOINCBaseFrame::OnCloseWindow(wxCommandEvent& WXUNUSED(event)) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::OnCloseWindow - Function Begin"));
#ifdef __WXMAC__
CFStringRef frontWindowTitle, eventLogTitle;
CDlgEventLog* eventLog = wxGetApp().GetEventLog();
if (eventLog) {
WindowRef win = FrontNonFloatingWindow();
if (win) {
CopyWindowTitleAsCFString(win, &frontWindowTitle);
eventLogTitle = CFStringCreateWithCString(NULL, eventLog->GetTitle().char_str(), kCFStringEncodingUTF8);
if (CFStringCompare(eventLogTitle, frontWindowTitle, 0) == kCFCompareEqualTo) {
wxCloseEvent eventClose;
eventLog->OnClose(eventClose);
return;
}
}
}
#endif
Close();
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::OnCloseWindow - Function End"));