Revision: 26037
          http://sourceforge.net/p/bibdesk/svn/26037
Author:   hofman
Date:     2021-05-22 14:14:39 +0000 (Sat, 22 May 2021)
Log Message:
-----------
Add extra subtitle to box title for options of an available field

Modified Paths:
--------------
    trunk/bibdesk/BDSKTemplateDocument.m
    trunk/bibdesk/BDSKToken.h
    trunk/bibdesk/BDSKToken.m
    trunk/bibdesk/Base.lproj/TemplateDocument.xib
    trunk/bibdesk/de.lproj/Localizable.strings
    trunk/bibdesk/de.lproj/TemplateDocument.strings
    trunk/bibdesk/en.lproj/Localizable.strings
    trunk/bibdesk/en.lproj/TemplateDocument.strings
    trunk/bibdesk/fr.lproj/Localizable.strings
    trunk/bibdesk/fr.lproj/TemplateDocument.strings

Modified: trunk/bibdesk/BDSKTemplateDocument.m
===================================================================
--- trunk/bibdesk/BDSKTemplateDocument.m        2021-05-22 09:26:57 UTC (rev 
26036)
+++ trunk/bibdesk/BDSKTemplateDocument.m        2021-05-22 14:14:39 UTC (rev 
26037)
@@ -457,6 +457,7 @@
         id token = [fieldTokens objectForKey:field];
         if (token == nil) {
             token = [BDSKToken tokenWithField:field];
+            [token setSubtitle:NSLocalizedString(@"(Available field)", 
@"Additional description of field")];
             [fieldTokens setObject:token forKey:field];
         }
         [tokens addObject:token];
@@ -860,6 +861,7 @@
         
         NSView *contentView = [tokenOptionsBox contentView];
         NSView *prevView = nil;
+        
         for (NSView *view in optionViews) {
             [contentView addSubview:view];
             [contentView addConstraint:[NSLayoutConstraint 
constraintWithItem:view attribute:NSLayoutAttributeLeading 
relatedBy:NSLayoutRelationEqual toItem:contentView 
attribute:NSLayoutAttributeLeading multiplier:1.0 constant:OPTION_SIDE_MARGIN]];

Modified: trunk/bibdesk/BDSKToken.h
===================================================================
--- trunk/bibdesk/BDSKToken.h   2021-05-22 09:26:57 UTC (rev 26036)
+++ trunk/bibdesk/BDSKToken.h   2021-05-22 14:14:39 UTC (rev 26037)
@@ -52,6 +52,7 @@
 
 @interface BDSKToken : NSObject <NSCopying, NSCoding> {
     NSString *title;
+    NSString *subtitle;
     NSString *fontName;
     CGFloat fontSize;
     NSInteger bold;
@@ -66,6 +67,8 @@
 
 @property (nonatomic, readonly) NSString *title;
 
+@property (nonatomic, retain) NSString *subtitle;
+
 @property (nonatomic, retain) NSString *fontName;
 @property (nonatomic) CGFloat fontSize;
 @property (nonatomic) NSInteger bold;

Modified: trunk/bibdesk/BDSKToken.m
===================================================================
--- trunk/bibdesk/BDSKToken.m   2021-05-22 09:26:57 UTC (rev 26036)
+++ trunk/bibdesk/BDSKToken.m   2021-05-22 14:14:39 UTC (rev 26037)
@@ -72,7 +72,7 @@
 
 @implementation BDSKToken
 
-@synthesize title, fontName, fontSize, bold, italic;
+@synthesize title, subtitle, fontName, fontSize, bold, italic;
 @dynamic type, string, keysForValuesToObserveForUndo;
 
 + (id)tokenWithField:(NSString *)field {
@@ -120,6 +120,7 @@
     self = [super init];
     if (self) {
         title = [aTitle copy];
+        subtitle = nil;
         fontName = nil;
         fontSize = 0.0;
         bold = NSMixedState;
@@ -159,6 +160,7 @@
 
 - (void)dealloc {
     BDSKDESTROY(title);
+    BDSKDESTROY(subtitle);
     BDSKDESTROY(fontName);
     [super dealloc];
 }

Modified: trunk/bibdesk/Base.lproj/TemplateDocument.xib
===================================================================
--- trunk/bibdesk/Base.lproj/TemplateDocument.xib       2021-05-22 09:26:57 UTC 
(rev 26036)
+++ trunk/bibdesk/Base.lproj/TemplateDocument.xib       2021-05-22 14:14:39 UTC 
(rev 26037)
@@ -553,11 +553,16 @@
                                             <constraint 
firstAttribute="height" constant="150" id="FrJ-9T-Ik5"/>
                                         </constraints>
                                         <connections>
-                                            <binding destination="299" 
name="displayPatternTitle1" keyPath="selection.title" id="1678">
+                                            <binding destination="299" 
name="displayPatternTitle1" keyPath="selection.title" id="gqM-VP-oo2">
                                                 <dictionary key="options">
-                                                    <string 
key="NSDisplayPattern">Options for field: %{title1}@</string>
+                                                    <string 
key="NSDisplayPattern">Options for field: %{title1}@ %{title2}@</string>
                                                 </dictionary>
                                             </binding>
+                                            <binding destination="299" 
name="displayPatternTitle2" keyPath="selection.subtitle" 
previousBinding="gqM-VP-oo2" id="q5Y-Ro-amC">
+                                                <dictionary key="options">
+                                                    <string 
key="NSDisplayPattern">Options for field: %{title1}@ %{title2}@</string>
+                                                </dictionary>
+                                            </binding>
                                         </connections>
                                     </box>
                                     <box title="Available Fields" 
translatesAutoresizingMaskIntoConstraints="NO" id="1547">

Modified: trunk/bibdesk/de.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/de.lproj/TemplateDocument.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/en.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/en.lproj/TemplateDocument.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/fr.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/fr.lproj/TemplateDocument.strings
===================================================================
(Binary files differ)

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to