From 766284a95fc9fd3d3da89998a502feb854a3f091 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 20 Aug 2015 15:59:36 +0200 Subject: [PATCH 1/4] Use official name of Windows Server 2016. Use the official name of Windows Server 2016 in wxGetOsDescription() and add it to the Windows versions table in the documentation. --- interface/wx/utils.h | 1 + src/msw/utils.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/wx/utils.h b/interface/wx/utils.h index d2f5e17aac..fd1f2d1f32 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -858,6 +858,7 @@ wxString wxGetOsDescription(); @beginTable @row3col{Windows OS name, Major version, Minor version} @row3col{Windows 10, 10, 0} + @row3col{Windows Server 2016, 10, 0} @row3col{Windows 8.1, 6, 3} @row3col{Windows Server 2012 R2, 6, 3} @row3col{Windows 8, 6, 2} diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 6bf4441701..88bb5ddc52 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1226,7 +1226,7 @@ wxString wxGetOsDescription() case 10: str = wxIsWindowsServer() == 1 - ? _("Windows Server 10") + ? _("Windows Server 2016") : _("Windows 10"); break; } From 3796744dacfc72610a8dc74e699ee5387adf2123 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 20 Aug 2015 16:16:45 +0200 Subject: [PATCH 2/4] Include OS X name in wxGetOsDescription(). Use the marketing/code name of the current OS X version (if known) as part of the wxGetOsDescription(). Also removed the Mac prefix in the description which is no longer used since OS X 10.8. --- src/osx/cocoa/utils.mm | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 46459586a3..78cd165708 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -677,9 +677,45 @@ bool wxCheckOsVersion(int majorVsn, int minorVsn) wxString wxGetOsDescription() { - NSString* osDesc = [NSProcessInfo processInfo].operatingSystemVersionString; - return wxString::Format("%s %s", _("Mac OS X"), wxCFStringRef::AsString(osDesc)); + int majorVer, minorVer; + wxGetOsVersion(&majorVer, &minorVer); + + wxString osBrand = _("OS X"); + wxString osName; + if (majorVer == 10) + { + switch (minorVer) + { + case 7: + osName = _("Lion"); + // 10.7 was the last version where the "Mac" prefix was used + osBrand = _("Mac OS X"); + break; + case 8: + osName = _("Mountain Lion"); + break; + case 9: + osName = _("Mavericks"); + break; + case 10: + osName = _("Yosemite"); + break; + case 11: + osName = _("El Capitan"); + break; + }; + } + + wxString osDesc = osBrand; + if (!osName.empty()) + osDesc += " " + osName; + + NSString* osVersionString = [NSProcessInfo processInfo].operatingSystemVersionString; + if (osVersionString) + osDesc += " " + wxCFStringRef::AsString(osVersionString); + + return osDesc; } #endif // wxOSX_USE_COCOA From d9761208e5aa22ee4af3e294abe400eda53afbbf Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 20 Aug 2015 16:27:36 +0200 Subject: [PATCH 3/4] Remove documentation notes to OS X prior 10.5. Since these prior versions are not supported by the cocoa or carbon builds these notes are no longer required in the documentation. --- interface/wx/srchctrl.h | 4 ---- interface/wx/sysopt.h | 1 - 2 files changed, 5 deletions(-) diff --git a/interface/wx/srchctrl.h b/interface/wx/srchctrl.h index 571082dcf8..51410de7bb 100644 --- a/interface/wx/srchctrl.h +++ b/interface/wx/srchctrl.h @@ -120,8 +120,6 @@ public: Returns the search button visibility value. If there is a menu attached, the search button will be visible regardless of the search button visibility value. - - This always returns @false in Mac OS X v10.3 */ virtual bool IsSearchButtonVisible() const; @@ -148,8 +146,6 @@ public: Sets the search button visibility value on the search control. If there is a menu attached, the search button will be visible regardless of the search button visibility value. - - This has no effect in Mac OS X v10.3 */ virtual void ShowSearchButton(bool show); diff --git a/interface/wx/sysopt.h b/interface/wx/sysopt.h index 30d9461da0..0a2d55b9e8 100644 --- a/interface/wx/sysopt.h +++ b/interface/wx/sysopt.h @@ -118,7 +118,6 @@ Tells wxListCtrl to use the generic control even when it is capable of using the native control instead. Also known as wxMAC_ALWAYS_USE_GENERIC_LISTCTRL. @flag{mac.textcontrol-use-spell-checker} - This option only has effect for Mac OS X 10.4 and higher. If 1 activates the spell checking in wxTextCtrl. @flag{osx.openfiledialog.always-show-types} Per default a wxFileDialog with wxFD_OPEN does not show a types-popup on OS X but allows From 8b2dc19dbb96591eb77aae7d9749301660efb78c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Sep 2015 14:24:17 +0200 Subject: [PATCH 4/4] Don't translate OS X codenames in wxGetOsDescription() OS X itself doesn't seem to do it. See https://github.com/wxWidgets/wxWidgets/pull/76#issuecomment-138067426 --- src/osx/cocoa/utils.mm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 78cd165708..545ebb6517 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -681,28 +681,31 @@ wxString wxGetOsDescription() int majorVer, minorVer; wxGetOsVersion(&majorVer, &minorVer); - wxString osBrand = _("OS X"); + // Notice that neither the OS name itself nor the code names seem to be + // ever translated, OS X itself uses the English words even for the + // languages not using Roman alphabet. + wxString osBrand = "OS X"; wxString osName; if (majorVer == 10) { switch (minorVer) { case 7: - osName = _("Lion"); + osName = "Lion"; // 10.7 was the last version where the "Mac" prefix was used - osBrand = _("Mac OS X"); + osBrand = "Mac OS X"; break; case 8: - osName = _("Mountain Lion"); + osName = "Mountain Lion"; break; case 9: - osName = _("Mavericks"); + osName = "Mavericks"; break; case 10: - osName = _("Yosemite"); + osName = "Yosemite"; break; case 11: - osName = _("El Capitan"); + osName = "El Capitan"; break; }; }