Browse Source

Version 1.3.0. Can select hot or new.

Thomas Buck 10 years ago
parent
commit
b9dee7c983

+ 1
- 1
RedditBar/AppDelegate.h View File

@@ -66,6 +66,6 @@
66 66
 -(void)reloadListHasFrontpageCallback:(NSArray *)items;
67 67
 -(void)readPMsCallback:(NSNumber *)items;
68 68
 
69
--(void)prefReturnName:(NSString *)name Modhash:(NSString *)modhash subscriptions:(Boolean)subscriptions subreddits:(NSString *)subreddits length:(NSInteger)length printSubs:(Boolean)showSubreddits titleLength:(NSInteger)titleLength refresh:(NSInteger)refreshInterval;
69
+-(void)prefReturnName:(NSString *)name Modhash:(NSString *)modhash subscriptions:(Boolean)subscriptions subreddits:(NSString *)subreddits length:(NSInteger)length printSubs:(Boolean)showSubreddits titleLength:(NSInteger)titleLength refresh:(NSInteger)refreshInterval filter:(NSString *)filter;
70 70
 
71 71
 @end

+ 5
- 1
RedditBar/AppDelegate.m View File

@@ -234,7 +234,7 @@
234 234
     [application orderFrontStandardAboutPanel:self];
235 235
 }
236 236
 
237
--(void)prefReturnName:(NSString *)name Modhash:(NSString *)modhash subscriptions:(Boolean)subscriptions subreddits:(NSString *)subreddits length:(NSInteger)length printSubs:(Boolean)showSubreddits titleLength:(NSInteger)titleLength refresh:(NSInteger)refreshInterval {
237
+-(void)prefReturnName:(NSString *)name Modhash:(NSString *)modhash subscriptions:(Boolean)subscriptions subreddits:(NSString *)subreddits length:(NSInteger)length printSubs:(Boolean)showSubreddits titleLength:(NSInteger)titleLength refresh:(NSInteger)refreshInterval filter:(NSString *)filter {
238 238
     currentState.username = name;
239 239
     currentState.modhash = modhash;
240 240
     currentState.useSubscriptions = subscriptions;
@@ -243,7 +243,11 @@
243 243
     currentState.showSubreddit = showSubreddits;
244 244
     currentState.titleLength = titleLength;
245 245
     currentState.refreshInterval = refreshInterval;
246
+    currentState.filter = filter;
246 247
     [currentState savePreferences];
248
+    [firstMenuItem setTitle:NSLocalizedString(@"Loading...", nil)];
249
+    [self clearMenuItems];
250
+    [firstMenuItem setHidden:NO];
247 251
     lastFullName = nil; // reload from start
248 252
     [self reloadListWithOptions];
249 253
     [self recreateRefreshTimer];

+ 12
- 0
RedditBar/Base.lproj/Prefs.strings View File

@@ -26,6 +26,9 @@
26 26
 /* Class = "NSButtonCell"; title = "Save"; ObjectID = "Mqa-FJ-C43"; */
27 27
 "Mqa-FJ-C43.title" = "Save";
28 28
 
29
+/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "Ow7-gc-PGv"; */
30
+"Ow7-gc-PGv.title" = "OtherViews";
31
+
29 32
 /* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "TjO-Z6-Vng"; */
30 33
 "TjO-Z6-Vng.title" = "Cancel";
31 34
 
@@ -35,12 +38,18 @@
35 38
 /* Class = "NSTextFieldCell"; title = "66"; ObjectID = "b76-4r-MEp"; */
36 39
 "b76-4r-MEp.title" = "66";
37 40
 
41
+/* Class = "NSTextFieldCell"; title = "Filter:"; ObjectID = "coc-11-MQH"; */
42
+"coc-11-MQH.title" = "Filter:";
43
+
38 44
 /* Class = "NSTextFieldCell"; title = "PM Refresh (in Minutes):"; ObjectID = "cwK-wP-wB6"; */
39 45
 "cwK-wP-wB6.title" = "PM Refresh (in Minutes):";
40 46
 
41 47
 /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "czz-51-wxr"; */
42 48
 "czz-51-wxr.title" = "Edit";
43 49
 
50
+/* Class = "NSMenuItem"; title = "new"; ObjectID = "dxr-Ml-O8i"; */
51
+"dxr-Ml-O8i.title" = "new";
52
+
44 53
 /* Class = "NSTextFieldCell"; title = "5"; ObjectID = "gZN-n2-TGX"; */
45 54
 "gZN-n2-TGX.title" = "5";
46 55
 
@@ -59,5 +68,8 @@
59 68
 /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "qSu-ha-DhM"; */
60 69
 "qSu-ha-DhM.title" = "Select All";
61 70
 
71
+/* Class = "NSMenuItem"; title = "hot"; ObjectID = "sKV-FZ-wbQ"; */
72
+"sKV-FZ-wbQ.title" = "hot";
73
+
62 74
 /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "wSY-To-FDI"; */
63 75
 "wSY-To-FDI.title" = "Copy";

+ 48
- 20
RedditBar/Base.lproj/Prefs.xib View File

@@ -7,6 +7,7 @@
7 7
     <objects>
8 8
         <customObject id="-2" userLabel="File's Owner" customClass="PrefController">
9 9
             <connections>
10
+                <outlet property="filterSelection" destination="FR2-RR-NOg" id="sOl-hW-dbV"/>
10 11
                 <outlet property="lengthField" destination="MAv-jO-hIv" id="tbQ-UG-2ew"/>
11 12
                 <outlet property="lengthStepper" destination="jxz-fQ-M1L" id="NK5-G4-9UJ"/>
12 13
                 <outlet property="password" destination="ARP-lb-J16" id="EDd-om-ciF"/>
@@ -27,14 +28,14 @@
27 28
         <window title="RedditBar Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" animationBehavior="default" id="1" customClass="PrefWindow">
28 29
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
29 30
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
30
-            <rect key="contentRect" x="196" y="240" width="340" height="363"/>
31
+            <rect key="contentRect" x="196" y="240" width="340" height="398"/>
31 32
             <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1058"/>
32 33
             <view key="contentView" id="2">
33
-                <rect key="frame" x="0.0" y="0.0" width="340" height="363"/>
34
+                <rect key="frame" x="0.0" y="0.0" width="340" height="398"/>
34 35
                 <autoresizingMask key="autoresizingMask"/>
35 36
                 <subviews>
36 37
                     <textField verticalHuggingPriority="750" id="0mi-88-o94">
37
-                        <rect key="frame" x="120" y="323" width="200" height="22"/>
38
+                        <rect key="frame" x="120" y="358" width="200" height="22"/>
38 39
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
39 40
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="xlI-hU-MqM">
40 41
                             <font key="font" metaFont="system"/>
@@ -43,7 +44,7 @@
43 44
                         </textFieldCell>
44 45
                     </textField>
45 46
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="f72-fM-yQc">
46
-                        <rect key="frame" x="18" y="328" width="96" height="17"/>
47
+                        <rect key="frame" x="18" y="363" width="96" height="17"/>
47 48
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
48 49
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Username: " id="GTO-OP-MYS">
49 50
                             <font key="font" metaFont="system"/>
@@ -52,7 +53,7 @@
52 53
                         </textFieldCell>
53 54
                     </textField>
54 55
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="JMQ-a6-DKC">
55
-                        <rect key="frame" x="18" y="294" width="96" height="17"/>
56
+                        <rect key="frame" x="18" y="329" width="96" height="17"/>
56 57
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
57 58
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Password:" id="m11-YF-fEa">
58 59
                             <font key="font" metaFont="system"/>
@@ -61,7 +62,7 @@
61 62
                         </textFieldCell>
62 63
                     </textField>
63 64
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="qFP-pd-32c">
64
-                        <rect key="frame" x="18" y="128" width="63" height="17"/>
65
+                        <rect key="frame" x="18" y="163" width="63" height="17"/>
65 66
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
66 67
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Items:" id="FNJ-RL-DXT">
67 68
                             <font key="font" metaFont="system"/>
@@ -70,7 +71,7 @@
70 71
                         </textFieldCell>
71 72
                     </textField>
72 73
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="O82-1u-lSr">
73
-                        <rect key="frame" x="152" y="128" width="63" height="17"/>
74
+                        <rect key="frame" x="152" y="163" width="63" height="17"/>
74 75
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
75 76
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Title:" id="Frl-AE-ROJ">
76 77
                             <font key="font" metaFont="system"/>
@@ -79,7 +80,7 @@
79 80
                         </textFieldCell>
80 81
                     </textField>
81 82
                     <secureTextField verticalHuggingPriority="750" id="ARP-lb-J16">
82
-                        <rect key="frame" x="120" y="291" width="200" height="22"/>
83
+                        <rect key="frame" x="120" y="326" width="200" height="22"/>
83 84
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
84 85
                         <secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="We7-pG-rAt">
85 86
                             <font key="font" metaFont="system"/>
@@ -116,7 +117,7 @@ Gw
116 117
                         </connections>
117 118
                     </button>
118 119
                     <scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="8ew-wY-1Yh">
119
-                        <rect key="frame" x="20" y="153" width="300" height="100"/>
120
+                        <rect key="frame" x="20" y="188" width="300" height="100"/>
120 121
                         <autoresizingMask key="autoresizingMask"/>
121 122
                         <clipView key="contentView" copiesOnScroll="NO" id="ENU-Jw-8fO">
122 123
                             <rect key="frame" x="1" y="1" width="298" height="98"/>
@@ -145,7 +146,7 @@ Gw
145 146
                         </scroller>
146 147
                     </scrollView>
147 148
                     <button id="XZM-90-hQ8">
148
-                        <rect key="frame" x="18" y="260" width="280" height="25"/>
149
+                        <rect key="frame" x="18" y="295" width="280" height="25"/>
149 150
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
150 151
                         <buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="vW5-Cp-Bm1">
151 152
                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -156,7 +157,7 @@ Gw
156 157
                         </connections>
157 158
                     </button>
158 159
                     <textField verticalHuggingPriority="750" id="MAv-jO-hIv">
159
-                        <rect key="frame" x="87" y="125" width="38" height="22"/>
160
+                        <rect key="frame" x="87" y="160" width="38" height="22"/>
160 161
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
161 162
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="10" drawsBackground="YES" id="0SD-Tf-uZS">
162 163
                             <font key="font" metaFont="system"/>
@@ -169,7 +170,7 @@ Gw
169 170
                         </connections>
170 171
                     </textField>
171 172
                     <textField verticalHuggingPriority="750" id="qju-1J-OOV">
172
-                        <rect key="frame" x="221" y="125" width="38" height="22"/>
173
+                        <rect key="frame" x="221" y="160" width="38" height="22"/>
173 174
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
174 175
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="66" drawsBackground="YES" id="b76-4r-MEp">
175 176
                             <font key="font" metaFont="system"/>
@@ -182,7 +183,7 @@ Gw
182 183
                         </connections>
183 184
                     </textField>
184 185
                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="jxz-fQ-M1L">
185
-                        <rect key="frame" x="130" y="122" width="19" height="27"/>
186
+                        <rect key="frame" x="130" y="157" width="19" height="27"/>
186 187
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
187 188
                         <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="Gba-jV-Ouh"/>
188 189
                         <connections>
@@ -191,7 +192,7 @@ Gw
191 192
                         </connections>
192 193
                     </stepper>
193 194
                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="2aV-fo-xh7">
194
-                        <rect key="frame" x="264" y="122" width="19" height="27"/>
195
+                        <rect key="frame" x="264" y="157" width="19" height="27"/>
195 196
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
196 197
                         <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="BWQ-gm-H9h"/>
197 198
                         <connections>
@@ -200,11 +201,11 @@ Gw
200 201
                         </connections>
201 202
                     </stepper>
202 203
                     <progressIndicator canDrawConcurrently="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="vz0-tR-n1f">
203
-                        <rect key="frame" x="304" y="264" width="16" height="16"/>
204
+                        <rect key="frame" x="304" y="299" width="16" height="16"/>
204 205
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
205 206
                     </progressIndicator>
206 207
                     <button id="fRR-M9-szp">
207
-                        <rect key="frame" x="18" y="93" width="304" height="18"/>
208
+                        <rect key="frame" x="18" y="128" width="304" height="18"/>
208 209
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
209 210
                         <buttonCell key="cell" type="check" title="Show Subreddit after Title" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="nFK-xi-2F3">
210 211
                             <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -212,7 +213,7 @@ Gw
212 213
                         </buttonCell>
213 214
                     </button>
214 215
                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="6zt-jq-NXJ">
215
-                        <rect key="frame" x="18" y="61" width="236" height="17"/>
216
+                        <rect key="frame" x="6" y="64" width="236" height="17"/>
216 217
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
217 218
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="PM Refresh (in Minutes):" id="cwK-wP-wB6">
218 219
                             <font key="font" metaFont="system"/>
@@ -221,14 +222,14 @@ Gw
221 222
                         </textFieldCell>
222 223
                     </textField>
223 224
                     <box autoresizesSubviews="NO" verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="paW-kV-tNF">
224
-                        <rect key="frame" x="12" y="84" width="316" height="5"/>
225
+                        <rect key="frame" x="12" y="87" width="316" height="5"/>
225 226
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
226 227
                         <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
227 228
                         <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
228 229
                         <font key="titleFont" metaFont="system"/>
229 230
                     </box>
230 231
                     <textField verticalHuggingPriority="750" id="2J7-SH-Grc">
231
-                        <rect key="frame" x="260" y="58" width="38" height="22"/>
232
+                        <rect key="frame" x="248" y="61" width="38" height="22"/>
232 233
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
233 234
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="5" drawsBackground="YES" id="gZN-n2-TGX">
234 235
                             <font key="font" metaFont="system"/>
@@ -241,7 +242,7 @@ Gw
241 242
                         </connections>
242 243
                     </textField>
243 244
                     <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="uaS-Xm-tIa">
244
-                        <rect key="frame" x="303" y="55" width="19" height="27"/>
245
+                        <rect key="frame" x="291" y="58" width="19" height="27"/>
245 246
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
246 247
                         <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="rTZ-Zs-1eO"/>
247 248
                         <connections>
@@ -249,6 +250,33 @@ Gw
249 250
                             <outlet property="formatter" destination="Y11-Cs-X1g" id="hoL-jC-QPe"/>
250 251
                         </connections>
251 252
                     </stepper>
253
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="cec-PF-2Hn">
254
+                        <rect key="frame" x="18" y="98" width="130" height="17"/>
255
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
256
+                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Filter:" id="coc-11-MQH">
257
+                            <font key="font" metaFont="system"/>
258
+                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
259
+                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
260
+                        </textFieldCell>
261
+                    </textField>
262
+                    <popUpButton verticalHuggingPriority="750" id="FR2-RR-NOg">
263
+                        <rect key="frame" x="164" y="93" width="159" height="26"/>
264
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
265
+                        <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="zJW-6u-fHd">
266
+                            <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
267
+                            <font key="font" metaFont="system"/>
268
+                            <menu key="menu" title="OtherViews" id="Ow7-gc-PGv">
269
+                                <items>
270
+                                    <menuItem title="hot" state="on" id="sKV-FZ-wbQ">
271
+                                        <modifierMask key="keyEquivalentModifierMask"/>
272
+                                    </menuItem>
273
+                                    <menuItem title="new" id="dxr-Ml-O8i">
274
+                                        <modifierMask key="keyEquivalentModifierMask"/>
275
+                                    </menuItem>
276
+                                </items>
277
+                            </menu>
278
+                        </popUpButtonCell>
279
+                    </popUpButton>
252 280
                 </subviews>
253 281
             </view>
254 282
         </window>

+ 7
- 5
RedditBar/PrefController.h View File

@@ -39,15 +39,17 @@
39 39
 @property (atomic, retain) IBOutlet NSTextField *lengthField;
40 40
 @property (atomic, retain) IBOutlet NSStepper *lengthStepper;
41 41
 @property (atomic, retain) IBOutlet NSProgressIndicator *progress;
42
-@property (weak) IBOutlet NSButton *showSubreddit;
43
-@property (atomic, retain) NSObject *parent;
44
-@property (atomic, retain) StateModel *state;
45
-@property (atomic) NSInteger length;
42
+@property (atomic, retain) IBOutlet NSButton *showSubreddit;
46 43
 @property (atomic, retain) IBOutlet NSTextField *titleField;
47 44
 @property (atomic, retain) IBOutlet NSStepper *titleStepper;
48
-@property (atomic) NSInteger titleLength;
49 45
 @property (atomic, retain) IBOutlet NSTextField *refreshField;
50 46
 @property (atomic, retain) IBOutlet NSStepper *refreshStepper;
47
+@property (atomic, retain) IBOutlet NSPopUpButton *filterSelection;
48
+
49
+@property (atomic, retain) NSObject *parent;
50
+@property (atomic, retain) StateModel *state;
51
+@property (atomic) NSInteger length;
52
+@property (atomic) NSInteger titleLength;
51 53
 @property (atomic) NSInteger refreshInterval;
52 54
 
53 55
 -(IBAction)buttonSave:(id)sender;

+ 7
- 2
RedditBar/PrefController.m View File

@@ -34,7 +34,7 @@
34 34
 NSString *modhashSetLiteral = @"__MODHASH__IS__SET__";
35 35
 NSString *subredditCharacters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_\n";
36 36
 
37
-@synthesize username, password, subscriptions, subreddits, win, parent, state, lengthField, lengthStepper, length, progress, showSubreddit, titleField, titleStepper, titleLength, refreshField, refreshStepper, refreshInterval;
37
+@synthesize username, password, subscriptions, subreddits, win, parent, state, lengthField, lengthStepper, length, progress, showSubreddit, titleField, titleStepper, titleLength, refreshField, refreshStepper, refreshInterval, filterSelection;
38 38
 
39 39
 -(Boolean)isValidList:(NSString *)input {
40 40
     NSCharacterSet *invalidChars = [[NSCharacterSet characterSetWithCharactersInString:subredditCharacters] invertedSet];
@@ -70,6 +70,11 @@ NSString *subredditCharacters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST
70 70
     [refreshField setIntegerValue:refreshInterval];
71 71
     [progress setUsesThreadedAnimation:YES];
72 72
     [showSubreddit setState:[NSNumber numberWithBool:state.showSubreddit].integerValue];
73
+    if ([state.filter isEqualToString:@"hot"]) {
74
+        [filterSelection selectItemAtIndex:0];
75
+    } else {
76
+        [filterSelection selectItemAtIndex:1];
77
+    }
73 78
 }
74 79
 
75 80
 -(IBAction)buttonSave:(id)sender {
@@ -132,7 +137,7 @@ NSString *subredditCharacters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST
132 137
         print = FALSE;
133 138
     
134 139
     AppDelegate *app = (AppDelegate *)parent;
135
-    [app prefReturnName:username.stringValue Modhash:modhash subscriptions:subs subreddits:subreddits.textStorage.string length:[lengthField integerValue] printSubs:print titleLength:[titleField integerValue] refresh:[refreshField integerValue]];
140
+    [app prefReturnName:username.stringValue Modhash:modhash subscriptions:subs subreddits:subreddits.textStorage.string length:[lengthField integerValue] printSubs:print titleLength:[titleField integerValue] refresh:[refreshField integerValue] filter:[filterSelection titleOfSelectedItem]];
136 141
     [win performClose:self];
137 142
 }
138 143
 

+ 6
- 4
RedditBar/Reddit.m View File

@@ -106,11 +106,12 @@ NSString *subredditFormat = @" [r/%@]";
106 106
     
107 107
     NSString *after = ((AppDelegate *)parent).lastFullName;
108 108
     Boolean showSubreddits = ((AppDelegate *)parent).currentState.showSubreddit;
109
+    NSString *where = ((AppDelegate *)parent).currentState.filter;
109 110
     NSString *url;
110 111
     if (after == nil)
111
-        url = [NSString stringWithFormat:@"hot.json?limit=%ld", (long)length];
112
+        url = [NSString stringWithFormat:@"%@.json?limit=%ld", where, (long)length];
112 113
     else
113
-        url = [NSString stringWithFormat:@"hot.json?limit=%ld&after=%@", (long)length, after];
114
+        url = [NSString stringWithFormat:@"%@.json?limit=%ld&after=%@", where, (long)length, after];
114 115
         
115 116
     NSData *data = [self queryAPI:url withResponse:&response];
116 117
     if ((data == nil) || ([response statusCode] != 200)) {
@@ -131,11 +132,12 @@ NSString *subredditFormat = @" [r/%@]";
131 132
     
132 133
     NSString *after = ((AppDelegate *)parent).lastFullName;
133 134
     Boolean showSubreddits = ((AppDelegate *)parent).currentState.showSubreddit;
135
+    NSString *where = ((AppDelegate *)parent).currentState.filter;
134 136
     NSString *url;
135 137
     if (after == nil)
136
-        url = [NSString stringWithFormat:@"%@/hot.json?limit=%ld", subs, (long)length];
138
+        url = [NSString stringWithFormat:@"%@/%@.json?limit=%ld", subs, where, (long)length];
137 139
     else
138
-        url = [NSString stringWithFormat:@"%@/hot.json?limit=%ld&after=%@", subs, (long)length, after];
140
+        url = [NSString stringWithFormat:@"%@/%@.json?limit=%ld&after=%@", subs, where, (long)length, after];
139 141
     
140 142
     NSHTTPURLResponse *response;
141 143
     NSData *data = [self queryAPI:url withResponse:&response];

+ 2
- 2
RedditBar/RedditBar-Info.plist View File

@@ -17,11 +17,11 @@
17 17
 	<key>CFBundlePackageType</key>
18 18
 	<string>APPL</string>
19 19
 	<key>CFBundleShortVersionString</key>
20
-	<string>1.2.0</string>
20
+	<string>1.3.0</string>
21 21
 	<key>CFBundleSignature</key>
22 22
 	<string>????</string>
23 23
 	<key>CFBundleVersion</key>
24
-	<string>266</string>
24
+	<string>274</string>
25 25
 	<key>LSApplicationCategoryType</key>
26 26
 	<string>public.app-category.utilities</string>
27 27
 	<key>LSMinimumSystemVersion</key>

+ 1
- 0
RedditBar/StateModel.h View File

@@ -38,6 +38,7 @@
38 38
 @property (atomic) Boolean showSubreddit;
39 39
 @property (atomic) NSInteger titleLength;
40 40
 @property (atomic) NSInteger refreshInterval;
41
+@property (atomic, retain) NSString *filter;
41 42
 
42 43
 -(void)registerDefaultPreferences;
43 44
 -(void)savePreferences;

+ 5
- 1
RedditBar/StateModel.m View File

@@ -30,7 +30,7 @@
30 30
 
31 31
 @implementation StateModel
32 32
 
33
-@synthesize username, modhash, useSubscriptions, subreddits, length, showSubreddit, titleLength, refreshInterval;
33
+@synthesize username, modhash, useSubscriptions, subreddits, length, showSubreddit, titleLength, refreshInterval, filter;
34 34
 
35 35
 NSString *s_username = @"username";
36 36
 NSString *s_modhash = @"modhash";
@@ -40,6 +40,7 @@ NSString *s_length = @"length";
40 40
 NSString *s_subs = @"showSubs";
41 41
 NSString *s_title = @"titleLength";
42 42
 NSString *s_refresh = @"refreshInterval";
43
+NSString *s_filter = @"filter";
43 44
 
44 45
 -(void)registerDefaultPreferences {
45 46
     NSUserDefaults *store = [NSUserDefaults standardUserDefaults];
@@ -50,6 +51,7 @@ NSString *s_refresh = @"refreshInterval";
50 51
     [appDefaults setValue:[NSNumber numberWithBool:YES] forKey:s_subs];
51 52
     [appDefaults setValue:[NSNumber numberWithInt:66] forKey:s_title];
52 53
     [appDefaults setValue:[NSNumber numberWithInt:5] forKey:s_refresh];
54
+    [appDefaults setValue:@"hot" forKey:s_filter];
53 55
     [store registerDefaults:appDefaults];
54 56
 }
55 57
 
@@ -63,6 +65,7 @@ NSString *s_refresh = @"refreshInterval";
63 65
     [store setBool:showSubreddit forKey:s_subs];
64 66
     [store setInteger:titleLength forKey:s_title];
65 67
     [store setInteger:refreshInterval forKey:s_refresh];
68
+    [store setObject:filter forKey:s_filter];
66 69
     [store synchronize];
67 70
 }
68 71
 
@@ -77,6 +80,7 @@ NSString *s_refresh = @"refreshInterval";
77 80
     showSubreddit = [store boolForKey:s_subs];
78 81
     titleLength = [store integerForKey:s_title];
79 82
     refreshInterval = [store integerForKey:s_refresh];
83
+    filter = [store stringForKey:s_filter];
80 84
 }
81 85
 
82 86
 @end

+ 12
- 0
RedditBar/de.lproj/Prefs.strings View File

@@ -25,6 +25,9 @@
25 25
 /* Class = "NSButtonCell"; title = "Save"; ObjectID = "Mqa-FJ-C43"; */
26 26
 "Mqa-FJ-C43.title" = "Speichern";
27 27
 
28
+/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "Ow7-gc-PGv"; */
29
+"Ow7-gc-PGv.title" = "OtherViews";
30
+
28 31
 /* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "TjO-Z6-Vng"; */
29 32
 "TjO-Z6-Vng.title" = "Abbrechen";
30 33
 
@@ -34,12 +37,18 @@
34 37
 /* Class = "NSTextFieldCell"; title = "66"; ObjectID = "b76-4r-MEp"; */
35 38
 "b76-4r-MEp.title" = "66";
36 39
 
40
+/* Class = "NSTextFieldCell"; title = "Filter:"; ObjectID = "coc-11-MQH"; */
41
+"coc-11-MQH.title" = "Filter:";
42
+
37 43
 /* Class = "NSTextFieldCell"; title = "PM Refresh (in Minutes):"; ObjectID = "cwK-wP-wB6"; */
38 44
 "cwK-wP-wB6.title" = "PM Aktualisierung (in Minuten):";
39 45
 
40 46
 /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "czz-51-wxr"; */
41 47
 "czz-51-wxr.title" = "Bearbeiten";
42 48
 
49
+/* Class = "NSMenuItem"; title = "new"; ObjectID = "dxr-Ml-O8i"; */
50
+"dxr-Ml-O8i.title" = "new";
51
+
43 52
 /* Class = "NSTextFieldCell"; title = "5"; ObjectID = "gZN-n2-TGX"; */
44 53
 "gZN-n2-TGX.title" = "5";
45 54
 
@@ -58,6 +67,9 @@
58 67
 /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "qSu-ha-DhM"; */
59 68
 "qSu-ha-DhM.title" = "Alle auswählen";
60 69
 
70
+/* Class = "NSMenuItem"; title = "hot"; ObjectID = "sKV-FZ-wbQ"; */
71
+"sKV-FZ-wbQ.title" = "hot";
72
+
61 73
 /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "wSY-To-FDI"; */
62 74
 "wSY-To-FDI.title" = "Kopieren";
63 75
 

+ 12
- 0
RedditBar/en.lproj/Prefs.strings View File

@@ -25,6 +25,9 @@
25 25
 /* Class = "NSButtonCell"; title = "Save"; ObjectID = "Mqa-FJ-C43"; */
26 26
 "Mqa-FJ-C43.title" = "Save";
27 27
 
28
+/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "Ow7-gc-PGv"; */
29
+"Ow7-gc-PGv.title" = "OtherViews";
30
+
28 31
 /* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "TjO-Z6-Vng"; */
29 32
 "TjO-Z6-Vng.title" = "Cancel";
30 33
 
@@ -34,12 +37,18 @@
34 37
 /* Class = "NSTextFieldCell"; title = "66"; ObjectID = "b76-4r-MEp"; */
35 38
 "b76-4r-MEp.title" = "66";
36 39
 
40
+/* Class = "NSTextFieldCell"; title = "Filter:"; ObjectID = "coc-11-MQH"; */
41
+"coc-11-MQH.title" = "Filter:";
42
+
37 43
 /* Class = "NSTextFieldCell"; title = "PM Refresh (in Minutes):"; ObjectID = "cwK-wP-wB6"; */
38 44
 "cwK-wP-wB6.title" = "PM Refresh (in Minutes):";
39 45
 
40 46
 /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "czz-51-wxr"; */
41 47
 "czz-51-wxr.title" = "Edit";
42 48
 
49
+/* Class = "NSMenuItem"; title = "new"; ObjectID = "dxr-Ml-O8i"; */
50
+"dxr-Ml-O8i.title" = "new";
51
+
43 52
 /* Class = "NSTextFieldCell"; title = "5"; ObjectID = "gZN-n2-TGX"; */
44 53
 "gZN-n2-TGX.title" = "5";
45 54
 
@@ -58,6 +67,9 @@
58 67
 /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "qSu-ha-DhM"; */
59 68
 "qSu-ha-DhM.title" = "Select All";
60 69
 
70
+/* Class = "NSMenuItem"; title = "hot"; ObjectID = "sKV-FZ-wbQ"; */
71
+"sKV-FZ-wbQ.title" = "hot";
72
+
61 73
 /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "wSY-To-FDI"; */
62 74
 "wSY-To-FDI.title" = "Copy";
63 75
 

+ 12
- 0
RedditBarTests/de.lproj/Prefs.strings View File

@@ -25,6 +25,9 @@
25 25
 /* Class = "NSButtonCell"; title = "Save"; ObjectID = "Mqa-FJ-C43"; */
26 26
 "Mqa-FJ-C43.title" = "Save";
27 27
 
28
+/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "Ow7-gc-PGv"; */
29
+"Ow7-gc-PGv.title" = "OtherViews";
30
+
28 31
 /* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "TjO-Z6-Vng"; */
29 32
 "TjO-Z6-Vng.title" = "Cancel";
30 33
 
@@ -34,12 +37,18 @@
34 37
 /* Class = "NSTextFieldCell"; title = "66"; ObjectID = "b76-4r-MEp"; */
35 38
 "b76-4r-MEp.title" = "66";
36 39
 
40
+/* Class = "NSTextFieldCell"; title = "Filter:"; ObjectID = "coc-11-MQH"; */
41
+"coc-11-MQH.title" = "Filter:";
42
+
37 43
 /* Class = "NSTextFieldCell"; title = "PM Refresh (in Minutes):"; ObjectID = "cwK-wP-wB6"; */
38 44
 "cwK-wP-wB6.title" = "PM Refresh (in Minutes):";
39 45
 
40 46
 /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "czz-51-wxr"; */
41 47
 "czz-51-wxr.title" = "Edit";
42 48
 
49
+/* Class = "NSMenuItem"; title = "new"; ObjectID = "dxr-Ml-O8i"; */
50
+"dxr-Ml-O8i.title" = "new";
51
+
43 52
 /* Class = "NSTextFieldCell"; title = "5"; ObjectID = "gZN-n2-TGX"; */
44 53
 "gZN-n2-TGX.title" = "5";
45 54
 
@@ -58,6 +67,9 @@
58 67
 /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "qSu-ha-DhM"; */
59 68
 "qSu-ha-DhM.title" = "Select All";
60 69
 
70
+/* Class = "NSMenuItem"; title = "hot"; ObjectID = "sKV-FZ-wbQ"; */
71
+"sKV-FZ-wbQ.title" = "hot";
72
+
61 73
 /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "wSY-To-FDI"; */
62 74
 "wSY-To-FDI.title" = "Copy";
63 75
 

+ 12
- 0
RedditBarTests/en.lproj/Prefs.strings View File

@@ -25,6 +25,9 @@
25 25
 /* Class = "NSButtonCell"; title = "Save"; ObjectID = "Mqa-FJ-C43"; */
26 26
 "Mqa-FJ-C43.title" = "Save";
27 27
 
28
+/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "Ow7-gc-PGv"; */
29
+"Ow7-gc-PGv.title" = "OtherViews";
30
+
28 31
 /* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "TjO-Z6-Vng"; */
29 32
 "TjO-Z6-Vng.title" = "Cancel";
30 33
 
@@ -34,12 +37,18 @@
34 37
 /* Class = "NSTextFieldCell"; title = "66"; ObjectID = "b76-4r-MEp"; */
35 38
 "b76-4r-MEp.title" = "66";
36 39
 
40
+/* Class = "NSTextFieldCell"; title = "Filter:"; ObjectID = "coc-11-MQH"; */
41
+"coc-11-MQH.title" = "Filter:";
42
+
37 43
 /* Class = "NSTextFieldCell"; title = "PM Refresh (in Minutes):"; ObjectID = "cwK-wP-wB6"; */
38 44
 "cwK-wP-wB6.title" = "PM Refresh (in Minutes):";
39 45
 
40 46
 /* Class = "NSMenuItem"; title = "Edit"; ObjectID = "czz-51-wxr"; */
41 47
 "czz-51-wxr.title" = "Edit";
42 48
 
49
+/* Class = "NSMenuItem"; title = "new"; ObjectID = "dxr-Ml-O8i"; */
50
+"dxr-Ml-O8i.title" = "new";
51
+
43 52
 /* Class = "NSTextFieldCell"; title = "5"; ObjectID = "gZN-n2-TGX"; */
44 53
 "gZN-n2-TGX.title" = "5";
45 54
 
@@ -58,6 +67,9 @@
58 67
 /* Class = "NSMenuItem"; title = "Select All"; ObjectID = "qSu-ha-DhM"; */
59 68
 "qSu-ha-DhM.title" = "Select All";
60 69
 
70
+/* Class = "NSMenuItem"; title = "hot"; ObjectID = "sKV-FZ-wbQ"; */
71
+"sKV-FZ-wbQ.title" = "hot";
72
+
61 73
 /* Class = "NSMenuItem"; title = "Copy"; ObjectID = "wSY-To-FDI"; */
62 74
 "wSY-To-FDI.title" = "Copy";
63 75
 

Loading…
Cancel
Save