Commits

Jens Alfke committed 93aa839

When a revision is selected, switch info pane to show revision log. And when a file is selected, switch to showing the diff (if the revision log was showing.)

  • Participants
  • Parent commits f4c0ef6

Comments (0)

Files changed (4)

English.lproj/Repo.xib

 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="1"/>
+			<integer value="3"/>
 			<integer value="300117"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 					</object>
 					<int key="connectionID">300408</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">revisionTableAction:</string>
+						<reference key="source" ref="798535885"/>
+						<reference key="destination" ref="392325734"/>
+					</object>
+					<int key="connectionID">300409</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">fileTableAction:</string>
+						<reference key="source" ref="798535885"/>
+						<reference key="destination" ref="408726427"/>
+					</object>
+					<int key="connectionID">300410</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<integer value="1"/>
-					<string>{{54, 313}, {800, 488}}</string>
+					<string>{{162, 313}, {800, 488}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{54, 313}, {800, 488}}</string>
+					<string>{{162, 313}, {800, 488}}</string>
 					<integer value="1"/>
 					<string>{{166, 135}, {586, 488}}</string>
 					<boolean value="YES"/>
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">300408</int>
+			<int key="maxID">300410</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 							<string>commitChanges:</string>
 							<string>discardChanges:</string>
 							<string>endCommitSheet:</string>
+							<string>fileTableAction:</string>
 							<string>infoChooserChanged:</string>
 							<string>markResolved:</string>
 							<string>merge:</string>
 							<string>remergeFiles:</string>
 							<string>removeFromRepository:</string>
 							<string>revealInFinder:</string>
+							<string>revisionTableAction:</string>
 							<string>showComparison:</string>
 							<string>showDiff:</string>
 							<string>showRevision:</string>
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
+							<string>id</string>
+							<string>id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
 							<string>commitChanges:</string>
 							<string>discardChanges:</string>
 							<string>endCommitSheet:</string>
+							<string>fileTableAction:</string>
 							<string>infoChooserChanged:</string>
 							<string>markResolved:</string>
 							<string>merge:</string>
 							<string>remergeFiles:</string>
 							<string>removeFromRepository:</string>
 							<string>revealInFinder:</string>
+							<string>revisionTableAction:</string>
 							<string>showComparison:</string>
 							<string>showDiff:</string>
 							<string>showRevision:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 							<object class="IBActionInfo">
+								<string key="name">fileTableAction:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
 								<string key="name">infoChooserChanged:</string>
 								<string key="candidateClassName">id</string>
 							</object>
 								<string key="candidateClassName">id</string>
 							</object>
 							<object class="IBActionInfo">
+								<string key="name">revisionTableAction:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
 								<string key="name">showComparison:</string>
 								<string key="candidateClassName">id</string>
 							</object>
     "English.lproj/FileViewer.xib": "89b3ce19501369084592522616927d3e", 
     "English.lproj/MainMenu.xib": "481b5b20475f1aedcf89bfc408754937", 
     "English.lproj/Projects.xib": "770fab372e314ce3a66f4c501d11d8ee", 
-    "English.lproj/Repo.xib": "1e2e2fb3346b88ab5cff231ba51d9549", 
+    "English.lproj/Repo.xib": "7a0adf65bdfee839d000f06e6fabae67", 
     "French.lproj/FileViewer.strings": "3180f066f393da424f8f32f60384cedf", 
     "French.lproj/MainMenu.strings": "d54b312e76454c8742206c78acb4a7e8", 
     "French.lproj/Projects.strings": "7f3632a7668f39432d8dbf4ffb770f55", 

Source/RepoController.h

 - (void) setValue: (id)value forSetting: (NSString*)setting;
 - (void) saveSettings;
 
+- (IBAction) revisionTableAction: (id)sender;
+- (IBAction) fileTableAction: (id)sender;
 - (IBAction) infoChooserChanged: (id)sender;
 
 // internal:

Source/RepoController.m

 };
 
 
+// Table-view action for the revision list; called when a row is clicked.
+- (IBAction) revisionTableAction: (id)sender {
+    if (_infoChooser.selectedSegment != kInfoLogSegment) {
+        _infoChooser.selectedSegment = kInfoLogSegment;
+        [self _updateInfoView];
+    }
+}
+
+// Table-view action for the file list; called when a row is clicked.
+- (IBAction) fileTableAction: (id)sender {
+    if (_infoChooser.selectedSegment == kInfoLogSegment) {
+        _infoChooser.selectedSegment = kInfoDiffSegment;
+        [self _updateInfoView];
+    }
+}
+
+
 - (void) _updateInfoChooser {
     BOOL hasRev = self.selectedRevision != nil;
     BOOL hasFile = self.selectedFile.isFile;