User preferences: Short article names, Tick marks and Open few

This commit is contained in:
relikd
2018-12-11 16:45:05 +01:00
parent 59d0ec7cca
commit 13a4191b93
6 changed files with 90 additions and 54 deletions

View File

@@ -38,7 +38,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Eyy-w7-79K">
<rect key="frame" x="18" y="234" width="22" height="18"/>
<rect key="frame" x="18" y="209" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Z56-ik-iHk">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -54,7 +54,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xbr-a8-v9X">
<rect key="frame" x="18" y="212" width="22" height="18"/>
<rect key="frame" x="18" y="187" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="FT6-me-ACu">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -70,7 +70,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kO5-iF-mZX">
<rect key="frame" x="44" y="212" width="22" height="18"/>
<rect key="frame" x="44" y="187" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="4uj-0i-drs">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -86,7 +86,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZVR-xf-ZeB">
<rect key="frame" x="70" y="212" width="22" height="18"/>
<rect key="frame" x="70" y="187" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="tQ4-MK-ghd">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -102,7 +102,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lAu-qx-vWl">
<rect key="frame" x="18" y="190" width="22" height="18"/>
<rect key="frame" x="18" y="165" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="8Ko-Cq-fCy">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -118,7 +118,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hAY-eb-Ygs">
<rect key="frame" x="44" y="190" width="22" height="18"/>
<rect key="frame" x="44" y="165" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="vBc-4I-hsa">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -134,7 +134,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TfV-CA-pjd">
<rect key="frame" x="70" y="190" width="22" height="18"/>
<rect key="frame" x="70" y="165" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="OPa-de-9M3">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -150,7 +150,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eKg-IL-v85">
<rect key="frame" x="18" y="168" width="22" height="18"/>
<rect key="frame" x="18" y="143" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="K4h-ul-R6b">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -166,7 +166,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="z97-Z3-YRK">
<rect key="frame" x="44" y="168" width="22" height="18"/>
<rect key="frame" x="44" y="143" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="bYm-jJ-lA7">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -182,7 +182,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yGm-6r-8xg">
<rect key="frame" x="70" y="168" width="22" height="18"/>
<rect key="frame" x="70" y="143" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="KHI-ra-F11">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -198,7 +198,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QYu-9A-RSx">
<rect key="frame" x="18" y="146" width="22" height="18"/>
<rect key="frame" x="18" y="121" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="NHd-8Y-lgR">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -215,7 +215,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iGf-ZI-o6t">
<rect key="frame" x="44" y="146" width="22" height="18"/>
<rect key="frame" x="44" y="121" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="fhA-hO-eSv">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -231,7 +231,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ezY-pZ-WN7">
<rect key="frame" x="70" y="146" width="22" height="18"/>
<rect key="frame" x="70" y="121" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="PgG-Pm-s9M">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -247,7 +247,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4Z4-ko-oj2">
<rect key="frame" x="70" y="124" width="22" height="18"/>
<rect key="frame" x="70" y="99" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="3cL-4f-90v">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -263,7 +263,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Fey-RP-7wF">
<rect key="frame" x="96" y="235" width="206" height="17"/>
<rect key="frame" x="96" y="210" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Update all feeds" id="Yy6-xr-m0l">
<font key="font" metaFont="system"/>
@@ -272,7 +272,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VhY-mw-Rej">
<rect key="frame" x="96" y="213" width="206" height="17"/>
<rect key="frame" x="96" y="188" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Open all unread" id="lVL-bb-uA6">
<font key="font" metaFont="system"/>
@@ -281,7 +281,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qFU-En-OSw">
<rect key="frame" x="96" y="191" width="206" height="17"/>
<rect key="frame" x="96" y="166" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Mark all read" id="XD8-5a-Hlg">
<font key="font" metaFont="system"/>
@@ -290,7 +290,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oFG-IQ-p9b">
<rect key="frame" x="96" y="169" width="206" height="17"/>
<rect key="frame" x="96" y="144" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Mark all unread" id="PJI-mv-AnH">
<font key="font" metaFont="system"/>
@@ -299,7 +299,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tjr-Of-qZE">
<rect key="frame" x="96" y="147" width="206" height="17"/>
<rect key="frame" x="96" y="122" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Number of unread items" id="JZc-eZ-uTe">
<font key="font" metaFont="system"/>
@@ -308,7 +308,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="K4q-A1-Fi9">
<rect key="frame" x="96" y="125" width="206" height="17"/>
<rect key="frame" x="96" y="100" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Tick mark unread items" id="a7h-dX-8Vg">
<font key="font" metaFont="system"/>
@@ -316,20 +316,6 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="36q-Dv-PLf">
<rect key="frame" x="18" y="76" width="133" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Menu bar icon:" id="Mkr-3d-gmN">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<imageView focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="usG-bX-431">
<rect key="frame" x="156" y="69" width="32" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" selectable="YES" editable="YES" focusRingType="none" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" image="NSBookmarksTemplate" id="QxY-0c-aDo"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2sG-NO-OJz">
<rect key="frame" x="18" y="49" width="133" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
@@ -356,7 +342,7 @@
</connections>
</popUpButton>
<customView toolTip="Show in menu bar" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="P4Y-i1-MGE" customClass="SettingsIconGlobal">
<rect key="frame" x="20" y="260" width="18" height="18"/>
<rect key="frame" x="20" y="235" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="color">
@@ -368,7 +354,7 @@
</userDefinedRuntimeAttributes>
</customView>
<customView toolTip="Show in group menu" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SKf-Y7-8xS" customClass="SettingsIconGroup">
<rect key="frame" x="46" y="260" width="18" height="18"/>
<rect key="frame" x="46" y="235" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="color">
@@ -380,7 +366,7 @@
</userDefinedRuntimeAttributes>
</customView>
<customView toolTip="Show in feed menu" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="18m-2g-bqW" customClass="RSSIcon">
<rect key="frame" x="72" y="260" width="18" height="18"/>
<rect key="frame" x="72" y="235" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="roundness">
@@ -392,9 +378,9 @@
</userDefinedRuntimeAttributes>
</customView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tec-F3-9cE">
<rect key="frame" x="201" y="75" width="46" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Tint" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="19k-mc-RLe">
<rect key="frame" x="18" y="271" width="284" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Tint menu bar icon" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="19k-mc-RLe">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
@@ -435,7 +421,7 @@
</popUpButton>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QwE-M7-q2R">
<rect key="frame" x="206" y="279" width="100" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Fix Cache" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ady-2s-Ggm">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -444,11 +430,33 @@
<action selector="fixCache:" target="-2" id="gbM-hA-UVF"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MrI-IA-Ruj">
<rect key="frame" x="70" y="77" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" inset="2" id="ixW-l7-SDZ">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="iU7-KA-nY5" name="value" keyPath="values.feedShortNames" id="E0p-Yy-3lu">
<dictionary key="options">
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
<integer key="NSNullPlaceholder" value="0"/>
</dictionary>
</binding>
</connections>
</button>
<textField toolTip="Truncate article title after 60 characters" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="u6A-qA-zxZ">
<rect key="frame" x="96" y="78" width="206" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Short article names" id="Fh4-U9-Rnv">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<point key="canvasLocation" x="140" y="-155.5"/>
</customView>
</objects>
<resources>
<image name="NSBookmarksTemplate" width="17" height="18"/>
</resources>
</document>

View File

@@ -25,6 +25,10 @@
@interface UserPrefs : NSObject
+ (BOOL)defaultYES:(NSString*)key;
+ (BOOL)defaultNO:(NSString*)key;
+ (NSString*)getHttpApplication;
+ (void)setHttpApplication:(NSString*)bundleID;
+ (NSUInteger)openFewLinksLimit; // Change with: 'defaults write de.relikd.baRSS openFewLinksLimit -int 10'
+ (NSUInteger)shortArticleNamesLimit; // Change with: 'defaults write de.relikd.baRSS shortArticleNamesLimit -int 50'
@end

View File

@@ -37,6 +37,13 @@
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
}
/// @return Return @c defaultInt if key is not set. Otherwise, return user defaults property from plist.
+ (NSInteger)defaultInt:(NSInteger)defaultInt forKey:(NSString*)key {
NSInteger ret = [[NSUserDefaults standardUserDefaults] integerForKey:key];
if (ret > 0) return ret;
return defaultInt;
}
/// @return User configured custom browser. Or @c nil if not set yet. (which will fallback to default browser)
+ (NSString*)getHttpApplication {
return [[NSUserDefaults standardUserDefaults] stringForKey:@"defaultHttpApplication"];
@@ -47,4 +54,16 @@
[[NSUserDefaults standardUserDefaults] setObject:bundleID forKey:@"defaultHttpApplication"];
}
#pragma mark - Hidden Plist Properties -
/// @return The limit on how many links should be opened at the same time, if user holds the option key.
+ (NSUInteger)openFewLinksLimit {
return (NSUInteger)[self defaultInt:10 forKey:@"openFewLinksLimit"];
}
/// @return The limit on when to truncate article titles (Short names setting must be active).
+ (NSUInteger)shortArticleNamesLimit {
return (NSUInteger)[self defaultInt:60 forKey:@"shortArticleNamesLimit"];
}
@end