Jens Alfke avatar Jens Alfke committed 5e03064

Add Enter as a key equivalent to the Commit button in the sheet.
Also fixed a bug in error handling in Localize.py.

Comments (0)

Files changed (5)

English.lproj/Repo.xib

 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="300083"/>
 			<integer value="3"/>
-			<integer value="300117"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 																		<object class="NSTextView" id="1057217485">
 																			<reference key="NSNextResponder" ref="378280175"/>
 																			<int key="NSvFlags">2322</int>
-																			<string key="NSFrame">{{0, -14}, {0.001, 14}}</string>
+																			<string key="NSFrameSize">{0.001, 12}</string>
 																			<reference key="NSSuperview" ref="378280175"/>
 																			<object class="NSTextContainer" key="NSTextContainer" id="178117438">
 																				<object class="NSLayoutManager" key="NSLayoutManager">
 				<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
 				<string key="NSWindowContentMinSize">{300, 124}</string>
 				<object class="NSView" key="NSWindowView" id="601455988">
-					<nil key="NSNextResponder"/>
+					<reference key="NSNextResponder"/>
 					<int key="NSvFlags">256</int>
 					<object class="NSMutableArray" key="NSSubviews">
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						</object>
 					</object>
 					<string key="NSFrameSize">{408, 208}</string>
+					<reference key="NSSuperview"/>
 				</object>
 				<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
 				<string key="NSMinSize">{300, 146}</string>
 					</object>
 					<int key="connectionID">300410</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">_commitButton</string>
+						<reference key="source" ref="798535885"/>
+						<reference key="destination" ref="495508749"/>
+					</object>
+					<int key="connectionID">300411</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">delegate</string>
+						<reference key="source" ref="925909873"/>
+						<reference key="destination" ref="798535885"/>
+					</object>
+					<int key="connectionID">300412</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>{{162, 313}, {800, 488}}</string>
+					<string>{{92, 313}, {800, 488}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{162, 313}, {800, 488}}</string>
+					<string>{{92, 313}, {800, 488}}</string>
 					<integer value="1"/>
 					<string>{{166, 135}, {586, 488}}</string>
 					<boolean value="YES"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{439, 595}, {408, 208}}</string>
+					<string>{{404, 595}, {408, 208}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{439, 595}, {408, 208}}</string>
+					<string>{{404, 595}, {408, 208}}</string>
 					<integer value="0"/>
 					<string>{{300, 252}, {408, 208}}</string>
 					<boolean value="YES"/>
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">300410</int>
+			<int key="maxID">300412</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						<object class="NSArray" key="dict.sortedKeys">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>_commitButton</string>
 							<string>_commitMessageField</string>
 							<string>_commitSheet</string>
 							<string>_hideShowUnmodifiedToolbarItem</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSButton</string>
 							<string>NSTextView</string>
 							<string>NSPanel</string>
 							<string>NSSegmentedControl</string>
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						<object class="NSArray" key="dict.sortedKeys">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>_commitButton</string>
 							<string>_commitMessageField</string>
 							<string>_commitSheet</string>
 							<string>_hideShowUnmodifiedToolbarItem</string>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<object class="IBToOneOutletInfo">
+								<string key="name">_commitButton</string>
+								<string key="candidateClassName">NSButton</string>
+							</object>
+							<object class="IBToOneOutletInfo">
 								<string key="name">_commitMessageField</string>
 								<string key="candidateClassName">NSTextView</string>
 							</object>
     "English.lproj/FileViewer.xib": "89b3ce19501369084592522616927d3e", 
     "English.lproj/MainMenu.xib": "481b5b20475f1aedcf89bfc408754937", 
     "English.lproj/Projects.xib": "770fab372e314ce3a66f4c501d11d8ee", 
-    "English.lproj/Repo.xib": "7a0adf65bdfee839d000f06e6fabae67", 
+    "English.lproj/Repo.xib": "22ec2f7574365381f41d796e0ba0b439", 
     "French.lproj/FileViewer.strings": "3180f066f393da424f8f32f60384cedf", 
     "French.lproj/MainMenu.strings": "d54b312e76454c8742206c78acb4a7e8", 
     "French.lproj/Projects.strings": "7f3632a7668f39432d8dbf4ffb770f55", 
     proc = subprocess.Popen(commandAndArgs, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     stdout, stderr = proc.communicate()
     if stderr != '':
-        raise LocalizationError(commandAndArgs, stderr)
+        raise LocalizationError(commandAndArgs + ' : ' + stderr)
     return stdout
  
 def md5(file):

Source/RepoController.h

     
     IBOutlet NSPanel *_commitSheet;
     IBOutlet NSTextView *_commitMessageField;
+    IBOutlet NSButton *_commitButton;
     
     IBOutlet NSPanel *_pushSheet;
     IBOutlet NSComboBox *_pushURLField;

Source/RepoController_Actions.m

     [other showWindow: self];
 }
 
+// if the user pressed the [ENTER] key, do like Version.app does and commit (i.e. simulate pressing "Commit" button)
+- (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)aSelector
+{
+    if (aTextView != _commitMessageField)
+        return NO;
+    
+    NSEvent *event = [[aTextView window] currentEvent];
+    if ([event keyCode] == 76) // enter key pressed
+    {
+        [[_commitButton target] performSelector:[_commitButton action] withObject:_commitButton];
+        return YES;
+    }
+    return NO;
+}
 
 #pragma mark -
 #pragma mark ADD / REMOVE / DISCARD:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.