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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user