Revision: 27490
          http://sourceforge.net/p/bibdesk/svn/27490
Author:   hofman
Date:     2022-05-27 22:18:07 +0000 (Fri, 27 May 2022)
Log Message:
-----------
Add popup to choose downloads folder tofields preferences

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

Modified: trunk/bibdesk/Base.lproj/BibPref_Defaults.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BibPref_Defaults.xib       2022-05-27 22:14:57 UTC 
(rev 27489)
+++ trunk/bibdesk/Base.lproj/BibPref_Defaults.xib       2022-05-27 22:18:07 UTC 
(rev 27490)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19162" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19162"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -11,6 +11,7 @@
                 <outlet property="addRemoveDefaultFieldButton" 
destination="340" id="342"/>
                 <outlet property="convertURLFieldsButton" destination="267" 
id="270"/>
                 <outlet property="defaultFieldsTableView" destination="25" 
id="39"/>
+                <outlet property="downloadsFolderPopUp" 
destination="Pdt-Fe-O1p" id="twZ-Qg-1uL"/>
                 <outlet property="editGlobalMacroDefsButton" destination="181" 
id="184"/>
                 <outlet property="globalMacroFileSheet" destination="215" 
id="226"/>
                 <outlet property="globalMacroFilesTableView" destination="220" 
id="227"/>
@@ -25,10 +26,10 @@
         <customObject id="-1" userLabel="First Responder" 
customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView translatesAutoresizingMaskIntoConstraints="NO" id="5" 
userLabel="View">
-            <rect key="frame" x="0.0" y="0.0" width="448" height="495"/>
+            <rect key="frame" x="0.0" y="0.0" width="448" height="525"/>
             <subviews>
                 <button toolTip="Remove converted Remote URL fields after 
successful automatic conversion" horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="269">
-                    <rect key="frame" x="74" y="190" width="255" height="18"/>
+                    <rect key="frame" x="74" y="220" width="255" height="18"/>
                     <buttonCell key="cell" type="check" title="Remove 
converted Remote URL fields" bezelStyle="regularSquare" imagePosition="left" 
alignment="left" inset="2" id="328">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -51,7 +52,7 @@
                     </connections>
                 </button>
                 <button toolTip="Remove converted Local File fields after 
successful automatic conversion" horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="268">
-                    <rect key="frame" x="74" y="212" width="236" height="18"/>
+                    <rect key="frame" x="74" y="242" width="236" height="18"/>
                     <buttonCell key="cell" type="check" title="Remove 
converted Local File fields" bezelStyle="regularSquare" imagePosition="left" 
alignment="left" inset="2" id="327">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -74,7 +75,7 @@
                     </connections>
                 </button>
                 <button toolTip="Automatically convert file and URL fields to 
linked files and URLs on open or import" horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="267">
-                    <rect key="frame" x="52" y="234" width="274" height="18"/>
+                    <rect key="frame" x="52" y="264" width="274" height="18"/>
                     <buttonCell key="cell" type="check" title="Automatically 
convert File and URL fields" bezelStyle="regularSquare" imagePosition="left" 
alignment="left" inset="2" id="326">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
                         <font key="font" metaFont="system"/>
@@ -89,7 +90,7 @@
                     </connections>
                 </button>
                 <button horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="348">
-                    <rect key="frame" x="30" y="256" width="180" height="18"/>
+                    <rect key="frame" x="30" y="286" width="180" height="18"/>
                     <string key="toolTip">Use linked files and linked URLs for 
Auto File and when dropping URLs on the main table.  Otherwise use the 
Local-Url and Url fields.</string>
                     <buttonCell key="cell" type="check" title="Use linked 
files and URLs" bezelStyle="regularSquare" imagePosition="left" 
alignment="left" inset="2" id="349">
                         <behavior key="behavior" changeContents="YES" 
doesNotDimImage="YES" lightByContents="YES"/>
@@ -104,7 +105,7 @@
                     </connections>
                 </button>
                 <textField horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="266">
-                    <rect key="frame" x="18" y="281" width="99" height="16"/>
+                    <rect key="frame" x="18" y="311" width="99" height="16"/>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" 
title="Files and URLs" id="325">
                         <font key="font" metaFont="systemBold"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
@@ -112,10 +113,10 @@
                     </textFieldCell>
                 </textField>
                 <box verticalHuggingPriority="750" boxType="separator" 
translatesAutoresizingMaskIntoConstraints="NO" id="264">
-                    <rect key="frame" x="12" y="307" width="424" height="5"/>
+                    <rect key="frame" x="12" y="337" width="424" height="5"/>
                 </box>
                 <textField horizontalHuggingPriority="750" 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="260">
-                    <rect key="frame" x="116" y="124" width="76" height="16"/>
+                    <rect key="frame" x="116" y="154" width="76" height="16"/>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" 
title="PDF viewer:" id="323">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
@@ -123,7 +124,7 @@
                     </textFieldCell>
                 </textField>
                 <popUpButton verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="253">
-                    <rect key="frame" x="195" y="117" width="237" height="25"/>
+                    <rect key="frame" x="195" y="147" width="237" height="25"/>
                     <popUpButtonCell key="cell" type="push" title="Default" 
bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" 
borderStyle="borderAndBezel" inset="2" arrowPosition="arrowAtCenter" 
preferredEdge="maxY" selectedItem="256" id="322">
                         <behavior key="behavior" lightByBackground="YES" 
lightByGray="YES"/>
                         <font key="font" metaFont="menu"/>
@@ -146,7 +147,7 @@
                     </connections>
                 </popUpButton>
                 <textField horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="353">
-                    <rect key="frame" x="30" y="154" width="162" height="16"/>
+                    <rect key="frame" x="30" y="184" width="162" height="16"/>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" 
title="Preferred local file format:" id="361">
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
@@ -154,7 +155,7 @@
                     </textFieldCell>
                 </textField>
                 <popUpButton verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="354">
-                    <rect key="frame" x="195" y="147" width="237" height="25"/>
+                    <rect key="frame" x="195" y="177" width="237" height="25"/>
                     <popUpButtonCell key="cell" type="push" title="File URL" 
bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" 
borderStyle="borderAndBezel" inset="2" arrowPosition="arrowAtCenter" 
preferredEdge="maxY" selectedItem="357" id="355">
                         <behavior key="behavior" lightByBackground="YES" 
lightByGray="YES"/>
                         <font key="font" metaFont="menu"/>
@@ -236,7 +237,7 @@
                     </connections>
                 </button>
                 <textField horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="32">
-                    <rect key="frame" x="18" y="459" width="144" height="16"/>
+                    <rect key="frame" x="18" y="489" width="144" height="16"/>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" 
title="Custom BibTeX Fields" id="315">
                         <font key="font" metaFont="systemBold"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
@@ -244,7 +245,7 @@
                     </textFieldCell>
                 </textField>
                 <scrollView horizontalLineScroll="16" 
horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" 
hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" 
translatesAutoresizingMaskIntoConstraints="NO" id="21">
-                    <rect key="frame" x="32" y="351" width="396" height="100"/>
+                    <rect key="frame" x="32" y="381" width="396" height="100"/>
                     <clipView key="contentView" id="TXc-oJ-2Z3">
                         <rect key="frame" x="1" y="1" width="394" height="98"/>
                         <autoresizingMask key="autoresizingMask" 
widthSizable="YES" heightSizable="YES"/>
@@ -359,7 +360,7 @@
                                         <tableColumnResizingMask 
key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                         <prototypeCellViews>
                                             <tableCellView id="VFR-1v-zAf" 
customClass="BDSKControlTableCellView">
-                                                <rect key="frame" x="308" 
y="1" width="65" height="14"/>
+                                                <rect key="frame" x="307.5" 
y="1" width="65" height="14"/>
                                                 <autoresizingMask 
key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <subviews>
                                                     <button 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="ZUV-ng-GFc">
@@ -409,7 +410,7 @@
                     </tableHeaderView>
                 </scrollView>
                 <segmentedControl verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="340">
-                    <rect key="frame" x="379" y="321" width="49" height="23"/>
+                    <rect key="frame" x="379" y="351" width="49" height="23"/>
                     <segmentedCell key="cell" borderStyle="border" 
alignment="left" style="smallSquare" trackingMode="momentary" id="341">
                         <font key="font" metaFont="system"/>
                         <segments>
@@ -421,11 +422,41 @@
                         <action selector="addRemoveDefaultField:" target="-2" 
id="343"/>
                     </connections>
                 </segmentedControl>
+                <popUpButton verticalHuggingPriority="750" 
imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" 
id="Pdt-Fe-O1p">
+                    <rect key="frame" x="195" y="117" width="237" height="25"/>
+                    <constraints>
+                        <constraint firstAttribute="width" 
relation="greaterThanOrEqual" constant="200" id="XkK-Ez-gYS"/>
+                    </constraints>
+                    <popUpButtonCell key="cell" type="push" 
bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" 
borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" 
selectedItem="BJT-WT-6ac" id="a9M-5q-M6l">
+                        <behavior key="behavior" lightByBackground="YES" 
lightByGray="YES"/>
+                        <font key="font" metaFont="menu"/>
+                        <menu key="menu" id="N8p-i0-Jqx">
+                            <items>
+                                <menuItem state="on" id="BJT-WT-6ac">
+                                    <modifierMask 
key="keyEquivalentModifierMask"/>
+                                </menuItem>
+                                <menuItem isSeparatorItem="YES" 
id="Dpb-of-Tpg"/>
+                                <menuItem title="Other…" id="pFk-ee-ev9"/>
+                            </items>
+                        </menu>
+                    </popUpButtonCell>
+                    <connections>
+                        <accessibilityConnection property="title" 
destination="lMP-JS-vat" id="Kot-MH-2Hw"/>
+                        <action selector="chooseDownloadsFolder:" target="-2" 
id="OMQ-f5-5zo"/>
+                    </connections>
+                </popUpButton>
+                <textField horizontalHuggingPriority="750" 
verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" 
id="lMP-JS-vat" userLabel="Downloads folder:">
+                    <rect key="frame" x="78" y="124" width="114" height="16"/>
+                    <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Downloads 
folder:" id="PYX-oD-Dag">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="controlColor" 
catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
             </subviews>
             <constraints>
                 <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="269" secondAttribute="trailing" 
constant="20" symbolic="YES" id="0er-mh-Gct"/>
                 <constraint firstItem="152" firstAttribute="top" 
secondItem="73" secondAttribute="bottom" constant="12" id="1AN-qU-h7N"/>
-                <constraint firstItem="73" firstAttribute="top" 
secondItem="253" secondAttribute="bottom" constant="12" id="1JA-Wu-U9t"/>
                 <constraint firstItem="232" firstAttribute="width" 
secondItem="64" secondAttribute="width" id="1gX-Nc-QCn"/>
                 <constraint firstItem="21" firstAttribute="top" 
secondItem="32" secondAttribute="bottom" constant="8" symbolic="YES" 
id="2we-zH-nbF"/>
                 <constraint firstItem="64" firstAttribute="firstBaseline" 
secondItem="95" secondAttribute="firstBaseline" id="57r-1a-QVw"/>
@@ -436,12 +467,15 @@
                 <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="64" secondAttribute="trailing" 
constant="20" symbolic="YES" id="9Of-lp-pPX"/>
                 <constraint firstItem="73" firstAttribute="leading" 
secondItem="264" secondAttribute="leading" id="9Ro-fA-UjE"/>
                 <constraint firstItem="232" firstAttribute="firstBaseline" 
secondItem="182" secondAttribute="firstBaseline" id="AQa-cv-rUj"/>
+                <constraint firstItem="Pdt-Fe-O1p" firstAttribute="baseline" 
secondItem="lMP-JS-vat" secondAttribute="firstBaseline" id="EE2-FF-xVg"/>
                 <constraint firstItem="264" firstAttribute="leading" 
secondItem="5" secondAttribute="leading" constant="12" id="Fcc-wA-R4d"/>
                 <constraint firstItem="64" firstAttribute="leading" 
secondItem="95" secondAttribute="trailing" constant="8" symbolic="YES" 
id="Gdi-pq-ydo"/>
+                <constraint firstItem="73" firstAttribute="top" 
secondItem="Pdt-Fe-O1p" secondAttribute="bottom" constant="12" id="H7r-j4-ENO"/>
                 <constraint firstItem="181" firstAttribute="leading" 
secondItem="182" secondAttribute="trailing" constant="8" symbolic="YES" 
id="HD1-ac-RsL"/>
                 <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="152" secondAttribute="trailing" 
constant="20" symbolic="YES" id="Ia7-TP-IlK"/>
                 <constraint firstItem="353" firstAttribute="leading" 
secondItem="5" secondAttribute="leading" priority="251" constant="32" 
id="Kbb-ae-ez4"/>
                 <constraint firstItem="354" firstAttribute="top" 
secondItem="269" secondAttribute="bottom" constant="20" symbolic="YES" 
id="Kp4-ka-kUf"/>
+                <constraint firstItem="Pdt-Fe-O1p" firstAttribute="top" 
secondItem="253" secondAttribute="bottom" constant="10" symbolic="YES" 
id="Lbz-fS-5yR"/>
                 <constraint firstAttribute="trailing" secondItem="21" 
secondAttribute="trailing" constant="20" symbolic="YES" id="Lz7-OJ-1d0"/>
                 <constraint firstItem="253" firstAttribute="leading" 
secondItem="354" secondAttribute="leading" id="OuT-Wa-kaM"/>
                 <constraint firstItem="268" firstAttribute="leading" 
secondItem="5" secondAttribute="leading" constant="76" id="QQO-zm-GKm"/>
@@ -453,6 +487,7 @@
                 <constraint firstItem="354" firstAttribute="trailing" 
secondItem="21" secondAttribute="trailing" id="X6U-9U-6qN"/>
                 <constraint firstItem="348" firstAttribute="top" 
secondItem="266" secondAttribute="bottom" constant="8" symbolic="YES" 
id="XJ9-NI-mb5"/>
                 <constraint firstItem="266" firstAttribute="leading" 
secondItem="32" secondAttribute="leading" id="XVz-qN-lLr"/>
+                <constraint firstItem="Pdt-Fe-O1p" firstAttribute="leading" 
secondItem="354" secondAttribute="leading" id="a5i-eC-MbG"/>
                 <constraint firstItem="348" firstAttribute="leading" 
secondItem="21" secondAttribute="leading" id="aP2-1z-Cvb"/>
                 <constraint firstItem="340" firstAttribute="trailing" 
secondItem="21" secondAttribute="trailing" id="aZD-6O-e53"/>
                 <constraint firstItem="253" firstAttribute="top" 
secondItem="354" secondAttribute="bottom" constant="10" symbolic="YES" 
id="dfp-um-YzX"/>
@@ -474,8 +509,11 @@
                 <constraint firstItem="152" firstAttribute="leading" 
secondItem="32" secondAttribute="leading" id="rVL-Ui-GVC"/>
                 <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="266" secondAttribute="trailing" 
constant="20" symbolic="YES" id="sHD-kH-uuR"/>
                 <constraint firstItem="340" firstAttribute="top" 
secondItem="21" secondAttribute="bottom" constant="8" symbolic="YES" 
id="sT3-dF-RGD"/>
+                <constraint firstItem="Pdt-Fe-O1p" firstAttribute="leading" 
secondItem="lMP-JS-vat" secondAttribute="trailing" constant="8" symbolic="YES" 
id="stN-q7-43g"/>
                 <constraint firstItem="266" firstAttribute="top" 
secondItem="264" secondAttribute="bottom" constant="12" id="tga-fe-yis"/>
+                <constraint firstItem="Pdt-Fe-O1p" firstAttribute="trailing" 
secondItem="21" secondAttribute="trailing" id="thX-kR-qGM"/>
                 <constraint firstItem="268" firstAttribute="top" 
secondItem="267" secondAttribute="bottom" constant="6" symbolic="YES" 
id="ufs-1i-8sH"/>
+                <constraint firstItem="lMP-JS-vat" firstAttribute="leading" 
relation="greaterThanOrEqual" secondItem="5" secondAttribute="leading" 
constant="32" id="uyP-sf-d6C"/>
                 <constraint firstAttribute="trailing" 
relation="greaterThanOrEqual" secondItem="32" secondAttribute="trailing" 
constant="20" symbolic="YES" id="v0d-wU-M9z"/>
                 <constraint firstItem="182" firstAttribute="leading" 
relation="greaterThanOrEqual" secondItem="5" secondAttribute="leading" 
constant="32" id="v14-Gg-bjp"/>
                 <constraint firstAttribute="bottom" secondItem="181" 
secondAttribute="bottom" constant="20" symbolic="YES" id="vu7-zI-q36"/>
@@ -486,7 +524,7 @@
                 <constraint firstItem="354" firstAttribute="firstBaseline" 
secondItem="353" secondAttribute="firstBaseline" id="zP2-10-KdN"/>
                 <constraint firstItem="269" firstAttribute="top" 
secondItem="268" secondAttribute="bottom" constant="6" symbolic="YES" 
id="zgw-wj-0qf"/>
             </constraints>
-            <point key="canvasLocation" x="139" y="154"/>
+            <point key="canvasLocation" x="139" y="153.5"/>
         </customView>
         <window title="Macro Files" 
allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" 
releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="Macro Files 
Window" animationBehavior="default" id="215" userLabel="Macro Files">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" 
miniaturizable="YES" resizable="YES"/>

Modified: trunk/bibdesk/BibPref_Defaults.h
===================================================================
--- trunk/bibdesk/BibPref_Defaults.h    2022-05-27 22:14:57 UTC (rev 27489)
+++ trunk/bibdesk/BibPref_Defaults.h    2022-05-27 22:18:07 UTC (rev 27490)
@@ -51,6 +51,7 @@
     NSButton *editGlobalMacroDefsButton;
     NSPopUpButton *localFileOptionPopup;
     NSPopUpButton *pdfViewerPopup;
+    NSPopUpButton *downloadsFolderPopUp;
     NSMutableArray *customFieldsArray;
     NSMutableSet *customFieldsSet;
     NSMutableArray *globalMacroFiles;
@@ -68,6 +69,7 @@
 @property (nonatomic, assign) IBOutlet NSButton *editGlobalMacroDefsButton;
 @property (nonatomic, assign) IBOutlet NSPopUpButton *localFileOptionPopup;
 @property (nonatomic, assign) IBOutlet NSPopUpButton *pdfViewerPopup;
+@property (nonatomic, assign) IBOutlet NSPopUpButton *downloadsFolderPopUp;
 
 @property (nonatomic) BOOL convertURLFields;
 
@@ -84,5 +86,6 @@
 - (IBAction)closeMacroFileWindow:(id)sender;
 - (IBAction)addRemoveGlobalMacroFile:(id)sender;
 - (IBAction)changeDefaultPDFViewer:(id)sender;
+- (IBAction)chooseDownloadsFolder:(id)sender;
 
 @end

Modified: trunk/bibdesk/BibPref_Defaults.m
===================================================================
--- trunk/bibdesk/BibPref_Defaults.m    2022-05-27 22:14:57 UTC (rev 27489)
+++ trunk/bibdesk/BibPref_Defaults.m    2022-05-27 22:18:07 UTC (rev 27490)
@@ -73,7 +73,7 @@
 
 @implementation BibPref_Defaults
 
-@synthesize useLocalUrlButton, convertURLFieldsButton, 
removeLocalFileFieldsButton, removeRemoteURLFieldsButton, 
addRemoveDefaultFieldButton, globalMacroFileSheet, globalMacroFilesTableView, 
defaultFieldsTableView, editGlobalMacroDefsButton, localFileOptionPopup, 
pdfViewerPopup;
+@synthesize useLocalUrlButton, convertURLFieldsButton, 
removeLocalFileFieldsButton, removeRemoteURLFieldsButton, 
addRemoveDefaultFieldButton, globalMacroFileSheet, globalMacroFilesTableView, 
defaultFieldsTableView, editGlobalMacroDefsButton, localFileOptionPopup, 
pdfViewerPopup, downloadsFolderPopUp;
 @dynamic convertURLFields;
 
 + (void)initialize {
@@ -189,6 +189,16 @@
     [addRemoveDefaultFieldButton setEnabled:shouldEnable forSegment:1];
 }
 
+- (void)updateDownloadsFolderPopUp {
+    NSString *downloadsFolder = [[[NSUserDefaults standardUserDefaults] 
stringForKey:BDSKDownloadsDirectoryKey] stringByExpandingTildeInPath];
+    if (downloadsFolder == nil)
+        downloadsFolder = [[[NSFileManager defaultManager] downloadFolderURL] 
path];
+    NSMenuItem *menuItem = [downloadsFolderPopUp itemAtIndex:0];
+    [menuItem setImageAndSize:[[NSWorkspace sharedWorkspace] 
iconForFile:downloadsFolder]];
+    [menuItem setTitle:[[NSFileManager defaultManager] 
displayNameAtPath:downloadsFolder]];
+    [downloadsFolderPopUp selectItemAtIndex:0];
+}
+
 - (void)loadView {
     [super loadView];
     
@@ -207,6 +217,8 @@
     while ([pdfViewerPopup numberOfItems] > 4)
         [pdfViewerPopup removeItemAtIndex:2];
     
+    [self updateDownloadsFolderPopUp];
+    
     for(i = 0; i < iMax; i++){
         NSDictionary *dict = [pdfViewers objectAtIndex:i];
         NSString *bundleID = [dict objectForKey:@"bundleID"];
@@ -257,6 +269,7 @@
     [self resetDefaultFields];
     // the field types may have changed, so notify the type manager
     [[BDSKTypeManager sharedManager] updateCustomFields];
+    [sud removeObjectForKey:BDSKDownloadsDirectoryKey];
     // reset UI, but only if we loaded the nib
     if ([self isViewLoaded]) {
         [self updateDeleteButton];
@@ -264,6 +277,7 @@
         [pdfViewerPopup selectItemAtIndex:0];
         [globalMacroFilesTableView reloadData];
         [defaultFieldsTableView reloadData];
+        [self updateDownloadsFolderPopUp];
     }
 }
 
@@ -657,6 +671,31 @@
     }
 }
 
+#pragma mark Downloads folder
+
+- (IBAction)chooseDownloadsFolder:(id)sender {
+    if ([sender selectedItem] == [sender lastItem]) {
+        [sender selectItemAtIndex:0];
+        
+        NSString *downloadsFolder = [[[NSUserDefaults standardUserDefaults] 
stringForKey:BDSKDownloadsDirectoryKey] stringByExpandingTildeInPath];
+        if (downloadsFolder == nil)
+            downloadsFolder = [[[NSFileManager defaultManager] 
downloadFolderURL] path];
+        NSURL *downloadsFolderURL = [NSURL fileURLWithPath:downloadsFolder 
isDirectory:YES];
+        
+        NSOpenPanel *openPanel = [NSOpenPanel openPanel];
+        [openPanel setCanChooseDirectories:YES];
+        [openPanel setCanChooseFiles:NO];
+        [openPanel setPrompt:NSLocalizedString(@"Select", @"Button title")];
+        [openPanel setDirectoryURL:downloadsFolderURL];
+        [openPanel beginSheetModalForWindow:[[self view] window] 
completionHandler:^(NSInteger result){
+                if (result == NSFileHandlingPanelOKButton) {
+                    [[NSUserDefaults standardUserDefaults] 
setObject:[[[openPanel URL] path] stringByAbbreviatingWithTildeInPath] 
forKey:BDSKDownloadsDirectoryKey];
+                    [self updateDownloadsFolderPopUp];
+                }
+            }];
+    }
+}
+
 #pragma mark BST macro methods
 
 - (IBAction)showMacrosWindow:(id)sender{

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

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

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

Modified: trunk/bibdesk/fr.lproj/BibPref_Defaults.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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to