mirror of https://github.com/BOINC/boinc.git
Mac: Determine size of BOINC Manager bundle in core client if it was launched by Manager rather than in the Manager itself, to get correct information when controlling a remote computer.
svn path=/trunk/boinc/; revision=12651
This commit is contained in:
parent
693d450a17
commit
1bf67eddda
|
@ -4821,8 +4821,14 @@ Charlie 10 May 2007
|
||||||
- Mac only: create CViewResources::GetViewRefreshRate() to update
|
- Mac only: create CViewResources::GetViewRefreshRate() to update
|
||||||
PieCtrl only every 10 seconds to reduce CPU overhead instead of
|
PieCtrl only every 10 seconds to reduce CPU overhead instead of
|
||||||
doing it with a counter in CViewResources::OnListRender().
|
doing it with a counter in CViewResources::OnListRender().
|
||||||
|
- Mac: Determine size of BOINC Manager bundle in core client if it was
|
||||||
|
launched by Manager rather than in the Manager itself, to get
|
||||||
|
correct information when controlling a remote computer.
|
||||||
|
|
||||||
|
client/
|
||||||
|
gui_rpc_server_ops.C
|
||||||
clientgui/
|
clientgui/
|
||||||
|
BOINCGUIApp.cpp, .h
|
||||||
ViewResources.cpp, h
|
ViewResources.cpp, h
|
||||||
common/
|
common/
|
||||||
wxPieCtrl.cpp, h
|
wxPieCtrl.cpp, h
|
||||||
|
|
|
@ -23,6 +23,10 @@
|
||||||
#include "boinc_win.h"
|
#include "boinc_win.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <Carbon/Carbon.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -124,6 +128,21 @@ static void handle_get_disk_usage(MIOFILE& fout) {
|
||||||
dir_size(".", d_boinc, false);
|
dir_size(".", d_boinc, false);
|
||||||
dir_size("locale", size, false);
|
dir_size("locale", size, false);
|
||||||
d_boinc += size;
|
d_boinc += size;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (gstate.launched_by_manager) {
|
||||||
|
// If launched by Manager, get Manager's size on disk
|
||||||
|
ProcessSerialNumber managerPSN;
|
||||||
|
FSRef ourFSRef;
|
||||||
|
char path[1024];
|
||||||
|
double manager_size = 0.0;
|
||||||
|
OSStatus err;
|
||||||
|
err = GetProcessForPID(getppid(), &managerPSN);
|
||||||
|
if (! err) err = GetProcessBundleLocation(&managerPSN, &ourFSRef);
|
||||||
|
if (! err) err = FSRefMakePath (&ourFSRef, (UInt8*)path, sizeof(path));
|
||||||
|
if (! err) dir_size(path, manager_size, true);
|
||||||
|
if (! err) d_boinc += manager_size;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
fout.printf(
|
fout.printf(
|
||||||
"<d_total>%f</d_total>\n"
|
"<d_total>%f</d_total>\n"
|
||||||
"<d_free>%f</d_free>\n"
|
"<d_free>%f</d_free>\n"
|
||||||
|
|
|
@ -552,8 +552,6 @@ void CBOINCGUIApp::StartupBOINCCore() {
|
||||||
}
|
}
|
||||||
if (err == noErr) {
|
if (err == noErr) {
|
||||||
err = FSRefMakePath (&ourFSRef, (UInt8*)buf, sizeof(buf));
|
err = FSRefMakePath (&ourFSRef, (UInt8*)buf, sizeof(buf));
|
||||||
// Get BOINC Manager Bundle Size and save for later use in CViewResources::OnListRender()
|
|
||||||
dir_size(buf, m_ManagerBundleSize, true);
|
|
||||||
}
|
}
|
||||||
if (err == noErr) {
|
if (err == noErr) {
|
||||||
#if 0 // The Mac version of wxExecute(wxString& ...) crashes if there is a space in the path
|
#if 0 // The Mac version of wxExecute(wxString& ...) crashes if there is a space in the path
|
||||||
|
|
|
@ -119,8 +119,6 @@ public:
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
CMacSystemMenu* GetMacSystemMenu() { return m_pMacSystemMenu; }
|
CMacSystemMenu* GetMacSystemMenu() { return m_pMacSystemMenu; }
|
||||||
int GetCurrentGUISelection() { return m_iGUISelected; }
|
int GetCurrentGUISelection() { return m_iGUISelected; }
|
||||||
double m_ManagerBundleSize;
|
|
||||||
double GetManagerBundleSize() { return m_ManagerBundleSize; }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxArrayString& GetSupportedLanguages() { return m_astrLanguages; }
|
wxArrayString& GetSupportedLanguages() { return m_astrLanguages; }
|
||||||
|
|
|
@ -231,9 +231,6 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) {
|
||||||
m_pieCtrlTotal->m_Series.Add(part);
|
m_pieCtrlTotal->m_Series.Add(part);
|
||||||
//used by boinc projects
|
//used by boinc projects
|
||||||
boinctotal += pDoc->disk_usage.d_boinc;
|
boinctotal += pDoc->disk_usage.d_boinc;
|
||||||
#ifdef __WXMAC__
|
|
||||||
boinctotal += wxGetApp().GetManagerBundleSize();
|
|
||||||
#endif
|
|
||||||
FormatDiskSpace(boinctotal,diskspace);
|
FormatDiskSpace(boinctotal,diskspace);
|
||||||
part.SetLabel(_("used by BOINC - ") + diskspace);
|
part.SetLabel(_("used by BOINC - ") + diskspace);
|
||||||
part.SetValue(boinctotal);
|
part.SetValue(boinctotal);
|
||||||
|
|
Loading…
Reference in New Issue