Permalink
Browse files

few more fixes for multi tagging

  • Loading branch information...
1 parent a92dbf4 commit 3bf00d6e0489065b9b8ae8d26e7981dddd4d3303 @elasticthreads elasticthreads committed May 3, 2013
View
@@ -945,7 +945,12 @@ - (IBAction)tagNote:(id)sender {
if ([selIndexes count] > 1) {
NSRect linkingFrame=[textScrollView convertRect:[textScrollView frame] toView:nil];
- linkingFrame=[window convertRectToScreen:linkingFrame];
+
+ if (IsLionOrLater) {
+ linkingFrame=[window convertRectToScreen:linkingFrame];
+ }else{
+ linkingFrame.origin=[window convertBaseToScreen:linkingFrame.origin];
+ }
NSPoint cPoint=NSMakePoint(NSMidX(linkingFrame), NSMaxY(linkingFrame));
//Multiple Notes selected, use ElasticThreads' multitagging implementation
@@ -1429,7 +1434,7 @@ - (void)controlTextDidChange:(NSNotification *)aNotification {
isAutocompleting = YES;
NSTextView *editor = [tagEditor tagFieldEditor];
NSRange selRange = [editor selectedRange];
- NSString *tagString = [tagEditor newMultinoteLabels];
+ NSString *tagString = [NSString stringWithString:tagEditor.tagFieldString];
NSString *searchString = tagString;
if (selRange.length>0) {
searchString = [searchString substringWithRange:selRange];
@@ -2402,7 +2407,7 @@ - (NSArray *)commonLabelsForNotesAtIndexes:(NSIndexSet *)selDexes{
}
- (IBAction)multiTag:(id)sender {
- NSString *tagString = [[tagEditor newMultinoteLabels] stringByTrimmingCharactersInSet:[NSCharacterSet labelSeparatorCharacterSet]];
+ NSString *tagString = [tagEditor.tagFieldString stringByTrimmingCharactersInSet:[NSCharacterSet labelSeparatorCharacterSet]];
NSArray *newTags;
if (tagString&&(tagString.length>0)) {
newTags=[tagString labelCompatibleWords];
@@ -37,25 +37,24 @@
<object class="NSWindowTemplate" id="387290972">
<int key="NSWindowStyleMask">8219</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{122, 324}, {322, 55}}</string>
+ <string key="NSWindowRect">{{122, 324}, {324, 53}}</string>
<int key="NSWTFlags">-1535638528</int>
<string key="NSWindowTitle">Modify or Add Tags to Selected Notes:</string>
<string key="NSWindowClass">NSPanel</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
- <string key="NSWindowContentMaxSize">{2000, 55}</string>
- <string key="NSWindowContentMinSize">{150, 55}</string>
+ <string key="NSWindowContentMaxSize">{2000, 53}</string>
+ <string key="NSWindowContentMinSize">{150, 53}</string>
<object class="NSView" key="NSWindowView" id="716340357">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="914473982">
<reference key="NSNextResponder" ref="716340357"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{20, 20}, {282, 22}}</string>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{13, 19}, {298, 22}}</string>
<reference key="NSSuperview" ref="716340357"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="746859396">
<int key="NSCellFlags">-1804599231</int>
@@ -90,14 +89,14 @@
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
- <string key="NSFrameSize">{322, 55}</string>
+ <string key="NSFrameSize">{324, 53}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="914473982"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
- <string key="NSMinSize">{150, 74}</string>
- <string key="NSMaxSize">{2000, 74}</string>
+ <string key="NSMinSize">{150, 72}</string>
+ <string key="NSMaxSize">{2000, 72}</string>
<bool key="NSWindowIsRestorable">NO</bool>
</object>
</array>
@@ -135,6 +134,26 @@
</object>
<int key="connectionID">436</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: tagFieldString</string>
+ <reference key="source" ref="914473982"/>
+ <reference key="destination" ref="515108334"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="914473982"/>
+ <reference key="NSDestination" ref="515108334"/>
+ <string key="NSLabel">value: tagFieldString</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">tagFieldString</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSContinuouslyUpdatesValue</string>
+ <boolean value="YES" key="NS.object.0"/>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">438</int>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -208,7 +227,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">436</int>
+ <int key="maxID">438</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -584,6 +584,11 @@
5C1830D3132EA6A4005E2210 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/SaveHTMLPreview.nib; sourceTree = "<group>"; };
5C1830D4132EA6A4005E2210 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SaveHTMLPreview.nib; sourceTree = "<group>"; };
5C1830D5132EA6A4005E2210 /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/SaveHTMLPreview.nib; sourceTree = "<group>"; };
+ 5C1D1CE217344B2200139AFE /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
+ 5C1D1CE317344B6600139AFE /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
+ 5C1D1CE417344BDC00139AFE /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
+ 5C1D1CE517344C1200139AFE /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
+ 5C1D1CE617344C3200139AFE /* zh */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh; path = zh.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
5C2CC183134989A8006FFE56 /* nvMenuC.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = nvMenuC.png; path = Images/nvMenuC.png; sourceTree = "<group>"; };
5C2CC189134989D7006FFE56 /* nvMenuDark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = nvMenuDark.png; path = Images/nvMenuDark.png; sourceTree = "<group>"; };
5C2CD035132ED47900CA0D7C /* ETScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETScrollView.h; sourceTree = "<group>"; };
@@ -690,7 +695,6 @@
5CDBA8F413A5492700E7494E /* zh */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh; path = zh.lproj/MarkupPreview.xib; sourceTree = "<group>"; };
5CDBA8F613A5493100E7494E /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = it; path = it.lproj/SaveHTMLPreview.nib; sourceTree = "<group>"; };
5CDBA8F713A5493100E7494E /* zh */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh; path = zh.lproj/SaveHTMLPreview.nib; sourceTree = "<group>"; };
- 5CDBA8F813A5493900E7494E /* zh */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh; path = zh.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
5CE5B0091422795300FB554C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PTKeyComboPanel.xib; sourceTree = "<group>"; };
5CE5B00C1422796900FB554C /* zh */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh; path = zh.lproj/PTKeyComboPanel.xib; sourceTree = "<group>"; };
5CE5B00D1422796900FB554C /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/PTKeyComboPanel.xib; sourceTree = "<group>"; };
@@ -772,11 +776,7 @@
5CF96D84132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/Preferences.xib; sourceTree = "<group>"; };
5CF96D8A132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/SavedSearches.nib; sourceTree = "<group>"; };
5CF96D90132EA29D0079B3FD /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/URLGetter.nib; sourceTree = "<group>"; };
- 5CFC3A4E13327EF9000B4792 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
- 5CFC3A4F13327EF9000B4792 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
- 5CFC3A5013327EF9000B4792 /* pt */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt; path = pt.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
5CFF810713A52EE2008A93A3 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/MainMenu.xib; sourceTree = "<group>"; };
- 5CFF810813A53625008A93A3 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/TagEditingManager.xib; sourceTree = "<group>"; };
5CFF810913A536F7008A93A3 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/Preferences.xib; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* nvALT.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = nvALT.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2075,11 +2075,11 @@
isa = PBXVariantGroup;
children = (
5CBA7A901305E2DF004ADEBB /* English */,
- 5CFC3A4E13327EF9000B4792 /* de */,
- 5CFC3A4F13327EF9000B4792 /* fr */,
- 5CFC3A5013327EF9000B4792 /* pt */,
- 5CFF810813A53625008A93A3 /* it */,
- 5CDBA8F813A5493900E7494E /* zh */,
+ 5C1D1CE217344B2200139AFE /* de */,
+ 5C1D1CE317344B6600139AFE /* fr */,
+ 5C1D1CE417344BDC00139AFE /* pt */,
+ 5C1D1CE517344C1200139AFE /* it */,
+ 5C1D1CE617344C3200139AFE /* zh */,
);
name = TagEditingManager.xib;
sourceTree = "<group>";
View
@@ -8,18 +8,19 @@
#import <Cocoa/Cocoa.h>
-@interface TagEditingManager : NSObject {
+@interface TagEditingManager : NSObject <NSWindowDelegate> {
IBOutlet NSPanel *tagPanel;
IBOutlet NSTextField *tagField;
BOOL isHappening;
+ NSString *tagFieldString;
NSArray *commonTags;
}
@property(retain,nonatomic)NSArray *commonTags;
+@property(retain)NSString *tagFieldString;
- (id)initWithDelegate:(id)del commonTags:(NSArray *)cTags atPoint:(NSPoint)centerpoint;
-- (NSString *)newMultinoteLabels;
- (void)setTF:(NSString *)inString;
- (void)closeTP:(id)sender;
- (NSTextView *)tagFieldEditor;
View
@@ -12,6 +12,7 @@
@implementation TagEditingManager
@synthesize commonTags;
+@synthesize tagFieldString;
- (id)initWithDelegate:(id)del commonTags:(NSArray *)cTags atPoint:(NSPoint)centerpoint{
if ((self=[super init])) {
@@ -34,6 +35,7 @@ - (id)initWithDelegate:(id)del commonTags:(NSArray *)cTags atPoint:(NSPoint)cent
}
- (void)dealloc{
+ [tagFieldString release];
[commonTags release];
[tagPanel release];
[tagField release];
@@ -52,7 +54,9 @@ - (void)setCommonTags:(NSArray *)newTags{
if (commonTags&&([commonTags count]>0)) {
newTagString=[commonTags componentsJoinedByString:@","];
}
- [tagField setStringValue:newTagString];
+ self.tagFieldString=newTagString;
+ }else{
+ self.tagFieldString=@"";
}
}
@@ -82,10 +86,6 @@ - (void)windowDidResignKey:(NSNotification *)notification{
[[NSNotificationCenter defaultCenter]postNotificationName:@"TagEditorShouldRelease" object:nil];
}
-- (NSString *)newMultinoteLabels{
- return [NSString stringWithString:[tagField stringValue]];
-}
-
- (void)setTF:(NSString *)inString{
[tagField setStringValue:inString];
}
Oops, something went wrong.

0 comments on commit 3bf00d6

Please sign in to comment.