]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
adding implementation for osx
[wxWidgets.git] / src / msw / utils.cpp
index a456a3417a654ae979bf7a88c6b87d55b68d591a..f208feb48fa6c50811d15f11cb9782614d940414 100644 (file)
@@ -303,7 +303,7 @@ bool wxGetUserName(wxChar *buf, int maxSize)
     // Get the computer name of a DC for the domain.
     if ( NetGetDCName( NULL, wszDomain, &ComputerName ) != NERR_Success )
     {
     // Get the computer name of a DC for the domain.
     if ( NetGetDCName( NULL, wszDomain, &ComputerName ) != NERR_Success )
     {
-        wxLogError(wxT("Can not find domain controller"));
+        wxLogError(wxT("Cannot find domain controller"));
 
         goto error;
     }
 
         goto error;
     }
@@ -627,7 +627,7 @@ bool wxDoSetEnv(const wxString& var, const wxChar *value)
     //
     // TODO: add checks for the other compilers (and update wxSetEnv()
     //       documentation in interface/wx/utils.h accordingly)
     //
     // TODO: add checks for the other compilers (and update wxSetEnv()
     //       documentation in interface/wx/utils.h accordingly)
-#if defined(__VISUALC__)
+#if defined(__VISUALC__) || defined(__MINGW32__)
     // notice that Microsoft _putenv() has different semantics from POSIX
     // function with almost the same name: in particular it makes a copy of the
     // string instead of using it as part of environment so we can safely call
     // notice that Microsoft _putenv() has different semantics from POSIX
     // function with almost the same name: in particular it makes a copy of the
     // string instead of using it as part of environment so we can safely call
@@ -1274,8 +1274,7 @@ wxString wxGetOsDescription()
                         switch ( info.dwMinorVersion )
                         {
                             case 0:
                         switch ( info.dwMinorVersion )
                         {
                             case 0:
-                                str.Printf(_("Windows 2000 (build %lu"),
-                                           info.dwBuildNumber);
+                                str = _("Windows 2000");
                                 break;
 
                             case 2:
                                 break;
 
                             case 2:
@@ -1284,36 +1283,44 @@ wxString wxGetOsDescription()
                                 // type to resolve this ambiguity
                                 if ( wxIsWindowsServer() == 1 )
                                 {
                                 // type to resolve this ambiguity
                                 if ( wxIsWindowsServer() == 1 )
                                 {
-                                    str.Printf(_("Windows Server 2003 (build %lu"),
-                                               info.dwBuildNumber);
+                                    str = _("Windows Server 2003");
                                     break;
                                 }
                                 //else: must be XP, fall through
 
                             case 1:
                                     break;
                                 }
                                 //else: must be XP, fall through
 
                             case 1:
-                                str.Printf(_("Windows XP (build %lu"),
-                                           info.dwBuildNumber);
+                                str = _("Windows XP");
                                 break;
                         }
                         break;
 
                     case 6:
                                 break;
                         }
                         break;
 
                     case 6:
-                        if ( info.dwMinorVersion == 0 )
+                        switch ( info.dwMinorVersion )
                         {
                         {
-                            str.Printf(_("Windows Vista (build %lu"),
-                                       info.dwBuildNumber);
+                            case 0:
+                                str = wxIsWindowsServer() == 1
+                                        ? _("Windows Server 2008")
+                                        : _("Windows Vista");
+                                break;
+
+                            case 1:
+                                str = wxIsWindowsServer() == 1
+                                        ? _("Windows Server 2008 R2")
+                                        : _("Windows 7");
+                                break;
                         }
                         break;
                 }
 
                 if ( str.empty() )
                 {
                         }
                         break;
                 }
 
                 if ( str.empty() )
                 {
-                    str.Printf(_("Windows NT %lu.%lu (build %lu"),
-                           info.dwMajorVersion,
-                           info.dwMinorVersion,
-                           info.dwBuildNumber);
+                    str.Printf(_("Windows NT %lu.%lu"),
+                               info.dwMajorVersion,
+                               info.dwMinorVersion);
                 }
 
                 }
 
+                str << wxT(" (")
+                    << wxString::Format(_("build %lu"), info.dwBuildNumber);
                 if ( !wxIsEmpty(info.szCSDVersion) )
                 {
                     str << wxT(", ") << info.szCSDVersion;
                 if ( !wxIsEmpty(info.szCSDVersion) )
                 {
                     str << wxT(", ") << info.szCSDVersion;