- MGR: Complete above changes for the Mac

clientgui/
        BOINCGUIApp.cpp, .h
        MainDocument.cpp

svn path=/trunk/boinc/; revision=22506
This commit is contained in:
Rom Walton 2010-10-14 19:37:13 +00:00
parent ccac28c863
commit 5f7f2a8bcd
3 changed files with 19 additions and 17 deletions

View File

@ -7334,3 +7334,10 @@ David 14 Oct 2010
client/
cs_apps.cpp
cs_scheduler.cpp
Rom 14 Oct 2010
- MGR: Complete above changes for the Mac
clientgui/
BOINCGUIApp.cpp, .h
MainDocument.cpp

View File

@ -671,6 +671,16 @@ bool CBOINCGUIApp::DetectDuplicateInstance() {
::SetForegroundWindow(hWnd);
return true;
}
#endif
#ifdef __WXMAC__
ProcessSerialNumber PSN;
int iInstanceID = wxGetApp().IsAnotherInstanceRunning();
if (iInstanceID) {
// Bring other instance to the front and exit this instance
OSStatus err = GetProcessForPID(iInstanceID, &PSN);
if (!err) SetFrontProcess(&PSN);
return true;
}
#endif
return false;
}

View File

@ -575,24 +575,9 @@ int CMainDocument::OnPoll() {
if (IsComputerNameLocal(hostName)) {
otherInstanceID = wxGetApp().IsAnotherInstanceRunning();
if (otherInstanceID) {
if (wxGetApp().IsMultipleInstancesOK()) {
if (!pFrame->SelectComputer(hostName, portNum, password, true)) {
wxCommandEvent event;
s_bSkipExitConfirmation = true;
pFrame->OnExit(event); // Exit if Select Computer dialog cancelled
}
} else { // (IsMultipleInstancesOK() == false)
// Bring other instance to the front and exit this instance
#ifdef __WXMAC__
ProcessSerialNumber otherInstancePSN;
OSStatus err;
err = GetProcessForPID(otherInstanceID, &otherInstancePSN);
if (!err) SetFrontProcess(&otherInstancePSN);
#endif
wxCommandEvent event;
if (!pFrame->SelectComputer(hostName, portNum, password, true)) {
s_bSkipExitConfirmation = true;
wxCommandEvent event;
pFrame->OnExit(event); // Exit if Select Computer dialog cancelled
}
}