Fixes after rebase

This commit is contained in:
r.kuznetsov 2015-10-16 14:14:31 +03:00
parent e345cdfb8d
commit d162713783
9 changed files with 25 additions and 9 deletions

View file

@ -477,6 +477,11 @@ void Framework::ApplyWidgets()
m_work.SetWidgetLayout(move(layout));
}
void Framework::SetupMeasurementSystem()
{
m_work.SetupMeasurementSystem();
}
//////////////////////////////////////////////////////////////////////////////////////////
void Framework::ItemStatusChanged(int childPosition)
{

View file

@ -83,6 +83,8 @@ namespace android
void SetMapStyle(MapStyle mapStyle);
MapStyle GetMapStyle() const;
void SetupMeasurementSystem();
void SetRouter(routing::RouterType type) { m_work.SetRouter(type); }
routing::RouterType GetRouter() const { return m_work.GetRouter(); }
routing::RouterType GetLastUsedRouter() const { return m_work.GetLastUsedRouter(); }

View file

@ -10,6 +10,7 @@ extern "C"
{
Settings::Units const u = static_cast<Settings::Units>(units);
Settings::Set("Units", u);
g_framework->SetupMeasurementSystem();
}
JNIEXPORT jint JNICALL

View file

@ -201,25 +201,25 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell)
break;
}
}
[self refreshLocationButtonState];
[self refreshLocationButtonState: state];
}
- (void)refreshLocationButtonState
- (void)refreshLocationButtonState:(location::EMyPositionMode)state
{
dispatch_async(dispatch_get_main_queue(), ^
{
if (self.locationButton.imageView.isAnimating)
{
[self refreshLocationButtonState];
[self refreshLocationButtonState: state];
}
else
{
UIButton * locBtn = self.locationButton;
switch (self.locationState)
switch (state)
{
case location::MODE_PENDING_POSITION:
break;
case location::State::Mode::UnknownPosition:
case location::MODE_UNKNOWN_POSITION:
[locBtn setImage:[UIImage imageNamed:@"ic_menu_location_off_mode_light"] forState:UIControlStateNormal];
break;
case location::MODE_NOT_FOLLOW:

View file

@ -22,12 +22,14 @@
+ (void)setup:(id)controller
{
Settings::Units u;
if (!Settings::Get("Units", u))
if (!Settings::Get("Units", u))
{
// get system locale preferences
BOOL const isMetric = [[[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleUsesMetricSystem] boolValue];
if (isMetric)
{
u = Settings::Metric;
}
else
{
u = Settings::Foot;
@ -35,9 +37,10 @@
PrefDelegate * d = [[PrefDelegate alloc] init];
d.m_controller = controller;
}
Settings::Set("Units", u);
}
GetFramework().SetupMeasurementSystem();
}
@end
@end

View file

@ -223,7 +223,7 @@ Settings::Units unitsForIndex(NSInteger index)
withParameters:@{kStatValue : (units == Settings::Units::Metric ? kStatKilometers : kStatMiles)}];
Settings::Set("Units", units);
[tableView reloadSections:[NSIndexSet indexSetWithIndex:SectionMetrics] withRowAnimation:UITableViewRowAnimationFade];
GetPlatform().SetupMeasurementSystem();
GetFramework().SetupMeasurementSystem();
}
else if (section == SectionRouting && indexPath.row == 1)
{

View file

@ -1314,6 +1314,8 @@ MapStyle Framework::GetMapStyle() const
void Framework::SetupMeasurementSystem()
{
GetPlatform().SetupMeasurementSystem();
Settings::Units units = Settings::Metric;
Settings::Get("Units", units);

View file

@ -310,6 +310,8 @@ public:
void SetMapStyle(MapStyle mapStyle);
MapStyle GetMapStyle() const;
void SetupMeasurementSystem();
void SetWidgetLayout(gui::TWidgetsLayoutInfo && layout);
const gui::TWidgetsSizeInfo & GetWidgetSizes();

View file

@ -386,6 +386,7 @@ void MainWindow::OnPreferences()
PreferencesDialog dlg(this);
dlg.exec();
m_pDrawWidget->GetFramework().SetupMeasurementSystem();
m_pDrawWidget->GetFramework().EnterForeground();
}