diff options
Diffstat (limited to 'iphone/Maps/Classes/MapsAppDelegate.mm')
-rw-r--r-- | iphone/Maps/Classes/MapsAppDelegate.mm | 55 |
1 files changed, 10 insertions, 45 deletions
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index c32d364adf..b40815f2e0 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -1,70 +1,37 @@ #import "MapsAppDelegate.h" #import "MapViewController.h" -#import "GuideViewController.h" #import "SettingsManager.h" -#import "../../Sloynik/Shared/global.hpp" @implementation MapsAppDelegate -@synthesize window; -@synthesize mapViewController; +@synthesize m_navigationController; +@synthesize m_window; +@synthesize m_mapViewController; + (MapsAppDelegate *) theApp { return [[UIApplication sharedApplication] delegate]; } -// here we're - (void) applicationWillTerminate: (UIApplication *) application { - [mapViewController OnTerminate]; + [m_mapViewController OnTerminate]; } - (void) applicationDidEnterBackground: (UIApplication *) application { - [mapViewController OnEnterBackground]; + [m_mapViewController OnEnterBackground]; } - (void) applicationWillEnterForeground: (UIApplication *) application { - [mapViewController OnEnterForeground]; -} - -- (void) onSloynikEngineInitialized: (void *) pEngine -{ - SetSloynikEngine(static_cast<sl::SloynikEngine *>(pEngine)); - if (m_guideViewController) - [m_guideViewController OnSloynikEngineInitialized]; + [m_mapViewController OnEnterForeground]; } - (void) applicationDidFinishLaunching: (UIApplication *) application { - // Initialize Sloynik engine. - // It takes long for the first time, so we do it while startup image is visible. - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ - sl::SloynikEngine * pEngine = CreateSloynikEngine(); - dispatch_async(dispatch_get_main_queue(), ^{ - [[MapsAppDelegate theApp] onSloynikEngineInitialized:pEngine]; - }); - }); - - - // Add the tab bar controller's current view as a subview of the window - [window addSubview:mapViewController.view]; - [window makeKeyAndVisible]; -} - -- (GuideViewController *)guideViewController -{ - if (!m_guideViewController) - { - m_guideViewController = [GuideViewController alloc]; - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) - m_guideViewController = [m_guideViewController initWithNibName:@"GuideView-iPad" bundle:nil]; - else - m_guideViewController = [m_guideViewController initWithNibName:@"GuideView" bundle:nil]; - } - return m_guideViewController; + [m_window addSubview:m_mapViewController.view]; + [m_window makeKeyAndVisible]; } - (SettingsManager *)settingsManager @@ -76,10 +43,9 @@ - (void) dealloc { - [m_guideViewController release]; [m_settingsManager release]; - mapViewController = nil; - window = nil; + m_mapViewController = nil; + m_window = nil; [super dealloc]; } @@ -97,4 +63,3 @@ } @end - |