1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-23 07:01:39 +00:00

Fixed the mess I had to introduce earlier to make selectable list work by using objp's new inheritance capabilities.

--HG--
branch : objp
This commit is contained in:
Virgil Dupras
2012-01-13 10:20:46 -05:00
parent 4c8ce4b52d
commit f9ced08e6d
13 changed files with 49 additions and 47 deletions

View File

@@ -21,8 +21,7 @@ http://www.hardcoded.net/licenses/bsd_license
PyPrioritizeDialog *py;
HSPopUpList2 *categoryPopUp;
// XXX Just to make it work temporarily, fix this asap (support to be HSSelectableList)
PrioritizeList *criteriaList;
HSSelectableList2 *criteriaList;
PrioritizeList *prioritizationList;
}
- (id)init;

View File

@@ -17,7 +17,7 @@ http://www.hardcoded.net/licenses/bsd_license
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];
criteriaList = [[HSSelectableList2 alloc] initWithPyRef:[[self py] criteriaList] tableView:criteriaTableView];
prioritizationList = [[PrioritizeList alloc] initWithPyRef:[[self py] prioritizationList] tableView:prioritizationTableView];
[py connect];
return self;

View File

@@ -12,5 +12,5 @@ http://www.hardcoded.net/licenses/bsd_license
@interface PrioritizeList : HSSelectableList2 {}
- (id)initWithPyRef:(PyObject *)aPyRef tableView:(NSTableView *)aTableView;
- (PyPrioritizeList *)py;
- (PyPrioritizeList *)model;
@end

View File

@@ -13,16 +13,16 @@ http://www.hardcoded.net/licenses/bsd_license
@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];
PyPrioritizeList *m = [[PyPrioritizeList alloc] initWithModel:aPyRef];
self = [super initWithModel:m tableView:aTableView];
[m bindCallback:createCallback(@"PrioritizeListView", self)];
[m release];
return self;
}
- (PyPrioritizeList *)py
- (PyPrioritizeList *)model
{
return (PyPrioritizeList *)py;
return (PyPrioritizeList *)model;
}
- (void)setView:(NSTableView *)aTableView
@@ -54,7 +54,7 @@ http://www.hardcoded.net/licenses/bsd_license
NSPasteboard* pboard = [info draggingPasteboard];
NSData* rowData = [pboard dataForType:DGPrioritizeIndexPasteboardType];
NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:rowData];
[[self py] moveIndexes:[Utils indexSet2Array:rowIndexes] toIndex:row];
[[self model] moveIndexes:[Utils indexSet2Array:rowIndexes] toIndex:row];
return YES;
}
@end