Browse Source

Finished code for Pref Window. Included Circular Progress Indicator. Removed Autolayout for Prefs XIB, no more warnings. Added Reddit API class structure.

Thomas Buck 11 years ago
parent
commit
78f73fd7eb

+ 6
- 0
RedditBar.xcodeproj/project.pbxproj View File

9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
10
 		E9341914184A1A1A00D03488 /* StateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E9341913184A1A1A00D03488 /* StateModel.m */; };
10
 		E9341914184A1A1A00D03488 /* StateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E9341913184A1A1A00D03488 /* StateModel.m */; };
11
 		E934191B184A47DE00D03488 /* Prefs.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9341919184A47DE00D03488 /* Prefs.xib */; };
11
 		E934191B184A47DE00D03488 /* Prefs.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9341919184A47DE00D03488 /* Prefs.xib */; };
12
+		E9B6773E184B73DC00850559 /* Reddit.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B6773D184B73DC00850559 /* Reddit.m */; };
12
 		E9CF1F21184961010004AE02 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9CF1F20184961010004AE02 /* Cocoa.framework */; };
13
 		E9CF1F21184961010004AE02 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9CF1F20184961010004AE02 /* Cocoa.framework */; };
13
 		E9CF1F2B184961010004AE02 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E9CF1F29184961010004AE02 /* InfoPlist.strings */; };
14
 		E9CF1F2B184961010004AE02 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E9CF1F29184961010004AE02 /* InfoPlist.strings */; };
14
 		E9CF1F2D184961010004AE02 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E9CF1F2C184961010004AE02 /* main.m */; };
15
 		E9CF1F2D184961010004AE02 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E9CF1F2C184961010004AE02 /* main.m */; };
39
 		E9341912184A1A1A00D03488 /* StateModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StateModel.h; sourceTree = "<group>"; };
40
 		E9341912184A1A1A00D03488 /* StateModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StateModel.h; sourceTree = "<group>"; };
40
 		E9341913184A1A1A00D03488 /* StateModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StateModel.m; sourceTree = "<group>"; };
41
 		E9341913184A1A1A00D03488 /* StateModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StateModel.m; sourceTree = "<group>"; };
41
 		E934191A184A47DE00D03488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Prefs.xib; sourceTree = "<group>"; };
42
 		E934191A184A47DE00D03488 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Prefs.xib; sourceTree = "<group>"; };
43
+		E9B6773C184B73DC00850559 /* Reddit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reddit.h; sourceTree = "<group>"; };
44
+		E9B6773D184B73DC00850559 /* Reddit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reddit.m; sourceTree = "<group>"; };
42
 		E9CF1F1D184961010004AE02 /* RedditBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RedditBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
45
 		E9CF1F1D184961010004AE02 /* RedditBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RedditBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
43
 		E9CF1F20184961010004AE02 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
46
 		E9CF1F20184961010004AE02 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
44
 		E9CF1F23184961010004AE02 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
47
 		E9CF1F23184961010004AE02 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
131
 				E9CF1F551849654F0004AE02 /* icon.png */,
134
 				E9CF1F551849654F0004AE02 /* icon.png */,
132
 				E9CF1F32184961010004AE02 /* AppDelegate.h */,
135
 				E9CF1F32184961010004AE02 /* AppDelegate.h */,
133
 				E9CF1F33184961010004AE02 /* AppDelegate.m */,
136
 				E9CF1F33184961010004AE02 /* AppDelegate.m */,
137
+				E9B6773C184B73DC00850559 /* Reddit.h */,
138
+				E9B6773D184B73DC00850559 /* Reddit.m */,
134
 				E9341912184A1A1A00D03488 /* StateModel.h */,
139
 				E9341912184A1A1A00D03488 /* StateModel.h */,
135
 				E9341913184A1A1A00D03488 /* StateModel.m */,
140
 				E9341913184A1A1A00D03488 /* StateModel.m */,
136
 				E9CF1F35184961020004AE02 /* MainMenu.xib */,
141
 				E9CF1F35184961020004AE02 /* MainMenu.xib */,
295
 				E9341914184A1A1A00D03488 /* StateModel.m in Sources */,
300
 				E9341914184A1A1A00D03488 /* StateModel.m in Sources */,
296
 				E9CF1F2D184961010004AE02 /* main.m in Sources */,
301
 				E9CF1F2D184961010004AE02 /* main.m in Sources */,
297
 				E9CF1F5C1849685C0004AE02 /* PrefController.m in Sources */,
302
 				E9CF1F5C1849685C0004AE02 /* PrefController.m in Sources */,
303
+				E9B6773E184B73DC00850559 /* Reddit.m in Sources */,
298
 			);
304
 			);
299
 			runOnlyForDeploymentPostprocessing = 0;
305
 			runOnlyForDeploymentPostprocessing = 0;
300
 		};
306
 		};

+ 2
- 0
RedditBar/AppDelegate.h View File

9
 #import <Cocoa/Cocoa.h>
9
 #import <Cocoa/Cocoa.h>
10
 #import "PrefController.h"
10
 #import "PrefController.h"
11
 #import "StateModel.h"
11
 #import "StateModel.h"
12
+#import "Reddit.h"
12
 
13
 
13
 @interface AppDelegate : NSObject <NSApplicationDelegate>
14
 @interface AppDelegate : NSObject <NSApplicationDelegate>
14
 
15
 
20
 @property (atomic, retain) NSImage *statusHighlightImage;
21
 @property (atomic, retain) NSImage *statusHighlightImage;
21
 @property (atomic, retain) PrefController *prefWindow;
22
 @property (atomic, retain) PrefController *prefWindow;
22
 @property (atomic, retain) StateModel *currentState;
23
 @property (atomic, retain) StateModel *currentState;
24
+@property (atomic, retain) Reddit *api;
23
 
25
 
24
 -(IBAction)showPreferences:(id)sender;
26
 -(IBAction)showPreferences:(id)sender;
25
 -(IBAction)showAbout:(id)sender;
27
 -(IBAction)showAbout:(id)sender;

+ 21
- 21
RedditBar/AppDelegate.m View File

10
 
10
 
11
 @implementation AppDelegate
11
 @implementation AppDelegate
12
 
12
 
13
-@synthesize statusMenu, statusItem, statusImage, statusHighlightImage, prefWindow, currentState, application;
13
+@synthesize statusMenu, statusItem, statusImage, statusHighlightImage, prefWindow, currentState, application, api;
14
+
15
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
16
+    statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
17
+    NSBundle *bundle = [NSBundle mainBundle];
18
+    statusImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon" ofType:@"png"]];
19
+    statusHighlightImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon-alt" ofType:@"png"]];
20
+    [statusItem setImage:statusImage];
21
+    [statusItem setAlternateImage:statusHighlightImage];
22
+    [statusItem setMenu:statusMenu];
23
+    [statusItem setToolTip:@"Reddit Bar"];
24
+    [statusItem setHighlightMode:YES];
25
+    currentState = [[StateModel alloc] init];
26
+    [self defaultPreferences];
27
+    [self loadPreferences];
28
+    [self reloadListWithOptions];
29
+}
14
 
30
 
15
 -(void)defaultPreferences {
31
 -(void)defaultPreferences {
16
     NSUserDefaults *store = [NSUserDefaults standardUserDefaults];
32
     NSUserDefaults *store = [NSUserDefaults standardUserDefaults];
41
     [currentState setLength:[store integerForKey:@"length"]];
57
     [currentState setLength:[store integerForKey:@"length"]];
42
 }
58
 }
43
 
59
 
44
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
45
-    statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
46
-    NSBundle *bundle = [NSBundle mainBundle];
47
-    statusImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon" ofType:@"png"]];
48
-    statusHighlightImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon-alt" ofType:@"png"]];
49
-    [statusItem setImage:statusImage];
50
-    [statusItem setAlternateImage:statusHighlightImage];
51
-    [statusItem setMenu:statusMenu];
52
-    [statusItem setToolTip:@"Reddit Bar"];
53
-    [statusItem setHighlightMode:YES];
60
+-(void)reloadListWithOptions {
61
+    api = [[Reddit alloc] initWithUsername:currentState.username Modhash:currentState.modhash];
54
     
62
     
55
-    [self defaultPreferences];
56
-    currentState = [[StateModel alloc] init];
57
-    [self loadPreferences]; // Fill currentState
58
-    
59
-    // TODO apply currentState
60
-    // TODO reload menu list
61
 }
63
 }
62
 
64
 
63
 -(IBAction)showPreferences:(id)sender {
65
 -(IBAction)showPreferences:(id)sender {
79
     currentState.useSubsciptions = subscriptions;
81
     currentState.useSubsciptions = subscriptions;
80
     currentState.subreddits = [subreddits componentsSeparatedByString: @"\n"];
82
     currentState.subreddits = [subreddits componentsSeparatedByString: @"\n"];
81
     currentState.length = length;
83
     currentState.length = length;
82
-    [self savePreferences]; // write currentState
83
-    
84
-    // TODO apply currentState
85
-    // TODO reload menu list
84
+    [self savePreferences];
85
+    [self reloadListWithOptions];
86
 }
86
 }
87
 
87
 
88
 @end
88
 @end

+ 24
- 67
RedditBar/Base.lproj/Prefs.xib View File

1
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
3
     <dependencies>
3
     <dependencies>
4
         <deployment defaultVersion="1080" identifier="macosx"/>
4
         <deployment defaultVersion="1080" identifier="macosx"/>
5
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
5
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
11
                 <outlet property="lengthFormat" destination="zpc-oG-upp" id="AKk-rK-pM3"/>
11
                 <outlet property="lengthFormat" destination="zpc-oG-upp" id="AKk-rK-pM3"/>
12
                 <outlet property="lengthStepper" destination="jxz-fQ-M1L" id="NK5-G4-9UJ"/>
12
                 <outlet property="lengthStepper" destination="jxz-fQ-M1L" id="NK5-G4-9UJ"/>
13
                 <outlet property="password" destination="ARP-lb-J16" id="EDd-om-ciF"/>
13
                 <outlet property="password" destination="ARP-lb-J16" id="EDd-om-ciF"/>
14
+                <outlet property="progress" destination="vz0-tR-n1f" id="t06-dO-WKY"/>
14
                 <outlet property="subreddits" destination="EhP-FS-8dT" id="td1-kv-jQm"/>
15
                 <outlet property="subreddits" destination="EhP-FS-8dT" id="td1-kv-jQm"/>
15
                 <outlet property="subscriptions" destination="vW5-Cp-Bm1" id="gja-K0-7Uh"/>
16
                 <outlet property="subscriptions" destination="vW5-Cp-Bm1" id="gja-K0-7Uh"/>
16
                 <outlet property="username" destination="0mi-88-o94" id="4bB-K2-q5m"/>
17
                 <outlet property="username" destination="0mi-88-o94" id="4bB-K2-q5m"/>
19
         </customObject>
20
         </customObject>
20
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
21
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
21
         <customObject id="-3" userLabel="Application"/>
22
         <customObject id="-3" userLabel="Application"/>
22
-        <window title="Reddit Bar Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" animationBehavior="default" id="1">
23
+        <window title="RedditBar Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" animationBehavior="default" id="1">
23
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
24
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
24
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
25
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
25
             <rect key="contentRect" x="196" y="240" width="340" height="339"/>
26
             <rect key="contentRect" x="196" y="240" width="340" height="339"/>
28
                 <rect key="frame" x="0.0" y="0.0" width="340" height="339"/>
29
                 <rect key="frame" x="0.0" y="0.0" width="340" height="339"/>
29
                 <autoresizingMask key="autoresizingMask"/>
30
                 <autoresizingMask key="autoresizingMask"/>
30
                 <subviews>
31
                 <subviews>
31
-                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0mi-88-o94">
32
+                    <textField verticalHuggingPriority="750" id="0mi-88-o94">
32
                         <rect key="frame" x="120" y="299" width="200" height="22"/>
33
                         <rect key="frame" x="120" y="299" width="200" height="22"/>
33
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
34
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
34
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="xlI-hU-MqM">
35
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="xlI-hU-MqM">
37
                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
38
                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
38
                         </textFieldCell>
39
                         </textFieldCell>
39
                     </textField>
40
                     </textField>
40
-                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f72-fM-yQc">
41
-                        <rect key="frame" x="18" y="302" width="96" height="17"/>
41
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="f72-fM-yQc">
42
+                        <rect key="frame" x="18" y="304" width="96" height="17"/>
42
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
43
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
43
-                        <constraints>
44
-                            <constraint firstAttribute="width" constant="92" id="NaA-TF-vqk"/>
45
-                        </constraints>
46
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Username: " id="GTO-OP-MYS">
44
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Username: " id="GTO-OP-MYS">
47
                             <font key="font" metaFont="system"/>
45
                             <font key="font" metaFont="system"/>
48
                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
46
                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
49
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
47
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
50
                         </textFieldCell>
48
                         </textFieldCell>
51
                     </textField>
49
                     </textField>
52
-                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JMQ-a6-DKC">
50
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="JMQ-a6-DKC">
53
                         <rect key="frame" x="18" y="270" width="96" height="17"/>
51
                         <rect key="frame" x="18" y="270" width="96" height="17"/>
54
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
52
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
55
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Password:" id="m11-YF-fEa">
53
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Password:" id="m11-YF-fEa">
58
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
56
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
59
                         </textFieldCell>
57
                         </textFieldCell>
60
                     </textField>
58
                     </textField>
61
-                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qFP-pd-32c">
62
-                        <rect key="frame" x="6" y="52" width="96" height="17"/>
59
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="qFP-pd-32c">
60
+                        <rect key="frame" x="18" y="52" width="96" height="17"/>
63
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
61
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
64
-                        <constraints>
65
-                            <constraint firstAttribute="width" constant="92" id="y5l-ux-awZ"/>
66
-                        </constraints>
67
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Items:" id="FNJ-RL-DXT">
62
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Items:" id="FNJ-RL-DXT">
68
                             <font key="font" metaFont="system"/>
63
                             <font key="font" metaFont="system"/>
69
                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
64
                             <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
70
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
65
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
71
                         </textFieldCell>
66
                         </textFieldCell>
72
                     </textField>
67
                     </textField>
73
-                    <secureTextField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ARP-lb-J16">
68
+                    <secureTextField verticalHuggingPriority="750" id="ARP-lb-J16">
74
                         <rect key="frame" x="120" y="267" width="200" height="22"/>
69
                         <rect key="frame" x="120" y="267" width="200" height="22"/>
75
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
70
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
76
                         <secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="We7-pG-rAt">
71
                         <secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="We7-pG-rAt">
82
                             </allowedInputSourceLocales>
77
                             </allowedInputSourceLocales>
83
                         </secureTextFieldCell>
78
                         </secureTextFieldCell>
84
                     </secureTextField>
79
                     </secureTextField>
85
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qwZ-cF-1JN">
80
+                    <button verticalHuggingPriority="750" id="qwZ-cF-1JN">
86
                         <rect key="frame" x="224" y="13" width="102" height="32"/>
81
                         <rect key="frame" x="224" y="13" width="102" height="32"/>
87
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
82
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
88
-                        <constraints>
89
-                            <constraint firstAttribute="width" constant="90" id="6O3-yW-gA0"/>
90
-                        </constraints>
91
                         <buttonCell key="cell" type="push" title="Save" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Mqa-FJ-C43">
83
                         <buttonCell key="cell" type="push" title="Save" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Mqa-FJ-C43">
92
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
84
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
93
                             <font key="font" metaFont="system"/>
85
                             <font key="font" metaFont="system"/>
96
                             <action selector="buttonSave:" target="-2" id="thy-nQ-Nld"/>
88
                             <action selector="buttonSave:" target="-2" id="thy-nQ-Nld"/>
97
                         </connections>
89
                         </connections>
98
                     </button>
90
                     </button>
99
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vO2-NN-i1n">
91
+                    <button verticalHuggingPriority="750" id="vO2-NN-i1n">
100
                         <rect key="frame" x="14" y="13" width="102" height="32"/>
92
                         <rect key="frame" x="14" y="13" width="102" height="32"/>
101
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
93
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
102
-                        <constraints>
103
-                            <constraint firstAttribute="width" constant="90" id="ZXJ-Cb-INd"/>
104
-                        </constraints>
105
                         <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="TjO-Z6-Vng">
94
                         <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="TjO-Z6-Vng">
106
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
95
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
107
                             <font key="font" metaFont="system"/>
96
                             <font key="font" metaFont="system"/>
113
                             <action selector="performClose:" target="1" id="A62-EW-ZrT"/>
102
                             <action selector="performClose:" target="1" id="A62-EW-ZrT"/>
114
                         </connections>
103
                         </connections>
115
                     </button>
104
                     </button>
116
-                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="R9P-ZH-hHZ">
105
+                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="R9P-ZH-hHZ">
117
                         <rect key="frame" x="18" y="235" width="96" height="17"/>
106
                         <rect key="frame" x="18" y="235" width="96" height="17"/>
118
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
107
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
119
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Subreddits:" id="Cmr-7n-CaG">
108
                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Subreddits:" id="Cmr-7n-CaG">
122
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
111
                             <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
123
                         </textFieldCell>
112
                         </textFieldCell>
124
                     </textField>
113
                     </textField>
125
-                    <scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8ew-wY-1Yh">
126
-                        <rect key="frame" x="20" y="77" width="300" height="150"/>
114
+                    <scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="8ew-wY-1Yh">
115
+                        <rect key="frame" x="20" y="79" width="300" height="150"/>
127
                         <autoresizingMask key="autoresizingMask"/>
116
                         <autoresizingMask key="autoresizingMask"/>
128
                         <clipView key="contentView" copiesOnScroll="NO" id="ENU-Jw-8fO">
117
                         <clipView key="contentView" copiesOnScroll="NO" id="ENU-Jw-8fO">
129
                             <rect key="frame" x="1" y="1" width="298" height="148"/>
118
                             <rect key="frame" x="1" y="1" width="298" height="148"/>
151
                             <autoresizingMask key="autoresizingMask"/>
140
                             <autoresizingMask key="autoresizingMask"/>
152
                         </scroller>
141
                         </scroller>
153
                     </scrollView>
142
                     </scrollView>
154
-                    <button translatesAutoresizingMaskIntoConstraints="NO" id="XZM-90-hQ8">
143
+                    <button id="XZM-90-hQ8">
155
                         <rect key="frame" x="118" y="234" width="204" height="18"/>
144
                         <rect key="frame" x="118" y="234" width="204" height="18"/>
156
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
145
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
157
                         <buttonCell key="cell" type="check" title="Subscriptions" bezelStyle="regularSquare" imagePosition="overlaps" alignment="right" state="on" inset="2" id="vW5-Cp-Bm1">
146
                         <buttonCell key="cell" type="check" title="Subscriptions" bezelStyle="regularSquare" imagePosition="overlaps" alignment="right" state="on" inset="2" id="vW5-Cp-Bm1">
162
                             <action selector="toggleSubs:" target="-2" id="TPd-6W-xQv"/>
151
                             <action selector="toggleSubs:" target="-2" id="TPd-6W-xQv"/>
163
                         </connections>
152
                         </connections>
164
                     </button>
153
                     </button>
165
-                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="MAv-jO-hIv">
166
-                        <rect key="frame" x="120" y="49" width="96" height="22"/>
154
+                    <textField verticalHuggingPriority="750" id="MAv-jO-hIv">
155
+                        <rect key="frame" x="120" y="49" width="57" height="22"/>
167
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
156
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
168
-                        <constraints>
169
-                            <constraint firstAttribute="width" constant="96" id="Q7V-Gm-EfI"/>
170
-                        </constraints>
171
                         <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">
157
                         <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">
172
                             <font key="font" metaFont="system"/>
158
                             <font key="font" metaFont="system"/>
173
                             <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
159
                             <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
178
                             <outlet property="formatter" destination="zpc-oG-upp" id="cw1-hM-34K"/>
164
                             <outlet property="formatter" destination="zpc-oG-upp" id="cw1-hM-34K"/>
179
                         </connections>
165
                         </connections>
180
                     </textField>
166
                     </textField>
181
-                    <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jxz-fQ-M1L">
182
-                        <rect key="frame" x="221" y="46" width="19" height="27"/>
167
+                    <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="jxz-fQ-M1L">
168
+                        <rect key="frame" x="182" y="46" width="19" height="27"/>
183
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
169
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
184
                         <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="Gba-jV-Ouh"/>
170
                         <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="Gba-jV-Ouh"/>
185
                         <connections>
171
                         <connections>
186
                             <action selector="lengthDidChange:" target="-2" id="CJm-58-seM"/>
172
                             <action selector="lengthDidChange:" target="-2" id="CJm-58-seM"/>
187
                         </connections>
173
                         </connections>
188
                     </stepper>
174
                     </stepper>
175
+                    <progressIndicator canDrawConcurrently="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="vz0-tR-n1f">
176
+                        <rect key="frame" x="267" y="49" width="16" height="16"/>
177
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
178
+                    </progressIndicator>
189
                 </subviews>
179
                 </subviews>
190
-                <constraints>
191
-                    <constraint firstItem="f72-fM-yQc" firstAttribute="top" secondItem="2" secondAttribute="top" constant="20" symbolic="YES" id="29D-Aw-Hsq"/>
192
-                    <constraint firstItem="R9P-ZH-hHZ" firstAttribute="leading" secondItem="JMQ-a6-DKC" secondAttribute="leading" id="37a-j4-cea"/>
193
-                    <constraint firstItem="qFP-pd-32c" firstAttribute="centerY" secondItem="jxz-fQ-M1L" secondAttribute="centerY" id="7Cf-YA-CG9"/>
194
-                    <constraint firstItem="XZM-90-hQ8" firstAttribute="trailing" secondItem="ARP-lb-J16" secondAttribute="trailing" id="7Na-cW-VbT"/>
195
-                    <constraint firstItem="8ew-wY-1Yh" firstAttribute="trailing" secondItem="XZM-90-hQ8" secondAttribute="trailing" id="7bq-Le-SlA"/>
196
-                    <constraint firstItem="qFP-pd-32c" firstAttribute="top" secondItem="8ew-wY-1Yh" secondAttribute="bottom" constant="8" symbolic="YES" id="7uB-Kt-r8c"/>
197
-                    <constraint firstItem="ARP-lb-J16" firstAttribute="leading" secondItem="JMQ-a6-DKC" secondAttribute="trailing" constant="8" symbolic="YES" id="ANm-KU-ah0"/>
198
-                    <constraint firstItem="qFP-pd-32c" firstAttribute="centerY" secondItem="MAv-jO-hIv" secondAttribute="centerY" id="C6t-id-Y7F"/>
199
-                    <constraint firstItem="0mi-88-o94" firstAttribute="leading" secondItem="f72-fM-yQc" secondAttribute="trailing" constant="8" symbolic="YES" id="DeX-3f-5VX"/>
200
-                    <constraint firstItem="R9P-ZH-hHZ" firstAttribute="baseline" secondItem="XZM-90-hQ8" secondAttribute="baseline" id="Dyr-Lq-Ctl"/>
201
-                    <constraint firstItem="vO2-NN-i1n" firstAttribute="baseline" secondItem="qwZ-cF-1JN" secondAttribute="baseline" id="Ess-AZ-MVK"/>
202
-                    <constraint firstItem="R9P-ZH-hHZ" firstAttribute="leading" secondItem="8ew-wY-1Yh" secondAttribute="leading" id="G3T-Ry-7uZ"/>
203
-                    <constraint firstItem="vO2-NN-i1n" firstAttribute="leading" secondItem="8ew-wY-1Yh" secondAttribute="leading" id="IsT-wH-jxK"/>
204
-                    <constraint firstAttribute="trailing" secondItem="0mi-88-o94" secondAttribute="trailing" constant="20" symbolic="YES" id="LZn-1N-eno"/>
205
-                    <constraint firstItem="f72-fM-yQc" firstAttribute="centerY" secondItem="0mi-88-o94" secondAttribute="centerY" id="LfD-Yu-zn8"/>
206
-                    <constraint firstItem="ARP-lb-J16" firstAttribute="leading" secondItem="0mi-88-o94" secondAttribute="leading" id="OYT-lx-Poi"/>
207
-                    <constraint firstItem="f72-fM-yQc" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="20" symbolic="YES" id="OiS-Rj-NBY"/>
208
-                    <constraint firstItem="XZM-90-hQ8" firstAttribute="leading" secondItem="R9P-ZH-hHZ" secondAttribute="trailing" constant="8" symbolic="YES" id="VL7-JL-apE"/>
209
-                    <constraint firstItem="vO2-NN-i1n" firstAttribute="top" secondItem="qFP-pd-32c" secondAttribute="bottom" constant="11" id="VdU-PT-I2v"/>
210
-                    <constraint firstItem="ARP-lb-J16" firstAttribute="leading" secondItem="XZM-90-hQ8" secondAttribute="leading" id="Vre-Lj-q0h"/>
211
-                    <constraint firstItem="jxz-fQ-M1L" firstAttribute="leading" secondItem="MAv-jO-hIv" secondAttribute="trailing" constant="8" symbolic="YES" id="Zpj-hy-F01"/>
212
-                    <constraint firstItem="ARP-lb-J16" firstAttribute="top" secondItem="0mi-88-o94" secondAttribute="bottom" constant="10" symbolic="YES" id="bI0-EE-Uau"/>
213
-                    <constraint firstItem="qFP-pd-32c" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="8" id="cqi-Wn-sxQ"/>
214
-                    <constraint firstItem="f72-fM-yQc" firstAttribute="leading" secondItem="JMQ-a6-DKC" secondAttribute="leading" id="fRq-oc-Xhi"/>
215
-                    <constraint firstItem="8ew-wY-1Yh" firstAttribute="top" secondItem="R9P-ZH-hHZ" secondAttribute="bottom" constant="8" symbolic="YES" id="fxf-FX-XZd"/>
216
-                    <constraint firstItem="8ew-wY-1Yh" firstAttribute="trailing" secondItem="qwZ-cF-1JN" secondAttribute="trailing" id="gAk-07-mMq"/>
217
-                    <constraint firstItem="MAv-jO-hIv" firstAttribute="leading" secondItem="qFP-pd-32c" secondAttribute="trailing" constant="20" id="hJP-mL-zrr"/>
218
-                    <constraint firstItem="XZM-90-hQ8" firstAttribute="top" secondItem="ARP-lb-J16" secondAttribute="bottom" constant="17" id="hf0-Vf-fvN"/>
219
-                    <constraint firstItem="JMQ-a6-DKC" firstAttribute="centerY" secondItem="ARP-lb-J16" secondAttribute="centerY" id="pYP-d0-eKw"/>
220
-                    <constraint firstItem="0mi-88-o94" firstAttribute="trailing" secondItem="ARP-lb-J16" secondAttribute="trailing" id="qtc-EY-7HS"/>
221
-                    <constraint firstAttribute="bottom" secondItem="vO2-NN-i1n" secondAttribute="bottom" constant="20" symbolic="YES" id="ynT-D2-t44"/>
222
-                </constraints>
223
             </view>
180
             </view>
224
         </window>
181
         </window>
225
         <numberFormatter formatterBehavior="10_0" positiveFormat="0" negativeFormat="-0" hasThousandSeparators="NO" thousandSeparator="," id="zpc-oG-upp">
182
         <numberFormatter formatterBehavior="10_0" positiveFormat="0" negativeFormat="-0" hasThousandSeparators="NO" thousandSeparator="," id="zpc-oG-upp">

+ 1
- 0
RedditBar/PrefController.h View File

19
 @property (atomic, retain) IBOutlet NSNumberFormatter *lengthFormat;
19
 @property (atomic, retain) IBOutlet NSNumberFormatter *lengthFormat;
20
 @property (atomic, retain) IBOutlet NSTextField *lengthField;
20
 @property (atomic, retain) IBOutlet NSTextField *lengthField;
21
 @property (atomic, retain) IBOutlet NSStepper *lengthStepper;
21
 @property (atomic, retain) IBOutlet NSStepper *lengthStepper;
22
+@property (atomic, retain) IBOutlet NSProgressIndicator *progress;
22
 @property (atomic, retain) NSObject *parent;
23
 @property (atomic, retain) NSObject *parent;
23
 @property (atomic, retain) StateModel *state;
24
 @property (atomic, retain) StateModel *state;
24
 @property (atomic) NSInteger length;
25
 @property (atomic) NSInteger length;

+ 17
- 8
RedditBar/PrefController.m View File

12
 @implementation PrefController
12
 @implementation PrefController
13
 
13
 
14
 NSString *modhashSetLiteral = @"__MODHASH__IS__SET__";
14
 NSString *modhashSetLiteral = @"__MODHASH__IS__SET__";
15
+NSString *subredditCharacters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_\n";
15
 
16
 
16
-@synthesize username, password, subscriptions, subreddits, win, parent, state, lengthFormat, lengthField, lengthStepper, length;
17
+@synthesize username, password, subscriptions, subreddits, win, parent, state, lengthFormat, lengthField, lengthStepper, length, progress;
17
 
18
 
18
 -(Boolean)isValidList:(NSString *)input {
19
 -(Boolean)isValidList:(NSString *)input {
19
-    NSCharacterSet *invalidChars = [[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_\n"] invertedSet];
20
+    NSCharacterSet *invalidChars = [[NSCharacterSet characterSetWithCharactersInString:subredditCharacters] invertedSet];
20
     if ([input rangeOfCharacterFromSet:invalidChars].location != NSNotFound) {
21
     if ([input rangeOfCharacterFromSet:invalidChars].location != NSNotFound) {
21
         return FALSE;
22
         return FALSE;
22
     } else {
23
     } else {
26
 
27
 
27
 -(void)showWindow:(id)sender {
28
 -(void)showWindow:(id)sender {
28
     [super showWindow:sender];
29
     [super showWindow:sender];
29
-    
30
     [username setStringValue:state.username];
30
     [username setStringValue:state.username];
31
-    
32
     if (![state.modhash isEqualToString:@""]) {
31
     if (![state.modhash isEqualToString:@""]) {
33
         [password setStringValue:modhashSetLiteral];
32
         [password setStringValue:modhashSetLiteral];
34
     }
33
     }
35
-    
36
     [subscriptions setState:[NSNumber numberWithBool:state.useSubsciptions].integerValue];
34
     [subscriptions setState:[NSNumber numberWithBool:state.useSubsciptions].integerValue];
37
     [self toggleSubs:nil]; // Maybe the subreddits field needs to be editable
35
     [self toggleSubs:nil]; // Maybe the subreddits field needs to be editable
38
-    
39
     NSMutableString *reddits = [[NSMutableString alloc] init];
36
     NSMutableString *reddits = [[NSMutableString alloc] init];
40
     for(int i = 0; i < [state.subreddits count]; i++) {
37
     for(int i = 0; i < [state.subreddits count]; i++) {
41
         if (![[state.subreddits objectAtIndex:i] isEqualToString:@""])
38
         if (![[state.subreddits objectAtIndex:i] isEqualToString:@""])
45
     length = state.length;
42
     length = state.length;
46
     [lengthStepper setIntegerValue:length];
43
     [lengthStepper setIntegerValue:length];
47
     [lengthField setIntegerValue:length];
44
     [lengthField setIntegerValue:length];
45
+    [progress setUsesThreadedAnimation:YES];
48
 }
46
 }
49
 
47
 
50
 -(IBAction)buttonSave:(id)sender {
48
 -(IBAction)buttonSave:(id)sender {
70
     
68
     
71
     NSString *modhash = state.modhash;
69
     NSString *modhash = state.modhash;
72
     if (![password.stringValue isEqualToString:modhashSetLiteral]) {
70
     if (![password.stringValue isEqualToString:modhashSetLiteral]) {
73
-        // TODO reauthenticate & get modhash from reddit
74
-        
71
+        [progress startAnimation:self];
72
+        Reddit *api = [[Reddit alloc] initWithUsername:username.stringValue Password:password.stringValue];
73
+        modhash = [api queryModhash];
74
+        [progress stopAnimation:self];
75
+        if ((modhash == nil) || ([modhash isEqualToString:@""])) {
76
+            NSAlert *alert = [[NSAlert alloc] init];
77
+            [alert addButtonWithTitle:@"OK"];
78
+            [alert setMessageText:@"Authentication Error"];
79
+            [alert setInformativeText:@"Wrong Username or Password!"];
80
+            [alert setAlertStyle:NSCriticalAlertStyle];
81
+            [alert beginSheetModalForWindow:win modalDelegate:nil didEndSelector:nil contextInfo:nil];
82
+            return;
83
+        }
75
     }
84
     }
76
     
85
     
77
     Boolean subs;
86
     Boolean subs;

+ 23
- 0
RedditBar/Reddit.h View File

1
+//
2
+//  Reddit.h
3
+//  RedditBar
4
+//
5
+//  Created by Thomas Buck on 01.12.13.
6
+//  Copyright (c) 2013 xythobuz. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface Reddit : NSObject
12
+
13
+@property (atomic, retain) NSString *username;
14
+@property (atomic, retain) NSString *modhash;
15
+@property (atomic, retain) NSString *password;
16
+
17
+-(id)initWithUsername:(NSString *)name Password:(NSString *)pass;
18
+-(NSString *)queryModhash;
19
+
20
+-(id)initWithUsername:(NSString *)name Modhash:(NSString *)hash;
21
+-(BOOL)isAuthenticated;
22
+
23
+@end

+ 44
- 0
RedditBar/Reddit.m View File

1
+//
2
+//  Reddit.m
3
+//  RedditBar
4
+//
5
+//  Created by Thomas Buck on 01.12.13.
6
+//  Copyright (c) 2013 xythobuz. All rights reserved.
7
+//
8
+
9
+#import "Reddit.h"
10
+
11
+@implementation Reddit
12
+
13
+@synthesize username, modhash, password;
14
+
15
+-(id)initWithUsername:(NSString *)name Modhash:(NSString *)hash {
16
+    self = [super init];
17
+    if (self) {
18
+        username = name;
19
+        modhash = hash;
20
+        password = nil;
21
+    }
22
+    return self;
23
+}
24
+
25
+-(id)initWithUsername:(NSString *)name Password:(NSString *)pass {
26
+    self = [super init];
27
+    if (self) {
28
+        username = name;
29
+        modhash = nil;
30
+        password = pass;
31
+    }
32
+    return self;
33
+}
34
+
35
+-(NSString *)queryModhash {
36
+    sleep(1);
37
+    return nil;
38
+}
39
+
40
+-(BOOL)isAuthenticated {
41
+    return FALSE;
42
+}
43
+
44
+@end

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

21
 	<key>CFBundleSignature</key>
21
 	<key>CFBundleSignature</key>
22
 	<string>????</string>
22
 	<string>????</string>
23
 	<key>CFBundleVersion</key>
23
 	<key>CFBundleVersion</key>
24
-	<string>42</string>
24
+	<string>82</string>
25
 	<key>LSApplicationCategoryType</key>
25
 	<key>LSApplicationCategoryType</key>
26
 	<string>public.app-category.utilities</string>
26
 	<string>public.app-category.utilities</string>
27
 	<key>LSMinimumSystemVersion</key>
27
 	<key>LSMinimumSystemVersion</key>

+ 3
- 1
RedditBar/en.lproj/Credits.rtf View File

18
 \b Inspired by:
18
 \b Inspired by:
19
 \b0 \
19
 \b0 \
20
 	HackerBar App ({\field{\*\fldinst{HYPERLINK "http://hackerbarapp.com"}}{\fldrslt http://hackerbarapp.com}})\
20
 	HackerBar App ({\field{\*\fldinst{HYPERLINK "http://hackerbarapp.com"}}{\fldrslt http://hackerbarapp.com}})\
21
-}
21
+	is Open Source software but requires\
22
+	a RubyMotion License, so I decided\
23
+	against forking it.}

Loading…
Cancel
Save