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"
|
|
|
|
|
2013-10-11 09:03:55 -03:00
|
|
|
#import "Logging.h"
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
@implementation FeedbackController {
|
|
|
|
BOOL showing;
|
|
|
|
BOOL sent;
|
|
|
|
|
|
|
|
NSString *name;
|
|
|
|
NSString *email;
|
|
|
|
NSString *comments;
|
|
|
|
}
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (id)init {
|
2025-02-26 06:11:55 -03:00
|
|
|
self = [super initWithWindowNibName:@"Feedback"];
|
|
|
|
if(self) {
|
|
|
|
showing = NO;
|
|
|
|
sent = NO;
|
|
|
|
}
|
|
|
|
return self;
|
2009-03-07 20:08:43 -03:00
|
|
|
}
|
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
- (IBAction)showWindow:(id)sender {
|
2025-02-26 06:11:55 -03:00
|
|
|
[nameView setStringValue:@""];
|
|
|
|
[emailView setStringValue:@""];
|
2005-06-02 14:16:43 -04:00
|
|
|
[messageView setString:@""];
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2009-03-07 20:08:43 -03:00
|
|
|
[super showWindow:sender];
|
2025-02-26 06:11:55 -03:00
|
|
|
|
|
|
|
showing = YES;
|
2005-06-02 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
- (IBAction)sendFeedback:(id)sender {
|
|
|
|
name = [nameView stringValue];
|
|
|
|
email = [emailView stringValue];
|
|
|
|
comments = [messageView string];
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
[[self window] close];
|
|
|
|
sent = YES;
|
|
|
|
showing = NO;
|
2005-06-02 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
- (IBAction)cancel:(id)sender {
|
|
|
|
[[self window] close];
|
|
|
|
sent = NO;
|
|
|
|
showing = NO;
|
2005-06-02 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
- (BOOL)waitForCompletion {
|
|
|
|
while(showing) {
|
|
|
|
usleep(2000);
|
|
|
|
}
|
|
|
|
return sent;
|
|
|
|
}
|
2007-05-27 11:34:04 -04:00
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
- (NSString *)name {
|
|
|
|
return name;
|
|
|
|
}
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
- (NSString *)email {
|
|
|
|
return email;
|
2005-06-02 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
2025-02-26 06:11:55 -03:00
|
|
|
- (NSString *)comments {
|
|
|
|
return comments;
|
2005-06-02 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|