Revision: 5418
http://skim-app.svn.sourceforge.net/skim-app/?rev=5418&view=rev
Author: hofman
Date: 2009-06-12 19:12:15 +0000 (Fri, 12 Jun 2009)
Log Message:
-----------
apply setups from bookmark also for already open documents, but apply directly
if in normal mode
Modified Paths:
--------------
trunk/SKDocumentController.m
trunk/SKMainWindowController.m
Modified: trunk/SKDocumentController.m
===================================================================
--- trunk/SKDocumentController.m 2009-06-12 18:03:17 UTC (rev 5417)
+++ trunk/SKDocumentController.m 2009-06-12 19:12:15 UTC (rev 5418)
@@ -347,7 +347,7 @@
if(fileURL && NO == SKFileIsInTrash(fileURL)) {
if (document = [self documentForURL:fileURL]) {
// the document was already open, don't call makeWindowControllers
because that adds new empty windows
- // perhaps we should somehow apply the settings anyway?
+ [document setInitialSetup:setup];
} else if (document = [self openDocumentWithContentsOfURL:fileURL
display:NO error:&error]) {
[document makeWindowControllers];
[document setInitialSetup:setup];
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2009-06-12 18:03:17 UTC (rev 5417)
+++ trunk/SKMainWindowController.m 2009-06-12 19:12:15 UTC (rev 5418)
@@ -539,10 +539,23 @@
}
- (void)setInitialSetup:(NSDictionary *)setup{
- if ([self isWindowLoaded] == NO)
+ if ([self isWindowLoaded] == NO) {
[savedNormalSetup setDictionary:setup];
- else
- NSLog(@"-[NSMainWindowController setupWindow:] called after window was
loaded");
+ } else if ([self isFullScreen] || [self isPresentation]) {
+ NSString *rectString = [setup objectForKey:SKMainWindowFrameKey];
+ if (rectString)
+ [mainWindow setFrame:NSRectFromString([setup
objectForKey:SKMainWindowFrameKey]) display:YES];
+ NSUInteger pageIndex = [[setup objectForKey:PAGEINDEX_KEY]
unsignedIntValue];
+ if (pageIndex != NSNotFound)
+ [pdfView goToPage:[[pdfView document] pageAtIndex:pageIndex]];
+ NSArray *snapshotSetups = [setup objectForKey:SNAPSHOTS_KEY];
+ if ([snapshotSetups count])
+ [self showSnapshotsWithSetups:snapshotSetups];
+ if ([self isFullScreen] || [self isPresentation])
+ [savedNormalSetup addEntriesFromDictionary:setup];
+ else
+ [self applyPDFSettings:setup];
+ }
}
- (NSDictionary *)currentSetup {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit