[haiku-commits] Re: r37427 - in haiku/trunk: headers/os/locale src/kits/locale src/preferences/locale

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 08 Jul 2010 12:54:25 +0200

On 2010-07-08 at 11:14:09 [+0200], pulkomandy@xxxxxxxxx wrote:
> Author: pulkomandy
> Date: 2010-07-08 11:14:09 +0200 (Thu, 08 Jul 2010)
> New Revision: 37427
> Changeset: http://dev.haiku-os.org/changeset/37427/haiku
> 
> Modified:
>    haiku/trunk/headers/os/locale/Country.h
>    haiku/trunk/src/kits/locale/Country.cpp
>    haiku/trunk/src/kits/locale/Locale.cpp
>    haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp
>    haiku/trunk/src/preferences/locale/TimeFormatSettingsView.h
> Log:
> Support for setting 12/24Hr mode in locale preflet.
> 
> 
> Modified: haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp
> ===================================================================
> --- haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp    
> 2010-07-08 07:11:55 UTC (rev 37426)
> +++ haiku/trunk/src/preferences/locale/TimeFormatSettingsView.cpp    
> 2010-07-08 09:14:09 UTC (rev 37427)
> @@ -435,6 +445,41 @@
>                  break;
>              }
>  
> +        case kClockFormatChange:
> +        {
> +            BString timeFormat;
> +            fCountry->TimeFormat(timeFormat, false);
> +            if (f24HrRadioButton->Value() == 1) {
> +                timeFormat.ReplaceAll("k","h");
> +                timeFormat.ReplaceAll("K","H");
> +                timeFormat.RemoveAll(" a");
> +            } else {
> +                timeFormat.ReplaceAll("h","k");
> +                timeFormat.ReplaceAll("H","K");
> +                timeFormat.Append(" a");
> +                f12HrRadioButton->SetValue(true);
> +            }
> +            std::cout << timeFormat.String() << std::endl;
> +            fCountry->SetTimeFormat(timeFormat.String(), false);
> +
> +            timeFormat.Truncate(0);
> +
> +            fCountry->TimeFormat(timeFormat, true);
> +            if (f24HrRadioButton->Value() == 1) {
> +                timeFormat.ReplaceAll("k","h");
> +                timeFormat.ReplaceAll("K","H");
> +                timeFormat.RemoveAll(" a");
> +            } else {
> +                timeFormat.ReplaceAll("h","k");
> +                timeFormat.ReplaceAll("H","K");
> +                timeFormat.Append(" a");
> +            }
> +            fCountry->SetTimeFormat(timeFormat.String(), true);
> +            _UpdateExamples();
> +            Window()->PostMessage(kSettingsContentsModified);
> +            break;
> +        }
> +

Coding style: Missing spaces after commas. :-}

Best regards,
-Stephan

Other related posts: