1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-11-16 20:29:02 +00:00
dupeguru/cocoa/base/ExtraFairwareReminder.m
Virgil Dupras 55db21f3e0 Removed temporary objp conversion hacks.
--HG--
branch : objp
2012-01-13 15:25:34 -05:00

78 lines
1.6 KiB
Objective-C

/*
Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import "ExtraFairwareReminder.h"
#import "Utils.h"
@implementation ExtraFairwareReminder
- (id)initWithPyRef:(PyObject *)aPyRef
{
self = [super initWithWindowNibName:@"ExtraFairwareReminder"];
[self window];
[continueButton setEnabled:NO];
model = [[PyExtraFairwareReminder alloc] initWithModel:aPyRef];
[model bindCallback:createCallback(@"ExtraFairwareReminderView", self)];
return self;
}
- (void)dealloc
{
[model release];
[timer release];
[super dealloc];
}
- (PyExtraFairwareReminder *)model
{
return (PyExtraFairwareReminder *)model;
}
- (void)start
{
[[self model] start];
}
- (void)updateButton
{
[[self model] updateButton];
}
- (IBAction)continue:(id)sender
{
[NSApp stopModal];
}
- (IBAction)contribute:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://open.hardcoded.net/contribute/"]];
}
/* Model --> View */
- (void)startTimer
{
timer = [[NSTimer timerWithTimeInterval:0.2 target:self selector:@selector(updateButton)
userInfo:nil repeats:YES] retain];
// Needed for the timer to work in modal mode.
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSModalPanelRunLoopMode];
}
- (void)stopTimer
{
[timer invalidate];
}
- (void)setButtonText:(NSString *)text
{
[continueButton setTitle:text];
}
- (void)enableButton
{
[continueButton setEnabled:YES];
}
@end