2011-09-13 20:31:25 +00:00
|
|
|
/*
|
2012-03-15 18:28:40 +00:00
|
|
|
Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
2011-09-13 20:31:25 +00:00
|
|
|
|
|
|
|
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 "PrioritizeDialog.h"
|
2012-05-28 18:45:13 +00:00
|
|
|
#import "HSPyUtil.h"
|
2011-09-13 20:31:25 +00:00
|
|
|
|
|
|
|
@implementation PrioritizeDialog
|
2012-01-15 22:24:30 +00:00
|
|
|
- (id)initWithApp:(PyDupeGuru *)aApp
|
2011-09-13 20:31:25 +00:00
|
|
|
{
|
2012-01-12 22:40:23 +00:00
|
|
|
self = [super initWithWindowNibName:@"PrioritizeDialog"];
|
2011-09-13 20:31:25 +00:00
|
|
|
[self window];
|
2012-01-15 22:24:30 +00:00
|
|
|
model = [[PyPrioritizeDialog alloc] initWithApp:[aApp pyRef]];
|
2012-01-13 20:25:34 +00:00
|
|
|
categoryPopUp = [[HSPopUpList alloc] initWithPyRef:[[self model] categoryList] popupView:categoryPopUpView];
|
|
|
|
criteriaList = [[HSSelectableList alloc] initWithPyRef:[[self model] criteriaList] tableView:criteriaTableView];
|
|
|
|
prioritizationList = [[PrioritizeList alloc] initWithPyRef:[[self model] prioritizationList] tableView:prioritizationTableView];
|
2012-03-19 20:52:08 +00:00
|
|
|
[model bindCallback:createCallback(@"PrioritizeDialogView", self)];
|
2011-09-13 20:31:25 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
|
|
|
[categoryPopUp release];
|
|
|
|
[criteriaList release];
|
2011-09-16 15:08:24 +00:00
|
|
|
[prioritizationList release];
|
2012-01-13 20:25:34 +00:00
|
|
|
[model release];
|
2011-09-13 20:31:25 +00:00
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
2012-01-13 20:25:34 +00:00
|
|
|
- (PyPrioritizeDialog *)model
|
2011-09-13 20:31:25 +00:00
|
|
|
{
|
2012-01-13 20:25:34 +00:00
|
|
|
return (PyPrioritizeDialog *)model;
|
2011-09-13 20:31:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)addSelected:(id)sender
|
|
|
|
{
|
2012-01-13 20:25:34 +00:00
|
|
|
[[self model] addSelected];
|
2011-09-13 20:31:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)removeSelected:(id)sender
|
|
|
|
{
|
2012-01-13 20:25:34 +00:00
|
|
|
[[self model] removeSelected];
|
2011-09-13 20:31:25 +00:00
|
|
|
}
|
2011-09-13 22:19:46 +00:00
|
|
|
|
|
|
|
- (IBAction)ok:(id)sender
|
|
|
|
{
|
|
|
|
[NSApp stopModal];
|
2012-01-12 22:40:23 +00:00
|
|
|
[self close];
|
2011-09-13 22:19:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)cancel:(id)sender
|
|
|
|
{
|
|
|
|
[NSApp abortModal];
|
2012-01-12 22:40:23 +00:00
|
|
|
[self close];
|
2011-09-13 22:19:46 +00:00
|
|
|
}
|
2011-09-13 20:31:25 +00:00
|
|
|
@end
|