mirror of https://github.com/BOINC/boinc.git
- MGR: Complete above changes for the Mac
clientgui/ BOINCGUIApp.cpp, .h MainDocument.cpp svn path=/trunk/boinc/; revision=22506
This commit is contained in:
parent
ccac28c863
commit
5f7f2a8bcd
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue