Cog/Feedback/FeedbackController.m

77 lines
1.1 KiB
Mathematica
Raw Permalink Normal View History

2005-06-02 14:16:43 -04:00
//
// FeedbackController.m
// Cog
//
// Created by Vincent Spader on 3/26/05.
2005-07-02 17:02:06 -04:00
// Copyright 2005 Vincent Spader All rights reserved.
2005-06-02 14:16:43 -04:00
//
#import "FeedbackController.h"
#import "Logging.h"
2005-06-02 14:16:43 -04:00
@implementation FeedbackController {
BOOL showing;
BOOL sent;
NSString *name;
NSString *email;
NSString *comments;
}
2005-06-02 14:16:43 -04:00
- (id)init {
self = [super initWithWindowNibName:@"Feedback"];
if(self) {
showing = NO;
sent = NO;
}
return self;
}
- (IBAction)showWindow:(id)sender {
[nameView setStringValue:@""];
[emailView setStringValue:@""];
2005-06-02 14:16:43 -04:00
[messageView setString:@""];
[super showWindow:sender];
showing = YES;
2005-06-02 14:16:43 -04:00
}
- (IBAction)sendFeedback:(id)sender {
name = [nameView stringValue];
email = [emailView stringValue];
comments = [messageView string];
[[self window] close];
sent = YES;
showing = NO;
2005-06-02 14:16:43 -04:00
}
- (IBAction)cancel:(id)sender {
[[self window] close];
sent = NO;
showing = NO;
2005-06-02 14:16:43 -04:00
}
- (BOOL)waitForCompletion {
while(showing) {
usleep(2000);
}
return sent;
}
- (NSString *)name {
return name;
}
- (NSString *)email {
return email;
2005-06-02 14:16:43 -04:00
}
- (NSString *)comments {
return comments;
2005-06-02 14:16:43 -04:00
}
@end