[ios] Downloader appears as a modal view

This commit is contained in:
Alex Zolotarev 2011-10-23 16:26:07 +03:00 committed by Alex Zolotarev
parent bf55904722
commit 0aa7a5ea25
9 changed files with 296 additions and 422 deletions

View file

@ -200,7 +200,7 @@ bool _inRepaint = false;
- (void)layoutSubviews
{
CGFloat const scale = self.contentScaleFactor;
CGSize const s = self.frame.size;
CGSize const s = self.bounds.size;
[self onSize:s.width * scale withHeight:s.height * scale];
}

View file

@ -10,7 +10,6 @@
NSInteger m_standbyCounter;
}
@property (nonatomic, retain) IBOutlet UINavigationController * m_navigationController;
@property (nonatomic, retain) IBOutlet UIWindow * m_window;
@property (nonatomic, retain) IBOutlet MapViewController * m_mapViewController;

View file

@ -6,7 +6,6 @@
@implementation MapsAppDelegate
@synthesize m_navigationController;
@synthesize m_window;
@synthesize m_mapViewController;
@synthesize m_locationManager;
@ -36,7 +35,7 @@
[Preferences setup:m_mapViewController];
m_locationManager = [[LocationManager alloc] init];
[m_window addSubview:m_navigationController.view];
[m_window addSubview:m_mapViewController.view];
[m_window makeKeyAndVisible];
}

View file

@ -217,14 +217,6 @@ static void OnSearchResultCallback(search::Result const & res, int queryId)
return YES; // All orientations are supported.
}
// correctly pass rotation event up to the root mapViewController
// to fix rotation bug when other controller is above the root
//- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
//{
// [[self.navigationController.viewControllers objectAtIndex:0] didRotateFromInterfaceOrientation:fromInterfaceOrientation];
// [self fixHeadingOrientation];
//}
//**************************************************************************
//*********** SearchBar handlers *******************************************
- (void)searchBar:(UISearchBar *)sender textDidChange:(NSString *)searchText

View file

@ -11,15 +11,12 @@
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUINavigationController</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
<string>IBUIButton</string>
<string>IBUIWindow</string>
<string>IBUINavigationBar</string>
<string>IBUINavigationItem</string>
<string>IBUICustomObject</string>
<string>IBUIViewController</string>
<string>IBUIButton</string>
<string>IBUIView</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -40,162 +37,131 @@
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUINavigationController" id="506791926">
<object class="IBUIViewController" id="963277495">
<bool key="IBUIAutoresizesArchivedViewToFullSize">NO</bool>
<string key="IBUITitle">Map</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<bool key="IBUIWantsFullScreenLayout">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUINavigationBar" key="IBUINavigationBar" id="913591306">
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{0, -74}, {0, 74}}</string>
<string key="NSReuseIdentifierKey">_NS:425</string>
<object class="NSColor" key="IBUIBackgroundColor" id="933778228">
<object class="IBUIView" key="IBUIView" id="53915144">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="803813744">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="23888313"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="933778228">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="538042181">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location-search.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="757694151">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="142678927">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="23888313">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{60, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="773974234"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="933778228"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="538042181"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">search.png</string>
</object>
<reference key="IBUIFontDescription" ref="757694151"/>
<reference key="IBUIFont" ref="142678927"/>
</object>
<object class="IBUIButton" id="773974234">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{110, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="933778228"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="538042181"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">downloader.png</string>
</object>
<reference key="IBUIFontDescription" ref="757694151"/>
<reference key="IBUIFont" ref="142678927"/>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 480}}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="803813744"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<array class="NSMutableArray" key="IBUIViewControllers">
<object class="IBUIViewController" id="963277495">
<bool key="IBUIAutoresizesArchivedViewToFullSize">NO</bool>
<object class="IBUIView" key="IBUIView" id="53915144">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="803813744">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="23888313"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="933778228"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="538042181">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location-search.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="757694151">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="142678927">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="23888313">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{60, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="773974234"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="933778228"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="538042181"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">search.png</string>
</object>
<reference key="IBUIFontDescription" ref="757694151"/>
<reference key="IBUIFont" ref="142678927"/>
</object>
<object class="IBUIButton" id="773974234">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{110, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="933778228"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="538042181"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">downloader.png</string>
</object>
<reference key="IBUIFontDescription" ref="757694151"/>
<reference key="IBUIFont" ref="142678927"/>
</object>
</array>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="803813744"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<array key="IBUIToolbarItems" id="0"/>
<object class="IBUINavigationItem" key="IBUINavigationItem" id="525978464">
<string key="IBUITitle">Map</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="506791926"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
<bool key="IBUINavigationBarHidden">YES</bool>
<array key="IBUIToolbarItems" id="0"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIWindow" id="380026005">
<reference key="NSNextResponder"/>
@ -227,17 +193,9 @@
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="380026005"/>
<reference key="destination" ref="506791926"/>
<reference key="destination" ref="963277495"/>
</object>
<int key="connectionID">195</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_navigationController</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="506791926"/>
</object>
<int key="connectionID">190</int>
<int key="connectionID">213</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
@ -321,43 +279,22 @@
<reference key="object" ref="532797962"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">181</int>
<reference key="object" ref="506791926"/>
<array class="NSMutableArray" key="children">
<reference ref="913591306"/>
<reference ref="963277495"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">182</int>
<reference key="object" ref="913591306"/>
<reference key="parent" ref="506791926"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">126</int>
<reference key="object" ref="963277495"/>
<array class="NSMutableArray" key="children">
<reference ref="525978464"/>
<reference ref="53915144"/>
</array>
<reference key="parent" ref="506791926"/>
<reference key="parent" ref="0"/>
<string key="objectName">Map View Controller</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">185</int>
<reference key="object" ref="525978464"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="963277495"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">161</int>
<reference key="object" ref="53915144"/>
<array class="NSMutableArray" key="children">
<reference ref="23888313"/>
<reference ref="773974234"/>
<reference ref="803813744"/>
<reference ref="773974234"/>
<reference ref="23888313"/>
</array>
<reference key="parent" ref="963277495"/>
</object>
@ -367,13 +304,13 @@
<reference key="parent" ref="53915144"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">201</int>
<reference key="object" ref="23888313"/>
<int key="objectID">202</int>
<reference key="object" ref="773974234"/>
<reference key="parent" ref="53915144"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">202</int>
<reference key="object" ref="773974234"/>
<int key="objectID">201</int>
<reference key="object" ref="23888313"/>
<reference key="parent" ref="53915144"/>
</object>
</array>
@ -387,9 +324,6 @@
<string key="126.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="161.CustomClassName">EAGLView</string>
<string key="161.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="181.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="182.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="185.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<dictionary class="NSMutableDictionary" key="2.IBAttributePlaceholdersKey"/>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="200.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -408,7 +342,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">212</int>
<int key="maxID">213</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">

View file

@ -11,15 +11,12 @@
<string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUINavigationController</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
<string>IBUIButton</string>
<string>IBUIWindow</string>
<string>IBUINavigationBar</string>
<string>IBUINavigationItem</string>
<string>IBUICustomObject</string>
<string>IBUIViewController</string>
<string>IBUIButton</string>
<string>IBUIView</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -46,6 +43,7 @@
<object class="NSPSMatrix" key="NSFrameMatrix"/>
<string key="NSFrameSize">{768, 1024}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
@ -58,152 +56,126 @@
<bool key="IBUIVisibleAtLaunch">YES</bool>
<bool key="IBUIResizesToFullScreen">YES</bool>
</object>
<object class="IBUINavigationController" id="1066481607">
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
<object class="IBUIViewController" id="963277495">
<object class="IBUIView" key="IBUIView" id="53915144">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="68084817">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 899}, {44, 44}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="312081333"/>
<string key="NSReuseIdentifierKey">_NS:237</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="95748844">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="422857318">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location-search.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="995536267">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="624138544">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="312081333">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{85, 899}, {44, 44}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="832785650"/>
<string key="NSReuseIdentifierKey">_NS:237</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="95748844"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="422857318"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">search.png</string>
</object>
<reference key="IBUIFontDescription" ref="995536267"/>
<reference key="IBUIFont" ref="624138544"/>
</object>
<object class="IBUIButton" id="832785650">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{150, 899}, {44, 44}}</string>
<reference key="NSSuperview" ref="53915144"/>
<string key="NSReuseIdentifierKey">_NS:237</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="95748844"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="422857318"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">downloader.png</string>
</object>
<reference key="IBUIFontDescription" ref="995536267"/>
<reference key="IBUIFont" ref="624138544"/>
</object>
</array>
<string key="NSFrameSize">{768, 960}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="68084817"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<array key="IBUIToolbarItems" id="0"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUINavigationBar" key="IBUINavigationBar" id="683601364">
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{0, 0}</string>
<string key="NSReuseIdentifierKey">_NS:428</string>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<array class="NSMutableArray" key="IBUIViewControllers">
<object class="IBUIViewController" id="963277495">
<object class="IBUIView" key="IBUIView" id="53915144">
<nil key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="68084817">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 899}, {44, 44}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="312081333"/>
<string key="NSReuseIdentifierKey">_NS:237</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="95748844">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="422857318">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUISelectedImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location-search.png</string>
</object>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">location.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="995536267">
<string key="name">Helvetica-Bold</string>
<string key="family">Helvetica</string>
<int key="traits">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="624138544">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="312081333">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{85, 899}, {44, 44}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView" ref="832785650"/>
<string key="NSReuseIdentifierKey">_NS:237</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="95748844"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="422857318"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">search.png</string>
</object>
<reference key="IBUIFontDescription" ref="995536267"/>
<reference key="IBUIFont" ref="624138544"/>
</object>
<object class="IBUIButton" id="832785650">
<reference key="NSNextResponder" ref="53915144"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{150, 899}, {44, 44}}</string>
<reference key="NSSuperview" ref="53915144"/>
<string key="NSReuseIdentifierKey">_NS:237</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<reference key="IBUIHighlightedTitleColor" ref="95748844"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="422857318"/>
<object class="NSCustomResource" key="IBUINormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">downloader.png</string>
</object>
<reference key="IBUIFontDescription" ref="995536267"/>
<reference key="IBUIFont" ref="624138544"/>
</object>
</array>
<string key="NSFrame">{{0, 64}, {768, 960}}</string>
<reference key="NSNextKeyView" ref="68084817"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<array key="IBUIToolbarItems" id="0"/>
<object class="IBUINavigationItem" key="IBUINavigationItem" id="708297450">
<string key="IBUITitle">Map</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<reference key="IBUIParentViewController" ref="1066481607"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</array>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
@ -220,25 +192,9 @@
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="380026005"/>
<reference key="destination" ref="1066481607"/>
</object>
<int key="connectionID">184</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_mapViewController</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="963277495"/>
</object>
<int key="connectionID">186</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_navigationController</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="1066481607"/>
</object>
<int key="connectionID">187</int>
<int key="connectionID">197</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
@ -248,6 +204,14 @@
</object>
<int key="connectionID">188</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_mapViewController</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="963277495"/>
</object>
<int key="connectionID">186</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_myPositionButton</string>
@ -314,58 +278,38 @@
<reference key="object" ref="532797962"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">179</int>
<reference key="object" ref="1066481607"/>
<array class="NSMutableArray" key="children">
<reference ref="683601364"/>
<reference ref="963277495"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">180</int>
<reference key="object" ref="683601364"/>
<reference key="parent" ref="1066481607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">126</int>
<reference key="object" ref="963277495"/>
<array class="NSMutableArray" key="children">
<reference ref="53915144"/>
<reference ref="708297450"/>
</array>
<reference key="parent" ref="1066481607"/>
<reference key="parent" ref="0"/>
<string key="objectName">Map View Controller</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">161</int>
<reference key="object" ref="53915144"/>
<array class="NSMutableArray" key="children">
<reference ref="312081333"/>
<reference ref="832785650"/>
<reference ref="68084817"/>
<reference ref="832785650"/>
<reference ref="312081333"/>
</array>
<reference key="parent" ref="963277495"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">183</int>
<reference key="object" ref="708297450"/>
<reference key="parent" ref="963277495"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">190</int>
<reference key="object" ref="68084817"/>
<reference key="parent" ref="53915144"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">191</int>
<reference key="object" ref="312081333"/>
<int key="objectID">192</int>
<reference key="object" ref="832785650"/>
<reference key="parent" ref="53915144"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">192</int>
<reference key="object" ref="832785650"/>
<int key="objectID">191</int>
<reference key="object" ref="312081333"/>
<reference key="parent" ref="53915144"/>
</object>
</array>
@ -379,9 +323,6 @@
<string key="126.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="161.CustomClassName">EAGLView</string>
<string key="161.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="179.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="180.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="183.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="190.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0" key="190.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="191.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -401,7 +342,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">196</int>
<int key="maxID">197</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">

View file

@ -38,7 +38,6 @@ static NSInteger RowFromIndex(TIndex const & index)
return index.m_group;
}
static bool IsOurIndex(TIndex const & theirs, TIndex const & ours)
{
TIndex theirsFixed = theirs;
@ -53,7 +52,7 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours)
@implementation CountriesViewController
- (void) OnAboutButton:(id)sender
- (void) onAboutButton:(id)sender
{
// display WebView with About text
NSString * text;
@ -70,6 +69,11 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours)
[aboutViewController release];
}
- (void) onCloseButton:(id)sender
{
[[[MapsAppDelegate theApp] settingsManager] Hide];
}
- (id) initWithStorage: (Storage &)storage andIndex: (TIndex const &) index andHeader: (NSString *)header
{
m_storage = &storage;
@ -81,6 +85,13 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours)
UIBarButtonItem * aboutButton = [[[UIBarButtonItem alloc] initWithTitle:@"About" style: UIBarButtonItemStylePlain
target:self action:@selector(OnAboutButton:)] autorelease];
self.navigationItem.rightBarButtonItem = aboutButton;
// Show Close button only on the first page
if ([header compare:@"Download"] == NSOrderedSame)
{
UIBarButtonItem * closeButton = [[[UIBarButtonItem alloc] initWithTitle:@"Close" style: UIBarButtonItemStylePlain
target:self action:@selector(onCloseButton:)] autorelease];
self.navigationItem.leftBarButtonItem = closeButton;
}
}
return self;
}
@ -102,13 +113,6 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours)
return YES;
}
// correctly pass rotation event up to the root mapViewController
// to fix rotation bug when other controller is above the root
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
{
[[self.navigationController.viewControllers objectAtIndex:0] didRotateFromInterfaceOrientation:fromInterfaceOrientation];
}
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
TIndex const index = CalculateIndex(m_index, indexPath);

View file

@ -7,6 +7,7 @@ namespace storage { class Storage; }
@interface SettingsManager : NSObject
{
storage::Storage * m_storage;
UINavigationController * m_navigationController;
}
// TODO: Refactor SettingsManager.Show: remove storage.

View file

@ -5,7 +5,7 @@
#include "../../../storage/storage.hpp"
#include <boost/bind.hpp>
#include "../../../std/bind.hpp"
using namespace storage;
@ -14,19 +14,21 @@ using namespace storage;
- (void) dealloc
{
[m_navigationController release];
[super dealloc];
}
/// Get right controller from the stack
- (UIViewController *) ControllerByIndex:(TIndex const &)index
{
NSArray * controllers = [[MapsAppDelegate theApp].m_navigationController viewControllers];
if (index.m_region != TIndex::INVALID && [controllers count] >= 4)
return [controllers objectAtIndex:3];
else if (index.m_country != TIndex::INVALID && [controllers count] >= 3)
NSArray * controllers = m_navigationController.viewControllers;
if (index.m_region != TIndex::INVALID && [controllers count] >= 3)
return [controllers objectAtIndex:2];
else if (index.m_group != TIndex::INVALID && [controllers count] >= 2)
else if (index.m_country != TIndex::INVALID && [controllers count] >= 2)
return [controllers objectAtIndex:1];
else if (index.m_group != TIndex::INVALID && [controllers count] >= 1)
return [controllers objectAtIndex:0];
return nil;
}
@ -48,9 +50,11 @@ using namespace storage;
- (void) Show:(UIViewController *)prevController WithStorage:(Storage *)storage
{
m_storage = storage;
CountriesViewController * countriesController = [[[CountriesViewController alloc]
initWithStorage:*m_storage andIndex:TIndex() andHeader:@"Download"] autorelease];
[[MapsAppDelegate theApp].m_navigationController pushViewController:countriesController animated:YES];
m_navigationController = [[UINavigationController alloc] initWithRootViewController:countriesController];
[prevController presentModalViewController:m_navigationController animated:YES];
// Subscribe to storage callbacks.
{
@ -63,8 +67,7 @@ using namespace storage;
SEL progressSel = @selector(OnCountryDownload:withProgress:);
TProgressFunc progressImpl = (TProgressFunc)[self methodForSelector:progressSel];
m_storage->Subscribe(boost::bind(changeImpl, self, changeSel, _1),
boost::bind(progressImpl, self, progressSel, _1, _2));
m_storage->Subscribe(bind(changeImpl, self, changeSel, _1), bind(progressImpl, self, progressSel, _1, _2));
}
}
@ -73,7 +76,8 @@ using namespace storage;
{
m_storage->Unsubscribe();
[[MapsAppDelegate theApp].m_navigationController popToRootViewControllerAnimated:YES];
[m_navigationController dismissModalViewControllerAnimated:YES];
[m_navigationController release], m_navigationController = nil;
m_storage = nil;
}