Skip to content

Commit

Permalink
Merge pull request BOINC#2576 from armstrdj/mac_branded_installer_bui…
Browse files Browse the repository at this point in the history
…ld_script

Generic Mac build script for branded version of Mac manager/screen saver
  • Loading branch information
JuhaSointusalo authored Jul 10, 2018
2 parents 2b16e07 + 9d036e7 commit 5dac399
Show file tree
Hide file tree
Showing 11 changed files with 528 additions and 15 deletions.
32 changes: 25 additions & 7 deletions clientgui/BOINCTaskBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,24 @@ CTaskBarIcon::CTaskBarIcon(wxString title, wxIconBundle* icon, wxIconBundle* ico
wxTaskBarIconEx(wxT("BOINCManagerSystray"), 1)
#endif
{
m_iconTaskBarNormal = icon->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarDisconnected = iconDisconnected->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarSnooze = iconSnooze->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
#ifdef __WXMAC__
m_iconType = iconType;
m_pNotificationRequest = NULL;
if (iconType == wxTBI_DOCK) {
// This code expects the wxTBI_CUSTOM_STATUSITEM CTaskBarIcon
// to be constructed before the wxTBI_DOCK CTaskBarIcon.
//
// Ensure that m_pTaskBarIcon and m_pMacDockIcon use same copy of each icon.
m_iconTaskBarNormal = wxGetApp().GetTaskBarIcon()->m_iconTaskBarNormal;
m_iconTaskBarDisconnected = wxGetApp().GetTaskBarIcon()->m_iconTaskBarDisconnected;
m_iconTaskBarSnooze = wxGetApp().GetTaskBarIcon()->m_iconTaskBarSnooze;
} else
#endif
{
m_iconTaskBarNormal = icon->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarDisconnected = iconDisconnected->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarSnooze = iconSnooze->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
}
m_SnoozeGPUMenuItem = NULL;

m_bTaskbarInitiatedShutdown = false;
Expand All @@ -98,10 +113,6 @@ CTaskBarIcon::CTaskBarIcon(wxString title, wxIconBundle* icon, wxIconBundle* ico

m_dtLastNotificationAlertExecuted = wxDateTime((time_t)0);
m_iLastNotificationUnreadMessageCount = 0;
#ifdef __WXMAC__
m_iconType = iconType;
m_pNotificationRequest = NULL;
#endif
}


Expand Down Expand Up @@ -348,6 +359,13 @@ void CTaskBarIcon::OnReloadSkin(CTaskbarEvent& WXUNUSED(event)) {
m_iconTaskBarNormal = pSkinAdvanced->GetApplicationIcon()->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarDisconnected = pSkinAdvanced->GetApplicationDisconnectedIcon()->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);
m_iconTaskBarSnooze = pSkinAdvanced->GetApplicationSnoozeIcon()->GetIcon(GetBestIconSize(), wxIconBundle::FALLBACK_NEAREST_LARGER);

#ifdef __WXMAC__
// Ensure that m_pTaskBarIcon and m_pMacDockIcon use same copy of each icon.
wxGetApp().GetMacDockIcon()->m_iconTaskBarNormal = m_iconTaskBarNormal;
wxGetApp().GetMacDockIcon()->m_iconTaskBarDisconnected = m_iconTaskBarDisconnected;
wxGetApp().GetMacDockIcon()->m_iconTaskBarSnooze = m_iconTaskBarSnooze;
#endif
}


Expand Down
18 changes: 12 additions & 6 deletions clientgui/DlgAbout.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2017 University of California
// Copyright (C) 2018 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -121,15 +121,11 @@ bool CDlgAbout::Create(wxWindow* parent, wxWindowID id, const wxString& caption,
);
m_AboutBOINCTitleCtrl->SetLabel(buf);

#if 0
m_AboutBOINCLogoCtrl->SetBitmap(wxBitmap(*(pSkinAdvanced->GetApplicationLogo())));

m_AboutBOINCSloganCtrl->SetLabel(wxEmptyString);

m_AboutBOINCURLCtrl->SetLabel(
pSkinAdvanced->GetOrganizationWebsite().c_str()
);
#endif

GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Expand All @@ -144,6 +140,10 @@ bool CDlgAbout::Create(wxWindow* parent, wxWindowID id, const wxString& caption,

void CDlgAbout::CreateControls() {
////@begin CDlgAbout content construction
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
wxASSERT(pSkinAdvanced);
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));

CDlgAbout* itemDialog1 = this;

wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
Expand Down Expand Up @@ -192,8 +192,14 @@ void CDlgAbout::CreateControls() {
itemStaticText13->Create( itemDialog1, wxID_STATIC, _("(C) 2003-2018 University of California, Berkeley.\nAll Rights Reserved."), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer7->Add(itemStaticText13, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

wxString buf = wxEmptyString;
buf.Printf(
_("%s is distributed under the GNU Lesser General Public License v3.0."),
pSkinAdvanced->GetApplicationShortName().c_str()
);

wxStaticText* itemStaticText14 = new wxStaticText;
itemStaticText14->Create( itemDialog1, wxID_STATIC, _("BOINC is distributed under the GNU Lesser General Public License v3.0."), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText14->Create( itemDialog1, wxID_STATIC, buf, wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
Expand Down
5 changes: 5 additions & 0 deletions clientgui/SkinManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ CSkinWizardATAM::~CSkinWizardATAM() {


void CSkinWizardATAM::Clear() {
m_strTitle = wxEmptyString;
m_strAccountInfoMessage = wxEmptyString;
}

Expand All @@ -770,6 +771,10 @@ int CSkinWizardATAM::Parse(MIOFILE& in) {
m_strAccountInfoMessage = wxString(strBuffer.c_str(), wxConvUTF8);
continue;
}
else if (parse_str(buf, "<title>", strBuffer)) {
m_strTitle = wxString(strBuffer.c_str(), wxConvUTF8);
continue;
}
}

InitializeDelayedValidation();
Expand Down
3 changes: 3 additions & 0 deletions clientgui/SkinManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,11 @@ class CSkinWizardATAM : public CSkinItem

wxString GetAccountInfoMessage() { return m_strAccountInfoMessage; }

wxString GetWizardTitle() { return m_strTitle; }

private:
wxString m_strAccountInfoMessage;
wxString m_strTitle;
};


Expand Down
17 changes: 16 additions & 1 deletion clientgui/WizardAttach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,26 @@ bool CWizardAttach::SyncToAccountManager() {
ACCT_MGR_INFO ami;
CMainDocument* pDoc = wxGetApp().GetDocument();

wxASSERT(pDoc);
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
CSkinWizardATAM* pSkinWizardATAM = wxGetApp().GetSkinManager()->GetWizards()->GetWizardATAM();

wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
wxASSERT(pSkinAdvanced);
wxASSERT(pSkinWizardATAM);
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
wxASSERT(wxDynamicCast(pSkinWizardATAM, CSkinWizardATAM));


if (!pSkinWizardATAM->GetWizardTitle().IsEmpty()) {
SetTitle(pSkinWizardATAM->GetWizardTitle());
} else {
SetTitle(pSkinAdvanced->GetApplicationName());
}

IsAttachToProjectWizard = false;
IsAccountManagerWizard = true;


pDoc->rpc.acct_mgr_info(ami);

Expand Down
Binary file added clientgui/res/WCGrid.icns
Binary file not shown.
35 changes: 34 additions & 1 deletion clientgui/skins/World Community Grid/skin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,44 @@
<notice_alert_color>0:100:157</notice_alert_color>
</simple>
<advanced>
<application_name>World Community Grid - BOINC Manager</application_name>
<application_name>World Community Grid</application_name>
<application_short_name>World Community Grid</application_short_name>
<organization_name>World Community Grid</organization_name>
<organization_website>https://www.worldcommunitygrid.org</organization_website>
<organization_help_url>https://www.worldcommunitygrid.org/boinc.do</organization_help_url>
<application_logo>wcg_about.ico</application_logo>
<application_icon>
<image>
<imagesrc>wcg_play.png</imagesrc>
</image>
</application_icon>

<application_icon32>
<image>
<imagesrc>wcg_32.png</imagesrc>
</image>
</application_icon32>

<application_disconnected_icon>
<image>
<imagesrc>wcg_stop.png</imagesrc>
</image>
</application_disconnected_icon>

<application_snooze_icon>
<image>
<imagesrc>wcg_pause.png</imagesrc>
</image>
</application_snooze_icon>
<is_branded>1</is_branded>
</advanced>
<wizards>
<attach_to_project>
<title>World Community Grid - Add Project</title>
</attach_to_project>
<attach_to_account_manager>
<title>World Community Grid - Use Account Manager</title>
</attach_to_account_manager>
</wizards>
</en>
</skin>
Binary file not shown.
6 changes: 6 additions & 0 deletions lib/procinfo_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ using std::vector;
#define GRIDREPUBLIC_BRAND_ID 1
#define PROGRESSTHRUPROCESSORS_BRAND_ID 2
#define CHARITYENGINE_BRAND_ID 3
#define WORLDCOMMUNITYGRID_BRAND_ID 4


// build table of all processes in system
Expand Down Expand Up @@ -164,6 +165,11 @@ int procinfo_setup(PROC_MAP& pm) {
p.is_boinc_app = true;
}
break;
case WORLDCOMMUNITYGRID_BRAND_ID:
if (!strcasestr(p.command, "World Community Grid")) {
p.is_boinc_app = true;
}
break;
}
pm.insert(std::pair<int, PROCINFO>(p.id, p));
}
Expand Down
21 changes: 21 additions & 0 deletions mac_installer/WCGridInstaller.environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SHORTBRANDNAME="wcgrid"
LONGBRANDNAME="World Community Grid"

MANAGERAPPNAME="World Community Grid"
MANAGERICON="WCGrid"

SSAVERAPPNAME="World Community Grid"
SSAVERPREVIEW="wcgrid.jpg"
SSAVERTHUMBNAIL="wcgrid-thumbnail"
SSAVERLOGO="wcg_ss_logo.jpg"
SKINDIR="World Community Grid"

UNINSTALLERAPPNAME="Uninstall World Community Grid"
UNINSTALLERICON="WCGrid"
UNINSTALLERTRASHICON="WCGrid"

INSTALLERAPPNAME="World Community Grid Installer"
INSTALLERICON="WCGrid"

READMEFILE="WCGrid-ReadMe.rtf"
BRANDING_INFO="BrandId=4"
Loading

0 comments on commit 5dac399

Please sign in to comment.