File: AppController.m

package info (click to toggle)
gnustep-examples 1%3A1.2.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,952 kB
  • ctags: 270
  • sloc: objc: 14,381; makefile: 65
file content (99 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download | duplicates (7)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* 
 * AppController.m created by phr on 2000-08-27 11:38:58 +0000
 *
 * Project TestApp
 *
 * Created with ProjectCenter - http://www.projectcenter.ch
 *
 * $Id: AppController.m 8822 2001-01-27 00:32:02Z nico $
 */

#import "AppController.h"
#import "Resolver.h"

@implementation AppController

static NSDictionary *infoDict = nil;

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

  /*
   * Register your app's defaults here by adding objects to the
   * dictionary, eg
   *
   * [defaults setObject:anObject forKey:keyForThatObject];
   *
   */
  
  [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
  [[NSUserDefaults standardUserDefaults] synchronize];
}

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

- (void)dealloc
{
  if (resolver) {
    RELEASE(resolver);
  }

  [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)showResolverWindow:(id)sender
{
  if (!resolver) {
    resolver = [[Resolver alloc] init];
  }

  [resolver makeKeyAndOrderFront];
}

@end