瀏覽代碼

PrefController now fills state upon saving.

Thomas Buck 10 年之前
父節點
當前提交
347502400d
共有 4 個檔案被更改,包括 13 行新增14 行删除
  1. 1
    1
      RedditBar/AppDelegate.h
  2. 1
    10
      RedditBar/AppDelegate.m
  3. 10
    2
      RedditBar/PrefController.m
  4. 1
    1
      RedditBar/RedditBar-Info.plist

+ 1
- 1
RedditBar/AppDelegate.h 查看文件

66
 -(void)reloadListHasFrontpageCallback:(NSArray *)items;
66
 -(void)reloadListHasFrontpageCallback:(NSArray *)items;
67
 -(void)readPMsCallback:(NSNumber *)items;
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
 @end
71
 @end

+ 1
- 10
RedditBar/AppDelegate.m 查看文件

234
     [application orderFrontStandardAboutPanel:self];
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
     [currentState savePreferences];
238
     [currentState savePreferences];
248
     [firstMenuItem setTitle:NSLocalizedString(@"Loading...", nil)];
239
     [firstMenuItem setTitle:NSLocalizedString(@"Loading...", nil)];
249
     [self clearMenuItems];
240
     [self clearMenuItems];

+ 10
- 2
RedditBar/PrefController.m 查看文件

136
     else
136
     else
137
         print = FALSE;
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
     [win performClose:self];
149
     [win performClose:self];
142
 }
150
 }
143
 
151
 

+ 1
- 1
RedditBar/RedditBar-Info.plist 查看文件

21
 	<key>CFBundleSignature</key>
21
 	<key>CFBundleSignature</key>
22
 	<string>????</string>
22
 	<string>????</string>
23
 	<key>CFBundleVersion</key>
23
 	<key>CFBundleVersion</key>
24
-	<string>278</string>
24
+	<string>280</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>

Loading…
取消
儲存