Signed-off-by: Francois Gouget fgouget@codeweavers.com --- This is mostly cosmetic but the --system and --utf8 options are closely related so it is more logical for them to be together and makes the code more understandable. The same goes for --locale and --country.
testbot/bin/SetWinLocale | 49 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-)
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale index 911aa452d9..b6992d92e5 100755 --- a/testbot/bin/SetWinLocale +++ b/testbot/bin/SetWinLocale @@ -301,7 +301,7 @@ sub CheckLocale($$) }
my ($OptHostName, $OptShow, $OptReboot); -my ($OptDefault, $OptLocale, $OptSystem, $OptMUI, $OptCountry, $OptKeyboard, $OptUTF8); +my ($OptDefault, $OptLocale, $OptCountry, $OptSystem, $OptUTF8, $OptMUI, $OptKeyboard); while (@ARGV) { my $Arg = shift @ARGV; @@ -339,10 +339,18 @@ while (@ARGV) { $OptLocale = CheckLocale($Arg, $OptLocale); } + elsif ($Arg eq "--country") + { + $OptCountry = CheckValue($Arg, $OptCountry); + } elsif ($Arg eq "--system") { $OptSystem = CheckLocale($Arg, $OptSystem); } + elsif ($Arg eq "--utf8") + { + $OptUTF8 = 1; + } elsif ($Arg eq "--mui") { $OptMUI = CheckLocale($Arg, $OptMUI); @@ -351,14 +359,6 @@ while (@ARGV) { $OptKeyboard = CheckLocale($Arg, $OptKeyboard); } - elsif ($Arg eq "--country") - { - $OptCountry = CheckValue($Arg, $OptCountry); - } - elsif ($Arg eq "--utf8") - { - $OptUTF8 = 1; - } elsif ($Arg eq "--debug") { $Debug = 1; @@ -437,7 +437,7 @@ if (defined $Usage) exit $Usage; } print "Usage: $name0 [options] --show HOSTNAME\n"; - print "or $name0 [options] [--default DEF] [--locale LOC] [--system SYS] [--utf8] [--mui MUI] [--keyboard KBD] [--country CTY] HOSTNAME\n"; + print "or $name0 [options] [--default DEF] [--locale LOC] [--country CTY] [--system SYS] [--utf8] [--mui MUI] [--keyboard KBD] [--no-reboot] HOSTNAME\n"; print "\n"; print "Sets the locale of the specified Windows machine.\n"; print "\n"; @@ -454,6 +454,11 @@ if (defined $Usage) print " format.\n"; print " . APIs: GetUserDefaultLCID().\n"; print " . Powershell: Set-Culture LOC\n"; + print " --country CTY Specifies the location using only the country part of the\n"; + print " Windows locale (see --defaults).\n"; + print " . Windows 10 GUI: Time & language -> Region -> Country.\n"; + print " . APIs: GetUserGeoID().\n"; + print " . Powershell: Set-WinHomeLocation -GeoId CTY-ID\n"; print " --system SYS Specifies the system locale (see --defaults).\n"; print " . Only takes effect after a reboot.\n"; print " . Windows 10 GUI: Time & language -> Language ->\n"; @@ -478,11 +483,6 @@ if (defined $Usage) print " . Windows 10 GUI: Time & language -> Language -> Keyboard ->\n"; print " Override for default input method.\n"; print " . Powershell: Set-WinDefaultInputMethodOverride -InputTip KBD-ID\n"; - print " --country CTY Specifies the location using only the country part of the\n"; - print " Windows locale (see --defaults).\n"; - print " . Windows 10 GUI: Time & language -> Region -> Country.\n"; - print " . APIs: GetUserGeoID().\n"; - print " . Powershell: Set-WinHomeLocation -GeoId CTY-ID\n"; print " --no-reboot Do not reboot Windows. Some locale changes will only take\n"; print " effect after the next reboot.\n"; print " --debug Show more detailed information about progress.\n"; @@ -885,14 +885,6 @@ if ($OptLocale) CheckSetting($Settings, "Locale", "0000$LCIDLocale", "for --locale $OptLocale", 1); CheckSetting($Settings, "LocaleName", $OptLocale, "for --locale $OptLocale"); } -if ($KeyboardIds) -{ - CheckSetting($Settings, "InputMethod", $KeyboardIds->[0], "for --keyboard $OptKeyboard", 1); -} -if ($OptMUI) -{ - CheckSetting($Settings, "PreferredUILanguages", $OptMUI, "for --mui $OptMUI"); -} if ($OptCountry) { CheckSetting($Settings, "Country", $CountryId, "for --country $OptCountry"); @@ -910,8 +902,15 @@ if ($OptUTF8) CheckSetting($Settings, $VName, "65001", "for --utf8"); } } -exit(1) if (!$Success); - +if ($OptMUI) +{ + CheckSetting($Settings, "PreferredUILanguages", $OptMUI, "for --mui $OptMUI"); +} +if ($KeyboardIds) +{ + CheckSetting($Settings, "InputMethod", $KeyboardIds->[0], "for --keyboard $OptKeyboard", 1); +}
+exit(1) if (!$Success); Debug(Elapsed($Start), " All done!\n"); exit(0);
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/SetWinLocale | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale index b6992d92e5..f725e30fd7 100755 --- a/testbot/bin/SetWinLocale +++ b/testbot/bin/SetWinLocale @@ -460,12 +460,16 @@ if (defined $Usage) print " . APIs: GetUserGeoID().\n"; print " . Powershell: Set-WinHomeLocation -GeoId CTY-ID\n"; print " --system SYS Specifies the system locale (see --defaults).\n"; + print " . This requires elevated privileges.\n"; print " . Only takes effect after a reboot.\n"; print " . Windows 10 GUI: Time & language -> Language ->\n"; print " Administrative Language Settings -> Change system locale.\n"; print " . APIs: GetSystemDefaultLCID(), GetThreadLocale().\n"; print " . Powershell: Set-WinSystemLocale -SystemLocale SYS\n"; print " --utf8 Set the code pages (ACP, MACCP and OEMCP) to UTF-8.\n"; + print " . This requires elevated privileges.\n"; + print " . Only supported on Windows 10+. This will render older Windows\n"; + print " versions unbootable.\n"; print " . Windows 10 GUI: Time & language -> Language ->\n"; print " Administrative Language Settings -> Change system locale ->\n"; print " Beta: Use Unicode UTF-8 for worldwide language support.\n"; @@ -483,8 +487,9 @@ if (defined $Usage) print " . Windows 10 GUI: Time & language -> Language -> Keyboard ->\n"; print " Override for default input method.\n"; print " . Powershell: Set-WinDefaultInputMethodOverride -InputTip KBD-ID\n"; - print " --no-reboot Do not reboot Windows. Some locale changes will only take\n"; - print " effect after the next reboot.\n"; + print " --no-reboot Do not reboot Windows. Some locale changes only take effect\n"; + print " after a reboot so this option should only be used for\n"; + print " debugging.\n"; print " --debug Show more detailed information about progress.\n"; print " --help Shows this usage message.\n"; exit 0;