mirror of https://github.com/BOINC/boinc.git
Mac MGR: don't show exit confirmation dialog if shutting down or restarting system
svn path=/trunk/boinc/; revision=19646
This commit is contained in:
parent
a8a393b2ef
commit
1ed1ed95f2
|
@ -9363,3 +9363,10 @@ Charlie 18 Nov 2009
|
||||||
mac_build/
|
mac_build/
|
||||||
boinc.xcodeproj/
|
boinc.xcodeproj/
|
||||||
project.pbxproj
|
project.pbxproj
|
||||||
|
|
||||||
|
Charlie 19 Nov 2009
|
||||||
|
- Mac MGR: fix bug - don't show exit confirmation dialog if shutting
|
||||||
|
down or restarting system.
|
||||||
|
|
||||||
|
clientgui/
|
||||||
|
BOINCGUIApp.cpp
|
||||||
|
|
|
@ -72,8 +72,7 @@ bool s_bSkipExitConfirmation = false;
|
||||||
OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon ) {
|
OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon ) {
|
||||||
DescType senderType;
|
DescType senderType;
|
||||||
Size actualSize;
|
Size actualSize;
|
||||||
ProcessSerialNumber SenderPSN, ourPSN;
|
ProcessSerialNumber SenderPSN;
|
||||||
Boolean isSame;
|
|
||||||
ProcessInfoRec pInfo;
|
ProcessInfoRec pInfo;
|
||||||
FSSpec fileSpec;
|
FSSpec fileSpec;
|
||||||
OSStatus anErr;
|
OSStatus anErr;
|
||||||
|
@ -89,14 +88,6 @@ OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt
|
||||||
&senderType, &SenderPSN, sizeof(SenderPSN), &actualSize);
|
&senderType, &SenderPSN, sizeof(SenderPSN), &actualSize);
|
||||||
|
|
||||||
if (anErr == noErr) {
|
if (anErr == noErr) {
|
||||||
|
|
||||||
GetCurrentProcess(&ourPSN);
|
|
||||||
|
|
||||||
anErr = SameProcess(&SenderPSN, &ourPSN, &isSame);
|
|
||||||
|
|
||||||
if (anErr == noErr) {
|
|
||||||
if (!isSame) {
|
|
||||||
|
|
||||||
pInfo.processInfoLength = sizeof( ProcessInfoRec );
|
pInfo.processInfoLength = sizeof( ProcessInfoRec );
|
||||||
pInfo.processName = NULL;
|
pInfo.processName = NULL;
|
||||||
pInfo.processAppSpec = &fileSpec;
|
pInfo.processAppSpec = &fileSpec;
|
||||||
|
@ -104,13 +95,11 @@ OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt
|
||||||
anErr = GetProcessInformation(&SenderPSN, &pInfo);
|
anErr = GetProcessInformation(&SenderPSN, &pInfo);
|
||||||
|
|
||||||
// Consider a Quit command from our Dock menu as coming from this application
|
// Consider a Quit command from our Dock menu as coming from this application
|
||||||
if (pInfo.processSignature != 'dock') {
|
if ( (pInfo.processSignature != 'dock') && (pInfo.processSignature != 'BNC!') ) {
|
||||||
s_bSkipExitConfirmation = true; // Not from our app, our dock icon or our taskbar icon
|
s_bSkipExitConfirmation = true; // Not from our app, our dock icon or our taskbar icon
|
||||||
wxGetApp().ExitMainLoop(); // Prevents wxMac from issuing events to closed frames
|
wxGetApp().ExitMainLoop(); // Prevents wxMac from issuing events to closed frames
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return wxGetApp().MacHandleAEQuit((AppleEvent*)appleEvt, reply);
|
return wxGetApp().MacHandleAEQuit((AppleEvent*)appleEvt, reply);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue