commit 3ef56992640b2e2cac1f5a091d384fbe63af0f2e
Author: Miltiadis Vasilakis <mvasilak@gmail.com>
Date:   Wed Dec 19 17:31:18 2012 +0200

    Improve folder sort UI
    
    Use buttons with changing label instead of segment controls. Use different direction keywords for different sort types. Fix bug that didn't reload folder contents when coming back from descendant folder view controller where sort preferences were changed.

diff --git a/Classes/FolderViewController-iPad.xib b/Classes/FolderViewController-iPad.xib
index 0922b81..a255862 100644
--- a/Classes/FolderViewController-iPad.xib
+++ b/Classes/FolderViewController-iPad.xib
@@ -16,7 +16,6 @@
 			<string>IBUIBarButtonItem</string>
 			<string>IBUISearchBar</string>
 			<string>IBUISearchDisplayController</string>
-			<string>IBUISegmentedControl</string>
 			<string>IBUITableView</string>
 			<string>IBUIToolbar</string>
 			<string>IBUIView</string>
@@ -47,88 +46,9 @@
 					<object class="IBUIToolbar" id="599029925">
 						<reference key="NSNextResponder" ref="228054471"/>
 						<int key="NSvFlags">266</int>
-						<object class="NSMutableArray" key="NSSubviews">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<object class="IBUISegmentedControl" id="441166131">
-								<reference key="NSNextResponder" ref="599029925"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{59, 8}, {100, 30}}</string>
-								<reference key="NSSuperview" ref="599029925"/>
-								<reference key="NSNextKeyView" ref="105773647"/>
-								<string key="NSReuseIdentifierKey">_NS:9</string>
-								<bool key="IBUIOpaque">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<int key="IBSegmentControlStyle">2</int>
-								<int key="IBNumberOfSegments">2</int>
-								<int key="IBSelectedSegmentIndex">0</int>
-								<object class="NSArray" key="IBSegmentTitles">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<string>name</string>
-									<string>date</string>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentWidths">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<real value="0.0"/>
-									<real value="0.0"/>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentEnabledStates">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<boolean value="YES"/>
-									<boolean value="YES"/>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentContentOffsets">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<string>{0, 0}</string>
-									<string>{0, 0}</string>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentImages">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<object class="NSNull" id="4"/>
-									<reference ref="4"/>
-								</object>
-							</object>
-							<object class="IBUISegmentedControl" id="105773647">
-								<reference key="NSNextResponder" ref="599029925"/>
-								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{189, 8}, {100, 30}}</string>
-								<reference key="NSSuperview" ref="599029925"/>
-								<reference key="NSNextKeyView"/>
-								<string key="NSReuseIdentifierKey">_NS:9</string>
-								<bool key="IBUIOpaque">NO</bool>
-								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<int key="IBSegmentControlStyle">2</int>
-								<int key="IBNumberOfSegments">2</int>
-								<int key="IBSelectedSegmentIndex">0</int>
-								<object class="NSArray" key="IBSegmentTitles">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<string>A-Z</string>
-									<string>Z-A</string>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentWidths">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<real value="0.0"/>
-									<real value="0.0"/>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentEnabledStates">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<boolean value="YES"/>
-									<boolean value="YES"/>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentContentOffsets">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<string>{0, 0}</string>
-									<string>{0, 0}</string>
-								</object>
-								<object class="NSMutableArray" key="IBSegmentImages">
-									<bool key="EncodedWithXMLCoder">YES</bool>
-									<reference ref="4"/>
-									<reference ref="4"/>
-								</object>
-							</object>
-						</object>
 						<string key="NSFrame">{{0, 416}, {320, 44}}</string>
 						<reference key="NSSuperview" ref="228054471"/>
-						<reference key="NSNextKeyView" ref="441166131"/>
+						<reference key="NSNextKeyView"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
 						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -145,9 +65,11 @@
 								<reference key="IBUIToolbar" ref="599029925"/>
 								<int key="IBUISystemItemIdentifier">5</int>
 							</object>
-							<object class="IBUIBarButtonItem" id="930671930">
+							<object class="IBUIBarButtonItem" id="130206227">
+								<string key="IBUITitle">name</string>
 								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<reference key="IBUICustomView" ref="441166131"/>
+								<float key="IBUIWidth">80</float>
+								<int key="IBUIStyle">1</int>
 								<reference key="IBUIToolbar" ref="599029925"/>
 							</object>
 							<object class="IBUIBarButtonItem" id="256942227">
@@ -155,9 +77,11 @@
 								<reference key="IBUIToolbar" ref="599029925"/>
 								<int key="IBUISystemItemIdentifier">5</int>
 							</object>
-							<object class="IBUIBarButtonItem" id="92279294">
+							<object class="IBUIBarButtonItem" id="52008472">
+								<string key="IBUITitle">A-Z</string>
 								<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
-								<reference key="IBUICustomView" ref="105773647"/>
+								<float key="IBUIWidth">80</float>
+								<int key="IBUIStyle">1</int>
 								<reference key="IBUIToolbar" ref="599029925"/>
 							</object>
 							<object class="IBUIBarButtonItem" id="819503578">
@@ -280,19 +204,19 @@
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">sortDirectionSegmentedControl</string>
+						<string key="label">sortDirectionButton</string>
 						<reference key="source" ref="372490531"/>
-						<reference key="destination" ref="105773647"/>
+						<reference key="destination" ref="52008472"/>
 					</object>
-					<int key="connectionID">51</int>
+					<int key="connectionID">60</int>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchOutletConnection" key="connection">
-						<string key="label">sortTypeSegmentedControl</string>
+						<string key="label">sortTypeButton</string>
 						<reference key="source" ref="372490531"/>
-						<reference key="destination" ref="441166131"/>
+						<reference key="destination" ref="130206227"/>
 					</object>
-					<int key="connectionID">52</int>
+					<int key="connectionID">61</int>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchOutletConnection" key="connection">
@@ -376,21 +300,19 @@
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">sortTypePressed:</string>
-						<reference key="source" ref="441166131"/>
+						<string key="label">toggleSortType:</string>
+						<reference key="source" ref="130206227"/>
 						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">13</int>
 					</object>
-					<int key="connectionID">53</int>
+					<int key="connectionID">59</int>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBCocoaTouchEventConnection" key="connection">
-						<string key="label">sortDirectionPressed:</string>
-						<reference key="source" ref="105773647"/>
+						<string key="label">toggleSortDirection:</string>
+						<reference key="source" ref="52008472"/>
 						<reference key="destination" ref="372490531"/>
-						<int key="IBEventType">13</int>
 					</object>
-					<int key="connectionID">54</int>
+					<int key="connectionID">62</int>
 				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
@@ -442,10 +364,10 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="187093173"/>
 							<reference ref="133076782"/>
-							<reference ref="92279294"/>
 							<reference ref="256942227"/>
 							<reference ref="819503578"/>
-							<reference ref="930671930"/>
+							<reference ref="130206227"/>
+							<reference ref="52008472"/>
 						</object>
 						<reference key="parent" ref="228054471"/>
 					</object>
@@ -476,15 +398,6 @@
 						<reference key="parent" ref="228054471"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">44</int>
-						<reference key="object" ref="92279294"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="105773647"/>
-						</object>
-						<reference key="parent" ref="599029925"/>
-					</object>
-					<object class="IBObjectRecord">
 						<int key="objectID">46</int>
 						<reference key="object" ref="256942227"/>
 						<reference key="parent" ref="599029925"/>
@@ -495,23 +408,14 @@
 						<reference key="parent" ref="599029925"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">48</int>
-						<reference key="object" ref="930671930"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="441166131"/>
-						</object>
+						<int key="objectID">55</int>
+						<reference key="object" ref="130206227"/>
 						<reference key="parent" ref="599029925"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">49</int>
-						<reference key="object" ref="441166131"/>
-						<reference key="parent" ref="930671930"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">50</int>
-						<reference key="object" ref="105773647"/>
-						<reference key="parent" ref="92279294"/>
+						<int key="objectID">56</int>
+						<reference key="object" ref="52008472"/>
+						<reference key="parent" ref="599029925"/>
 					</object>
 				</object>
 			</object>
@@ -529,14 +433,10 @@
 					<string>24.IBPluginDependency</string>
 					<string>31.IBPluginDependency</string>
 					<string>32.IBPluginDependency</string>
-					<string>44.IBPluginDependency</string>
 					<string>46.IBPluginDependency</string>
 					<string>47.IBPluginDependency</string>
-					<string>48.IBPluginDependency</string>
-					<string>49.IBPluginDependency</string>
-					<string>49.IUISegmentedControlInspectorSelectedSegmentMetadataKey</string>
-					<string>50.IBPluginDependency</string>
-					<string>50.IUISegmentedControlInspectorSelectedSegmentMetadataKey</string>
+					<string>55.IBPluginDependency</string>
+					<string>56.IBPluginDependency</string>
 					<string>9.CustomClassName</string>
 					<string>9.IBPluginDependency</string>
 				</object>
@@ -556,10 +456,6 @@
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<integer value="0"/>
-					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<integer value="0"/>
 					<string>FolderView</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 				</object>
@@ -576,7 +472,7 @@
 				<reference key="dict.values" ref="0"/>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">54</int>
+			<int key="maxID">62</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes"/>
 		<int key="IBDocument.localizationMode">0</int>
