Revision: 3332
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3332&view=rev
Author:   hofman
Date:     2007-12-20 10:50:09 -0800 (Thu, 20 Dec 2007)

Log Message:
-----------
make auto-rotation of printed pages stick between documents and settings.

Modified Paths:
--------------
    trunk/SKDocument.m

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-12-20 01:07:26 UTC (rev 3331)
+++ trunk/SKDocument.m  2007-12-20 18:50:09 UTC (rev 3332)
@@ -77,6 +77,7 @@
 
 static NSString *SKLastExportedTypeKey = @"SKLastExportedType";
 static NSString *SKAutoReloadFileUpdateKey = @"SKAutoReloadFileUpdate";
+static NSString *SKAutoRotatePrintedPagesKey = @"SKAutoRotatePrintedPages";
 
 @interface NSFileManager (SKDocumentExtensions)
 - (NSString *)subfileWithExtension:(NSString *)extensions 
inPDFBundleAtPath:(NSString *)path;
@@ -109,6 +110,13 @@
 
 @implementation SKDocument
 
+- (id)init {
+    if (self = [super init]) {
+        autoRotate = [[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoRotatePrintedPagesKey];
+    }
+    return self;
+}
+
 - (void)dealloc {
     [[NSUserDefaultsController sharedUserDefaultsController] 
removeObserver:self forKey:SKAutoCheckFileUpdateKey];
     [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -1513,8 +1521,13 @@
     [[self undoManager] disableUndoRegistration];
     [super setPrintInfo:printInfo];
     [[self undoManager] enableUndoRegistration];
-    if (autoRotateButton)
-        autoRotate = [autoRotateButton state] == NSOnState;
+    if (autoRotateButton) {
+        BOOL newAutoRotate = [autoRotateButton state] == NSOnState;
+        if (newAutoRotate != autoRotate) {
+            autoRotate = newAutoRotate;
+            [[NSUserDefaults standardUserDefaults] setBool:autoRotate 
forKey:SKAutoRotatePrintedPagesKey];
+        }
+    }
 }
 
 - (BOOL)preparePageLayout:(NSPageLayout *)pageLayout {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to