Revision: 3645
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3645&view=rev
Author:   hofman
Date:     2008-04-05 15:58:02 -0700 (Sat, 05 Apr 2008)

Log Message:
-----------
Notify for changes of display settings of pdfview.

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKPDFView.h
    trunk/SKPDFView.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-04-05 22:25:48 UTC (rev 3644)
+++ trunk/SKMainWindowController.m      2008-04-05 22:58:02 UTC (rev 3645)
@@ -531,6 +531,10 @@
                              name:SKPDFViewSelectionChangedNotification 
object:pdfView];
     [nc addObserver:self 
selector:@selector(handleMagnificationChangedNotification:) 
                              name:SKPDFViewMagnificationChangedNotification 
object:pdfView];
+    [nc addObserver:self 
selector:@selector(handleDisplayModeChangedNotification:) 
+                             name:SKPDFViewDisplayModeChangedNotification 
object:pdfView];
+    [nc addObserver:self 
selector:@selector(handleDisplayBoxChangedNotification:) 
+                             name:SKPDFViewDisplayBoxChangedNotification 
object:pdfView];
     [nc addObserver:self selector:@selector(handleChangedHistoryNotification:) 
                              name:PDFViewChangedHistoryNotification 
object:pdfView];
     [nc addObserver:self 
selector:@selector(handleDidChangeActiveAnnotationNotification:) 
@@ -623,10 +627,8 @@
         [pdfView setDisplaysAsBook:[number boolValue]];
     if (number = [setup objectForKey:DISPLAY_MODE_KEY])
         [pdfView setDisplayMode:[number intValue]];
-    if (number = [setup objectForKey:DISPLAY_BOX_KEY]) {
+    if (number = [setup objectForKey:DISPLAY_BOX_KEY])
         [pdfView setDisplayBox:[number intValue]];
-        [self handleDisplayBoxChangedNotification:nil];
-    }
 }
 
 - (NSDictionary *)currentPDFSettings {
@@ -1524,8 +1526,6 @@
     else if ([sender respondsToSelector:@selector(selectedSegment)])
         displayBox = [sender selectedSegment];
     [pdfView setDisplayBox:displayBox];
-    [self handleDisplayBoxChangedNotification:nil];
-    [self resetThumbnails];
 }
 
 - (IBAction)doGoToNextPage:(id)sender {
@@ -2522,7 +2522,6 @@
     [pdfView setAutoScales:YES];
     [pdfView setDisplayMode:kPDFDisplaySinglePage];
     [pdfView setDisplayBox:kPDFDisplayBoxCropBox];
-    [self handleDisplayBoxChangedNotification:nil];
     [pdfView setDisplaysPageBreaks:YES];
     [scrollView setNeverHasHorizontalScroller:YES];
     [scrollView setNeverHasVerticalScroller:YES];
@@ -3289,6 +3288,7 @@
 
 - (void)handleDisplayBoxChangedNotification:(NSNotification *)notification {
     [displayBoxButton selectSegmentWithTag:[pdfView displayBox]];
+    [self resetThumbnails];
 }
 
 - (void)handleDisplayModeChangedNotification:(NSNotification *)notification {

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2008-04-05 22:25:48 UTC (rev 3644)
+++ trunk/SKPDFView.h   2008-04-05 22:58:02 UTC (rev 3645)
@@ -51,6 +51,9 @@
 extern NSString *SKPDFViewReadingBarDidChangeNotification;
 extern NSString *SKPDFViewSelectionChangedNotification;
 extern NSString *SKPDFViewMagnificationChangedNotification;
+extern NSString *SKPDFViewDisplayModeChangedNotification;
+extern NSString *SKPDFViewDisplayAsBookChangedNotification;
+extern NSString *SKPDFViewDisplayBoxChangedNotification;
 
 extern NSString *SKSkimNotePboardType;
 

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-04-05 22:25:48 UTC (rev 3644)
+++ trunk/SKPDFView.m   2008-04-05 22:58:02 UTC (rev 3645)
@@ -78,6 +78,9 @@
 NSString *SKPDFViewReadingBarDidChangeNotification = 
@"SKPDFViewReadingBarDidChangeNotification";
 NSString *SKPDFViewSelectionChangedNotification = 
@"SKPDFViewSelectionChangedNotification";
 NSString *SKPDFViewMagnificationChangedNotification = 
@"SKPDFViewMagnificationChangedNotification";
+NSString *SKPDFViewDisplayModeChangedNotification = 
@"SKPDFViewDisplayModeChangedNotification";
+NSString *SKPDFViewDisplayAsBookChangedNotification = 
@"SKPDFViewDisplayAsBookChangedNotification";
+NSString *SKPDFViewDisplayBoxChangedNotification = 
@"SKPDFViewDisplayBoxChangedNotification";
 
 NSString *SKSkimNotePboardType = @"SKSkimNotePboardType";
 
@@ -530,13 +533,20 @@
 - (void)setDisplayMode:(PDFDisplayMode)mode {
     [super setDisplayMode:mode];
     [self relayoutEditField];
+    [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewDisplayModeChangedNotification object:self 
userInfo:nil];
 }
 
 - (void)setDisplaysAsBook:(BOOL)asBook {
     [super setDisplaysAsBook:asBook];
     [self relayoutEditField];
+    [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewDisplayAsBookChangedNotification object:self 
userInfo:nil];
 }
 
+- (void)setDisplayBox:(PDFDisplayBox)displayBox {
+    [super setDisplayBox:displayBox];
+    [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewDisplayBoxChangedNotification object:self 
userInfo:nil];
+}
+
 - (NSRect)currentSelectionRect {
     if (toolMode == SKSelectToolMode)
         return selectionRect;


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 the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to