From: <ho...@us...> - 2008-08-23 23:34:40
|
Revision: 13607 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13607&view=rev Author: hofman Date: 2008-08-23 23:34:49 +0000 (Sat, 23 Aug 2008) Log Message: ----------- remove an assert for Leopard, we check for that. Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2008-08-23 18:22:52 UTC (rev 13606) +++ trunk/bibdesk/BibDocument.m 2008-08-23 23:34:49 UTC (rev 13607) @@ -1167,8 +1167,6 @@ */ - NSParameterAssert(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4); - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_4 && NO == didSave && [absoluteURL isFileURL] && NSAutosaveOperation != saveOperation) { NSFileManager *fileManager = [NSFileManager defaultManager]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2008-10-13 19:41:40
|
Revision: 13716 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13716&view=rev Author: hofman Date: 2008-10-13 19:41:34 +0000 (Mon, 13 Oct 2008) Log Message: ----------- Don't update preview before the window shows Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2008-10-13 19:04:51 UTC (rev 13715) +++ trunk/bibdesk/BibDocument.m 2008-10-13 19:41:34 UTC (rev 13716) @@ -376,6 +376,8 @@ } } + [self updatePreviews]; + if (docState.displayMigrationAlert) { docState.displayMigrationAlert = NO; // If a single file was migrated, this alert will be shown even if all other BibItems already use BDSKLinkedFile. However, I think that's an edge case, since the user had to manually add that pub in a text editor or by setting the local-url field. Items imported or added in BD will already use BDSKLinkedFile, so this notification won't be posted. @@ -3075,7 +3077,7 @@ // Coalesce these messages here, since something like select all -> generate cite keys will force a preview update for every // changed key, so we have to update all the previews each time. This should be safer than using cancelPrevious... since those // don't get performed on the main thread (apparently), and can lead to problems. - if (docState.isDocumentClosed == NO) + if (docState.isDocumentClosed == NO && [documentWindow isVisible]) [self queueSelectorOnce:@selector(doUpdatePreviews)]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2008-10-15 11:57:50
|
Revision: 13727 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13727&view=rev Author: hofman Date: 2008-10-15 11:57:48 +0000 (Wed, 15 Oct 2008) Log Message: ----------- simplify code generating string representations Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2008-10-14 21:55:33 UTC (rev 13726) +++ trunk/bibdesk/BibDocument.m 2008-10-15 11:57:48 UTC (rev 13727) @@ -2060,42 +2060,18 @@ } - (NSString *)RISStringForPublications:(NSArray *)items{ - NSMutableString *s = [NSMutableString string]; - NSEnumerator *e = [items objectEnumerator]; - BibItem *pub; - - while(pub = [e nextObject]){ - [s appendString:@"\n"]; - [s appendString:[pub RISStringValue]]; - [s appendString:@"\n"]; - } - - return s; + return [[items valueForKey:@"RISStringValue"] componentsJoinedByString:@"\n\n"]; } - (NSString *)citeStringForPublications:(NSArray *)items citeString:(NSString *)citeString{ OFPreferenceWrapper *sud = [OFPreferenceWrapper sharedPreferenceWrapper]; - BOOL prependTilde = [sud boolForKey:BDSKCitePrependTildeKey]; - NSString *startCite = [NSString stringWithFormat:@"%@\\%@%@", (prependTilde? @"~" : @""), citeString, [sud stringForKey:BDSKCiteStartBracketKey]]; + NSString *startCite = [NSString stringWithFormat:@"%@\\%@%@", ([sud boolForKey:BDSKCitePrependTildeKey] ? @"~" : @""), citeString, [sud stringForKey:BDSKCiteStartBracketKey]]; NSString *endCite = [sud stringForKey:BDSKCiteEndBracketKey]; - NSMutableString *s = [NSMutableString stringWithString:startCite]; - - BOOL sep = [sud boolForKey:BDSKSeparateCiteKey]; - NSString *separator = (sep)? [NSString stringWithFormat:@"%@%@", endCite, startCite] : @","; - BibItem *pub; - BOOL first = YES; + NSString *separator = [sud boolForKey:BDSKSeparateCiteKey] ? [endCite stringByAppendingString:startCite] : @","; if([items count]) NSParameterAssert([[items objectAtIndex:0] isKindOfClass:[BibItem class]]); - NSEnumerator *e = [items objectEnumerator]; - while(pub = [e nextObject]){ - if(first) first = NO; - else [s appendString:separator]; - [s appendString:[pub citeKey]]; - } - [s appendString:endCite]; - - return s; + return [NSString stringWithFormat:@"%@%@%@", startCite, [[items valueForKey:@"citeKey"] componentsJoinedByString:separator], endCite]; } #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2008-10-15 12:33:46
|
Revision: 13729 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13729&view=rev Author: hofman Date: 2008-10-15 12:33:17 +0000 (Wed, 15 Oct 2008) Log Message: ----------- simplify preview updating code Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2008-10-15 12:06:29 UTC (rev 13728) +++ trunk/bibdesk/BibDocument.m 2008-10-15 12:33:17 UTC (rev 13729) @@ -3075,43 +3075,34 @@ if (maxItems > 0 && [items count] > maxItems) items = [items subarrayWithRange:NSMakeRange(0, maxItems)]; - // do this _before_ messing with the text storage; otherwise you can have a leftover selection that ends up being out of range - static NSArray *zeroRanges = nil; - if (zeroRanges == nil) zeroRanges = [[NSArray alloc] initWithObjects:[NSValue valueWithRange: NSMakeRange(0, 0)], nil]; - - NSTextStorage *textStorage = [textView textStorage]; - [textView setSelectedRanges:zeroRanges]; - - NSLayoutManager *layoutManager = [[textStorage layoutManagers] lastObject]; - [layoutManager retain]; - [textStorage removeLayoutManager:layoutManager]; // optimization: make sure the layout manager doesn't do any work while we're loading - - [textStorage beginEditing]; - BDSKTemplate *template = [BDSKTemplate templateForStyle:templateStyle] ?: [BDSKTemplate templateForStyle:[BDSKTemplate defaultStyleNameForFileType:@"rtf"]]; + NSAttributedString *templateString = nil; // make sure this is really one of the attributed string types... if([template templateFormat] & BDSKRichTextTemplateFormat){ - NSAttributedString *templateString = [BDSKTemplateObjectProxy attributedStringByParsingTemplate:template withObject:self publications:items documentAttributes:NULL]; - [textStorage setAttributedString:templateString]; + templateString = [BDSKTemplateObjectProxy attributedStringByParsingTemplate:template withObject:self publications:items documentAttributes:NULL]; } else if([template templateFormat] & BDSKPlainTextTemplateFormat){ // parse as plain text, so the HTML is interpreted properly by NSAttributedString NSString *str = [BDSKTemplateObjectProxy stringByParsingTemplate:template withObject:self publications:items]; // we generally assume UTF-8 encoding for all template-related files - NSAttributedString *templateString = nil; if ([template templateFormat] == BDSKPlainHTMLTemplateFormat) - templateString = [[NSAttributedString alloc] initWithHTML:[str dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL]; + templateString = [[[NSAttributedString alloc] initWithHTML:[str dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL] autorelease]; else - templateString = [[NSAttributedString alloc] initWithString:str attributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:0.0], NSFontAttributeName, nil]]; - [textStorage setAttributedString:templateString]; - [templateString release]; - } else { - [[textStorage mutableString] setString:@""]; + templateString = [[[NSAttributedString alloc] initWithString:str attributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont userFontOfSize:0.0], NSFontAttributeName, nil]] autorelease]; } + // do this _before_ messing with the text storage; otherwise you can have a leftover selection that ends up being out of range + static NSArray *zeroRanges = nil; + if (zeroRanges == nil) zeroRanges = [[NSArray alloc] initWithObjects:[NSValue valueWithRange: NSMakeRange(0, 0)], nil]; + + NSTextStorage *textStorage = [textView textStorage]; + [textView setSelectedRanges:zeroRanges]; + [textStorage beginEditing]; + if (templateString) + [textStorage setAttributedString:templateString]; + else + [[textStorage mutableString] setString:@""]; [textStorage endEditing]; - [textStorage addLayoutManager:layoutManager]; - [layoutManager release]; if([NSString isEmptyString:[searchField stringValue]] == NO) [textView highlightComponentsOfSearchString:[searchField stringValue]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2008-12-11 13:57:57
|
Revision: 13897 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13897&view=rev Author: hofman Date: 2008-12-11 13:57:53 +0000 (Thu, 11 Dec 2008) Log Message: ----------- RIS should not be a native type, as it's data will not be preserved during a save/read cycle and saving will often lead to data loss. Our only native type is bibTeX. RIS should only be available as readable or exportable type. Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2008-12-11 12:34:05 UTC (rev 13896) +++ trunk/bibdesk/BibDocument.m 2008-12-11 13:57:53 UTC (rev 13897) @@ -931,6 +931,11 @@ #pragma mark - #pragma mark Document Saving ++ (BOOL)isNativeType:(NSString *)aType +{ + return [super isNativeType:aType] && [aType isEqualToString:BDSKRISDocumentType] == NO; +} + + (NSArray *)writableTypes { NSMutableArray *writableTypes = [[[super writableTypes] mutableCopy] autorelease]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2008-12-12 10:21:03
|
Revision: 13903 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13903&view=rev Author: hofman Date: 2008-12-12 10:20:59 +0000 (Fri, 12 Dec 2008) Log Message: ----------- really only bibtex is a native document type Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2008-12-12 05:56:36 UTC (rev 13902) +++ trunk/bibdesk/BibDocument.m 2008-12-12 10:20:59 UTC (rev 13903) @@ -933,7 +933,7 @@ + (BOOL)isNativeType:(NSString *)aType { - return [super isNativeType:aType] && [aType isEqualToString:BDSKRISDocumentType] == NO; + return [aType isEqualToString:BDSKBibTeXDocumentType]; } + (NSArray *)writableTypes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-01-04 16:05:15
|
Revision: 13950 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13950&view=rev Author: hofman Date: 2009-01-04 16:04:59 +0000 (Sun, 04 Jan 2009) Log Message: ----------- Read RIS and PubMed as other string formats. It may not be RIS. Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-01-04 16:01:30 UTC (rev 13949) +++ trunk/bibdesk/BibDocument.m 2009-01-04 16:04:59 UTC (rev 13950) @@ -1833,8 +1833,6 @@ if ([aType isEqualToString:BDSKBibTeXDocumentType] || [aType isEqualToUTI:[[NSWorkspace sharedWorkspace] UTIForPathExtension:@"bib"]]){ success = [self readFromBibTeXData:data fromURL:absoluteURL encoding:encoding error:&error]; - }else if([aType isEqualToString:BDSKRISDocumentType] || [aType isEqualToUTI:[[NSWorkspace sharedWorkspace] UTIForPathExtension:@"ris"]]){ - success = [self readFromData:data ofStringType:BDSKRISStringType fromURL:absoluteURL encoding:encoding error:&error]; }else{ // sniff the string to see what format we got NSString *string = [[[NSString alloc] initWithData:data encoding:encoding] autorelease]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-01-14 17:20:43
|
Revision: 14036 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14036&view=rev Author: hofman Date: 2009-01-14 17:20:37 +0000 (Wed, 14 Jan 2009) Log Message: ----------- Make complex string a private class. Declare the full API in NSString category. Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-01-14 17:17:49 UTC (rev 14035) +++ trunk/bibdesk/BibDocument.m 2009-01-14 17:20:37 UTC (rev 14036) @@ -2225,13 +2225,13 @@ - (NSArray *)publicationsFromArchivedData:(NSData *)data{ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data]; - [BDSKComplexString setMacroResolverForUnarchiving:macroResolver]; + [NSString setMacroResolverForUnarchiving:macroResolver]; NSArray *newPubs = [unarchiver decodeObjectForKey:@"publications"]; [unarchiver finishDecoding]; [unarchiver release]; - [BDSKComplexString setMacroResolverForUnarchiving:nil]; + [NSString setMacroResolverForUnarchiving:nil]; return newPubs; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-01-16 01:25:03
|
Revision: 14067 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14067&view=rev Author: hofman Date: 2009-01-16 01:24:54 +0000 (Fri, 16 Jan 2009) Log Message: ----------- use more specific pubmed search term to look for item from OID using file name Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-01-16 01:17:37 UTC (rev 14066) +++ trunk/bibdesk/BibDocument.m 2009-01-16 01:24:54 UTC (rev 14067) @@ -2415,7 +2415,7 @@ NSString *lastPathComponent = [[fnStr lastPathComponent] stringByDeletingPathExtension]; BOOL tryPubMed = [[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShouldUsePubMedMetadata]; if(newBI == nil && tryPubMed && [lastPathComponent containsCharacterInSet:[NSCharacterSet nonDecimalDigitCharacterSet]] == NO) - newBI = [BibItem itemWithPubMedSearchTerm:lastPathComponent]; + newBI = [BibItem itemWithPubMedSearchTerm:[NSString stringWithFormat:@"%@ [AID]", lastPathComponent]]; // GJ try parsing pdf to extract info that is then used to get a PubMed record if(newBI == nil && [[[NSWorkspace sharedWorkspace] UTIForURL:url] isEqualToUTI:(NSString *)kUTTypePDF] && [[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShouldParsePDFToGeneratePubMedSearchTerm]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jef...@us...> - 2009-01-16 13:19:04
|
Revision: 14070 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14070&view=rev Author: jefferis Date: 2009-01-16 12:33:59 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Fix reversion of PubMed lookup for dropped <PMID>.pdf files - svn 14067 restricted the search to [AID] field but this only contains DOIs or published supplied IDs. - PMID is contained in [PMID] field. Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-01-16 12:02:15 UTC (rev 14069) +++ trunk/bibdesk/BibDocument.m 2009-01-16 12:33:59 UTC (rev 14070) @@ -2415,7 +2415,7 @@ NSString *lastPathComponent = [[fnStr lastPathComponent] stringByDeletingPathExtension]; BOOL tryPubMed = [[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShouldUsePubMedMetadata]; if(newBI == nil && tryPubMed && [lastPathComponent containsCharacterInSet:[NSCharacterSet nonDecimalDigitCharacterSet]] == NO) - newBI = [BibItem itemWithPubMedSearchTerm:[NSString stringWithFormat:@"%@ [AID]", lastPathComponent]]; + newBI = [BibItem itemWithPubMedSearchTerm:[NSString stringWithFormat:@"%@ [PMID]", lastPathComponent]]; // GJ try parsing pdf to extract info that is then used to get a PubMed record if(newBI == nil && [[[NSWorkspace sharedWorkspace] UTIForURL:url] isEqualToUTI:(NSString *)kUTTypePDF] && [[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShouldParsePDFToGeneratePubMedSearchTerm]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-02-22 01:14:11
|
Revision: 14416 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14416&view=rev Author: hofman Date: 2009-02-22 01:14:10 +0000 (Sun, 22 Feb 2009) Log Message: ----------- use new statusbar height for views in status bar Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-02-22 00:51:22 UTC (rev 14415) +++ trunk/bibdesk/BibDocument.m 2009-02-22 01:14:10 UTC (rev 14416) @@ -470,7 +470,7 @@ // This must also be done before we resize the window and the splitViews [groupCollapsibleView setCollapseEdges:BDSKMinXEdgeMask]; - [groupCollapsibleView setMinSize:NSMakeSize(56.0, 20.0)]; + [groupCollapsibleView setMinSize:NSMakeSize(56.0, 22.0)]; [groupGradientView setUpperColor:[NSColor colorWithCalibratedWhite:0.9 alpha:1.0]]; [groupGradientView setLowerColor:[NSColor colorWithCalibratedWhite:0.75 alpha:1.0]]; @@ -544,7 +544,7 @@ [bottomFileView setBackgroundColor:[[bottomFileView enclosingScrollView] backgroundColor]]; [fileCollapsibleView setCollapseEdges:BDSKMaxXEdgeMask]; - [fileCollapsibleView setMinSize:NSMakeSize(65.0, 20.0)]; + [fileCollapsibleView setMinSize:NSMakeSize(65.0, 22.0)]; [fileGradientView setUpperColor:[NSColor colorWithCalibratedWhite:0.9 alpha:1.0]]; [fileGradientView setLowerColor:[NSColor colorWithCalibratedWhite:0.75 alpha:1.0]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-02-25 17:10:32
|
Revision: 14488 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14488&view=rev Author: hofman Date: 2009-02-25 17:10:28 +0000 (Wed, 25 Feb 2009) Log Message: ----------- remove alternate images from button Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-02-25 17:08:58 UTC (rev 14487) +++ trunk/bibdesk/BibDocument.m 2009-02-25 17:10:28 UTC (rev 14488) @@ -3011,7 +3011,6 @@ if (isOptionKeyState) { [groupAddButton setImage:[NSImage imageNamed:@"GroupAddSmart"]]; - [groupAddButton setAlternateImage:[NSImage imageNamed:@"GroupAddSmart_Pressed"]]; [groupAddButton setToolTip:NSLocalizedString(@"Add new smart group.", @"Tool tip message")]; static NSImage *alternateNewToolbarImage = nil; @@ -3030,7 +3029,6 @@ [toolbarItem setAction:@selector(createNewPubUsingCrossrefAction:)]; } else { [groupAddButton setImage:[NSImage imageNamed:@"GroupAdd"]]; - [groupAddButton setAlternateImage:[NSImage imageNamed:@"GroupAdd_Pressed"]]; [groupAddButton setToolTip:NSLocalizedString(@"Add new group.", @"Tool tip message")]; [toolbarItem setLabel:NSLocalizedString(@"New", @"Toolbar item label")]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-02-28 18:27:28
|
Revision: 14539 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14539&view=rev Author: hofman Date: 2009-02-28 18:27:20 +0000 (Sat, 28 Feb 2009) Log Message: ----------- recalculate keyview loop when loading main window Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-02-28 18:22:02 UTC (rev 14538) +++ trunk/bibdesk/BibDocument.m 2009-02-28 18:27:20 UTC (rev 14539) @@ -614,6 +614,8 @@ [saveTextEncodingPopupButton setEncoding:0]; + // this shouldn't be necessary + [documentWindow recalculateKeyViewLoop]; } - (BOOL)undoManagerShouldUndoChange:(id)sender{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-03-08 17:20:03
|
Revision: 14648 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14648&view=rev Author: hofman Date: 2009-03-08 17:19:55 +0000 (Sun, 08 Mar 2009) Log Message: ----------- make the main table the initial first responder Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-03-08 15:45:17 UTC (rev 14647) +++ trunk/bibdesk/BibDocument.m 2009-03-08 17:19:55 UTC (rev 14648) @@ -616,6 +616,7 @@ // this shouldn't be necessary [documentWindow recalculateKeyViewLoop]; + [documentWindow makeFirstResponder:tableView]; } - (BOOL)undoManagerShouldUndoChange:(id)sender{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-01 00:15:01
|
Revision: 14914 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=14914&view=rev Author: hofman Date: 2009-04-01 00:14:55 +0000 (Wed, 01 Apr 2009) Log Message: ----------- remember webview fraction accross sessions in xattr defaults Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-03-31 22:28:01 UTC (rev 14913) +++ trunk/bibdesk/BibDocument.m 2009-04-01 00:14:55 UTC (rev 14914) @@ -146,6 +146,7 @@ #define BDSKMainWindowExtendedAttributeKey @"net.sourceforge.bibdesk.BDSKDocumentWindowAttributes" #define BDSKGroupSplitViewFractionKey @"BDSKGroupSplitViewFractionKey" #define BDSKMainTableSplitViewFractionKey @"BDSKMainTableSplitViewFractionKey" +#define BDSKWebViewFractionKey @"BDSKWebViewFractionKey" #define BDSKDocumentWindowFrameKey @"BDSKDocumentWindowFrameKey" #define BDSKSelectedPublicationsKey @"BDSKSelectedPublicationsKey" #define BDSKDocumentStringEncodingKey @"BDSKDocumentStringEncodingKey" @@ -514,6 +515,8 @@ if (fract >= 0) [splitView setFraction:fract]; + docState.lastWebViewFraction = [xattrDefaults floatForKey:BDSKWebViewFractionKey defaultValue:0.0]; + [mainBox setBackgroundColor:[NSColor controlBackgroundColor]]; // this might be replaced by the file content tableView @@ -737,6 +740,7 @@ // of the 3 splitviews, the fraction of the first divider would be considered, so fallback to the fraction from the nib if (NO == [self hasWebGroupSelected]) [dictionary setFloatValue:[splitView fraction] forKey:BDSKMainTableSplitViewFractionKey]; + [dictionary setFloatValue:docState.lastWebViewFraction forKey:BDSKWebViewFractionKey]; [dictionary setObject:currentGroupField forKey:BDSKCurrentGroupFieldKey]; // if this isn't a save operation, the encoding in xattr is already correct, while our encoding might be different from the actual file encoding, if the user might ignored an encoding warning without saving This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-19 10:17:51
|
Revision: 15108 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15108&view=rev Author: hofman Date: 2009-04-19 10:17:46 +0000 (Sun, 19 Apr 2009) Log Message: ----------- warn when importing items with duplicate cite keys Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-04-19 09:27:38 UTC (rev 15107) +++ trunk/bibdesk/BibDocument.m 2009-04-19 10:17:46 UTC (rev 15108) @@ -2173,24 +2173,27 @@ } BOOL autoGenerate = [[NSUserDefaults standardUserDefaults] boolForKey:BDSKCiteKeyAutogenerateKey]; - NSMutableArray *pubs = [NSMutableArray arrayWithCapacity:[newPubs count]]; + NSMutableArray *autogeneratePubs = [NSMutableArray arrayWithCapacity:[newPubs count]]; + BOOL hasDuplicateCiteKey = NO; pubEnum = [newPubs objectEnumerator]; while (pub = [pubEnum nextObject]) { if ((autoGenerate == NO && [pub hasEmptyOrDefaultCiteKey]) || - (autoGenerate && [pub canGenerateAndSetCiteKey])) // @@ or should we check for hasEmptyOrDefaultCiteKey ? - [pubs addObject:pub]; + (autoGenerate && [pub canGenerateAndSetCiteKey])) { // @@ or should we check for hasEmptyOrDefaultCiteKey ? + [autogeneratePubs addObject:pub]; + } else if ([pub isValidCiteKey:[pub citeKey]] == NO) { + hasDuplicateCiteKey = YES; + } } - [self generateCiteKeysForPublications:pubs]; + [self generateCiteKeysForPublications:autogeneratePubs]; // set Date-Added to the current date, since unarchived items will have their own (incorrect) date NSCalendarDate *importDate = [NSCalendarDate date]; [newPubs makeObjectsPerformSelector:@selector(setField:toValue:) withObject:BDSKDateAddedString withObject:[importDate description]]; - if(shouldEdit) { + if(shouldEdit) [self editPublications:newPubs]; // this will ask the user when there are many pubs - } [[self undoManager] setActionName:NSLocalizedString(@"Add Publication", @"Undo action name")]; @@ -2206,8 +2209,17 @@ [[BDSKScriptHookManager sharedManager] runScriptHookWithName:BDSKImportPublicationsScriptHookName forPublications:newPubs document:self]; - if(tmpCiteKey != nil) + if (tmpCiteKey != nil) { [self reportTemporaryCiteKeys:tmpCiteKey forNewDocument:NO]; + } else if (hasDuplicateCiteKey) { // should we do this when we don't edit? + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Duplicate Cite Key", @"Message in alert dialog when duplicate citye key was found") + defaultButton:nil + alternateButton:nil + otherButton:nil + informativeTextWithFormat:NSLocalizedString(@"One or more items you added have a cite key which is either already used in this document. You should provide a unique one.", @"Informative text in alert dialog")]; + // don't begin a sheet, because the edit command may have one put up already + [alert runModal]; + } } - (BOOL)addPublicationsFromPasteboard:(NSPasteboard *)pb selectLibrary:(BOOL)shouldSelect verbose:(BOOL)verbose error:(NSError **)outError{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-22 23:21:02
|
Revision: 15159 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15159&view=rev Author: hofman Date: 2009-04-22 23:20:40 +0000 (Wed, 22 Apr 2009) Log Message: ----------- don't resize export panel accessory view Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-04-22 18:35:33 UTC (rev 15158) +++ trunk/bibdesk/BibDocument.m 2009-04-22 23:20:40 UTC (rev 15159) @@ -1032,7 +1032,6 @@ NSPopUpButton *saveFormatPopupButton = popUpButtonSubview(accessoryView); BDSKASSERT(saveFormatPopupButton != nil); NSRect savFrame = [saveAccessoryView frame]; - savFrame.size.width = NSWidth([accessoryView frame]); NSRect exportFrame = [exportAccessoryView frame]; savFrame.origin = NSMakePoint(0.0, SAVE_ENCODING_VIEW_OFFSET); [saveAccessoryView setFrame:savFrame]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-24 09:37:19
|
Revision: 15169 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15169&view=rev Author: hofman Date: 2009-04-24 09:37:09 +0000 (Fri, 24 Apr 2009) Log Message: ----------- resort groups initially when showing the main window, otherwise the sort descriptors for the parents may not be set Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-04-24 09:22:02 UTC (rev 15168) +++ trunk/bibdesk/BibDocument.m 2009-04-24 09:37:09 UTC (rev 15169) @@ -375,6 +375,8 @@ [groupOutlineView expandItem:parent]; } } + // make sure the groups are sorted and have their sort descriptors set + [self sortGroupsByKey:nil]; NSData *groupData = [xattrDefaults objectForKey:BDSKSelectedGroupsKey]; if ([groupData length]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-24 19:30:09
|
Revision: 15179 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15179&view=rev Author: hofman Date: 2009-04-24 19:30:00 +0000 (Fri, 24 Apr 2009) Log Message: ----------- save class names of expanded parent groups rather than the name, because the name can be changed but the class is unique. Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-04-24 17:43:20 UTC (rev 15178) +++ trunk/bibdesk/BibDocument.m 2009-04-24 19:30:00 UTC (rev 15179) @@ -364,16 +364,13 @@ // some xattr setup has to be done after the window is on-screen NSDictionary *xattrDefaults = [self mainWindowSetupDictionaryFromExtendedAttributes]; - NSArray *groupsToExpand = [xattrDefaults objectForKey:BDSKDocumentGroupsToExpandKey defaultObject:[groups valueForKey:@"name"]]; - NSEnumerator *groupEnum = [groupsToExpand objectEnumerator]; - NSString *groupName; - while (groupName = [groupEnum nextObject]) { - NSEnumerator *parentEnum = [groups objectEnumerator]; - BDSKParentGroup *parent; - while (parent = [parentEnum nextObject]) { - if ([[parent name] isEqual:groupName]) - [groupOutlineView expandItem:parent]; - } + NSArray *groupsToExpand = [xattrDefaults objectForKey:BDSKDocumentGroupsToExpandKey]; + NSEnumerator *parentEnum = [groups objectEnumerator]; + BDSKParentGroup *parent; + [parentEnum nextObject]; + while (parent = [parentEnum nextObject]) { + if (groupsToExpand == nil || [groupsToExpand containsObject:NSStringFromClass([parent class])]) + [groupOutlineView expandItem:parent]; } // make sure the groups are sorted and have their sort descriptors set [self sortGroupsByKey:nil]; @@ -804,10 +801,10 @@ NSMutableArray *groupsToExpand = [NSMutableArray array]; NSEnumerator *groupEnum = [groups objectEnumerator]; BDSKParentGroup *parent; + [groupEnum nextObject]; while (parent = [groupEnum nextObject]) { - // name is localized, but that's not worth worrying about if ([groupOutlineView isItemExpanded:parent]) - [groupsToExpand addObject:[parent name]]; + [groupsToExpand addObject:NSStringFromClass([parent class])]; } [dictionary setObject:groupsToExpand forKey:BDSKDocumentGroupsToExpandKey]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-29 12:16:30
|
Revision: 15232 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15232&view=rev Author: hofman Date: 2009-04-29 12:12:57 +0000 (Wed, 29 Apr 2009) Log Message: ----------- use light blue from second alternating row as background color for the bottom file view Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-04-29 11:33:15 UTC (rev 15231) +++ trunk/bibdesk/BibDocument.m 2009-04-29 12:12:57 UTC (rev 15232) @@ -564,7 +564,7 @@ [groupOutlineView registerForDraggedTypes:dragTypes]; [[sideFileView enclosingScrollView] setBackgroundColor:[sideFileView backgroundColor]]; - [bottomFileView setBackgroundColor:[NSColor controlBackgroundColor]]; + [bottomFileView setBackgroundColor:[[NSColor controlAlternatingRowBackgroundColors] lastObject]]; [[bottomFileView enclosingScrollView] setBackgroundColor:[bottomFileView backgroundColor]]; [fileCollapsibleView setCollapseEdges:BDSKMaxXEdgeMask]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-04-29 14:32:17
|
Revision: 15233 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15233&view=rev Author: hofman Date: 2009-04-29 14:32:09 +0000 (Wed, 29 Apr 2009) Log Message: ----------- remove unused filewrapper category Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-04-29 12:12:57 UTC (rev 15232) +++ trunk/bibdesk/BibDocument.m 2009-04-29 14:32:09 UTC (rev 15233) @@ -159,10 +159,10 @@ static char BDSKDocumentDefaultsObservationContext; enum { - BDSKItemChangedGroupFieldMask = 1, - BDSKItemChangedSearchKeyMask = 2, - BDSKItemChangedSortKeyMask = 4, - BDSKItemChangedFilesMask = 8 + BDSKItemChangedGroupFieldMask = 1 << 0, + BDSKItemChangedSearchKeyMask = 1 << 1, + BDSKItemChangedSortKeyMask = 1 << 2, + BDSKItemChangedFilesMask = 1 << 3 }; @interface BDSKFileViewObject : NSObject { @@ -174,33 +174,8 @@ - (NSString *)string; @end -@implementation BDSKFileViewObject +#pragma mark - -- (id)initWithURL:(NSURL *)aURL string:(NSString *)aString { - if (self = [super init]) { - URL = [aURL copy]; - string = [aString copy]; - } - return self; -} - -- (void)dealloc { - [URL release]; - [string release]; - [super dealloc]; -} - -- (NSURL *)URL { return URL; } - -- (NSString *)string { return string; } - -@end - - -@interface NSFileWrapper (BDSKExtensions) -- (NSFileWrapper *)addFileWrapperWithPath:(NSString *)path relativeTo:(NSString *)basePath recursive:(BOOL)recursive; -@end - @interface NSDocument (BDSKPrivateExtensions) // declare a private NSDocument method so we can override it - (void)changeSaveType:(id)sender; @@ -3851,38 +3826,24 @@ #pragma mark - -@implementation NSFileWrapper (BDSKExtensions) +@implementation BDSKFileViewObject -- (NSFileWrapper *)addFileWrapperWithPath:(NSString *)path relativeTo:(NSString *)basePath recursive:(BOOL)recursive { - NSFileWrapper *fileWrapper = nil; - BOOL isDir; - if ([[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir]) { - NSString *filename = [path lastPathComponent]; - NSString *relativePath = basePath ? [path relativePathFromPath:basePath] : filename; - NSFileWrapper *container = self; - - if ([relativePath isEqualToString:filename] == NO) - container = [self addFileWrapperWithPath:[path stringByDeletingLastPathComponent] relativeTo:basePath recursive:NO]; - - fileWrapper = [[container fileWrappers] objectForKey:filename]; - if (fileWrapper == nil || [fileWrapper isDirectory] != isDir) { - if (isDir) - fileWrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:[NSDictionary dictionary]]; - else - fileWrapper = [[NSFileWrapper alloc] initRegularFileWithContents:[NSData dataWithContentsOfFile:path]]; - [fileWrapper setPreferredFilename:filename]; - [container addFileWrapper:fileWrapper]; - [fileWrapper release]; - } - - if (isDir && recursive) { - NSEnumerator *fileEnum = [[[NSFileManager defaultManager] subpathsAtPath:path] objectEnumerator]; - NSString *file; - while (file = [fileEnum nextObject]) - [self addFileWrapperWithPath:[path stringByAppendingPathComponent:file] relativeTo:path recursive:YES]; - } +- (id)initWithURL:(NSURL *)aURL string:(NSString *)aString { + if (self = [super init]) { + URL = [aURL copy]; + string = [aString copy]; } - return fileWrapper; + return self; } +- (void)dealloc { + [URL release]; + [string release]; + [super dealloc]; +} + +- (NSURL *)URL { return URL; } + +- (NSString *)string { return string; } + @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-05-05 10:13:28
|
Revision: 15267 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15267&view=rev Author: hofman Date: 2009-05-05 10:13:13 +0000 (Tue, 05 May 2009) Log Message: ----------- use NSDate instead of NSCalendarDate Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-05-05 04:59:35 UTC (rev 15266) +++ trunk/bibdesk/BibDocument.m 2009-05-05 10:13:13 UTC (rev 15267) @@ -1553,7 +1553,7 @@ if ([userName canBeConvertedToEncoding:encoding] == NO) userName = [[[NSString alloc] initWithData:[userName dataUsingEncoding:encoding allowLossyConversion:YES] encoding:encoding] autorelease]; - [templateFile appendFormat:@"\n%%%% Created for %@ at %@ \n\n", userName, [NSCalendarDate calendarDate]]; + [templateFile appendFormat:@"\n%%%% Created for %@ at %@ \n\n", userName, [[NSDate date] standardDescription]]; [templateFile appendFormat:@"\n%%%% Saved with string encoding %@ \n\n", encodingName]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-05-13 11:22:32
|
Revision: 15317 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15317&view=rev Author: hofman Date: 2009-05-13 11:22:16 +0000 (Wed, 13 May 2009) Log Message: ----------- replace archived groups to select by equal groups that are actually present, because group selection now uses pointer equality Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-05-13 04:59:24 UTC (rev 15316) +++ trunk/bibdesk/BibDocument.m 2009-05-13 11:22:16 UTC (rev 15317) @@ -350,9 +350,19 @@ [self sortGroupsByKey:nil]; NSData *groupData = [xattrDefaults objectForKey:BDSKSelectedGroupsKey]; - if ([groupData length]) - [self selectGroups:[NSKeyedUnarchiver unarchiveObjectWithData:groupData]]; - + if ([groupData length]) { + NSSet *allGroups = [NSSet setWithArray:[groups valueForKeyPath:@"@unionOfArrays.children"]]; + NSMutableArray *groupsToSelect = [NSMutableArray array]; + NSEnumerator *groupEnum = [[NSKeyedUnarchiver unarchiveObjectWithData:groupData] objectEnumerator]; + BDSKGroup *group; + while (group = [groupEnum nextObject]) { + if (group = [allGroups member:group]) + [groupsToSelect addObject:group]; + } + if ([groupsToSelect count]) + [self selectGroups:groupsToSelect]; + } + [self selectItemsForCiteKeys:[xattrDefaults objectForKey:BDSKSelectedPublicationsKey defaultObject:[NSArray array]] selectLibrary:NO]; NSPoint scrollPoint = [xattrDefaults pointForKey:BDSKDocumentScrollPercentageKey defaultValue:NSZeroPoint]; [[tableView enclosingScrollView] setScrollPositionAsPercentage:scrollPoint]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-05-16 09:41:06
|
Revision: 15330 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15330&view=rev Author: hofman Date: 2009-05-16 09:40:50 +0000 (Sat, 16 May 2009) Log Message: ----------- workaround for encoding problem of toolbar item, the document was encoded as the delegate of a menu item Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-05-16 09:27:44 UTC (rev 15329) +++ trunk/bibdesk/BibDocument.m 2009-05-16 09:40:50 UTC (rev 15330) @@ -256,6 +256,15 @@ return self; } +// implement a dummy implementation for NSCoding, as the Action popup toolbar item can call this because we're the delegate of a menu item +// I consider this an AppKit bug +- (id)initWithCoder:(NSCoder *)coder { + [self release]; + return nil; +} + +- (void)encodeWithCoder:(NSCoder *)encoder {} + - (void)invalidateSearchFieldCellTimer{ // AppKit bug workarounds: NSSearchFieldCell's timer creates a retain cycle after typing in it, so we manually invalidate it when the document is deallocated to avoid leaking the cell and timer. Further, if the insertion point is in the searchfield cell when the window closes, the field editor (and associated text system) and undo manager also leak, so we send -[documentWindow endEditingFor:nil] in windowWillClose:. id timer = [[searchField cell] valueForKey:@"_partialStringTimer"]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2009-06-30 13:16:50
|
Revision: 15478 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15478&view=rev Author: hofman Date: 2009-06-30 12:56:02 +0000 (Tue, 30 Jun 2009) Log Message: ----------- fix a leak Modified Paths: -------------- trunk/bibdesk/BibDocument.m Modified: trunk/bibdesk/BibDocument.m =================================================================== --- trunk/bibdesk/BibDocument.m 2009-06-30 04:59:42 UTC (rev 15477) +++ trunk/bibdesk/BibDocument.m 2009-06-30 12:56:02 UTC (rev 15478) @@ -284,6 +284,7 @@ [tableColumnWidths release]; [sortKey release]; [sortGroupsKey release]; + [currentGroupField release]; [searchGroupViewController release]; [webGroupViewController release]; [searchIndexes release]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |