2011-09-13 20:31:25 +00:00
|
|
|
/*
|
|
|
|
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 "PrioritizeDialog.h"
|
2012-01-12 22:40:23 +00:00
|
|
|
#import "Utils.h"
|
2011-09-13 20:31:25 +00:00
|
|
|
|
|
|
|
@implementation PrioritizeDialog
|
2012-01-13 20:25:34 +00:00
|
|
|
- (id)initWithPyRef:(PyObject *)aPyRef
|
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-13 20:25:34 +00:00
|
|
|
model = [[PyPrioritizeDialog alloc] initWithModel:aPyRef];
|
|
|
|
[model bindCallback:createCallback(@"PrioritizeDialogView", self)];
|
|
|
|
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];
|
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
|