Revision: 4478
http://skim-app.svn.sourceforge.net/skim-app/?rev=4478&view=rev
Author: hofman
Date: 2008-08-29 23:11:46 +0000 (Fri, 29 Aug 2008)
Log Message:
-----------
Remember last open files in order and reopen them in reverse order.
Modified Paths:
--------------
trunk/SKApplication.h
trunk/SKApplication.m
trunk/SKApplicationController.m
Modified: trunk/SKApplication.h
===================================================================
--- trunk/SKApplication.h 2008-08-29 17:12:51 UTC (rev 4477)
+++ trunk/SKApplication.h 2008-08-29 23:11:46 UTC (rev 4478)
@@ -43,8 +43,12 @@
@interface SKApplication : NSApplication {
BOOL userAttentionDisabled;
}
+
- (BOOL)isUserAttentionDisabled;
- (void)setUserAttentionDisabled:(BOOL)flag;
+
+- (NSArray *)allOrderedDocuments;
+
@end
Modified: trunk/SKApplication.m
===================================================================
--- trunk/SKApplication.m 2008-08-29 17:12:51 UTC (rev 4477)
+++ trunk/SKApplication.m 2008-08-29 23:11:46 UTC (rev 4478)
@@ -219,6 +219,10 @@
#pragma mark Scripting support
+- (NSArray *)allOrderedDocuments {
+ return [super orderedDocuments];
+}
+
- (NSArray *)orderedDocuments {
NSMutableArray *orderedDocuments = [[[super orderedDocuments] mutableCopy]
autorelease];
int i = [orderedDocuments count];
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2008-08-29 17:12:51 UTC (rev 4477)
+++ trunk/SKApplicationController.m 2008-08-29 23:11:46 UTC (rev 4478)
@@ -37,6 +37,7 @@
*/
#import "SKApplicationController.h"
+#import "SKApplication.h"
#import "SKLineInspector.h"
#import "SKNotesPanelController.h"
#import "SKPreferenceController.h"
@@ -143,7 +144,7 @@
}
- (void)registerCurrentDocuments:(NSNotification *)aNotification {
- [[NSUserDefaults standardUserDefaults] setObject:[[[NSDocumentController
sharedDocumentController] documents] valueForKey:SKCurrentDocumentSetupKey]
forKey:SKLastOpenFileNamesKey];
+ [[NSUserDefaults standardUserDefaults] setObject:[[(SKApplication *)NSApp
allOrderedDocuments] valueForKey:SKCurrentDocumentSetupKey]
forKey:SKLastOpenFileNamesKey];
[[[NSDocumentController sharedDocumentController] documents]
makeObjectsPerformSelector:@selector(saveRecentDocumentInfo)];
}
@@ -153,7 +154,7 @@
if ([[NSUserDefaults standardUserDefaults]
boolForKey:SKReopenLastOpenFilesKey]) {
NSArray *files = [[NSUserDefaults standardUserDefaults]
objectForKey:SKLastOpenFileNamesKey];
- NSEnumerator *fileEnum = [files objectEnumerator];
+ NSEnumerator *fileEnum = [files reverseObjectEnumerator];
NSDictionary *dict;
NSError *error;
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 Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit