Revision: 18250
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18250&view=rev
Author:   hofman
Date:     2011-11-28 00:48:41 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
Don't set stupid default value for added fields. As no value is set there is no 
undo needed. Just reset the fields and redisplay. Also just reset the fields 
when removing an empty field.

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2011-11-28 00:42:12 UTC (rev 18249)
+++ trunk/bibdesk/BDSKEditor.m  2011-11-28 00:48:41 UTC (rev 18250)
@@ -729,9 +729,8 @@
             addedFields = [[NSMutableSet alloc] init];
         [addedFields addObject:newField];
                [tabView selectFirstTabViewItem:nil];
-        [publication setField:newField toValue:[NSString stringWithFormat:@"%@ 
%@",NSLocalizedString(@"Add data for field:", @"Default value for new field"), 
newField]];
-               [[self undoManager] setActionName:NSLocalizedString(@"Add 
Field", @"Undo action name")];
-               [self setKeyField:newField];
+               [self resetFields];
+        [self setKeyField:newField];
     }
 }
 
@@ -770,9 +769,13 @@
         
         [addedFields removeObject:oldField];
         [tabView selectFirstTabViewItem:nil];
-        [publication setField:oldField toValue:nil];
-        [[self undoManager] setActionName:NSLocalizedString(@"Remove Field", 
@"Undo action name")];
-        [self userChangedField:oldField from:oldValue to:@""];
+        if ([NSString isEmptyString:oldValue]) {
+            [self resetFields];
+        } else {
+            [publication setField:oldField toValue:nil];
+            [[self undoManager] setActionName:NSLocalizedString(@"Remove 
Field", @"Undo action name")];
+            [self userChangedField:oldField from:oldValue to:@""];
+        }
     }
 }
 

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to