mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-07 21:13:55 +00:00
[traffic][ios] Make HttpTraffSource configurable in Preferences
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
NS_SWIFT_NAME(SettingsBridge)
|
||||
@interface MWMSettings : NSObject
|
||||
|
||||
+ (BOOL)liveTrafficEnabled;
|
||||
+ (void)setLiveTrafficEnabled:(BOOL)liveTrafficEnabled;
|
||||
|
||||
+ (NSURL *)liveTrafficUrl;
|
||||
+ (void)setLiveTrafficUrl:(NSURL *)liveTrafficUrl;
|
||||
|
||||
+ (BOOL)buildings3dViewEnabled;
|
||||
+ (void)setBuildings3dViewEnabled:(BOOL)buildings3dViewEnabled;
|
||||
|
||||
|
||||
@@ -26,6 +26,40 @@ NSString * const kUDFileLoggingEnabledKey = @"FileLoggingEnabledKey";
|
||||
|
||||
@implementation MWMSettings
|
||||
|
||||
+ (BOOL)liveTrafficEnabled;
|
||||
{
|
||||
return GetFramework().LoadTrafficHttpEnabled();
|
||||
}
|
||||
|
||||
+ (void)setLiveTrafficEnabled:(BOOL)liveTrafficEnabled;
|
||||
{
|
||||
auto &f = GetFramework();
|
||||
f.SaveTrafficHttpEnabled(liveTrafficEnabled);
|
||||
f.SetTrafficHttpEnabled(liveTrafficEnabled);
|
||||
}
|
||||
|
||||
+ (NSURL *)liveTrafficUrl;
|
||||
{
|
||||
NSString * link = @(GetFramework().LoadTrafficHttpUrl().c_str());
|
||||
if ([link length] == 0) {
|
||||
return nil;
|
||||
} else {
|
||||
return [NSURL URLWithString:link];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)setLiveTrafficUrl:(NSURL *)liveTrafficUrl;
|
||||
{
|
||||
auto &f = GetFramework();
|
||||
if (liveTrafficUrl == nil) {
|
||||
f.SaveTrafficHttpUrl(@"".UTF8String);
|
||||
f.SetTrafficHttpUrl(@"".UTF8String);
|
||||
} else {
|
||||
f.SaveTrafficHttpUrl(liveTrafficUrl.absoluteString.UTF8String);
|
||||
f.SetTrafficHttpUrl(liveTrafficUrl.absoluteString.UTF8String);
|
||||
}
|
||||
}
|
||||
|
||||
+ (BOOL)buildings3dViewEnabled;
|
||||
{
|
||||
bool _ = true, on = true;
|
||||
|
||||
Reference in New Issue
Block a user