MGR: after initial install with acct_mgr_url.xml file, if we automatically showed the Attach Wizard, hide the Manager only if branded for GridRepublic, Charity Engine or Progress Thru Processors.

This commit is contained in:
Charlie Fenton 2014-02-27 01:25:49 -08:00
parent 593181e196
commit 21bf0cb7dd
2 changed files with 46 additions and 13 deletions

View File

@ -1709,17 +1709,32 @@ void CAdvancedFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
pWizard = new CWizardAttach(this);
if (pWizard->SyncToAccountManager()) {
// _GRIDREPUBLIC, _PROGRESSTHRUPROCESSORS and _CHARITYENGINE
// are defined for those branded builds on Windows only
#if defined(_GRIDREPUBLIC) || defined(_PROGRESSTHRUPROCESSORS) || defined(_CHARITYENGINE) || defined(__WXMAC__)
#ifdef __WXMAC__
// For GridRepublic, Charity Engine or ProgressThruProcessors,
// the Mac installer put a branding file in our data directory
long iBrandID = 0; // 0 is unbranded (default) BOINC
#if defined(__WXMSW__) || defined(__WXMAC__)
// If successful, hide the main window if we showed it
if (!wasVisible) {
wxGetApp().ShowApplication(false);
}
#ifndef __WXMAC__ // See explanation in ShowApplication()
if (!wasShown) {
Hide();
FILE *f = boinc_fopen("/Library/Application Support/BOINC Data/Branding", "r");
if (f) {
fscanf(f, "BrandId=%ld\n", &iBrandID);
fclose(f);
}
if ((iBrandID > 0) && (iBrandID < 4))
#endif
{
// If successful, hide the main window if we showed it
if (!wasVisible) {
wxGetApp().ShowApplication(false);
}
#ifndef __WXMAC__ // See explanation in ShowApplication()
if (!wasShown) {
Hide();
}
#endif
}
#endif
// %s is the application name

View File

@ -665,13 +665,31 @@ void CSimpleFrame::OnConnect(CFrameEvent& WXUNUSED(event)) {
pWizard = new CWizardAttach(this);
if (pWizard->SyncToAccountManager()) {
// If successful, hide the main window if we showed it
if (!wasVisible) {
wxGetApp().ShowApplication(false);
// _GRIDREPUBLIC, _PROGRESSTHRUPROCESSORS and _CHARITYENGINE
// are defined for those branded builds on Windows only
#if defined(_GRIDREPUBLIC) || defined(_PROGRESSTHRUPROCESSORS) || defined(_CHARITYENGINE) || defined(__WXMAC__)
#ifdef __WXMAC__
// For GridRepublic, Charity Engine or ProgressThruProcessors,
// the Mac installer put a branding file in our data directory
long iBrandID = 0; // 0 is unbranded (default) BOINC
FILE *f = boinc_fopen("/Library/Application Support/BOINC Data/Branding", "r");
if (f) {
fscanf(f, "BrandId=%ld\n", &iBrandID);
fclose(f);
}
if ((iBrandID > 0) && (iBrandID < 4))
#endif
{
// If successful, hide the main window if we showed it
if (!wasVisible) {
wxGetApp().ShowApplication(false);
}
#ifndef __WXMAC__ // See explanation in ShowApplication()
if (!wasShown) {
Hide();
if (!wasShown) {
Hide();
}
#endif
}
#endif
}