Permalink
Browse files

More li'l bug fixes in preparation for 2.2 release

- Fixed "Use Selection for Find"
- Adjusted the NoteTable Overlay scroller position to not overlap the
date when using horizontal layout
- cmd-shift-return now inserts a new line before the current paragraph
when editing a note
  • Loading branch information...
elasticthreads committed Feb 24, 2012
1 parent eae5135 commit 78a325b570d9dd7c5a71e993faf08d6e45e7fa00
Showing with 112 additions and 481 deletions.
  1. +3 −0 AppController_Importing.m
  2. +2 −2 ETOverlayScroller.m
  3. +28 −453 English.lproj/MainMenu.xib
  4. +1 −1 Info.plist
  5. +1 −0 LinkingEditor.h
  6. +50 −16 LinkingEditor.m
  7. +2 −2 UnifiedCell.m
  8. +25 −7 zh.lproj/MainMenu.xib
@@ -151,6 +151,9 @@ - (BOOL)addNotesFromPasteboard:(NSPasteboard*)pasteboard {
}
- (BOOL)interpretNVURL:(NSURL*)aURL {
+
+// NSLog(@"interpret URL:|||%@|||",[aURL absoluteString]);
+
// currently supported:
// hostname -> command
// first level -> search term / title
View
@@ -18,8 +18,8 @@ + (BOOL)isCompatibleWithOverlayScrollers {
- (id)initWithFrame:(NSRect)frameRect{
if ((self=[super initWithFrame:frameRect])) {
-// verticalPaddingLeft = 4.0f;
-// verticalPaddingRight = 2.75f;
+ verticalPaddingLeft = 5.25f;
+ verticalPaddingRight = 1.5f;
knobAlpha=0.7f;
slotAlpha=0.55f;
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -159,7 +159,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
- <string>91</string>
+ <string>92</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSArchitecturePriority</key>
View
@@ -113,6 +113,7 @@
- (void)hideTextFinderIfNecessary:(NSNotification *)aNotification;
- (IBAction)pasteMarkdownLink:(id)sender;
- (BOOL)clipboardHasLink;
+- (IBAction)toggleLayoutOrientation:(id)sender;
#endif
//
@end
View
@@ -947,9 +947,14 @@ - (void)keyDown:(NSEvent*)anEvent {
//maybe it works on someone else's 10.3 Mac
[self doCommandBySelector:@selector(insertBacktab:)];
return;
- }else if (([anEvent keyCode]==36)&&([anEvent modifierFlags]&NSCommandKeyMask)&&(!(([anEvent modifierFlags]&NSControlKeyMask)||([anEvent modifierFlags]&NSAlternateKeyMask)||([anEvent modifierFlags]&NSShiftKeyMask)))) {
- [self moveToEndOfParagraph:self];
- [self insertNewlineIgnoringFieldEditor:self];
+ }else if (([anEvent keyCode]==36)&&([anEvent modifierFlags]&NSCommandKeyMask)&&(!(([anEvent modifierFlags]&NSControlKeyMask)||([anEvent modifierFlags]&NSAlternateKeyMask)))) {
+ if ([anEvent modifierFlags]&NSShiftKeyMask) {
+ [self moveToBeginningOfParagraph:self];
+ [self moveBackward:self];
+ }else{
+ [self moveToEndOfParagraph:self];
+ }
+ [self insertNewlineIgnoringFieldEditor:self];
return;
}
//[super interpretKeyEvents:[NSArray arrayWithObject:anEvent]];
@@ -1356,17 +1361,24 @@ - (BOOL)validateMenuItem:(NSMenuItem*)menuItem {
//for ElasticThreads Find... fix. Also make sure all Find menuItems point their targets to LinkingEditor instead of firstResponder
//hide Find and Replace... on Pre-Lion machines
- if (!IsLionOrLater&&([menuItem tag]==12)) {
+ if (!IsLionOrLater){
+ if([menuItem tag]==12) {
[menuItem setHidden:YES];
return NO;
+ }
+ }else{
+ if ([menuItem tag]==7) {
+ if (![textFinder validateAction:[menuItem tag]]) {
+ return NO;
+ }
+ }
}
return YES;
}else if (action==@selector(pasteMarkdownLink:)) {
// if ([[NSUserDefaults standardUserDefaults]boolForKey:@"UsesMarkdownCompletions"]) {
// [menuItem setHidden:NO];
- if ([self clipboardHasLink]) {
-
+ if ([self clipboardHasLink]) {
return YES;
}
@@ -1423,6 +1435,7 @@ - (id)highlightLinkAtIndex:(unsigned)givenIndex {
- (void)clickedOnLink:(id)aLink atIndex:(NSUInteger)charIndex {
NSEvent *currentEvent = [[self window] currentEvent];
+// NSLog(@"clicked:%@",[currentEvent description]);
if (![prefsController URLsAreClickable] && [currentEvent modifierFlags] & NSCommandKeyMask) {
@@ -1435,6 +1448,15 @@ - (void)clickedOnLink:(id)aLink atIndex:(NSUInteger)charIndex {
}
if ([aLink isKindOfClass:[NSURL class]] && [[aLink scheme] isEqualToString:@"nv"]) {
+ if (([currentEvent type]==10)&&((([currentEvent modifierFlags] & NSAlternateKeyMask)&&([currentEvent modifierFlags] & NSCommandKeyMask))&&!(([currentEvent modifierFlags] & NSControlKeyMask)))) {
+ NSString *newURLString=[[aLink lastPathComponent]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ NSString *txtString=[[NSString stringWithFormat:@"[[%@]]",[aLink lastPathComponent]] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ newURLString=[NSString stringWithFormat:@"nv://make/?title=%@&txt=%@",newURLString,txtString];
+// NSLog(@"newurlstring:%@",newURLString);
+ NSURL *newURL=[NSURL URLWithString:newURLString];
+// NSLog(@"interpret from cmd-keydown OLD URL:||%@|| AND NEW URL:|%@|",[aLink absoluteString],[newURL absoluteString]);
+ aLink=newURL;
+ }
[[NSApp delegate] interpretNVURL:aLink];
} else {
[super clickedOnLink:aLink atIndex:charIndex];
@@ -1875,7 +1897,7 @@ - (IBAction)insertLink:(id)sender{
NSRange selRange = [self selectedRange];
if (selRange.length>0) {
NSString *selString = [[self string] substringWithRange:selRange];
- selString = [NSString stringWithFormat:@"%@%@%@",@"[[",selString,@"]]"];
+ selString = [NSString stringWithFormat:@"[[%@]]",selString];
[super insertText:selString];
}else{
@@ -2057,7 +2079,6 @@ - (BOOL)clipboardHasLink{
}
}
}
-
return NO;
}
@@ -2258,9 +2279,9 @@ - (IBAction)performFindPanelAction:(id)sender {
return;
NSInteger findTag=[sender tag];
+
[sender setTarget:self];
if(!IsLionOrLater||([sender tag]!=7)){
-
NSString *pbType;
if (IsSnowLeopardOrLater) {
pbType=NSPasteboardTypeString;
@@ -2282,15 +2303,19 @@ - (IBAction)performFindPanelAction:(id)sender {
[lastImportedFindString release];
lastImportedFindString = [typedString retain];
}
+
+// NSLog(@"aqui typedSTring:|%@|",typedString);
}
if ([[self window] firstResponder]!=self) {
[[self window]makeFirstResponder:self];
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (IsLionOrLater) {
+
+ id newSender=[sender copy];
if((findTag!=1)&&(findTag!=12)&&(findTag!=7)&&(![self textFinderIsVisible])){
- [sender setTag:NSTextFinderActionShowFindInterface];
- [super performTextFinderAction:sender];
+ [newSender setTag:NSTextFinderActionShowFindInterface];
+ [super performTextFinderAction:newSender];
}
if (findTag==1) {
findTag=NSTextFinderActionShowFindInterface;
@@ -2305,25 +2330,27 @@ - (IBAction)performFindPanelAction:(id)sender {
}else if (findTag==6) {
findTag=NSTextFinderActionReplaceAndFind;
}else if (findTag==7) {
+// NSLog(@"aqui2");
findTag=(NSTextFinderActionSetSearchString);
}else if (findTag==9) {
findTag=NSTextFinderActionSelectAll;
}else if (findTag==12) {
findTag=NSTextFinderActionShowReplaceInterface;
}//NSTextFinderActionSelectAll = 9,
- [sender setTag:findTag];
+ [newSender setTag:findTag];
if ([textFinder validateAction:findTag]) {
- [super performTextFinderAction:sender];
+ [super performTextFinderAction:newSender];
if ((findTag==NSTextFinderActionSetSearchString)&&(![self textFinderIsVisible])) {
- [sender setTag:NSTextFinderActionShowFindInterface];
- [super performTextFinderAction:sender];
+ [newSender setTag:NSTextFinderActionShowFindInterface];
+ [super performTextFinderAction:newSender];
}
- [textFinder setFindIndicatorNeedsUpdate:YES];
+// [textFinder setFindIndicatorNeedsUpdate:YES];
}else{
NSLog(@"find action was invalid");
}
+ [newSender release];
return;
}
#endif
@@ -2340,4 +2367,11 @@ - (IBAction)performFindPanelAction:(id)sender {
[super performFindPanelAction:sender];
}
+- (IBAction)toggleLayoutOrientation:(id)sender {
+ /*not ready yet. lots of display bugs. no horizontal scrollers... need to make SELF horizontally scrollable and switch to default scrollers or add ETTRANSPARENTHORIZONTAL BOYS. ALSO preference, binding, tag switching, etc.*/
+
+// [super changeLayoutOrientation:sender];
+
+}
+
@end
View
@@ -82,7 +82,7 @@ - (float)tableFontFrameHeight {
- (NSRect)nv_titleRectForFrame:(NSRect)aFrame {
//fixed based on width of the cell
- //height could justifiably vary based on wrapped height of title string
+ //height could justifiably vary based on wrapped height of title string-9.0
return NSMakeRect(aFrame.origin.x, aFrame.origin.y, aFrame.size.width, [self tableFontFrameHeight]);
}
@@ -203,7 +203,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
}
NSString *dateStr = (showDateCreated ? dateCreatedStringOfNote : dateModifiedStringOfNote)(tv, noteObject, NSNotFound);
- [dateStr drawInRect:NSMakeRect(NSMaxX(cellFrame) - 67.0, NSMinY(cellFrame), 70.0, fontHeight) withAttributes:baseAttrs];
+ [dateStr drawInRect:NSMakeRect(NSMaxX(cellFrame) - 76.0, NSMinY(cellFrame), 70.0, fontHeight) withAttributes:baseAttrs];
}
if (ColumnIsSet(NoteLabelsColumn, columnsBitmap) && [labelsOfNote(noteObject) length]) {
View
@@ -66,6 +66,7 @@
<string key="NSFrameSize">{397, 464}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{213, 129}</string>
@@ -1462,6 +1463,7 @@
<string key="NSFrame">{{206, 6}, {145, 14}}</string>
<reference key="NSSuperview" ref="638000589"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTokenFieldCell" key="NSCell" id="283957023">
<int key="NSCellFlags">67239424</int>
@@ -1946,7 +1948,7 @@
<bool key="NSSharedInstance">YES</bool>
</object>
<object class="NSScrollView" id="26511639">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="572834572">
@@ -1977,7 +1979,8 @@
</set>
<string key="NSFrameSize">{399, 14}</string>
<reference key="NSSuperview" ref="572834572"/>
- <reference key="NSNextKeyView" ref="965568530"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="540470833"/>
<object class="NSTextContainer" key="NSTextContainer" id="721568932">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
@@ -2035,6 +2038,7 @@
</array>
<string key="NSFrameSize">{399, 304}</string>
<reference key="NSSuperview" ref="26511639"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="633888970"/>
<reference key="NSDocView" ref="633888970"/>
<object class="NSColor" key="NSBGColor">
@@ -2071,6 +2075,8 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<int key="NSvFlags">-2147479296</int>
<string key="NSFrame">{{384, 0}, {15, 304}}</string>
<reference key="NSSuperview" ref="26511639"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<int key="NSArrowsLoc">2</int>
<reference key="NSTarget" ref="26511639"/>
<string key="NSAction">_doScroller:</string>
@@ -2081,6 +2087,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<int key="NSvFlags">-2147479296</int>
<string key="NSFrame">{{-100, -100}, {384, 15}}</string>
<reference key="NSSuperview" ref="26511639"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="572834572"/>
<int key="NSsFlags">1</int>
<int key="NSArrowsLoc">2</int>
@@ -2091,14 +2098,16 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
</object>
</array>
<string key="NSFrameSize">{399, 304}</string>
- <reference key="NSNextKeyView" ref="572834572"/>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="965568530"/>
<int key="NSsFlags">133648</int>
<reference key="NSVScroller" ref="540470833"/>
<reference key="NSHScroller" ref="965568530"/>
<reference key="NSContentView" ref="572834572"/>
</object>
<object class="NSScrollView" id="1012988132">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="313519754">
@@ -2110,13 +2119,15 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{399, 136}</string>
<reference key="NSSuperview" ref="313519754"/>
- <reference key="NSNextKeyView" ref="902416422"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="64005823"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="379318512">
<reference key="NSNextResponder" ref="643799251"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{399, 17}</string>
<reference key="NSSuperview" ref="643799251"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="313519754"/>
<reference key="NSTableView" ref="1037522481"/>
</object>
@@ -2153,6 +2164,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
</array>
<string key="NSFrame">{{0, 17}, {399, 136}}</string>
<reference key="NSSuperview" ref="1012988132"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1037522481"/>
<reference key="NSDocView" ref="1037522481"/>
<object class="NSColor" key="NSBGColor" id="770513632">
@@ -2167,6 +2179,8 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{384, 17}, {15, 136}}</string>
<reference key="NSSuperview" ref="1012988132"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<int key="NSArrowsLoc">2</int>
<reference key="NSTarget" ref="1012988132"/>
<string key="NSAction">_doScroller:</string>
@@ -2177,6 +2191,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {382, 15}}</string>
<reference key="NSSuperview" ref="1012988132"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="643799251"/>
<int key="NSsFlags">1</int>
<int key="NSArrowsLoc">2</int>
@@ -2192,14 +2207,17 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
</array>
<string key="NSFrameSize">{399, 17}</string>
<reference key="NSSuperview" ref="1012988132"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="379318512"/>
<reference key="NSDocView" ref="379318512"/>
<reference key="NSBGColor" ref="770513632"/>
<int key="NScvFlags">4</int>
</object>
</array>
<string key="NSFrameSize">{399, 153}</string>
- <reference key="NSNextKeyView" ref="313519754"/>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="902416422"/>
<int key="NSsFlags">133648</int>
<reference key="NSVScroller" ref="64005823"/>
<reference key="NSHScroller" ref="902416422"/>
@@ -4936,7 +4954,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">1331</int>
+ <int key="maxID">1422</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">

0 comments on commit 78a325b

Please sign in to comment.