aka RedditBar, Mac OS X menu bar reddit client
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

AppDelegate.m 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // AppDelegate.m
  3. // RedditBar
  4. //
  5. // Created by Thomas Buck on 30.11.13.
  6. // Copyright (c) 2013 xythobuz. All rights reserved.
  7. //
  8. #import "AppDelegate.h"
  9. @implementation AppDelegate
  10. @synthesize statusMenu, statusItem, statusImage, statusHighlightImage, prefWindow;
  11. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  12. statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
  13. NSBundle *bundle = [NSBundle mainBundle];
  14. statusImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon" ofType:@"png"]];
  15. statusHighlightImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon-alt" ofType:@"png"]];
  16. [statusItem setImage:statusImage];
  17. [statusItem setAlternateImage:statusHighlightImage];
  18. [statusItem setMenu:statusMenu];
  19. [statusItem setToolTip:@"Reddit Bar"];
  20. [statusItem setHighlightMode:YES];
  21. // TODO load preferences
  22. // TODO apply config
  23. // TODO reload menu list
  24. }
  25. -(IBAction)showPreferences:(id)sender {
  26. [NSApp activateIgnoringOtherApps:YES];
  27. prefWindow = [[PrefController alloc] initWithWindowNibName:@"Prefs"];
  28. [prefWindow setParent:self];
  29. [prefWindow showWindow:self];
  30. }
  31. -(void)prefReturnName:(NSString *)name Pass:(NSString *)pass subscriptions:(Boolean)subscriptions subreddits:(NSString *)subreddits {
  32. // TODO store preferences
  33. // TODO apply config
  34. // TODO reload menu list
  35. }
  36. @end