From 1fcb58e34e3502806410523facd5f74afe6ed05a Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 22 Oct 2013 00:36:18 -0700 Subject: [PATCH] MGR: Mac updates for wxWidgets 3.0.0-rc1 (wxCocoa) - API _() or wxGetTranslation() cannot be used for static or global strings; it never worked and it causes a crash under wxWidgets 3.0.0-rc2 --- clientgui/sg_DlgPreferences.cpp | 65 ++++++++++++----------- mac_build/boinc.xcodeproj/project.pbxproj | 20 +++---- mac_build/buildWxMac.sh | 5 +- 3 files changed, 47 insertions(+), 43 deletions(-) diff --git a/clientgui/sg_DlgPreferences.cpp b/clientgui/sg_DlgPreferences.cpp index 52cf111c2b..0338944702 100644 --- a/clientgui/sg_DlgPreferences.cpp +++ b/clientgui/sg_DlgPreferences.cpp @@ -89,20 +89,6 @@ wxString astrTimeOfDayStrings[] = { }; -int iDiskUsageArraySize = 10; -wxString astrDiskUsageStrings[] = { - _("100 MB"), - _("200 MB"), - _("500 MB"), - _("1 GB"), - _("2 GB"), - _("5 GB"), - _("10 GB"), - _("20 GB"), - _("50 GB"), - _("100 GB") -}; - // Used for sorting disk usage values static int CompareDiskUsage(const wxString& strFirst, const wxString& strSecond) { long lFirstValue; @@ -131,16 +117,16 @@ static int CompareDiskUsage(const wxString& strFirst, const wxString& strSecond) int iCPUUsageArraySize = 10; wxString astrCPUUsageStrings[] = { - _("10%"), - _("20%"), - _("30%"), - _("40%"), - _("50%"), - _("60%"), - _("70%"), - _("80%"), - _("90%"), - _("100%") + wxT("10%"), + wxT("20%"), + wxT("30%"), + wxT("40%"), + wxT("50%"), + wxT("60%"), + wxT("70%"), + wxT("80%"), + wxT("90%"), + wxT("100%") }; // Used for sorting cpu usage values @@ -165,13 +151,13 @@ static int CompareCPUUsage(const wxString& strFirst, const wxString& strSecond) int iWorkWhenIdleArraySize = 7; wxString astrWorkWhenIdleStrings[] = { - _("1"), - _("3"), - _("5"), - _("10"), - _("15"), - _("30"), - _("60") + wxT("1"), + wxT("3"), + wxT("5"), + wxT("10"), + wxT("15"), + wxT("30"), + wxT("60") }; // Used for sorting work when idle values @@ -650,6 +636,23 @@ bool CPanelPreferences::ReadPreferenceSettings() { int retval; unsigned int i; + // We localize these because some languages (e.g., French) use + // different abbreviations for MB and GB. + // Note: _() cannot be used for static or global strings. + wxString astrDiskUsageStrings[] = { + _("100 MB"), + _("200 MB"), + _("500 MB"), + _("1 GB"), + _("2 GB"), + _("5 GB"), + _("10 GB"), + _("20 GB"), + _("50 GB"), + _("100 GB") + }; + int iDiskUsageArraySize = 10; + wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); diff --git a/mac_build/boinc.xcodeproj/project.pbxproj b/mac_build/boinc.xcodeproj/project.pbxproj index 80a947b4fc..f237bb4118 100755 --- a/mac_build/boinc.xcodeproj/project.pbxproj +++ b/mac_build/boinc.xcodeproj/project.pbxproj @@ -1134,7 +1134,7 @@ DDE1374710DC613600161D6B /* DlgEventLogListCtrl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DlgEventLogListCtrl.cpp; path = ../clientgui/DlgEventLogListCtrl.cpp; sourceTree = SOURCE_ROOT; }; DDE1374810DC613600161D6B /* DlgEventLogListCtrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DlgEventLogListCtrl.h; path = ../clientgui/DlgEventLogListCtrl.h; sourceTree = SOURCE_ROOT; }; DDE2552B07C62F3E008E7D6E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; - DDE36DF517C3896A000E78D6 /* libwx_osx_cocoa_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwx_osx_cocoa_static.a; path = "../../wxWidgets-2.9.5/build/osx/build/Release/libwx_osx_cocoa_static.a"; sourceTree = ""; }; + DDE36DF517C3896A000E78D6 /* libwx_osx_cocoa_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwx_osx_cocoa_static.a; path = "../../wxWidgets-3.0.0-rc1/build/osx/build/Release/libwx_osx_cocoa_static.a"; sourceTree = ""; }; DDE3A87F0E90D1BF00A363A7 /* client_state.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = client_state.cpp; sourceTree = ""; }; DDE3A8840E90D23400A363A7 /* scheduler_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scheduler_op.cpp; sourceTree = ""; }; DDE41C250C1FCA8F00CA1F86 /* graphics2_util.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = graphics2_util.cpp; sourceTree = ""; }; @@ -3509,15 +3509,15 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ../clientgui/mac/MacGUI.pch; HEADER_SEARCH_PATHS = ( - "../../wxWidgets-2.9.5/include", - "../../wxWidgets-2.9.5/build/osx/setup/carbon/include", + "../../wxWidgets-3.0.0-rc1/include", + "../../wxWidgets-3.0.0-rc1/build/osx/setup/cocoa/include", ../clientgui, ); INFOPLIST_FILE = Info.plist; LIBRARY_SEARCH_PATHS = ( - "../../wxWidgets-2.9.5/build/osx/build/Debug", - "\"$(SRCROOT)/../../wxWidgets-2.9.5/build/osx/build/Debug\"", - "\"$(SRCROOT)/../../wxWidgets-2.9.5/build/osx/build/Release\"", + "../../wxWidgets-3.0.0-rc1/build/osx/build/Debug", + "\"$(SRCROOT)/../../wxWidgets-3.0.0-rc1/build/osx/build/Debug\"", + "\"$(SRCROOT)/../../wxWidgets-3.0.0-rc1/build/osx/build/Release\"", ); MACOSX_DEPLOYMENT_TARGET = 10.4; OTHER_CFLAGS = ( @@ -3559,14 +3559,14 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ../clientgui/mac/MacGUI.pch; HEADER_SEARCH_PATHS = ( - "../../wxWidgets-2.9.5/include", - "../../wxWidgets-2.9.5/build/osx/setup/carbon/include", + "../../wxWidgets-3.0.0-rc1/include", + "../../wxWidgets-3.0.0-rc1/build/osx/setup/cocoa/include", ../clientgui, ); INFOPLIST_FILE = Info.plist; LIBRARY_SEARCH_PATHS = ( - "../../wxWidgets-2.9.5/build/osx/build/Release", - "\"$(SRCROOT)/../../wxWidgets-2.9.5/build/osx/build/Release\"", + "../../wxWidgets-3.0.0-rc1/build/osx/build/Release", + "\"$(SRCROOT)/../../wxWidgets-3.0.0-rc1/build/osx/build/Release\"", ); MACOSX_DEPLOYMENT_TARGET = 10.4; OTHER_CFLAGS = ( diff --git a/mac_build/buildWxMac.sh b/mac_build/buildWxMac.sh index 6cf4ffbeae..8623e163da 100644 --- a/mac_build/buildWxMac.sh +++ b/mac_build/buildWxMac.sh @@ -25,11 +25,12 @@ # Updated for OS 10.7 and XCode 4.1 with OS 10.4 compatibility 9/26/11 # Updated for partial OS 10.8 and XCode 4.5 compatibility 7/27/12 # Updated for wxCocoa 2.9.5 8/20/13 +# Updated for wxCocoa 3.0.0-rc1 10/17/13 # ## This script requires OS 10.6 or later ## -## In Terminal, CD to the wxMac-2.9.5 directory. -## cd [path]/wxMac-2.9.5/ +## In Terminal, CD to the wxWidgets-3.0.0 directory. +## cd [path]/wxWidgets-3.0.0/ ## then run this script: ## source [ path_to_this_script ] [ -clean ] ##