Revision: 3152
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3152&view=rev
Author:   hofman
Date:     2007-11-05 01:48:18 -0800 (Mon, 05 Nov 2007)

Log Message:
-----------
Defer reverting document dirty state for some undoable actions on Leopard.

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

Modified: trunk/SKDocument.h
===================================================================
--- trunk/SKDocument.h  2007-11-04 23:08:10 UTC (rev 3151)
+++ trunk/SKDocument.h  2007-11-05 09:48:18 UTC (rev 3152)
@@ -88,6 +88,8 @@
     NSTimer *fileUpdateTimer;
 }
 
+- (void)undoableActionDoesntDirtyDocument;
+
 - (IBAction)readNotes:(id)sender;
 - (IBAction)convertNotes:(id)sender;
 - (IBAction)saveArchive:(id)sender;

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-11-04 23:08:10 UTC (rev 3151)
+++ trunk/SKDocument.m  2007-11-05 09:48:18 UTC (rev 3152)
@@ -188,6 +188,20 @@
         [[SKBookmarkController sharedBookmarkController] 
addRecentDocumentForPath:path pageIndex:pageIndex snapshots:[[[self 
mainWindowController] snapshots] valueForKey:@"currentSetup"]];
 }
 
+- (void)undoableActionDoesntDirtyDocumentDeferred:(NSNumber *)anUndoState {
+       [self updateChangeCount:[anUndoState boolValue] ? NSChangeRedone : 
NSChangeUndone];
+}
+
+- (void)undoableActionDoesntDirtyDocument {
+       // This action, while undoable, shouldn't mark the document dirty
+       BOOL isUndoing = [[self undoManager] isUndoing];
+       if (floor(NSAppKitVersion) <= NSAppKitVersion10_4) {
+               [self updateChangeCount:isUndoing ? NSChangeDone : 
NSChangeUndone];
+       } else {
+               [self 
performSelector:@selector(undoableActionDoesntDirtyDocumentDeferred:) 
withObject:[NSNumber numberWithBool:isUndoing] afterDelay:0.0];
+       }
+}
+
 #pragma mark Document read/write
 
 - (BOOL)prepareSavePanel:(NSSavePanel *)savePanel {


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to