Ver código fonte

PrefController now fills state upon saving.

Thomas Buck 11 anos atrás
pai
commit
347502400d

+ 1
- 1
RedditBar/AppDelegate.h Ver arquivo

@@ -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 filter:(NSString *)filter;
69
+-(void)prefsDidSave;
70 70
 
71 71
 @end

+ 1
- 10
RedditBar/AppDelegate.m Ver arquivo

@@ -234,16 +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 filter:(NSString *)filter {
238
-    currentState.username = name;
239
-    currentState.modhash = modhash;
240
-    currentState.useSubscriptions = subscriptions;
241
-    currentState.subreddits = [subreddits componentsSeparatedByString: @"\n"];
242
-    currentState.length = length;
243
-    currentState.showSubreddit = showSubreddits;
244
-    currentState.titleLength = titleLength;
245
-    currentState.refreshInterval = refreshInterval;
246
-    currentState.filter = filter;
237
+-(void)prefsDidSave {
247 238
     [currentState savePreferences];
248 239
     [firstMenuItem setTitle:NSLocalizedString(@"Loading...", nil)];
249 240
     [self clearMenuItems];

+ 10
- 2
RedditBar/PrefController.m Ver arquivo

@@ -136,8 +136,16 @@ NSString *subredditCharacters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST
136 136
     else
137 137
         print = FALSE;
138 138
     
139
-    AppDelegate *app = (AppDelegate *)parent;
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]];
139
+    state.username = username.stringValue;
140
+    state.modhash = modhash;
141
+    state.useSubscriptions = subs;
142
+    state.subreddits = [subreddits.textStorage.string componentsSeparatedByString: @"\n"];
143
+    state.length = [lengthField integerValue];
144
+    state.showSubreddit = print;
145
+    state.titleLength = [titleField integerValue];
146
+    state.refreshInterval = [refreshField integerValue];
147
+    state.filter = [filterSelection titleOfSelectedItem];
148
+    [(AppDelegate *)parent prefsDidSave];
141 149
     [win performClose:self];
142 150
 }
143 151
 

+ 1
- 1
RedditBar/RedditBar-Info.plist Ver arquivo

@@ -21,7 +21,7 @@
21 21
 	<key>CFBundleSignature</key>
22 22
 	<string>????</string>
23 23
 	<key>CFBundleVersion</key>
24
-	<string>278</string>
24
+	<string>280</string>
25 25
 	<key>LSApplicationCategoryType</key>
26 26
 	<string>public.app-category.utilities</string>
27 27
 	<key>LSMinimumSystemVersion</key>

Carregando…
Cancelar
Salvar