You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2007-08-27 17:03:38
|
Revision: 2732 http://skim-app.svn.sourceforge.net/skim-app/?rev=2732&view=rev Author: hofman Date: 2007-08-27 10:03:37 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Set camera cursor for snapshot only when the mouse is pressed, as the command key is more often pressed for other purposes (keyboard shortcuts). Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-27 17:00:09 UTC (rev 2731) +++ trunk/SKPDFView.m 2007-08-27 17:03:37 UTC (rev 2732) @@ -3258,6 +3258,8 @@ [[self window] discardCachedImage]; + [[NSCursor cameraCursor] set]; + while (YES) { theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSFlagsChangedMask]; @@ -3521,7 +3523,7 @@ if ([theEvent modifierFlags] & NSShiftKeyMask) cursor = [NSCursor arrowCursor]; else - cursor = [NSCursor cameraCursor]; + cursor = [NSCursor arrowCursor]; } else { switch (toolMode) { case SKTextToolMode: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 17:00:13
|
Revision: 2731 http://skim-app.svn.sourceforge.net/skim-app/?rev=2731&view=rev Author: hofman Date: 2007-08-27 10:00:09 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Fix typos in calculating hittest for lines and dragging end points of lines. Modified Paths: -------------- trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-08-27 16:18:01 UTC (rev 2730) +++ trunk/SKPDFAnnotationNote.m 2007-08-27 17:00:09 UTC (rev 2731) @@ -1415,8 +1415,6 @@ NSPoint startPoint = [self startPoint]; NSPoint endPoint = [self endPoint]; - point = SKSubstractPoints(point, bounds.origin); - if ([super hitTest:point]) { NSPoint relPoint = SKSubstractPoints(endPoint, startPoint); float lengthSquared = relPoint.x * relPoint.x + relPoint.y * relPoint.y; @@ -1425,11 +1423,13 @@ if (lengthSquared < 16.0) return YES; - extProduct = (point.x - startPoint.x) * relPoint.y - (point.y - startPoint.y) * relPoint.x; + point = SKSubstractPoints(SKSubstractPoints(point, bounds.origin), startPoint); + extProduct = point.x * relPoint.y - point.y * relPoint.x; return extProduct * extProduct < 16.0 * lengthSquared; } else { + point = SKSubstractPoints(point, bounds.origin); return (fabs(point.x - startPoint.x) < 3.5 && fabs(point.y - startPoint.y) < 3.5) || (fabs(point.x - endPoint.x) < 3.5 && fabs(point.y - endPoint.y) < 3.5); } Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-27 16:18:01 UTC (rev 2730) +++ trunk/SKPDFView.m 2007-08-27 17:00:09 UTC (rev 2731) @@ -2837,8 +2837,8 @@ if ([[activeAnnotation type] isEqualToString:@"Line"]) { SKPDFAnnotationLine *annotation = (SKPDFAnnotationLine *)activeAnnotation; - NSPoint endPoint = SKIntegralPoint(SKSubstractPoints(wasEndPoint, wasBounds.origin)); - startPoint = SKIntegralPoint(SKSubstractPoints(wasStartPoint, wasBounds.origin)); + NSPoint endPoint = SKIntegralPoint(SKAddPoints(wasEndPoint, wasBounds.origin)); + startPoint = SKIntegralPoint(SKAddPoints(wasStartPoint, wasBounds.origin)); NSPoint *draggedPoint = draggingStartPoint ? &startPoint : &endPoint; *draggedPoint = SKConstrainPointInRect(SKAddPoints(*draggedPoint, relPoint), pageBounds); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 16:18:05
|
Revision: 2730 http://skim-app.svn.sourceforge.net/skim-app/?rev=2730&view=rev Author: hofman Date: 2007-08-27 09:18:01 -0700 (Mon, 27 Aug 2007) Log Message: ----------- rename notification. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-27 15:39:41 UTC (rev 2729) +++ trunk/SKMainWindowController.m 2007-08-27 16:18:01 UTC (rev 2730) @@ -410,7 +410,7 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; // Application [nc addObserver:self selector:@selector(handleApplicationWillTerminateNotification:) - name:SKApplicationWillTerminateNotification object:NSApp]; + name:SKApplicationStartsTerminatingNotification object:NSApp]; [nc addObserver:self selector:@selector(handleApplicationDidResignActiveNotification:) name:NSApplicationDidResignActiveNotification object:NSApp]; [nc addObserver:self selector:@selector(handleApplicationWillBecomeActiveNotification:) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 15:46:23
|
Revision: 2722 http://skim-app.svn.sourceforge.net/skim-app/?rev=2722&view=rev Author: hofman Date: 2007-08-27 01:49:55 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Fix actions and validation for imageView. Modified Paths: -------------- trunk/BDSKDragImageView.m Modified: trunk/BDSKDragImageView.m =================================================================== --- trunk/BDSKDragImageView.m 2007-08-26 20:43:17 UTC (rev 2721) +++ trunk/BDSKDragImageView.m 2007-08-27 08:49:55 UTC (rev 2722) @@ -87,17 +87,28 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { SEL action = [menuItem action]; - if (action == @selector(copy:)) - return [self image] && [delegate respondsToSelector:@selector(dragImageView:writeDataToPasteboard:)]; - else if (action == @selector(delete:)) + if (action == @selector(cut:) || action == @selector(copy:) || action == @selector(delete:) || action == @selector(show:)) return [self image] != nil; - else if (action == @selector(show:)) - return [self image] != nil; + else if (action == @selector(paste:)) + return YES; else if ([[BDSKDragImageView superclass] instancesRespondToSelector:_cmd]) [super validateMenuItem:menuItem]; return YES; } +- (NSMenu *)menuForEvent:(NSEvent *)theEvent { + NSMenu *menu = [[[super menuForEvent:theEvent] copy] autorelease]; + int i = [menu numberOfItems]; + + while (i-- > 0) { + NSMenuItem *item = (NSMenuItem *)[menu itemAtIndex:i]; + if ([self validateMenuItem:item] == NO) + [menu removeItem:item]; + } + + return [menu numberOfItems] ? menu : nil; +} + - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender{ NSDragOperation dragOp = NSDragOperationNone; if ([delegate respondsToSelector:@selector(dragImageView:validateDrop:)]) @@ -124,19 +135,13 @@ return [delegate dragImageView:self acceptDrop:sender]; return NO; } -/* -- (void)keyDown:(NSEvent *)theEvent { - NSString *characters = [theEvent charactersIgnoringModifiers]; - unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; - unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + +- (void)mouseDown:(NSEvent *)theEvent { + if ([theEvent clickCount] == 2) { + [self show:self]; + return; + } - if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifierFlags == 0 && [self image]) - [self delete:self]; - else - [super keyDown:theEvent]; -} -*/ -- (void)mouseDown:(NSEvent *)theEvent { BOOL keepOn = YES; BOOL isInside = YES; NSPoint mouseLoc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 15:45:54
|
Revision: 2723 http://skim-app.svn.sourceforge.net/skim-app/?rev=2723&view=rev Author: hofman Date: 2007-08-27 02:24:03 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Update version numbers and release notes for release. Modified Paths: -------------- trunk/Dutch.lproj/InfoPlist.strings trunk/Dutch.lproj/Skim Help/version.texi trunk/English.lproj/InfoPlist.strings trunk/English.lproj/Skim Help/version.texi trunk/French.lproj/InfoPlist.strings trunk/French.lproj/Skim Help/version.texi trunk/Info.plist trunk/Italian.lproj/InfoPlist.strings trunk/Italian.lproj/Skim Help/version.texi trunk/ReleaseNotes.rtf Modified: trunk/Dutch.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/Skim Help/version.texi =================================================================== --- trunk/Dutch.lproj/Skim Help/version.texi 2007-08-27 08:49:55 UTC (rev 2722) +++ trunk/Dutch.lproj/Skim Help/version.texi 2007-08-27 09:24:03 UTC (rev 2723) @@ -1 +1 @@ -@set VERSION 0.6.1 +@set VERSION 0.7 Modified: trunk/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/Skim Help/version.texi =================================================================== --- trunk/English.lproj/Skim Help/version.texi 2007-08-27 08:49:55 UTC (rev 2722) +++ trunk/English.lproj/Skim Help/version.texi 2007-08-27 09:24:03 UTC (rev 2723) @@ -1 +1 @@ -@set VERSION 0.6.1 +@set VERSION 0.7 Modified: trunk/French.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/Skim Help/version.texi =================================================================== --- trunk/French.lproj/Skim Help/version.texi 2007-08-27 08:49:55 UTC (rev 2722) +++ trunk/French.lproj/Skim Help/version.texi 2007-08-27 09:24:03 UTC (rev 2723) @@ -1 +1 @@ -@set VERSION 0.6.1 +@set VERSION 0.7 Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2007-08-27 08:49:55 UTC (rev 2722) +++ trunk/Info.plist 2007-08-27 09:24:03 UTC (rev 2723) @@ -312,11 +312,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.6.1</string> + <string>0.7</string> <key>CFBundleSignature</key> <string>SKIM</string> <key>CFBundleVersion</key> - <string>v9</string> + <string>v10</string> <key>LSMinimumSystemVersion</key> <string>10.4.0</string> <key>NSAppleScriptEnabled</key> Modified: trunk/Italian.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/Skim Help/version.texi =================================================================== --- trunk/Italian.lproj/Skim Help/version.texi 2007-08-27 08:49:55 UTC (rev 2722) +++ trunk/Italian.lproj/Skim Help/version.texi 2007-08-27 09:24:03 UTC (rev 2723) @@ -1 +1 @@ -@set VERSION 0.6.1 +@set VERSION 0.7 Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-08-27 08:49:55 UTC (rev 2722) +++ trunk/ReleaseNotes.rtf 2007-08-27 09:24:03 UTC (rev 2723) @@ -136,9 +136,12 @@ {\listtext \'a5 }PDF view can now provide selected PDF for services.\ {\listtext \'a5 }Skim can now download PDFs from remote URLs, which can be provided on the clipboard, dropped on the Skim icon, or through Services.\ {\listtext \'a5 }Added a service to open selected PDF in Skim.\ -{\listtext \'a5 }Hidden defaults to to automatically open or close the downloads window or remove a finished downloads.\ {\listtext \'a5 }Added a new item in the page setup sheet to automatically rotate pages for printing. Choose Skim from the Settings popup.\ {\listtext \'a5 }You can now drag the image from an anchored notes window.\ +{\listtext \'a5 }Added type-select to quickly move to a page or an item in a table.\ +{\listtext \'a5 }You can now preview the image linked to an anchored note.\ +{\listtext \'a5 }Added some copy and delete actions as well as contextual menus to various tables.\ +{\listtext \'a5 }Some interface improvements.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ @@ -162,6 +165,10 @@ {\listtext \'a5 }Hopefully fix some problems with the placement of fullscreen windows.\ {\listtext \'a5 }Fix window title for single page documents.\ {\listtext \'a5 }Fix rounding problems when joining highlights.\ +{\listtext \'a5 }Implement Home and End keys in tables.\ +{\listtext \'a5 }Fix a possible crasher when reloading a file.\ +{\listtext \'a5 }Fix placement of full screen windows on secondary screens.\ +{\listtext \'a5 }Open all snapshots fom a previous run.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 15:39:57
|
Revision: 2726 http://skim-app.svn.sourceforge.net/skim-app/?rev=2726&view=rev Author: hofman Date: 2007-08-27 05:57:56 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Make camera cursor static variable. Modified Paths: -------------- trunk/NSCursor_SKExtensions.m Modified: trunk/NSCursor_SKExtensions.m =================================================================== --- trunk/NSCursor_SKExtensions.m 2007-08-27 12:00:17 UTC (rev 2725) +++ trunk/NSCursor_SKExtensions.m 2007-08-27 12:57:56 UTC (rev 2726) @@ -96,11 +96,11 @@ } + (NSCursor *)cameraCursor { - NSCursor *cameraCursor = nil; - - if (cameraCursor == nil) - cameraCursor = [[NSCursor alloc] initWithImage:[NSImage imageNamed:@"CameraCursor"] hotSpot:NSMakePoint(8.0, 8.0)]; - + static NSCursor *cameraCursor = nil; + if (nil == cameraCursor) { + NSImage *cursorImage = [[[NSImage imageNamed:@"CameraCursor"] copy] autorelease]; + cameraCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)]; + } return cameraCursor; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 15:39:53
|
Revision: 2729 http://skim-app.svn.sourceforge.net/skim-app/?rev=2729&view=rev Author: hofman Date: 2007-08-27 08:39:41 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Do saving of current documents in application delegate rather than the application. Somehow the application does not know when it opens the saved files. Modified Paths: -------------- trunk/SKApplication.h trunk/SKApplication.m trunk/SKApplicationController.h trunk/SKApplicationController.m Modified: trunk/SKApplication.h =================================================================== --- trunk/SKApplication.h 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplication.h 2007-08-27 15:39:41 UTC (rev 2729) @@ -38,15 +38,18 @@ #import <Cocoa/Cocoa.h> -extern NSString *SKApplicationWillTerminateNotification; +extern NSString *SKApplicationStartsTerminatingNotification; -@interface SKApplication : NSApplication { - NSTimer *currentDocumentsTimer; -} +@interface SKApplication : NSApplication - (IBAction)orderFrontLineInspector:(id)sender; @end +@interface NSObject (SKApplicationDelegate) +- (void)applicationStartsTerminating:(NSNotification *)aNotification; +@end + + @interface NSResponder (SKMagnifyWheel) - (void)magnifyWheel:(NSEvent *)theEvent; @end Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplication.m 2007-08-27 15:39:41 UTC (rev 2729) @@ -37,14 +37,13 @@ */ #import "SKApplication.h" -#import "SKStringConstants.h" #import "SKDocument.h" #import "SKPDFSynchronizer.h" #import "SKPDFView.h" #import "SKLineInspector.h" #import "NSString_SKExtensions.h" -NSString *SKApplicationWillTerminateNotification = @"SKApplicationWillTerminateNotification"; +NSString *SKApplicationStartsTerminatingNotification = @"SKApplicationStartsTerminatingNotification"; @interface NSApplication (NSApplicationPrivateDeclarations) - (id)handleOpenScriptCommand:(NSScriptCommand *)command; @@ -90,21 +89,11 @@ [super sendEvent:anEvent]; } -- (void)saveCurrentOpenDocuments:(NSTimer *)timer { - [[NSUserDefaults standardUserDefaults] setObject:[[[NSDocumentController sharedDocumentController] documents] valueForKey:@"currentDocumentSetup"] forKey:SKLastOpenFileNamesKey]; -} - -- (void)finishLaunching { - [super finishLaunching]; - currentDocumentsTimer = [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(saveCurrentOpenDocuments:) userInfo:nil repeats:YES] retain]; -} - - (IBAction)terminate:(id)sender { - [[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationWillTerminateNotification object:self]; - [currentDocumentsTimer invalidate]; - [currentDocumentsTimer release]; - currentDocumentsTimer = nil; - [self saveCurrentOpenDocuments:nil]; + NSNotification *notification = [NSNotification notificationWithName:SKApplicationStartsTerminatingNotification object:self]; + [[NSNotificationCenter defaultCenter] postNotification:notification]; + if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) + [[self delegate] applicationStartsTerminating:notification]; [super terminate:sender]; } Modified: trunk/SKApplicationController.h =================================================================== --- trunk/SKApplicationController.h 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplicationController.h 2007-08-27 15:39:41 UTC (rev 2729) @@ -41,8 +41,8 @@ @class SUUpdater, SKLine, SKDownloadController; @interface SKApplicationController : NSObject { + NSTimer *currentDocumentsTimer; BOOL remoteScrolling; - } + (void)setupDefaults; @@ -58,6 +58,8 @@ - (void)doSpotlightImportIfNeeded; +- (void)saveCurrentOpenDocuments:(id)sender; + - (NSString *)applicationSupportPathForDomain:(int)domain create:(BOOL)create; - (NSString *)pathForApplicationSupportFile:(NSString *)file ofType:(NSString *)extension; Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplicationController.m 2007-08-27 15:39:41 UTC (rev 2729) @@ -141,6 +141,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ [NSApp setServicesProvider:self]; + NSString *versionString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; SKVersionNumber *versionNumber = versionString ? [[[SKVersionNumber alloc] initWithVersionString:versionString] autorelease] : nil; NSString *lastVersionString = [[NSUserDefaults standardUserDefaults] stringForKey:SKLastVersionLaunchedKey]; @@ -149,9 +150,13 @@ [self showReleaseNotes:nil]; [[NSUserDefaults standardUserDefaults] setObject:versionString forKey:SKLastVersionLaunchedKey]; } - if ([[NSUserDefaults standardUserDefaults] boolForKey:SKEnableAppleRemoteKey]) + + if ([[NSUserDefaults standardUserDefaults] boolForKey:SKEnableAppleRemoteKey]) [[AppleRemote sharedRemote] setDelegate:self]; + [self doSpotlightImportIfNeeded]; + + currentDocumentsTimer = [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(saveCurrentOpenDocuments:) userInfo:nil repeats:YES] retain]; } - (void)applicationDidBecomeActive:(NSNotification *)aNotification { @@ -164,6 +169,13 @@ [[AppleRemote sharedRemote] setListeningToRemote:NO]; } +- (void)applicationStartsTerminating:(NSNotification *)aNotification { + [currentDocumentsTimer invalidate]; + [currentDocumentsTimer release]; + currentDocumentsTimer = nil; + [self saveCurrentOpenDocuments:nil]; +} + - (void)applicationWillTerminate:(NSNotification *)aNotification { if ([[NSUserDefaults standardUserDefaults] boolForKey:SKEnableAppleRemoteKey]) { [[AppleRemote sharedRemote] setListeningToRemote:NO]; @@ -341,6 +353,10 @@ } } +- (void)saveCurrentOpenDocuments:(id)sender { + [[NSUserDefaults standardUserDefaults] setObject:[[[NSDocumentController sharedDocumentController] documents] valueForKey:@"currentDocumentSetup"] forKey:SKLastOpenFileNamesKey]; +} + - (NSString *)applicationSupportPathForDomain:(int)domain create:(BOOL)create { static CFMutableDictionaryRef pathDict = nil; if (pathDict == nil) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 15:23:37
|
Revision: 2725 http://skim-app.svn.sourceforge.net/skim-app/?rev=2725&view=rev Author: hofman Date: 2007-08-27 05:00:17 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Add some white to the zoom cursors so they are visible on dark backgrounds. Modified Paths: -------------- trunk/Images/zoomInCursor.tiff trunk/Images/zoomOutCursor.tiff Modified: trunk/Images/zoomInCursor.tiff =================================================================== (Binary files differ) Modified: trunk/Images/zoomOutCursor.tiff =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 15:09:14
|
Revision: 2728 http://skim-app.svn.sourceforge.net/skim-app/?rev=2728&view=rev Author: hofman Date: 2007-08-27 08:09:12 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Periodically save the current open documents, so the last open file can be approximated in case of a crash. Make sure the normal window state is saved rather than the full screen state. Modified Paths: -------------- trunk/SKApplication.h trunk/SKApplication.m trunk/SKMainWindowController.m Modified: trunk/SKApplication.h =================================================================== --- trunk/SKApplication.h 2007-08-27 14:11:14 UTC (rev 2727) +++ trunk/SKApplication.h 2007-08-27 15:09:12 UTC (rev 2728) @@ -40,7 +40,9 @@ extern NSString *SKApplicationWillTerminateNotification; -@interface SKApplication : NSApplication +@interface SKApplication : NSApplication { + NSTimer *currentDocumentsTimer; +} - (IBAction)orderFrontLineInspector:(id)sender; @end Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2007-08-27 14:11:14 UTC (rev 2727) +++ trunk/SKApplication.m 2007-08-27 15:09:12 UTC (rev 2728) @@ -90,9 +90,21 @@ [super sendEvent:anEvent]; } +- (void)saveCurrentOpenDocuments:(NSTimer *)timer { + [[NSUserDefaults standardUserDefaults] setObject:[[[NSDocumentController sharedDocumentController] documents] valueForKey:@"currentDocumentSetup"] forKey:SKLastOpenFileNamesKey]; +} + +- (void)finishLaunching { + [super finishLaunching]; + currentDocumentsTimer = [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(saveCurrentOpenDocuments:) userInfo:nil repeats:YES] retain]; +} + - (IBAction)terminate:(id)sender { [[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationWillTerminateNotification object:self]; - [[NSUserDefaults standardUserDefaults] setObject:[[[NSDocumentController sharedDocumentController] documents] valueForKey:@"currentDocumentSetup"] forKey:SKLastOpenFileNamesKey]; + [currentDocumentsTimer invalidate]; + [currentDocumentsTimer release]; + currentDocumentsTimer = nil; + [self saveCurrentOpenDocuments:nil]; [super terminate:sender]; } Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-27 14:11:14 UTC (rev 2727) +++ trunk/SKMainWindowController.m 2007-08-27 15:09:12 UTC (rev 2728) @@ -520,7 +520,12 @@ [setup setObject:[NSNumber numberWithFloat:NSWidth([leftSideContentBox frame])] forKey:@"leftSidePaneWidth"]; [setup setObject:[NSNumber numberWithFloat:NSWidth([rightSideContentBox frame])] forKey:@"rightSidePaneWidth"]; [setup setObject:[NSNumber numberWithUnsignedInt:[[pdfView document] indexForPage:[pdfView currentPage]]] forKey:@"pageIndex"]; - [setup addEntriesFromDictionary:[self currentPDFSettings]]; + if ([self isFullScreen] || [self isPresentation]) { + [setup addEntriesFromDictionary:savedNormalSetup]; + [setup removeObjectsForKeys:[NSArray arrayWithObjects:@"hasHorizontalScroller", @"hasVerticalScroller", @"autoHidesScrollers", nil]]; + } else { + [setup addEntriesFromDictionary:[self currentPDFSettings]]; + } return setup; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 14:56:25
|
Revision: 2724 http://skim-app.svn.sourceforge.net/skim-app/?rev=2724&view=rev Author: hofman Date: 2007-08-27 02:25:08 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Tag for release. Added Paths: ----------- tags/REL_0_7/ Copied: tags/REL_0_7 (from rev 2723, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 14:11:17
|
Revision: 2727 http://skim-app.svn.sourceforge.net/skim-app/?rev=2727&view=rev Author: hofman Date: 2007-08-27 07:11:14 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Adjust size of page columns so they page numbers exactly fit. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.m trunk/SKThumbnailTableView.m Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-27 12:57:56 UTC (rev 2726) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-27 14:11:14 UTC (rev 2727) @@ -29,6 +29,12 @@ <array> <integer>208</integer> </array> + <key>IBOpenObjects</key> + <array> + <integer>314</integer> + <integer>502</integer> + <integer>224</integer> + </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-08-27 12:57:56 UTC (rev 2726) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-08-27 14:11:14 UTC (rev 2727) @@ -32,19 +32,19 @@ <key>IBOpenObjects</key> <array> <integer>256</integer> + <integer>633</integer> <integer>5</integer> - <integer>208</integer> + <integer>224</integer> + <integer>553</integer> <integer>694</integer> - <integer>314</integer> - <integer>585</integer> + <integer>687</integer> <integer>502</integer> - <integer>633</integer> <integer>168</integer> - <integer>224</integer> - <integer>553</integer> + <integer>539</integer> + <integer>208</integer> <integer>511</integer> - <integer>687</integer> - <integer>539</integer> + <integer>585</integer> + <integer>314</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/French.lproj/MainWindow.nib/info.nib 2007-08-27 12:57:56 UTC (rev 2726) +++ trunk/French.lproj/MainWindow.nib/info.nib 2007-08-27 14:11:14 UTC (rev 2727) @@ -31,16 +31,16 @@ </array> <key>IBOpenObjects</key> <array> - <integer>224</integer> - <integer>661</integer> <integer>511</integer> - <integer>168</integer> + <integer>256</integer> <integer>633</integer> <integer>314</integer> + <integer>224</integer> <integer>660</integer> + <integer>661</integer> + <integer>168</integer> <integer>502</integer> <integer>5</integer> - <integer>256</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-27 12:57:56 UTC (rev 2726) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-27 14:11:14 UTC (rev 2727) @@ -31,19 +31,19 @@ </array> <key>IBOpenObjects</key> <array> - <integer>539</integer> - <integer>628</integer> + <integer>168</integer> + <integer>314</integer> + <integer>511</integer> <integer>677</integer> <integer>5</integer> - <integer>676</integer> + <integer>539</integer> <integer>502</integer> <integer>553</integer> + <integer>628</integer> + <integer>256</integer> + <integer>224</integer> <integer>208</integer> - <integer>224</integer> - <integer>314</integer> - <integer>256</integer> - <integer>511</integer> - <integer>168</integer> + <integer>676</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-27 12:57:56 UTC (rev 2726) +++ trunk/SKMainWindowController.m 2007-08-27 14:11:14 UTC (rev 2727) @@ -793,14 +793,33 @@ [self resetThumbnails]; [self updateThumbnailSelection]; + NSTableColumn *tableColumn = [[thumbnailTableView tableColumns] objectAtIndex:1]; + id cell = [tableColumn dataCell]; + float labelWidth = 0.0; + int i, count = [document pageCount]; + [self willChangeValueForKey:@"pageLabels"]; [pageLabels removeAllObjects]; - int i, count = [document pageCount]; for (i = 0; i < count; i++) { NSString *label = [[document pageAtIndex:i] label]; [pageLabels addObject:label ? label : @""]; + [cell setStringValue:label]; + labelWidth = fmax(labelWidth, [cell cellSize].width); } [self didChangeValueForKey:@"pageLabels"]; + + [tableColumn setMinWidth:labelWidth]; + [tableColumn setMaxWidth:labelWidth]; + [thumbnailTableView sizeToFit]; + tableColumn = [[outlineView tableColumns] objectAtIndex:1]; + [tableColumn setMinWidth:labelWidth]; + [tableColumn setMaxWidth:labelWidth]; + [outlineView sizeToFit]; + tableColumn = [[snapshotTableView tableColumns] objectAtIndex:1]; + [tableColumn setMinWidth:labelWidth]; + [tableColumn setMaxWidth:labelWidth]; + [snapshotTableView sizeToFit]; + [[thumbnailTableView typeSelectHelper] rebuildTypeSelectSearchCache]; NSEnumerator *setupEnum = [snapshotDicts objectEnumerator]; Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-08-27 12:57:56 UTC (rev 2726) +++ trunk/SKThumbnailTableView.m 2007-08-27 14:11:14 UTC (rev 2727) @@ -175,6 +175,12 @@ return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:hasWindow], @"hasWindow", [self stringValue], @"label", nil]; } +- (NSSize)cellSize { + NSSize size = [super cellSize]; + size.width = fmax(size.width, 12.0); + return size; +} + - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { NSRect textRect, imageRect, ignored; NSDivideRect(cellFrame, &textRect, &imageRect, 17.0, NSMinYEdge); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-27 13:59:10
|
Revision: 2720 http://skim-app.svn.sourceforge.net/skim-app/?rev=2720&view=rev Author: hofman Date: 2007-08-26 12:39:17 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Open all remembered snapshot when opening a file. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-26 09:40:06 UTC (rev 2719) +++ trunk/SKMainWindowController.m 2007-08-26 19:39:17 UTC (rev 2720) @@ -369,7 +369,7 @@ if ([sud boolForKey:SKRememberSnapshotsKey]) { NSEnumerator *setupEnum = [[[SKBookmarkController sharedBookmarkController] snapshotsAtPath:[[[self document] fileURL] path]] objectEnumerator]; NSDictionary *setup; - if (setup = [setupEnum nextObject]) + while (setup = [setupEnum nextObject]) [self showSnapshotAtPageNumber:[[setup objectForKey:@"page"] unsignedIntValue] forRect:NSRectFromString([setup objectForKey:@"rect"]) factor:[[setup objectForKey:@"scaleFactor"] floatValue] autoFits:[[setup objectForKey:@"autoFits"] boolValue] display:[[setup objectForKey:@"hasWindow"] boolValue]]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-26 11:06:02
|
Revision: 2719 http://skim-app.svn.sourceforge.net/skim-app/?rev=2719&view=rev Author: hofman Date: 2007-08-26 02:40:06 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Select row for contextual menu in some tables. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-24 17:17:30 UTC (rev 2718) +++ trunk/SKMainWindowController.m 2007-08-26 09:40:06 UTC (rev 2719) @@ -3353,6 +3353,8 @@ NSMenuItem *menuItem; if ([ov isEqual:noteOutlineView]) { + [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:item]] byExtendingSelection:NO]; + PDFAnnotation *annotation = [item type] ? item : [(SKNoteText *)item annotation]; menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease]; if ([self outlineView:ov canDeleteItems:[NSArray arrayWithObjects:item, nil]]) { @@ -3581,6 +3583,8 @@ [menuItem setTarget:self]; [menuItem setRepresentedObject:[[pdfView document] pageAtIndex:row]]; } else if ([tv isEqual:snapshotTableView]) { + [snapshotTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease]; SKSnapshotWindowController *controller = [[snapshotArrayController arrangedObjects] objectAtIndex:row]; NSMenuItem *menuItem = [menu addItemWithTitle:NSLocalizedString(@"Delete", @"Menu item title") action:@selector(deleteSnapshot:) keyEquivalent:@""]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-24 17:17:34
|
Revision: 2718 http://skim-app.svn.sourceforge.net/skim-app/?rev=2718&view=rev Author: hofman Date: 2007-08-24 10:17:30 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Remove accents from type-select values, as we don't support accents in type-select anyway. This makes type-select ignore accents. Modified Paths: -------------- trunk/NSString_SKExtensions.h trunk/NSString_SKExtensions.m trunk/SKBookmarkController.m trunk/SKDownloadController.m trunk/SKMainWindowController.m trunk/SKNotesDocument.m Modified: trunk/NSString_SKExtensions.h =================================================================== --- trunk/NSString_SKExtensions.h 2007-08-24 14:16:09 UTC (rev 2717) +++ trunk/NSString_SKExtensions.h 2007-08-24 17:17:30 UTC (rev 2718) @@ -51,6 +51,8 @@ - (NSArray *)shellScriptArgumentsArray; - (NSComparisonResult)localizedCaseInsensitiveNumericCompare:(NSString *)aStr; +- (NSString *)lossyASCIIString; + - (NSRange)rangeOfLeadingEmptyLine; - (NSRange)rangeOfLeadingEmptyLineInRange:(NSRange)range; - (NSRange)rangeOfTrailingEmptyLine; Modified: trunk/NSString_SKExtensions.m =================================================================== --- trunk/NSString_SKExtensions.m 2007-08-24 14:16:09 UTC (rev 2717) +++ trunk/NSString_SKExtensions.m 2007-08-24 17:17:30 UTC (rev 2718) @@ -199,6 +199,10 @@ locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]; } +- (NSString *)lossyASCIIString { + return [[[NSString alloc] initWithData:[self dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding] autorelease]; +} + #pragma mark Empty lines // whitespace at the beginning of the string up to the end or until (and including) a newline Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-24 14:16:09 UTC (rev 2717) +++ trunk/SKBookmarkController.m 2007-08-24 17:17:30 UTC (rev 2718) @@ -360,7 +360,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { - return [bookmarks valueForKey:@"label"]; + return [bookmarks valueForKeyPath:@"label.lossyASCIIString"]; } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { Modified: trunk/SKDownloadController.m =================================================================== --- trunk/SKDownloadController.m 2007-08-24 14:16:09 UTC (rev 2717) +++ trunk/SKDownloadController.m 2007-08-24 17:17:30 UTC (rev 2718) @@ -327,7 +327,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { - return [downloads valueForKeyPath:@"fileName"]; + return [downloads valueForKey:@"fileName"]; } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-24 14:16:09 UTC (rev 2717) +++ trunk/SKMainWindowController.m 2007-08-24 17:17:30 UTC (rev 2718) @@ -3604,12 +3604,12 @@ if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { return pageLabels; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { - return [[noteArrayController arrangedObjects] valueForKey:@"contents"]; + return [[noteArrayController arrangedObjects] valueForKeyPath:@"contents.lossyASCIIString"]; } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { int i, count = [outlineView numberOfRows]; NSMutableArray *array = [NSMutableArray arrayWithCapacity:count]; for (i = 0; i < count; i++) - [array addObject:[(PDFOutline *)[outlineView itemAtRow:i] label]]; + [array addObject:[[(PDFOutline *)[outlineView itemAtRow:i] label] lossyASCIIString]]; return array; } return nil; Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2007-08-24 14:16:09 UTC (rev 2717) +++ trunk/SKNotesDocument.m 2007-08-24 17:17:30 UTC (rev 2718) @@ -329,7 +329,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { - return [[arrayController arrangedObjects] valueForKey:@"contents"]; + return [[arrayController arrangedObjects] valueForKeyPath:@"contents.lossyASCIIString"]; } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-24 14:16:10
|
Revision: 2717 http://skim-app.svn.sourceforge.net/skim-app/?rev=2717&view=rev Author: hofman Date: 2007-08-24 07:16:09 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Use geometry category convenience method. No need to save the graphics state as lockFocus/unlockFocus makes sure the graphics state is setup initially. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-24 09:55:24 UTC (rev 2716) +++ trunk/SKPDFView.m 2007-08-24 14:16:09 UTC (rev 2717) @@ -3374,12 +3374,10 @@ int originalLevel = [theEvent clickCount]; // this should be at least 1 BOOL postNotification = [documentView postsBoundsChangedNotifications]; NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; - float smallWidth = [sud floatForKey:@"SKSmallMagnificationWidth"]; - float smallHeight = [sud floatForKey:@"SKSmallMagnificationHeight"]; - float largeWidth = [sud floatForKey:@"SKLargeMagnificationWidth"]; - float largeHeight = [sud floatForKey:@"SKLargeMagnificationHeight"]; - NSRect smallMagRect = NSMakeRect(-0.5 * smallWidth, -0.5 * smallHeight, smallWidth, smallHeight); - NSRect largeMagRect = NSMakeRect(-0.5 * largeWidth, -0.5 * largeHeight, largeWidth, largeHeight); + NSSize smallSize = NSMakeSize([sud floatForKey:@"SKSmallMagnificationWidth"], [sud floatForKey:@"SKSmallMagnificationHeight"]); + NSSize largeSize = NSMakeSize([sud floatForKey:@"SKLargeMagnificationWidth"], [sud floatForKey:@"SKLargeMagnificationHeight"]); + NSRect smallMagRect = SKRectFromCenterAndSize(NSZeroPoint, smallSize); + NSRect largeMagRect = SKRectFromCenterAndSize(NSZeroPoint, largeSize); NSBezierPath *path; NSColor *color = [NSColor colorWithCalibratedWhite:0.2 alpha:1.0]; NSShadow *shadow = [[[NSShadow alloc] init] autorelease]; @@ -3438,13 +3436,11 @@ NSWidth(originalBounds) / magnification, NSHeight(originalBounds) / magnification); [clipView lockFocus]; - [[NSGraphicsContext currentContext] saveGraphicsState]; outlineRect = [clipView convertRect:magRect fromView:nil]; [shadow set]; [color set]; path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect radius:9.5]; [path fill]; - [[NSGraphicsContext currentContext] restoreGraphicsState]; [clipView unlockFocus]; [documentView setBounds:magBounds]; @@ -3452,13 +3448,11 @@ [documentView setBounds:originalBounds]; [clipView lockFocus]; - [[NSGraphicsContext currentContext] saveGraphicsState]; outlineRect = NSInsetRect(outlineRect, 1.5, 1.5); [color set]; path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect radius:8.0]; [path setLineWidth:3.0]; [path stroke]; - [[NSGraphicsContext currentContext] restoreGraphicsState]; [clipView unlockFocus]; [[self window] enableFlushWindow]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-24 09:55:25
|
Revision: 2716 http://skim-app.svn.sourceforge.net/skim-app/?rev=2716&view=rev Author: hofman Date: 2007-08-24 02:55:24 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Add some shadow to the magnifying glass. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-23 17:39:40 UTC (rev 2715) +++ trunk/SKPDFView.m 2007-08-24 09:55:24 UTC (rev 2716) @@ -3380,6 +3380,12 @@ float largeHeight = [sud floatForKey:@"SKLargeMagnificationHeight"]; NSRect smallMagRect = NSMakeRect(-0.5 * smallWidth, -0.5 * smallHeight, smallWidth, smallHeight); NSRect largeMagRect = NSMakeRect(-0.5 * largeWidth, -0.5 * largeHeight, largeWidth, largeHeight); + NSBezierPath *path; + NSColor *color = [NSColor colorWithCalibratedWhite:0.2 alpha:1.0]; + NSShadow *shadow = [[[NSShadow alloc] init] autorelease]; + [shadow setShadowBlurRadius:4.0]; + [shadow setShadowOffset:NSMakeSize(0.0, -2.0)]; + [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.5]]; [documentView setPostsBoundsChangedNotifications: NO]; @@ -3415,31 +3421,43 @@ [[self window] disableFlushWindow]; // define rect for magnification in window coordinate if (currentLevel > 2) { - magRect = visibleRect; + magRect = (visibleRect); } else { magRect = currentLevel == 2 ? largeMagRect : smallMagRect; magRect.origin = SKAddPoints(magRect.origin, mouseLoc); + magRect = NSIntegralRect(magRect); // restore the cached image in order to clear the rect [[self window] restoreCachedImage]; - [[self window] cacheImageInRect:NSIntersectionRect(NSInsetRect(magRect, -2.0, -2.0), visibleRect)]; + [[self window] cacheImageInRect:NSIntersectionRect(NSInsetRect(magRect, -8.0, -8.0), visibleRect)]; } // resize bounds around mouseLoc magBounds.origin = [documentView convertPoint:mouseLoc fromView:nil]; - magBounds = NSMakeRect(magBounds.origin.x + (originalBounds.origin.x - magBounds.origin.x) / magnification, - magBounds.origin.y + (originalBounds.origin.y - magBounds.origin.y) / magnification, + magBounds = NSMakeRect(NSMinX(magBounds) + (NSMinX(originalBounds) - NSMinX(magBounds)) / magnification, + NSMinY(magBounds) + (NSMinY(originalBounds) - NSMinY(magBounds)) / magnification, NSWidth(originalBounds) / magnification, NSHeight(originalBounds) / magnification); + [clipView lockFocus]; + [[NSGraphicsContext currentContext] saveGraphicsState]; + outlineRect = [clipView convertRect:magRect fromView:nil]; + [shadow set]; + [color set]; + path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect radius:9.5]; + [path fill]; + [[NSGraphicsContext currentContext] restoreGraphicsState]; + [clipView unlockFocus]; + [documentView setBounds:magBounds]; [self displayRect:[self convertRect:NSInsetRect(magRect, 3.0, 3.0) fromView:nil]]; // this flushes the buffer [documentView setBounds:originalBounds]; [clipView lockFocus]; [[NSGraphicsContext currentContext] saveGraphicsState]; - outlineRect = NSInsetRect(NSIntegralRect([clipView convertRect:magRect fromView:nil]), 1.5, 1.5); - [NSBezierPath setDefaultLineWidth:3.0]; - [[NSColor colorWithCalibratedWhite:0.2 alpha:1.0] set]; - [NSBezierPath strokeRoundRectInRect:outlineRect radius:8.0]; + outlineRect = NSInsetRect(outlineRect, 1.5, 1.5); + [color set]; + path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect radius:8.0]; + [path setLineWidth:3.0]; + [path stroke]; [[NSGraphicsContext currentContext] restoreGraphicsState]; [clipView unlockFocus]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 17:39:42
|
Revision: 2715 http://skim-app.svn.sourceforge.net/skim-app/?rev=2715&view=rev Author: hofman Date: 2007-08-23 10:39:40 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Separate methods to enable and disable navigation window. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-23 15:31:23 UTC (rev 2714) +++ trunk/SKMainWindowController.m 2007-08-23 17:39:40 UTC (rev 2715) @@ -2177,7 +2177,7 @@ if ([fullScreenSetup count]) [self applyPDFSettings:fullScreenSetup]; - [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey] autohidesCursor:NO screen:screen]; + [pdfView enableNavigationActivatedAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey] autohidesCursor:NO screen:screen]; [self showSideWindowsOnScreen:screen]; } @@ -2200,7 +2200,7 @@ else [self goFullScreen]; - [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey] autohidesCursor:YES screen:nil]; + [pdfView enableNavigationActivatedAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey] autohidesCursor:YES screen:screen]; } - (IBAction)exitFullScreen:(id)sender { @@ -2212,7 +2212,7 @@ if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView]) [fullScreenWindow makeFirstResponder:nil]; - [pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO screen:nil]; + [pdfView disableNavigation]; [pdfView setFrame:[[pdfContentBox contentView] bounds]]; [pdfContentBox addSubview:pdfView]; // this should be done before exitPresentationMode to get a smooth transition Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-08-23 15:31:23 UTC (rev 2714) +++ trunk/SKPDFView.h 2007-08-23 17:39:40 UTC (rev 2715) @@ -175,7 +175,8 @@ - (void)takeSnapshot:(id)sender; -- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen; +- (void)enableNavigationActivatedAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen; +- (void)disableNavigation; - (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page; - (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-23 15:31:23 UTC (rev 2714) +++ trunk/SKPDFView.m 2007-08-23 17:39:40 UTC (rev 2715) @@ -2125,27 +2125,32 @@ [navWindow orderOut:self]; } -- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen { - hasNavigation = hasNav; +- (void)enableNavigationActivatedAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen { + hasNavigation = YES; autohidesCursor = hideCursor; activateNavigationAtBottom = atBottom; - if (hasNavigation) { - // always recreate the navWindow, since moving between screens of different resolution can mess up the location (in spite of moveToScreen:) - if (navWindow != nil) - [navWindow release]; - else - [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleWindowWillCloseNotification:) - name: NSWindowWillCloseNotification object: [self window]]; - navWindow = [[SKNavigationWindow alloc] initWithPDFView:self]; - [navWindow moveToScreen:screen]; - [navWindow setLevel:[[self window] level] + 1]; - } else if ([navWindow isVisible]) { - [navWindow orderOut:self]; - } - [self doAutohide:autohidesCursor || hasNavigation]; + // always recreate the navWindow, since moving between screens of different resolution can mess up the location (in spite of moveToScreen:) + if (navWindow != nil) + [navWindow release]; + else + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleWindowWillCloseNotification:) + name: NSWindowWillCloseNotification object: [self window]]; + navWindow = [[SKNavigationWindow alloc] initWithPDFView:self]; + [navWindow moveToScreen:screen]; + [navWindow setLevel:[[self window] level] + 1]; + + [self doAutohide:YES]; } +- (void)disableNavigation { + hasNavigation = NO; + autohidesCursor = NO; + activateNavigationAtBottom = NO; + + [navWindow orderOut:self]; +} + #pragma mark Menu validation - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 15:31:32
|
Revision: 2714 http://skim-app.svn.sourceforge.net/skim-app/?rev=2714&view=rev Author: hofman Date: 2007-08-23 08:31:23 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Use SKStatusBar in bookmarks window. Show status message while type select is processing. Modified Paths: -------------- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/classes.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/classes.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/classes.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/SKBookmarkController.h trunk/SKBookmarkController.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( - {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = SKTableView; }; + OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, + { + ACTIONS = {startAnimation = id; stopAnimation = id; }; + CLASS = SKStatusBar; + LANGUAGE = ObjC; + OUTLETS = {leftCell = id; rightCell = id; }; + SUPERCLASS = NSControl; + }, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( - {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = SKTableView; }; + OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, + { + ACTIONS = {startAnimation = id; stopAnimation = id; }; + CLASS = SKStatusBar; + LANGUAGE = ObjC; + OUTLETS = {leftCell = id; rightCell = id; }; + SUPERCLASS = NSControl; + }, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( - {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = SKTableView; }; + OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, + { + ACTIONS = {startAnimation = id; stopAnimation = id; }; + CLASS = SKStatusBar; + LANGUAGE = ObjC; + OUTLETS = {leftCell = id; rightCell = id; }; + SUPERCLASS = NSControl; + }, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( - {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = SKTableView; }; + OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, + { + ACTIONS = {startAnimation = id; stopAnimation = id; }; + CLASS = SKStatusBar; + LANGUAGE = ObjC; + OUTLETS = {leftCell = id; rightCell = id; }; + SUPERCLASS = NSControl; + }, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKBookmarkController.h =================================================================== --- trunk/SKBookmarkController.h 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/SKBookmarkController.h 2007-08-23 15:31:23 UTC (rev 2714) @@ -38,10 +38,11 @@ #import <Cocoa/Cocoa.h> -@class SKTableView; +@class SKTableView, SKStatusBar; @interface SKBookmarkController : NSWindowController { IBOutlet SKTableView *tableView; + IBOutlet SKStatusBar *statusBar; NSMutableArray *bookmarks; NSMutableArray *recentDocuments; NSUndoManager *undoManager; Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/SKBookmarkController.m 2007-08-23 15:31:23 UTC (rev 2714) @@ -43,6 +43,7 @@ #import "Files_SKExtensions.h" #import "SKTableView.h" #import "SKTypeSelectHelper.h" +#import "SKStatusBar.h" static NSString *SKBookmarkRowsPboardType = @"SKBookmarkRowsPboardType"; static NSString *SKBookmarkChangedNotification = @"SKBookmarkChangedNotification"; @@ -371,6 +372,13 @@ [tableView scrollRowToVisible:itemIndex]; } +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { + NSString *message = @""; + if (searchString) + message = [NSString stringWithFormat:NSLocalizedString(@"Finding: \"%@\"", @"Status message"), searchString]; + [statusBar setLeftStringValue:message]; +} + @end #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 14:54:59
|
Revision: 2713 http://skim-app.svn.sourceforge.net/skim-app/?rev=2713&view=rev Author: hofman Date: 2007-08-23 07:54:57 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Return nothing for outlineRowForPageIndex: when there is no outline, as the outlineView may perhaps be stale when the document is reloading. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-23 12:59:11 UTC (rev 2712) +++ trunk/SKMainWindowController.m 2007-08-23 14:54:57 UTC (rev 2713) @@ -3662,6 +3662,9 @@ #pragma mark Outline - (int)outlineRowForPageIndex:(unsigned int)pageIndex { + if (pdfOutline == nil) + return -1; + int i, numRows = [outlineView numberOfRows]; for (i = 0; i < numRows; i++) { // Get the destination of the given row.... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 12:59:12
|
Revision: 2712 http://skim-app.svn.sourceforge.net/skim-app/?rev=2712&view=rev Author: hofman Date: 2007-08-23 05:59:11 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Invert check for control characters. Modified Paths: -------------- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-23 12:53:21 UTC (rev 2711) +++ trunk/SKTypeSelectHelper.m 2007-08-23 12:59:11 UTC (rev 2712) @@ -161,7 +161,7 @@ - (BOOL)isTypeSelectCharacter:(unichar)character { if ([[NSCharacterSet alphanumericCharacterSet] characterIsMember:character]) return YES; - if ([self isProcessing] && [[NSCharacterSet controlCharacterSet] characterIsMember:character]) + if ([self isProcessing] && [[NSCharacterSet controlCharacterSet] characterIsMember:character] == NO) return YES; return NO; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 12:53:22
|
Revision: 2711 http://skim-app.svn.sourceforge.net/skim-app/?rev=2711&view=rev Author: hofman Date: 2007-08-23 05:53:21 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Allow typing non-control and non-alphanumeric characters for type-select, just not as the initial character. Add some convenience accessors for those. Scroll row found by type-select to visible. Modified Paths: -------------- trunk/SKBookmarkController.m trunk/SKDownloadController.m trunk/SKMainWindowController.m trunk/SKNotesDocument.m trunk/SKOutlineView.m trunk/SKTableView.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKBookmarkController.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -368,6 +368,7 @@ - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; + [tableView scrollRowToVisible:itemIndex]; } @end Modified: trunk/SKDownloadController.m =================================================================== --- trunk/SKDownloadController.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKDownloadController.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -336,6 +336,7 @@ - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; + [tableView scrollRowToVisible:itemIndex]; } @end Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKMainWindowController.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -3633,8 +3633,10 @@ } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; [noteOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + [noteOutlineView scrollRowToVisible:row]; } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; + [noteOutlineView scrollRowToVisible:itemIndex]; } } Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKNotesDocument.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -348,6 +348,7 @@ - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { int row = [outlineView rowForItem:[[arrayController arrangedObjects] objectAtIndex:itemIndex]]; [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + [outlineView scrollRowToVisible:row]; } @end Modified: trunk/SKOutlineView.m =================================================================== --- trunk/SKOutlineView.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKOutlineView.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -91,9 +91,9 @@ unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if (typeSelectHelper && modifierFlags == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) + if ([typeSelectHelper isTypeSelectCharacter:eventChar] && typeSelectHelper && modifierFlags == 0) [typeSelectHelper processKeyDownCharacter:eventChar]; - else if (typeSelectHelper && modifierFlags == 0 && eventChar == '/') + else if ([typeSelectHelper isRepeatCharacter:eventChar] && modifierFlags == 0) [typeSelectHelper repeatSearch]; else if (eventChar == NSHomeFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) [self scrollToBeginningOfDocument:nil]; Modified: trunk/SKTableView.m =================================================================== --- trunk/SKTableView.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKTableView.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -69,9 +69,9 @@ unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if (typeSelectHelper && modifierFlags == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) + if ([typeSelectHelper isTypeSelectCharacter:eventChar] && typeSelectHelper && modifierFlags == 0) [typeSelectHelper processKeyDownCharacter:eventChar]; - else if ([typeSelectHelper cyclesSimilarResults] && modifierFlags == 0 && eventChar == '/') + else if ([typeSelectHelper isRepeatCharacter:eventChar] && modifierFlags == 0) [typeSelectHelper repeatSearch]; else if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifierFlags == 0 && [self canDelete]) [self delete:self]; Modified: trunk/SKTypeSelectHelper.h =================================================================== --- trunk/SKTypeSelectHelper.h 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKTypeSelectHelper.h 2007-08-23 12:53:21 UTC (rev 2711) @@ -76,6 +76,9 @@ - (void)processKeyDownCharacter:(unichar)character; - (void)repeatSearch; +- (BOOL)isTypeSelectCharacter:(unichar)character; +- (BOOL)isRepeatCharacter:(unichar)character; + @end Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKTypeSelectHelper.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -39,6 +39,7 @@ #import "SKTypeSelectHelper.h" #define TIMEOUT 0.7 +#define REPEAT_CHARACTER '/' @interface NSString (BDSKTypeAheadHelperExtensions) - (BOOL)containsStringStartingAtWord:(NSString *)string options:(int)mask range:(NSRange)range; @@ -157,6 +158,18 @@ processing = NO; } +- (BOOL)isTypeSelectCharacter:(unichar)character { + if ([[NSCharacterSet alphanumericCharacterSet] characterIsMember:character]) + return YES; + if ([self isProcessing] && [[NSCharacterSet controlCharacterSet] characterIsMember:character]) + return YES; + return NO; +} + +- (BOOL)isRepeatCharacter:(unichar)character { + return [self cyclesSimilarResults] && character == REPEAT_CHARACTER; +} + @end #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 11:34:36
|
Revision: 2710 http://skim-app.svn.sourceforge.net/skim-app/?rev=2710&view=rev Author: hofman Date: 2007-08-23 04:08:50 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Move delete and copy support to custom base table classes. Implement copying for note table and delete for donwload table. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKNoteOutlineView.h trunk/SKNoteOutlineView.m trunk/SKOutlineView.h trunk/SKOutlineView.m trunk/SKTableView.h trunk/SKTableView.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKMainWindowController.m 2007-08-23 11:08:50 UTC (rev 2710) @@ -3230,13 +3230,74 @@ [item setRowHeight:newHeight]; } -- (void)outlineViewDeleteSelectedRows:(NSOutlineView *)ov { - if ([ov isEqual:noteOutlineView] && [ov selectedRow] != -1) { - [pdfView removeAnnotation:[self selectedNote]]; +- (NSArray *)noteItems:(NSArray *)items { + NSEnumerator *itemEnum = [items objectEnumerator]; + PDFAnnotation *item; + NSMutableArray *noteItems = [NSMutableArray array]; + + while (item = [itemEnum nextObject]) { + if ([item type] == nil) { + item = [(SKNoteText *)item annotation]; + } + if ([noteItems containsObject:item] == NO) + [noteItems addObject:item]; + } + return noteItems; +} + +- (void)outlineView:(NSOutlineView *)ov deleteItems:(NSArray *)items { + if ([ov isEqual:noteOutlineView] && [items count]) { + NSEnumerator *itemEnum = [[self noteItems:items] objectEnumerator]; + PDFAnnotation *item; + while (item = [itemEnum nextObject]) + [pdfView removeAnnotation:item]; [[[self document] undoManager] setActionName:NSLocalizedString(@"Remove Note", @"Undo action name")]; } } +- (BOOL)outlineView:(NSOutlineView *)ov canDeleteItems:(NSArray *)items { + if ([ov isEqual:noteOutlineView]) { + return [items count] > 0; + } + return NO; +} + +- (void)outlineView:(NSOutlineView *)ov copyItems:(NSArray *)items { + if ([ov isEqual:noteOutlineView] && [items count]) { + NSEnumerator *itemEnum = [[self noteItems:items] objectEnumerator]; + PDFAnnotation *item = nil; + id firstItem = [items objectAtIndex:0]; + while (item = [itemEnum nextObject]) + if ([item isMovable]) break; + NSPasteboard *pboard = [NSPasteboard generalPasteboard]; + NSMutableArray *types = [NSMutableArray array]; + NSData *noteData = item ? [NSKeyedArchiver archivedDataWithRootObject:[item dictionaryValue]] : nil; + NSAttributedString *attrString = [firstItem type] ? nil : [(SKNoteText *)firstItem contents]; + NSString *string = [firstItem type] ? [firstItem contents] : [attrString string]; + if (noteData) + [types addObject:SKSkimNotePboardType]; + if (string) + [types addObject:NSStringPboardType]; + if (attrString) + [types addObject:NSRTFPboardType]; + if ([types count]) + [pboard declareTypes:types owner:nil]; + if (noteData) + [pboard setData:noteData forType:SKSkimNotePboardType]; + if (string) + [pboard setString:string forType:NSStringPboardType]; + if (attrString) + [pboard setData:[attrString RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil] forType:NSRTFPboardType]; + } +} + +- (BOOL)outlineView:(NSOutlineView *)ov canCopyItems:(NSArray *)items { + if ([ov isEqual:noteOutlineView]) { + return [items count] > 0; + } + return NO; +} + - (NSArray *)outlineViewHighlightedRows:(NSOutlineView *)ov { if ([ov isEqual:outlineView]) { NSMutableArray *array = [NSMutableArray array]; @@ -3270,10 +3331,14 @@ - (void)deleteNote:(id)sender { PDFAnnotation *annotation = [sender representedObject]; - [pdfView removeAnnotation:annotation]; - [[[self document] undoManager] setActionName:NSLocalizedString(@"Remove Note", @"Undo action name")]; + [self outlineView:noteOutlineView deleteItems:[NSArray arrayWithObjects:annotation, nil]]; } +- (void)copyNote:(id)sender { + PDFAnnotation *annotation = [sender representedObject]; + [self outlineView:noteOutlineView copyItems:[NSArray arrayWithObjects:annotation, nil]]; +} + - (void)selectNote:(id)sender { PDFAnnotation *annotation = [sender representedObject]; [pdfView setActiveAnnotation:annotation]; @@ -3285,25 +3350,33 @@ - (NSMenu *)outlineView:(NSOutlineView *)ov menuForTableColumn:(NSTableColumn *)tableColumn item:(id)item { NSMenu *menu = nil; + NSMenuItem *menuItem; + if ([ov isEqual:noteOutlineView]) { - if ([item type] == nil) - item = [(SKNoteText *)item annotation]; + PDFAnnotation *annotation = [item type] ? item : [(SKNoteText *)item annotation]; menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease]; - NSMenuItem *menuItem = [menu addItemWithTitle:NSLocalizedString(@"Delete", @"Menu item title") action:@selector(deleteNote:) keyEquivalent:@""]; - [menuItem setTarget:self]; - [menuItem setRepresentedObject:item]; + if ([self outlineView:ov canDeleteItems:[NSArray arrayWithObjects:item, nil]]) { + menuItem = [menu addItemWithTitle:NSLocalizedString(@"Delete", @"Menu item title") action:@selector(deleteNote:) keyEquivalent:@""]; + [menuItem setTarget:self]; + [menuItem setRepresentedObject:item]; + } + if ([self outlineView:ov canCopyItems:[NSArray arrayWithObjects:item, nil]]) { + menuItem = [menu addItemWithTitle:NSLocalizedString(@"Copy", @"Menu item title") action:@selector(copyNote:) keyEquivalent:@""]; + [menuItem setTarget:self]; + [menuItem setRepresentedObject:item]; + } if ([pdfView hideNotes] == NO) { - if ([item isEditable]) { + if ([annotation isEditable]) { menuItem = [menu addItemWithTitle:NSLocalizedString(@"Edit", @"Menu item title") action:@selector(editThisAnnotation:) keyEquivalent:@""]; [menuItem setTarget:pdfView]; - [menuItem setRepresentedObject:item]; + [menuItem setRepresentedObject:annotation]; } - if ([pdfView activeAnnotation] == item) + if ([pdfView activeAnnotation] == annotation) menuItem = [menu addItemWithTitle:NSLocalizedString(@"Deselect", @"Menu item title") action:@selector(deselectNote:) keyEquivalent:@""]; else menuItem = [menu addItemWithTitle:NSLocalizedString(@"Select", @"Menu item title") action:@selector(selectNote:) keyEquivalent:@""]; [menuItem setTarget:self]; - [menuItem setRepresentedObject:item]; + [menuItem setRepresentedObject:annotation]; } } return menu; Modified: trunk/SKNoteOutlineView.h =================================================================== --- trunk/SKNoteOutlineView.h 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKNoteOutlineView.h 2007-08-23 11:08:50 UTC (rev 2710) @@ -58,11 +58,9 @@ @interface NSObject (SKNoteOutlineViewDelegate) -- (void)outlineViewDeleteSelectedRows:(NSOutlineView *)anOutlineView; - (BOOL)outlineView:(NSOutlineView *)anOutlineView canResizeRowByItem:(id)item; - (void)outlineView:(NSOutlineView *)anOutlineView setHeightOfRow:(int)newHeight byItem:(id)item; - (void)outlineViewNoteTypesDidChange:(NSOutlineView *)anOutlineView; -- (NSMenu *)outlineView:(NSOutlineView *)anOutlineView menuForTableColumn:(NSTableColumn *)tableColumn item:(id)item; @end Modified: trunk/SKNoteOutlineView.m =================================================================== --- trunk/SKNoteOutlineView.m 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKNoteOutlineView.m 2007-08-23 11:08:50 UTC (rev 2710) @@ -53,50 +53,6 @@ [self noteTypeMenu]; // this sets the menu for the header view } -- (void)delete:(id)sender { - if ([[self delegate] respondsToSelector:@selector(outlineViewDeleteSelectedRows:)]) { - if ([[self selectedRowIndexes] count] == 0) - NSBeep(); - else - [[self delegate] outlineViewDeleteSelectedRows:self]; - } -} - -- (void)keyDown:(NSEvent *)theEvent { - NSString *characters = [theEvent charactersIgnoringModifiers]; - unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; - unsigned int modifiers = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - - if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifiers == 0) - [self delete:self]; - else - [super keyDown:theEvent]; -} - -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - if ([menuItem action] == @selector(delete:)) - return [[self selectedRowIndexes] count] > 0; - else if ([NSOutlineView instancesRespondToSelector:@selector(validateMenuItem:)]) - return [super validateMenuItem:menuItem]; - return YES; -} - -- (NSMenu *)menuForEvent:(NSEvent *)theEvent { - NSMenu *menu = nil; - - if ([[self delegate] respondsToSelector:@selector(outlineView:menuForTableColumn:item:)]) { - NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - int row = [self rowAtPoint:mouseLoc]; - int column = [self columnAtPoint:mouseLoc]; - if (row != -1 && column != -1) { - NSTableColumn *tableColumn = [[self tableColumns] objectAtIndex:column]; - menu = [[self delegate] outlineView:self menuForTableColumn:tableColumn item:[self itemAtRow:row]]; - } - } - - return menu; -} - - (BOOL)resizeRow:(int)row withEvent:(NSEvent *)theEvent { id item = [self itemAtRow:row]; NSPoint startPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; Modified: trunk/SKOutlineView.h =================================================================== --- trunk/SKOutlineView.h 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKOutlineView.h 2007-08-23 11:08:50 UTC (rev 2710) @@ -44,10 +44,27 @@ SKTypeSelectHelper *typeSelectHelper; } +- (NSArray *)selectedItems; + - (SKTypeSelectHelper *)typeSelectHelper; - (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; +- (BOOL)canDelete; +- (void)delete:(id)sender; + +- (BOOL)canCopy; +- (void)copy:(id)sender; + - (void)scrollToBeginningOfDocument:(id)sender; - (void)scrollToEndOfDocument:(id)sender; @end + + +@interface NSObject (SKOutlineViewDelegate) +- (void)outlineView:(NSOutlineView *)anOutlineView deleteItems:(NSArray *)items; +- (BOOL)outlineView:(NSOutlineView *)anOutlineView canDeleteItems:(NSArray *)items; +- (void)outlineView:(NSOutlineView *)anOutlineView copyItems:(NSArray *)items; +- (BOOL)outlineView:(NSOutlineView *)anOutlineView canCopyItems:(NSArray *)items; +- (NSMenu *)outlineView:(NSOutlineView *)anOutlineView menuForTableColumn:(NSTableColumn *)tableColumn item:(id)item; +@end Modified: trunk/SKOutlineView.m =================================================================== --- trunk/SKOutlineView.m 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKOutlineView.m 2007-08-23 11:08:50 UTC (rev 2710) @@ -48,6 +48,18 @@ [super dealloc]; } +- (NSArray *)selectedItems { + NSMutableArray *items = [NSMutableArray array]; + NSIndexSet *indexes = [self selectedRowIndexes]; + unsigned int index = [indexes firstIndex]; + + while (index != NSNotFound) { + [items addObject:[self itemAtRow:index]]; + index = [indexes indexGreaterThanIndex:index]; + } + return items; +} + - (SKTypeSelectHelper *)typeSelectHelper { return typeSelectHelper; } @@ -101,4 +113,66 @@ [self scrollRowToVisible:[self numberOfRows] - 1]; } +- (BOOL)canDelete { + NSArray *items = [self selectedItems]; + if ([items count] && [[self delegate] respondsToSelector:@selector(outlineView:deleteItems:)]) { + if ([[self delegate] respondsToSelector:@selector(outlineView:canDeleteItems:)]) + return [[self delegate] outlineView:self canDeleteItems:items]; + else + return YES; + } + return NO; +} + +- (void)delete:(id)sender { + if ([self canDelete]) + [[self delegate] outlineView:self deleteItems:[self selectedItems]]; + else + NSBeep(); +} + +- (BOOL)canCopy { + NSArray *items = [self selectedItems]; + if ([items count] && [[self delegate] respondsToSelector:@selector(outlineView:copyItems:)]) { + if ([[self delegate] respondsToSelector:@selector(outlineView:canCopyItems:)]) + return [[self delegate] outlineView:self canCopyItems:items]; + else + return YES; + } + return NO; +} + +- (void)copy:(id)sender { + if ([self canCopy]) + [[self delegate] outlineView:self copyItems:[self selectedItems]]; + else + NSBeep(); +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { + if ([menuItem action] == @selector(delete:)) + return [self canDelete]; + else if ([menuItem action] == @selector(copy:)) + return [self canCopy]; + else if ([[SKOutlineView superclass] instancesRespondToSelector:@selector(validateMenuItem:)]) + return [super validateMenuItem:menuItem]; + return YES; +} + +- (NSMenu *)menuForEvent:(NSEvent *)theEvent { + NSMenu *menu = nil; + + if ([[self delegate] respondsToSelector:@selector(outlineView:menuForTableColumn:item:)]) { + NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + int row = [self rowAtPoint:mouseLoc]; + int column = [self columnAtPoint:mouseLoc]; + if (row != -1 && column != -1) { + NSTableColumn *tableColumn = [[self tableColumns] objectAtIndex:column]; + menu = [[self delegate] outlineView:self menuForTableColumn:tableColumn item:[self itemAtRow:row]]; + } + } + + return menu; +} + @end Modified: trunk/SKTableView.h =================================================================== --- trunk/SKTableView.h 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKTableView.h 2007-08-23 11:08:50 UTC (rev 2710) @@ -50,6 +50,9 @@ - (BOOL)canDelete; - (void)delete:(id)sender; +- (BOOL)canCopy; +- (void)copy:(id)sender; + - (void)scrollToBeginningOfDocument:(id)sender; - (void)scrollToEndOfDocument:(id)sender; @@ -59,4 +62,7 @@ @interface NSObject (SKTableViewDelegate) - (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes; - (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes; +- (void)tableView:(NSTableView *)aTableView copyRowsWithIndexes:(NSIndexSet *)rowIndexes; +- (BOOL)tableView:(NSTableView *)aTableView canCopyRowsWithIndexes:(NSIndexSet *)rowIndexes; +- (NSMenu *)tableView:(NSTableView *)aTableView menuForTableColumn:(NSTableColumn *)tableColumn row:(int)rowIndex; @end Modified: trunk/SKTableView.m =================================================================== --- trunk/SKTableView.m 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKTableView.m 2007-08-23 11:08:50 UTC (rev 2710) @@ -95,10 +95,13 @@ - (BOOL)canDelete { NSIndexSet *indexes = [self selectedRowIndexes]; - return [indexes count] && - [[self delegate] respondsToSelector:@selector(tableView:canDeleteRowsWithIndexes:)] && - [[self delegate] respondsToSelector:@selector(tableView:deleteRowsWithIndexes:)] && - [[self delegate] tableView:self canDeleteRowsWithIndexes:indexes]; + if ([indexes count] && [[self delegate] respondsToSelector:@selector(tableView:deleteRowsWithIndexes:)]) { + if ([[self delegate] respondsToSelector:@selector(tableView:canDeleteRowsWithIndexes:)]) + return [[self delegate] tableView:self canDeleteRowsWithIndexes:indexes]; + else + return YES; + } + return NO; } - (void)delete:(id)sender { @@ -108,10 +111,48 @@ NSBeep(); } +- (BOOL)canCopy { + NSIndexSet *indexes = [self selectedRowIndexes]; + if ([indexes count] && [[self delegate] respondsToSelector:@selector(tableView:copyRowsWithIndexes:)]) { + if ([[self delegate] respondsToSelector:@selector(tableView:canCopyRowsWithIndexes:)]) + return [[self delegate] tableView:self canCopyRowsWithIndexes:indexes]; + else + return YES; + } + return NO; +} + +- (void)copy:(id)sender { + if ([self canCopy]) + [[self delegate] tableView:self copyRowsWithIndexes:[self selectedRowIndexes]]; + else + NSBeep(); +} + - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if ([menuItem action] == @selector(delete:)) return [self canDelete]; + else if ([menuItem action] == @selector(copy:)) + return [self canCopy]; + else if ([[SKTableView superclass] instancesRespondToSelector:@selector(validateMenuItem:)]) + return [super validateMenuItem:menuItem]; return YES; } +- (NSMenu *)menuForEvent:(NSEvent *)theEvent { + NSMenu *menu = nil; + + if ([[self delegate] respondsToSelector:@selector(tableView:menuForTableColumn:row:)]) { + NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + int row = [self rowAtPoint:mouseLoc]; + int column = [self columnAtPoint:mouseLoc]; + if (row != -1 && column != -1) { + NSTableColumn *tableColumn = [[self tableColumns] objectAtIndex:column]; + menu = [[self delegate] tableView:self menuForTableColumn:tableColumn row:row]; + } + } + + return menu; +} + @end Modified: trunk/SKThumbnailTableView.h =================================================================== --- trunk/SKThumbnailTableView.h 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKThumbnailTableView.h 2007-08-23 11:08:50 UTC (rev 2710) @@ -48,7 +48,6 @@ } - (BOOL)isScrolling; -- (BOOL)canCopy; @end @@ -66,7 +65,4 @@ @interface NSObject (SKThumbnailTableViewDelegate) - (NSArray *)tableViewHighlightedRows:(NSTableView *)tableView; - (BOOL)tableView:(NSTableView *)tableView commandSelectRow:(int)rowIndex; -- (void)tableView:(NSTableView *)aTableView copyRowsWithIndexes:(NSIndexSet *)rowIndexes; -- (BOOL)tableView:(NSTableView *)aTableView canCopyRowsWithIndexes:(NSIndexSet *)rowIndexes; -- (NSMenu *)tableView:(NSTableView *)aTableView menuForTableColumn:(NSTableColumn *)tableColumn row:(int)rowIndex; @end Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-08-23 08:51:51 UTC (rev 2709) +++ trunk/SKThumbnailTableView.m 2007-08-23 11:08:50 UTC (rev 2710) @@ -132,45 +132,6 @@ [super mouseDown:theEvent]; } -- (BOOL)canCopy { - NSIndexSet *indexes = [self selectedRowIndexes]; - return [indexes count] && - [[self delegate] respondsToSelector:@selector(tableView:canCopyRowsWithIndexes:)] && - [[self delegate] respondsToSelector:@selector(tableView:copyRowsWithIndexes:)] && - [[self delegate] tableView:self canCopyRowsWithIndexes:indexes]; -} - -- (void)copy:(id)sender { - if ([self canCopy]) - [[self delegate] tableView:self copyRowsWithIndexes:[self selectedRowIndexes]]; - else - NSBeep(); -} - -- (NSMenu *)menuForEvent:(NSEvent *)theEvent { - NSMenu *menu = nil; - - if ([[self delegate] respondsToSelector:@selector(tableView:menuForTableColumn:row:)]) { - NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - int row = [self rowAtPoint:mouseLoc]; - int column = [self columnAtPoint:mouseLoc]; - if (row != -1 && column != -1) { - NSTableColumn *tableColumn = [[self tableColumns] objectAtIndex:column]; - menu = [[self delegate] tableView:self menuForTableColumn:tableColumn row:row]; - } - } - - return menu; -} - -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - if ([menuItem action] == @selector(copy:)) - return [self canCopy]; - else if ([NSTableView instancesRespondToSelector:@selector(validateMenuItem:)]) - return [super validateMenuItem:menuItem]; - return YES; -} - @end #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-23 08:51:53
|
Revision: 2709 http://skim-app.svn.sourceforge.net/skim-app/?rev=2709&view=rev Author: hofman Date: 2007-08-23 01:51:51 -0700 (Thu, 23 Aug 2007) Log Message: ----------- implement delete for downloads table. Modified Paths: -------------- trunk/SKDownloadController.m Modified: trunk/SKDownloadController.m =================================================================== --- trunk/SKDownloadController.m 2007-08-22 23:42:16 UTC (rev 2708) +++ trunk/SKDownloadController.m 2007-08-23 08:51:51 UTC (rev 2709) @@ -306,6 +306,24 @@ return toolTip; } +- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes { + unsigned int row = [rowIndexes firstIndex]; + SKDownload *download = [downloads objectAtIndex:row]; + + if ([download canCancel]) { + [download cancelDownload]; + } else { + [download cleanupDownload]; + [downloads removeObjectAtIndex:row]; + [self reloadTableView]; + [self updateButtons]; + } +} + +- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes { + return YES; +} + #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 23:42:23
|
Revision: 2708 http://skim-app.svn.sourceforge.net/skim-app/?rev=2708&view=rev Author: hofman Date: 2007-08-22 16:42:16 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Add type-select helper to pdfview to quickly switch pages. Share the one from the thumbnail table, as it does exactly the same thing, and cannot be used at the same time. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-22 22:40:31 UTC (rev 2707) +++ trunk/SKMainWindowController.m 2007-08-22 23:42:16 UTC (rev 2708) @@ -380,6 +380,7 @@ [typeSelectHelper setMatchOption:SKFullStringMatch]; [typeSelectHelper setDataSource:self]; [thumbnailTableView setTypeSelectHelper:typeSelectHelper]; + [pdfView setTypeSelectHelper:typeSelectHelper]; typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; [typeSelectHelper setMatchOption:SKSubstringMatch]; @@ -3527,7 +3528,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { - if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { return pageLabels; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] valueForKey:@"contents"]; @@ -3542,7 +3543,7 @@ } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { - if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { return [[thumbnailTableView selectedRowIndexes] lastIndex]; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] indexOfObject:[self selectedNote]]; @@ -3554,7 +3555,7 @@ } - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { - if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { [self setPageNumber:itemIndex + 1]; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; @@ -3565,7 +3566,7 @@ } - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { - if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { if (searchString) [statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@"Go to page: %@", @"Status message"), searchString]]; else Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-08-22 22:40:31 UTC (rev 2707) +++ trunk/SKPDFView.h 2007-08-22 23:42:16 UTC (rev 2708) @@ -73,7 +73,7 @@ SKLineNote } SKNoteType; -@class SKReadingBar, SKTransitionController; +@class SKReadingBar, SKTransitionController, SKTypeSelectHelper; @interface SKPDFView : PDFView { SKToolMode toolMode; @@ -91,6 +91,8 @@ SKTransitionController *transitionController; + SKTypeSelectHelper *typeSelectHelper; + PDFAnnotation *activeAnnotation; PDFAnnotation *highlightAnnotation; PDFAnnotationTextWidget *editAnnotation; @@ -149,6 +151,9 @@ - (BOOL)transitionShouldRestrict; - (void)setTransitionShouldRestrict:(BOOL)flag; +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + - (IBAction)delete:(id)sender; - (IBAction)autoSelectContent:(id)sender; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-22 22:40:31 UTC (rev 2707) +++ trunk/SKPDFView.m 2007-08-22 23:42:16 UTC (rev 2708) @@ -55,6 +55,7 @@ #import "SKLineWell.h" #import <Carbon/Carbon.h> #import "NSGeometry_SKExtensions.h" +#import "SKTypeSelectHelper.h" NSString *SKPDFViewToolModeChangedNotification = @"SKPDFViewToolModeChangedNotification"; NSString *SKPDFViewAnnotationModeChangedNotification = @"SKPDFViewAnnotationModeChangedNotification"; @@ -162,6 +163,8 @@ transitionController = nil; + typeSelectHelper = nil; + spellingTag = [NSSpellChecker uniqueSpellDocumentTag]; hideNotes = NO; @@ -229,6 +232,8 @@ [[SKPDFHoverWindow sharedHoverWindow] orderOut:self]; [self removeHoverRects]; [hoverRects release]; + [typeSelectHelper setDataSource:nil]; + [typeSelectHelper release]; [transitionController release]; [navWindow release]; [readingBar release]; @@ -577,6 +582,17 @@ [[self transitionController] setShouldRestrict:flag]; } +- (SKTypeSelectHelper *)typeSelectHelper { + return typeSelectHelper; +} + +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { + if (typeSelectHelper != newTypeSelectHelper) { + [typeSelectHelper release]; + typeSelectHelper = [newTypeSelectHelper retain]; + } +} + #pragma mark Reading bar - (BOOL)hasReadingBar { @@ -922,6 +938,10 @@ [self setAnnotationMode:SKStrikeOutNote]; } else if (isPresentation == NO && [self toolMode] == SKNoteToolMode && modifiers == 0 && eventChar == 'l') { [self setAnnotationMode:SKLineNote]; + } else if (isPresentation == NO && typeSelectHelper && modifiers == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) { + [typeSelectHelper processKeyDownCharacter:eventChar]; + } else if (isPresentation == NO && [typeSelectHelper cyclesSimilarResults] && modifiers == 0 && eventChar == '/') { + [typeSelectHelper repeatSearch]; } else { [super keyDown:theEvent]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 22:40:40
|
Revision: 2707 http://skim-app.svn.sourceforge.net/skim-app/?rev=2707&view=rev Author: hofman Date: 2007-08-22 15:40:31 -0700 (Wed, 22 Aug 2007) Log Message: ----------- update dutch localization. Modified Paths: -------------- trunk/Dutch.lproj/Localizable.strings Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |