From 66d288a95976bf8d17eb6ed966e2fc968bd63342 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 19 Jul 2010 17:33:07 +0000 Subject: [PATCH] * Actually set the 12/24hr clock selector depending on the date format when selecting a country. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37605 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/locale/TimeFormatSettingsView.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/preferences/locale/TimeFormatSettingsView.cpp b/src/preferences/locale/TimeFormatSettingsView.cpp index 9fcb98354e..fc41f2cf4f 100644 --- a/src/preferences/locale/TimeFormatSettingsView.cpp +++ b/src/preferences/locale/TimeFormatSettingsView.cpp @@ -188,7 +188,7 @@ FormatView::FormatView(BCountry* country) BString timeFormat; fCountry->TimeFormat(timeFormat, false); - if (timeFormat.FindFirst(" a")) + if (timeFormat.FindFirst("a") != B_ERROR) f12HrRadioButton->SetValue(1); else f24HrRadioButton->SetValue(1); @@ -537,10 +537,14 @@ FormatView::SetCountry(BCountry* country) delete fCountry; fCountry = country; - /* - f24HrRadioButton->SetValue(settings.ClockIs24Hr()); - f12HrRadioButton->SetValue(!settings.ClockIs24Hr()); + BString timeFormat; + fCountry->TimeFormat(timeFormat, false); + if (timeFormat.FindFirst("a") != B_ERROR) + f12HrRadioButton->SetValue(1); + else + f24HrRadioButton->SetValue(1); + /* FormatSeparator separator = settings.TimeFormatSeparator(); if (separator >= kNoSeparator && separator < kSeparatorsEnd)