dupeguru-cocoa/cocoa/PrioritizeDialog.m

65 lines
1.6 KiB
Mathematica
Raw Permalink Normal View History

2017-03-11 19:18:27 -06:00
/*
2017-04-04 20:36:42 -05:00
Copyright 2017 Virgil Dupras
2017-03-11 19:18:27 -06:00
This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.gnu.org/licenses/gpl-3.0.html
*/
#import "PrioritizeDialog.h"
#import "HSPyUtil.h"
@implementation PrioritizeDialog
@synthesize categoryPopUpView;
@synthesize criteriaTableView;
@synthesize prioritizationTableView;
- (id)initWithApp:(PyDupeGuru *)aApp
{
self = [super initWithWindowNibName:@"PrioritizeDialog"];
2017-04-04 20:36:42 -05:00
[self window];
2017-03-11 19:18:27 -06:00
model = [[PyPrioritizeDialog alloc] initWithApp:[aApp pyRef]];
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];
[model bindCallback:createCallback(@"PrioritizeDialogView", self)];
return self;
}
- (void)dealloc
{
[categoryPopUp release];
[criteriaList release];
[prioritizationList release];
[model release];
[super dealloc];
}
- (PyPrioritizeDialog *)model
{
return (PyPrioritizeDialog *)model;
}
2017-04-04 20:36:42 -05:00
- (IBAction)addSelected:(id)sender
{
[[self model] addSelected];
}
- (IBAction)removeSelected:(id)sender
{
[[self model] removeSelected];
}
- (IBAction)ok:(id)sender
2017-03-11 19:18:27 -06:00
{
[NSApp stopModal];
[self close];
}
2017-04-04 20:36:42 -05:00
- (IBAction)cancel:(id)sender
2017-03-11 19:18:27 -06:00
{
[NSApp abortModal];
[self close];
}
@end