Revision: 22598
http://sourceforge.net/p/bibdesk/svn/22598
Author: hofman
Date: 2018-09-14 20:41:32 +0000 (Fri, 14 Sep 2018)
Log Message:
-----------
combine duplicate code blocks
Modified Paths:
--------------
trunk/bibdesk/BibDocument_Groups.m
Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m 2018-09-14 10:00:00 UTC (rev 22597)
+++ trunk/bibdesk/BibDocument_Groups.m 2018-09-14 20:41:32 UTC (rev 22598)
@@ -1340,6 +1340,17 @@
oldValue = [[[pub valueOfField:field] retain] autorelease];
rv = [pub removeFromGroup:group
handleInherited:handleInherited];
+ if(rv == BDSKFieldActionAsk){
+ NSAlert *alert = [[[NSAlert alloc] init] autorelease];
+ [alert setMessageText:NSLocalizedString(@"Inherited Value",
@"Message in alert dialog when trying to edit inherited value")];
+ [alert setInformativeText:NSLocalizedString(@"One or more
items have a value that was inherited from an item linked to by the Crossref
field. This operation would break the inheritance for this value. What do you
want me to do with inherited values?", @"Informative text in alert dialog")];
+ [[alert addButtonWithTitle:NSLocalizedString(@"Don't Change",
@"Button title")] setTag:BDSKFieldActionIgnore];
+ [[alert addButtonWithTitle:NSLocalizedString(@"Remove",
@"Button title")] setTag:BDSKFieldActionAppend];
+ handleInherited = rv = [alert runModal];
+ if(rv != BDSKFieldActionIgnore)
+ [pub removeFromGroup:group
handleInherited:handleInherited];
+ }
+
if(rv == BDSKFieldActionSet || rv ==
BDSKFieldActionAppend){
tmpCount++;
if(field){
@@ -1347,23 +1358,6 @@
[oldValues addObject:oldValue ?: @""];
[newValues addObject:[pub valueOfField:field]];
}
- }else if(rv == BDSKFieldActionAsk){
- NSAlert *alert = [[[NSAlert alloc] init] autorelease];
- [alert setMessageText:NSLocalizedString(@"Inherited Value",
@"Message in alert dialog when trying to edit inherited value")];
- [alert setInformativeText:NSLocalizedString(@"One or more
items have a value that was inherited from an item linked to by the Crossref
field. This operation would break the inheritance for this value. What do you
want me to do with inherited values?", @"Informative text in alert dialog")];
- [[alert addButtonWithTitle:NSLocalizedString(@"Don't Change",
@"Button title")] setTag:BDSKFieldActionIgnore];
- [[alert addButtonWithTitle:NSLocalizedString(@"Remove",
@"Button title")] setTag:BDSKFieldActionAppend];
- rv = [alert runModal];
- handleInherited = rv;
- if(handleInherited != BDSKFieldActionIgnore){
- [pub removeFromGroup:group
handleInherited:handleInherited];
- tmpCount++;
- if(field){
- [changedPubs addObject:pub];
- [oldValues addObject:oldValue ?: @""];
- [newValues addObject:[pub valueOfField:field]];
- }
- }
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit