mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-23 07:01:39 +00:00
Converted the prioritize dialog to objp. A bit hackish though. Refactorings required before going further.
--HG-- branch : objp
This commit is contained in:
@@ -7,24 +7,25 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSWindowController.h"
|
||||
#import "PyApp.h"
|
||||
#import "PyPrioritizeDialog.h"
|
||||
#import "HSPopUpList.h"
|
||||
#import "HSSelectableList.h"
|
||||
#import "HSPopUpList2.h"
|
||||
#import "HSSelectableList2.h"
|
||||
#import "PrioritizeList.h"
|
||||
|
||||
@interface PrioritizeDialog : HSWindowController
|
||||
@interface PrioritizeDialog : NSWindowController
|
||||
{
|
||||
IBOutlet NSPopUpButton *categoryPopUpView;
|
||||
IBOutlet NSTableView *criteriaTableView;
|
||||
IBOutlet NSTableView *prioritizationTableView;
|
||||
|
||||
HSPopUpList *categoryPopUp;
|
||||
HSSelectableList *criteriaList;
|
||||
PyPrioritizeDialog *py;
|
||||
HSPopUpList2 *categoryPopUp;
|
||||
// XXX Just to make it work temporarily, fix this asap (support to be HSSelectableList)
|
||||
PrioritizeList *criteriaList;
|
||||
PrioritizeList *prioritizationList;
|
||||
}
|
||||
- (id)initWithPy:(PyApp *)aPy;
|
||||
- (id)init;
|
||||
- (PyPrioritizeDialog *)py;
|
||||
|
||||
- (IBAction)addSelected:(id)sender;
|
||||
|
||||
@@ -7,22 +7,25 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import "PrioritizeDialog.h"
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation PrioritizeDialog
|
||||
- (id)initWithPy:(PyApp *)aPy
|
||||
- (id)init
|
||||
{
|
||||
self = [super initWithNibName:@"PrioritizeDialog" pyClassName:@"PyPrioritizeDialog" pyParent:aPy];
|
||||
self = [super initWithWindowNibName:@"PrioritizeDialog"];
|
||||
[self window];
|
||||
categoryPopUp = [[HSPopUpList alloc] initWithPy:[[self py] categoryList] view:categoryPopUpView];
|
||||
criteriaList = [[HSSelectableList alloc] initWithPy:[[self py] criteriaList] view:criteriaTableView];
|
||||
prioritizationList = [[PrioritizeList alloc] initWithPy:[[self py] prioritizationList] view:prioritizationTableView];
|
||||
[self connect];
|
||||
py = [[PyPrioritizeDialog alloc] initWithModel:findHackishModel(@"prioritize_dialog")];
|
||||
[py bindCallback:createCallback(@"PrioritizeDialogView", self)];
|
||||
categoryPopUp = [[HSPopUpList2 alloc] initWithPyRef:[[self py] categoryList] popupView:categoryPopUpView];
|
||||
criteriaList = [[PrioritizeList alloc] initWithPyRef:[[self py] criteriaList] tableView:criteriaTableView];
|
||||
prioritizationList = [[PrioritizeList alloc] initWithPyRef:[[self py] prioritizationList] tableView:prioritizationTableView];
|
||||
[py connect];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self disconnect];
|
||||
[py disconnect];
|
||||
[categoryPopUp release];
|
||||
[criteriaList release];
|
||||
[prioritizationList release];
|
||||
@@ -47,10 +50,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (IBAction)ok:(id)sender
|
||||
{
|
||||
[NSApp stopModal];
|
||||
[self close];
|
||||
}
|
||||
|
||||
- (IBAction)cancel:(id)sender
|
||||
{
|
||||
[NSApp abortModal];
|
||||
[self close];
|
||||
}
|
||||
@end
|
||||
@@ -7,9 +7,10 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "HSSelectableList.h"
|
||||
#import "HSSelectableList2.h"
|
||||
#import "PyPrioritizeList.h"
|
||||
|
||||
@interface PrioritizeList : HSSelectableList {}
|
||||
@interface PrioritizeList : HSSelectableList2 {}
|
||||
- (id)initWithPyRef:(PyObject *)aPyRef tableView:(NSTableView *)aTableView;
|
||||
- (PyPrioritizeList *)py;
|
||||
@end
|
||||
@@ -11,6 +11,15 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "Consts.h"
|
||||
|
||||
@implementation PrioritizeList
|
||||
- (id)initWithPyRef:(PyObject *)aPyRef tableView:(NSTableView *)aTableView
|
||||
{
|
||||
PyPrioritizeList *model = [[PyPrioritizeList alloc] initWithModel:aPyRef];
|
||||
self = [super initWithPy:model tableView:aTableView];
|
||||
[model bindCallback:createCallback(@"PrioritizeListView", self)];
|
||||
[model release];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (PyPrioritizeList *)py
|
||||
{
|
||||
return (PyPrioritizeList *)py;
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
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 <Cocoa/Cocoa.h>
|
||||
#import "PyGUI.h"
|
||||
#import "PySelectableList.h"
|
||||
|
||||
@interface PyPrioritizeDialog : PyGUI
|
||||
- (PySelectableList *)categoryList;
|
||||
- (PySelectableList *)criteriaList;
|
||||
- (PySelectableList *)prioritizationList;
|
||||
- (void)addSelected;
|
||||
- (void)removeSelected;
|
||||
- (void)performReprioritization;
|
||||
@end
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
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 <Cocoa/Cocoa.h>
|
||||
#import "PySelectableList.h"
|
||||
|
||||
@interface PyPrioritizeList : PySelectableList
|
||||
- (void)moveIndexes:(NSArray *)indexes toIndex:(NSInteger)destIndex;
|
||||
@end
|
||||
@@ -272,7 +272,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (IBAction)reprioritizeResults:(id)sender
|
||||
{
|
||||
PrioritizeDialog *dlg = [[PrioritizeDialog alloc] initWithPy:py];
|
||||
PrioritizeDialog *dlg = [[PrioritizeDialog alloc] init];
|
||||
NSInteger result = [NSApp runModalForWindow:[dlg window]];
|
||||
if (result == NSRunStoppedResponse) {
|
||||
[[dlg py] performReprioritization];
|
||||
|
||||
Reference in New Issue
Block a user