Manager: code formatting; no functional change

This commit is contained in:
David Anderson 2017-07-03 14:44:51 -07:00
parent ff7633a65d
commit 6c0a92d1b1
1 changed files with 40 additions and 17 deletions

View File

@ -1768,7 +1768,8 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
pDoc->GetCoreClientStatus(status, true); pDoc->GetCoreClientStatus(status, true);
// Do we need to bug out to the simple view? // Do we need to switch to the simple view?
//
if (status.simple_gui_only) { if (status.simple_gui_only) {
wxGetApp().SetActiveGUI(BOINC_SIMPLEGUI, true); wxGetApp().SetActiveGUI(BOINC_SIMPLEGUI, true);
StartTimers(); StartTimers();
@ -1776,13 +1777,13 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
return; return;
} }
// Stop all timers so that the wizard is the only thing doing anything // Stop all timers so that the wizard is the only thing doing anything
//
StopTimers(); StopTimers();
// If we are connected to the localhost, run a quick screensaver
// If we are connected to the localhost, run a really quick screensaver
// test to trigger a firewall popup. // test to trigger a firewall popup.
//
pDoc->GetConnectedComputerName(strComputer); pDoc->GetConnectedComputerName(strComputer);
if (pDoc->IsComputerNameLocal(strComputer)) { if (pDoc->IsComputerNameLocal(strComputer)) {
wxGetApp().StartBOINCScreensaverTest(); wxGetApp().StartBOINCScreensaverTest();
@ -1790,6 +1791,7 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
} }
// Clear selected rows in all tab pages when connecting to a different host // Clear selected rows in all tab pages when connecting to a different host
//
iItemCount = (int)m_pNotebook->GetPageCount() - 1; iItemCount = (int)m_pNotebook->GetPageCount() - 1;
for (iIndex = 0; iIndex <= iItemCount; iIndex++) { for (iIndex = 0; iIndex <= iItemCount; iIndex++) {
pwndNotebookPage = m_pNotebook->GetPage(iIndex); pwndNotebookPage = m_pNotebook->GetPage(iIndex);
@ -1807,13 +1809,18 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
pDoc->rpc.get_project_init_status(pis); pDoc->rpc.get_project_init_status(pis);
pDoc->rpc.acct_mgr_info(ami); pDoc->rpc.acct_mgr_info(ami);
if (ami.acct_mgr_url.size() && ami.have_credentials) { // Is the client using an account manager?
// Fall through
// //
// There isn't a need to bring up the attach wizard, the client will if (ami.acct_mgr_url.size() && ami.have_credentials) {
// take care of attaching to projects when it completes the needed RPCs // Yes, and client has AM account credentials.
//
// We don't need to bring up the attach wizard;
// the client will attach to projects after doing AM RPC
// //
} else if (ami.acct_mgr_url.size() && !ami.have_credentials) { } else if (ami.acct_mgr_url.size() && !ami.have_credentials) {
// Yes, but we don't have have credentials.
// Bring up the Wizard to get them.
//
wasShown = IsShown(); wasShown = IsShown();
Show(); Show();
wasVisible = wxGetApp().IsApplicationVisible(); wasVisible = wxGetApp().IsApplicationVisible();
@ -1823,13 +1830,14 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
pWizard = new CWizardAttach(this); pWizard = new CWizardAttach(this);
if (pWizard->SyncToAccountManager()) { if (pWizard->SyncToAccountManager()) {
// _GRIDREPUBLIC, _PROGRESSTHRUPROCESSORS and _CHARITYENGINE // _GRIDREPUBLIC, _PROGRESSTHRUPROCESSORS and _CHARITYENGINE
// are defined for those branded builds on Windows only // are defined for those branded builds on Windows only
//
#if defined(_GRIDREPUBLIC) || defined(_PROGRESSTHRUPROCESSORS) || defined(_CHARITYENGINE) || defined(__WXMAC__) #if defined(_GRIDREPUBLIC) || defined(_PROGRESSTHRUPROCESSORS) || defined(_CHARITYENGINE) || defined(__WXMAC__)
#ifdef __WXMAC__ #ifdef __WXMAC__
// For GridRepublic, Charity Engine or ProgressThruProcessors, // For GridRepublic, Charity Engine or ProgressThruProcessors,
// the Mac installer put a branding file in our data directory // the Mac installer put a branding file in our data directory
//
long iBrandID = 0; // 0 is unbranded (default) BOINC long iBrandID = 0; // 0 is unbranded (default) BOINC
FILE *f = boinc_fopen("/Library/Application Support/BOINC Data/Branding", "r"); FILE *f = boinc_fopen("/Library/Application Support/BOINC Data/Branding", "r");
@ -1854,6 +1862,7 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
// %s is the application name // %s is the application name
// i.e. 'BOINC Manager', 'GridRepublic Manager' // i.e. 'BOINC Manager', 'GridRepublic Manager'
//
strDialogTitle.Printf( strDialogTitle.Printf(
_("%s"), _("%s"),
pSkinAdvanced->GetApplicationName().c_str() pSkinAdvanced->GetApplicationName().c_str()
@ -1863,6 +1872,7 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
// i.e. 'BOINC Manager', 'GridRepublic Manager' // i.e. 'BOINC Manager', 'GridRepublic Manager'
// %s is the project name // %s is the project name
// i.e. 'BOINC', 'GridRepublic' // i.e. 'BOINC', 'GridRepublic'
//
strDialogDescription.Printf( strDialogDescription.Printf(
_("%s has successfully added %s"), _("%s has successfully added %s"),
pSkinAdvanced->GetApplicationName().c_str(), pSkinAdvanced->GetApplicationName().c_str(),
@ -1877,9 +1887,14 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
); );
} else { } else {
// If failure, display the notification tab // If failure, display the notification tab
//
m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE); m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE);
} }
} else if ((0 >= pDoc->GetProjectCount()) && !status.disallow_attach) { } else if ((0 >= pDoc->GetProjectCount()) && !status.disallow_attach) {
// client isn't attached to any projects.
// Look for an account to attach to, either in project_init.xml
// or in browser cookies
//
if (pis.url.size() > 0) { if (pis.url.size() > 0) {
strProjectName = pis.name.c_str(); strProjectName = pis.name.c_str();
@ -1888,8 +1903,9 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
bAccountKeyDetected = pis.has_account_key; bAccountKeyDetected = pis.has_account_key;
bEmbedded = pis.embedded; bEmbedded = pis.embedded;
// If credentials are not cached, then we should try one last place to look up the // If credentials are not cached,
// authenticator. Some projects will set a "Setup" cookie off of their URL with a // then we should try one last place to look up the authenticator.
// Some projects will set a "Setup" cookie off of their URL with a
// pretty short timeout. Lets take a crack at detecting it. // pretty short timeout. Lets take a crack at detecting it.
// //
if (pis.url.length() && !pis.has_account_key) { if (pis.url.length() && !pis.has_account_key) {
@ -1898,7 +1914,8 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
} else { } else {
detect_simple_account_credentials( detect_simple_account_credentials(
strProjectName, strProjectURL, strProjectAuthenticator, strProjectInstitution, strProjectDescription, strProjectKnown strProjectName, strProjectURL, strProjectAuthenticator,
strProjectInstitution, strProjectDescription, strProjectKnown
); );
} }
@ -1918,29 +1935,35 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
bEmbedded) bEmbedded)
){ ){
// If successful, display the work tab // If successful, display the work tab
//
m_pNotebook->SetSelection(ID_ADVTASKSVIEW - ID_ADVVIEWBASE); m_pNotebook->SetSelection(ID_ADVTASKSVIEW - ID_ADVVIEWBASE);
} else { } else {
// If failure, display the notices tab // If failure, display the notices tab
//
m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE); m_pNotebook->SetSelection(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE);
} }
} }
// Update the menus // Update the menus
//
DeleteMenu(); DeleteMenu();
CreateMenu(); CreateMenu();
// Restart timers to continue normal operations. // Restart timers to continue normal operations.
//
StartTimers(); StartTimers();
// Set the correct refresh interval, then manually fire the refresh // Set the correct refresh interval, then manually fire the refresh
// event to do the initial population of the view. // event to do the initial population of the view.
//
UpdateRefreshTimerInterval(m_pNotebook->GetSelection()); UpdateRefreshTimerInterval(m_pNotebook->GetSelection());
FireRefreshView(); FireRefreshView();
if (pWizard) if (pWizard) {
pWizard->Destroy(); pWizard->Destroy();
}
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnConnect - Function End")); wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::OnConnect - Function End"));
} }