Skip to content

Commit

Permalink
Pester 1.0b1
Browse files Browse the repository at this point in the history
git-svn-id: http://dev.sabi.net/svn/dev/trunk/Cocoa/Pester@26 24bc951d-4bb6-0310-a7b7-f2527510289e
  • Loading branch information
nriley committed Oct 20, 2002
1 parent 6db3e0d commit 8b366a0
Show file tree
Hide file tree
Showing 30 changed files with 5,412 additions and 334 deletions.
Binary file modified Source/Application icon.icns
Binary file not shown.
14 changes: 14 additions & 0 deletions Source/English.lproj/Alarms.nib/classes.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Source/English.lproj/Alarms.nib/info.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Source/English.lproj/Alarms.nib/objects.nib
Binary file not shown.
1 change: 1 addition & 0 deletions Source/English.lproj/Credits.html
@@ -0,0 +1 @@
<font face="Lucida Grande" size="-1"><b>Icon by</b> <a href="mailto:excellence@global.co.za">Diederik Vemer</a></font>.
Binary file modified Source/English.lproj/InfoPlist.strings
Binary file not shown.
18 changes: 18 additions & 0 deletions Source/English.lproj/MainMenu.nib/classes.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Source/English.lproj/MainMenu.nib/info.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Source/English.lproj/MainMenu.nib/objects.nib
Binary file not shown.
14 changes: 5 additions & 9 deletions Source/English.lproj/Notifier.nib/info.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Source/English.lproj/Notifier.nib/objects.nib
Binary file not shown.
19 changes: 19 additions & 0 deletions Source/NJRHistoryTrackingComboBox.h
@@ -0,0 +1,19 @@
//
// NJRHistoryTrackingComboBox.h
// DockCam
//
// Created by Nicholas Riley on Fri Jun 28 2002.
// Copyright (c) 2002 Nicholas Riley. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface NJRHistoryTrackingComboBox : NSComboBox {

}

- (IBAction)removeEntry:(id)sender;
- (IBAction)clearAllEntries:(id)sender;

@end
75 changes: 75 additions & 0 deletions Source/NJRHistoryTrackingComboBox.m
@@ -0,0 +1,75 @@
//
// NJRHistoryTrackingComboBox.m
// DockCam
//
// Created by Nicholas Riley on Fri Jun 28 2002.
// Copyright (c) 2002 Nicholas Riley. All rights reserved.
//

#import "NJRHistoryTrackingComboBox.h"

#define NJRHistoryTrackingComboBoxMaxItems 10

@implementation NJRHistoryTrackingComboBox

- (NSString *)_defaultKey;
{
NSAssert([self tag] != 0, @"CanÕt track history for combo box with tag 0: please set a tag");
return [NSString stringWithFormat: @"NJRHistoryTrackingComboBox tag %d", [self tag]];
}

- (void)awakeFromNib;
{
NSAssert([self tag] != 0, @"CanÕt track history for combo box with tag 0: please set a tag");
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(textDidEndEditing:)
name: NSTextDidEndEditingNotification
object: self];
[self removeAllItems];
[self addItemsWithObjectValues: [[NSUserDefaults standardUserDefaults] stringArrayForKey: [self _defaultKey]]];
[self setItemHeight: [self itemHeight] + 2];
}

- (void)_writeHistory;
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject: [self objectValues] forKey: [self _defaultKey]];
[defaults synchronize];
}

- (IBAction)removeEntry:(id)sender;
{
int idx = [self indexOfSelectedItem];
if (idx == -1) {
[self selectItemWithObjectValue: [self stringValue]];
idx = [self indexOfSelectedItem];
}
if (idx != -1) [self removeItemAtIndex: idx];
[self setStringValue: @""];
[self _writeHistory];
}

- (IBAction)clearAllEntries:(id)sender;
{
[self removeAllItems];
[self setStringValue: @""];
[self _writeHistory];
}

- (BOOL)textShouldEndEditing:(NSText *)textObject;
{
NSString *newValue = [self stringValue];
int oldIndex = [self indexOfItemWithObjectValue: newValue];
[self removeItemWithObjectValue: newValue];
[self insertItemWithObjectValue: newValue atIndex: 0];
if (oldIndex == NSNotFound) {
int numItems = [self numberOfItems];
while (numItems-- > NJRHistoryTrackingComboBoxMaxItems) {
[self removeItemAtIndex: numItems - 1];
}
}
[self _writeHistory];
return YES;
}

@end
16 changes: 16 additions & 0 deletions Source/NSTableView-NJRExtensions.h
@@ -0,0 +1,16 @@
//
// NSTableView-NJRExtensions.h
// HostLauncher
//
// Created by Nicholas Riley on Mon Apr 22 2002.
// Copyright (c) 2002 Nicholas Riley. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface NSTableView (NJRExtensions)

- (float)cellHeight;

@end
25 changes: 25 additions & 0 deletions Source/NSTableView-NJRExtensions.m
@@ -0,0 +1,25 @@
//
// NSTableView-NJRExtensions.m
// HostLauncher
//
// Created by Nicholas Riley on Mon Apr 22 2002.
// Copyright (c) 2002 Nicholas Riley. All rights reserved.
//

#import "NSTableView-NJRExtensions.h"


@implementation NSTableView (NJRExtensions)

- (float)cellHeight;
{
return [self rowHeight] + [self intercellSpacing].height;
}

// causes NSTableView to get keyboard focus (with thanks to Pierre-Olivier Latour)
- (BOOL)needsPanelToBecomeKey
{
return YES;
}

@end
15 changes: 11 additions & 4 deletions Source/PSAlarm.h
Expand Up @@ -9,27 +9,34 @@
#import <Foundation/Foundation.h>

typedef enum {
PSAlarmInvalid, PSAlarmInterval, PSAlarmDate
PSAlarmInvalid, PSAlarmInterval, PSAlarmDate, PSAlarmSet
} PSAlarmType;

@interface PSAlarm : NSObject {
extern NSString * const PSAlarmTimerSetNotification;
extern NSString * const PSAlarmTimerExpiredNotification;

@interface PSAlarm : NSObject <NSCoding> {
PSAlarmType alarmType;
NSCalendarDate *alarmDate;
NSTimeInterval alarmInterval;
NSString *alarmMessage;
NSString *invalidMessage;
NSTimer *timer;
}

- (void)setInterval:(NSTimeInterval)anInterval;
- (void)setForDateAtTime:(NSDate *)dateTime;
- (void)setForDateAtTime:(NSCalendarDate *)dateTime;
- (void)setForDate:(NSDate *)date atTime:(NSDate *)time;
- (void)setMessage:(NSString *)aMessage;

- (NSDate *)date;
- (NSTimeInterval)interval;
- (NSString *)message;
- (NSComparisonResult)compare:(PSAlarm *)otherAlarm;

- (BOOL)isValid;
- (NSString *)message;
- (NSString *)invalidMessage;

- (BOOL)setTimer;

@end

0 comments on commit 8b366a0

Please sign in to comment.