Revision: 6360
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6360&view=rev
Author:   hofman
Date:     2010-03-22 12:37:46 +0000 (Mon, 22 Mar 2010)

Log Message:
-----------
commit editing for prefs using protocol

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

Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m      2010-03-22 12:32:37 UTC (rev 6359)
+++ trunk/SKPreferenceController.m      2010-03-22 12:37:46 UTC (rev 6360)
@@ -138,8 +138,8 @@
 
 - (void)windowWillClose:(NSNotification *)notification {
     // make sure edits are committed
-    if ([[[self window] firstResponder] isKindOfClass:[NSText class]] && 
[[self window] makeFirstResponder:[self window]] == NO)
-        [[self window] endEditingFor:nil];
+    [currentPane commitEditing];
+    [[NSUserDefaultsController sharedUserDefaultsController] commitEditing];
 }
 
 #pragma mark Actions
@@ -212,21 +212,19 @@
         
         [[self window] setTitle:[pane title]];
         
-        NSView *oldView = [currentPane view];
-        NSView *view = [pane view];
-        
-        currentPane = pane;
-        
         // make sure edits are committed
-        if ([[[self window] firstResponder] isKindOfClass:[NSText class]] && 
[[self window] makeFirstResponder:[self window]] == NO)
-            [[self window] endEditingFor:nil];
+        [currentPane commitEditing];
+        [[NSUserDefaultsController sharedUserDefaultsController] 
commitEditing];
         
+        NSView *view = [pane view];
         NSRect frame = [view frame];
         CGFloat dh = NSHeight([contentView frame]) - NSHeight(frame);
         
         [view setFrameOrigin:NSMakePoint(0.0, dh)];
-        [contentView replaceSubview:oldView with:view];
+        [contentView replaceSubview:[currentPane view] with:view];
         
+        currentPane = pane;
+        
         frame = [[self window] frame];
         frame.origin.y += dh;
         frame.size.height -= dh;


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

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to