mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Moved column information in new edition-specific core result_table units.
This commit is contained in:
@@ -7,10 +7,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PyResultTable.h"
|
||||
#import "PyApp.h"
|
||||
|
||||
@interface PyDupeGuruBase : PyApp
|
||||
- (void)bindCocoa:(id)cocoa;
|
||||
- (PyResultTable *)resultTable;
|
||||
//Actions
|
||||
- (NSNumber *)addDirectory:(NSString *)name;
|
||||
- (void)removeDirectory:(NSNumber *)index;
|
||||
|
||||
@@ -17,7 +17,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (NSString *)valueForRow:(NSInteger)rowIndex column:(NSString *)aColumn;
|
||||
- (BOOL)renameSelected:(NSString *)aNewName;
|
||||
- (void)sortBy:(NSInteger)aIdentifier ascending:(BOOL)aAscending;
|
||||
- (void)sortBy:(NSString *)aIdentifier ascending:(BOOL)aAscending;
|
||||
- (void)markSelected;
|
||||
- (void)removeSelected;
|
||||
- (NSInteger)selectedDupeCount;
|
||||
|
||||
@@ -17,7 +17,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
NSIndexSet *_deltaColumns;
|
||||
HSColumns *columns;
|
||||
}
|
||||
- (id)initWithPyParent:(id)aPyParent view:(NSTableView *)aTableView;
|
||||
- (id)initWithPy:(id)aPy view:(NSTableView *)aTableView;
|
||||
- (PyResultTable *)py;
|
||||
- (HSColumns *)columns;
|
||||
- (BOOL)powerMarkerMode;
|
||||
|
||||
@@ -18,9 +18,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
@end
|
||||
|
||||
@implementation ResultTable
|
||||
- (id)initWithPyParent:(id)aPyParent view:(NSTableView *)aTableView
|
||||
- (id)initWithPy:(id)aPy view:(NSTableView *)aTableView
|
||||
{
|
||||
self = [super initWithPyClassName:@"PyResultTable" pyParent:aPyParent view:aTableView];
|
||||
self = [super initWithPy:aPy view:aTableView];
|
||||
columns = [[HSColumns alloc] initWithPy:[[self py] columns] tableView:aTableView];
|
||||
[self connect];
|
||||
return self;
|
||||
@@ -145,7 +145,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
if ([[tableView sortDescriptors] count] < 1)
|
||||
return;
|
||||
NSSortDescriptor *sd = [[tableView sortDescriptors] objectAtIndex:0];
|
||||
[[self py] sortBy:[[sd key] integerValue] ascending:[sd ascending]];
|
||||
[[self py] sortBy:[sd key] ascending:[sd ascending]];
|
||||
}
|
||||
|
||||
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)column row:(NSInteger)row
|
||||
|
||||
@@ -24,7 +24,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
columnsMenu = [app columnsMenu];
|
||||
/* Put a cute iTunes-like bottom bar */
|
||||
[[self window] setContentBorderThickness:28 forEdge:NSMinYEdge];
|
||||
table = [[ResultTable alloc] initWithPyParent:py view:matches];
|
||||
table = [[ResultTable alloc] initWithPy:[py resultTable] view:matches];
|
||||
statsLabel = [[StatsLabel alloc] initWithPyParent:py labelView:stats];
|
||||
problemDialog = [[ProblemDialog alloc] initWithPy:py];
|
||||
[self initResultColumns];
|
||||
|
||||
@@ -3,12 +3,13 @@ import logging
|
||||
from jobprogress import job
|
||||
from hscommon import cocoa
|
||||
from hscommon.cocoa import install_exception_hook
|
||||
from hscommon.cocoa.inter import signature, PyFairware
|
||||
from hscommon.cocoa.inter import signature, subproxy, PyFairware
|
||||
from hscommon.cocoa.objcmin import (NSNotificationCenter, NSSearchPathForDirectoriesInDomains,
|
||||
NSApplicationSupportDirectory, NSUserDomainMask, NSWorkspace)
|
||||
from hscommon.trans import trget
|
||||
|
||||
from core.app import JobType
|
||||
from .result_table import PyResultTable
|
||||
|
||||
tr = trget('ui')
|
||||
|
||||
@@ -31,6 +32,8 @@ class PyDupeGuruBase(PyFairware):
|
||||
def bindCocoa_(self, cocoa):
|
||||
self.cocoa = cocoa
|
||||
|
||||
resultTable = subproxy('resultTable', 'result_table', PyResultTable)
|
||||
|
||||
#---Directories
|
||||
def addDirectory_(self, directory):
|
||||
return self.py.add_directory(directory)
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
from hscommon.cocoa.inter import signature, PyTable
|
||||
|
||||
from core.gui.result_table import ResultTable
|
||||
|
||||
class PyResultTable(PyTable):
|
||||
py_class = ResultTable
|
||||
|
||||
@signature('c@:')
|
||||
def powerMarkerMode(self):
|
||||
return self.py.power_marker
|
||||
@@ -29,7 +25,7 @@ class PyResultTable(PyTable):
|
||||
def renameSelected_(self, newname):
|
||||
return self.py.rename_selected(newname)
|
||||
|
||||
@signature('v@:ic')
|
||||
@signature('v@:@c')
|
||||
def sortBy_ascending_(self, key, asc):
|
||||
self.py.sort(key, asc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user