You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

65 lines
1.6 KiB

  1. /*
  2. Copyright 2017 Virgil Dupras
  3. This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
  4. which should be included with this package. The terms are also available at
  5. http://www.gnu.org/licenses/gpl-3.0.html
  6. */
  7. #import "PrioritizeDialog.h"
  8. #import "HSPyUtil.h"
  9. @implementation PrioritizeDialog
  10. @synthesize categoryPopUpView;
  11. @synthesize criteriaTableView;
  12. @synthesize prioritizationTableView;
  13. - (id)initWithApp:(PyDupeGuru *)aApp
  14. {
  15. self = [super initWithWindowNibName:@"PrioritizeDialog"];
  16. [self window];
  17. model = [[PyPrioritizeDialog alloc] initWithApp:[aApp pyRef]];
  18. categoryPopUp = [[HSPopUpList alloc] initWithPyRef:[[self model] categoryList] popupView:categoryPopUpView];
  19. criteriaList = [[HSSelectableList alloc] initWithPyRef:[[self model] criteriaList] tableView:criteriaTableView];
  20. prioritizationList = [[PrioritizeList alloc] initWithPyRef:[[self model] prioritizationList] tableView:prioritizationTableView];
  21. [model bindCallback:createCallback(@"PrioritizeDialogView", self)];
  22. return self;
  23. }
  24. - (void)dealloc
  25. {
  26. [categoryPopUp release];
  27. [criteriaList release];
  28. [prioritizationList release];
  29. [model release];
  30. [super dealloc];
  31. }
  32. - (PyPrioritizeDialog *)model
  33. {
  34. return (PyPrioritizeDialog *)model;
  35. }
  36. - (IBAction)addSelected:(id)sender
  37. {
  38. [[self model] addSelected];
  39. }
  40. - (IBAction)removeSelected:(id)sender
  41. {
  42. [[self model] removeSelected];
  43. }
  44. - (IBAction)ok:(id)sender
  45. {
  46. [NSApp stopModal];
  47. [self close];
  48. }
  49. - (IBAction)cancel:(id)sender
  50. {
  51. [NSApp abortModal];
  52. [self close];
  53. }
  54. @end