Rev | Line | |
---|
[21] | 1 | //
|
---|
| 2 | // PSAlarmNotifierController.m
|
---|
| 3 | // Pester
|
---|
| 4 | //
|
---|
| 5 | // Created by Nicholas Riley on Tue Oct 08 2002.
|
---|
| 6 | // Copyright (c) 2002 Nicholas Riley. All rights reserved.
|
---|
| 7 | //
|
---|
| 8 |
|
---|
| 9 | #import "PSAlarmNotifierController.h"
|
---|
[24] | 10 | #import "PSAlarm.h"
|
---|
[21] | 11 |
|
---|
| 12 | @implementation PSAlarmNotifierController
|
---|
| 13 |
|
---|
[26] | 14 | // XXX should use NSNonactivatingPanelMask on 10.2
|
---|
| 15 |
|
---|
| 16 | + (PSAlarmNotifierController *)controllerWithTimerExpiredNotification:(NSNotification *)notification;
|
---|
[21] | 17 | {
|
---|
[26] | 18 | return [[self alloc] initWithAlarm: [notification object]];
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | - (id)initWithAlarm:(PSAlarm *)alarm;
|
---|
| 22 | {
|
---|
[21] | 23 | if ([self initWithWindowNibName: @"Notifier"]) {
|
---|
| 24 | [[self window] center];
|
---|
[24] | 25 | [messageField setStringValue: [alarm message]];
|
---|
[26] | 26 | [dateField setObjectValue: [alarm date]];
|
---|
[28] | 27 | [NSApp requestUserAttention: NSInformationalRequest];
|
---|
[21] | 28 | [NSApp activateIgnoringOtherApps: YES];
|
---|
| 29 | [[self window] makeKeyAndOrderFront: nil];
|
---|
| 30 | [[self window] orderFrontRegardless];
|
---|
[28] | 31 | [NSApp cancelUserAttentionRequest: NSInformationalRequest];
|
---|
[21] | 32 | NSBeep();
|
---|
| 33 | }
|
---|
| 34 | return self;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | - (IBAction)close:(id)sender;
|
---|
| 38 | {
|
---|
| 39 | [self close];
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | @end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.