File: AppController.m

package info (click to toggle)
gettext 0.18.1.1-9
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 70,628 kB
  • sloc: ansic: 333,297; sh: 51,604; makefile: 8,355; perl: 4,181; lisp: 3,357; yacc: 665; java: 613; cs: 578; sed: 369; objc: 337; cpp: 325; awk: 80; tcl: 63; pascal: 11; php: 8
file content (81 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* Example for use of GNU gettext.
   This file is in the public domain.

   Source code of the AppController class.  */

#include "AppController.h"
#include "Hello.h"

@implementation AppController

static NSDictionary *infoDict = nil;

+ (void)initialize
{
  NSMutableDictionary *defaults = [NSMutableDictionary dictionary];

  [[NSUserDefaults standardUserDefaults] registerDefaults: defaults];
  [[NSUserDefaults standardUserDefaults] synchronize];
}

- (id)init
{
  self = [super init];
  return self;
}

- (void)dealloc
{
  if (hello)
    RELEASE (hello);

  [super dealloc];
}

- (void)awakeFromNib
{
}

- (void)applicationDidFinishLaunching:(NSNotification *)notif
{
}

- (BOOL)applicationShouldTerminate:(id)sender
{
  return YES;
}

- (void)applicationWillTerminate:(NSNotification *)notification
{
}

- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
{
}

- (void)showPrefPanel:(id)sender
{
}

- (void)showInfoPanel:(id)sender
{
  if (!infoDict)
    {
      NSString *fp;
      NSBundle *bundle = [NSBundle mainBundle];

      fp = [bundle pathForResource: @"Info-project" ofType: @"plist"];
      infoDict = [[NSDictionary dictionaryWithContentsOfFile: fp] retain];
    }
  [[NSApplication sharedApplication] orderFrontStandardInfoPanelWithOptions: infoDict];
}

- (void)showHelloWindow:(id)sender
{
  if (!hello)
    hello = [[Hello alloc] init];

  [hello makeKeyAndOrderFront];
}

@end