mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +00:00 
			
		
		
		
	DetailsPanel is now a subclass of HGWindowController.
This commit is contained in:
		
							parent
							
								
									76d351d8be
								
							
						
					
					
						commit
						af41876a5e
					
				| @ -7,16 +7,16 @@ http://www.hardcoded.net/licenses/hs_license | |||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| #import <Cocoa/Cocoa.h> | #import <Cocoa/Cocoa.h> | ||||||
|  | #import "HSWindowController.h" | ||||||
| #import "PyApp.h" | #import "PyApp.h" | ||||||
| #import "PyDetailsPanel.h" | #import "PyDetailsPanel.h" | ||||||
| 
 | 
 | ||||||
| @interface DetailsPanel : NSWindowController | @interface DetailsPanel : HSWindowController | ||||||
| { | { | ||||||
|     IBOutlet NSTableView *detailsTable; |     IBOutlet NSTableView *detailsTable; | ||||||
|      |  | ||||||
|     PyDetailsPanel *py; |  | ||||||
| } | } | ||||||
| - (id)initWithPy:(PyApp *)aPy; | - (id)initWithPy:(PyApp *)aPy; | ||||||
|  | - (PyDetailsPanel *)py; | ||||||
| 
 | 
 | ||||||
| - (void)toggleVisibility; | - (void)toggleVisibility; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,17 +12,14 @@ http://www.hardcoded.net/licenses/hs_license | |||||||
| @implementation DetailsPanel | @implementation DetailsPanel | ||||||
| - (id)initWithPy:(PyApp *)aPy | - (id)initWithPy:(PyApp *)aPy | ||||||
| { | { | ||||||
|     self = [super initWithWindowNibName:@"DetailsPanel"]; |     self = [super initWithNibName:@"DetailsPanel" pyClassName:@"PyDetailsPanel" pyParent:aPy]; | ||||||
|     [self window]; //So the detailsTable is initialized. |     [self window]; //So the detailsTable is initialized. | ||||||
|     Class pyClass = [Utils classNamed:@"PyDetailsPanel"]; |  | ||||||
|     py = [[pyClass alloc] initWithCocoa:self pyParent:aPy]; |  | ||||||
|     return self; |     return self; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| - (void)dealloc | - (PyDetailsPanel *)py | ||||||
| { | { | ||||||
|     [py release]; |     return (PyDetailsPanel *)py; | ||||||
|     [super dealloc]; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| - (void)refreshDetails | - (void)refreshDetails | ||||||
| @ -44,12 +41,12 @@ http://www.hardcoded.net/licenses/hs_license | |||||||
| /* NSTableView Delegate */ | /* NSTableView Delegate */ | ||||||
| - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView | ||||||
| { | { | ||||||
|     return [py numberOfRows]; |     return [[self py] numberOfRows]; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)row | - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)row | ||||||
| { | { | ||||||
|     return [py valueForColumn:[column identifier] row:row]; |     return [[self py] valueForColumn:[column identifier] row:row]; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* Python --> Cocoa */ | /* Python --> Cocoa */ | ||||||
|  | |||||||
| @ -7,9 +7,9 @@ http://www.hardcoded.net/licenses/hs_license | |||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| #import <Cocoa/Cocoa.h> | #import <Cocoa/Cocoa.h> | ||||||
|  | #import "PyGUI.h" | ||||||
| 
 | 
 | ||||||
| @interface PyDetailsPanel : NSObject | @interface PyDetailsPanel : PyGUI | ||||||
| - (id)initWithCocoa:(id)cocoa pyParent:(id)pyParent; |  | ||||||
| - (NSInteger)numberOfRows; | - (NSInteger)numberOfRows; | ||||||
| - (id)valueForColumn:(NSString *)column row:(NSInteger)row; | - (id)valueForColumn:(NSString *)column row:(NSInteger)row; | ||||||
| @end | @end | ||||||
| @ -28,6 +28,7 @@ | |||||||
| 		CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDDE111EE42F006618EA /* HSOutline.m */; }; | 		CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDDE111EE42F006618EA /* HSOutline.m */; }; | ||||||
| 		CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDF6111EE561006618EA /* NSEventAdditions.m */; }; | 		CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDF6111EE561006618EA /* NSEventAdditions.m */; }; | ||||||
| 		CEAC6811109B0B7E00B43C85 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEAC6810109B0B7E00B43C85 /* Preferences.xib */; }; | 		CEAC6811109B0B7E00B43C85 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = CEAC6810109B0B7E00B43C85 /* Preferences.xib */; }; | ||||||
|  | 		CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */; }; | ||||||
| 		CEDD92DA0FDD01640031C7B7 /* BRSingleLineFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDD92D70FDD01640031C7B7 /* BRSingleLineFormatter.m */; }; | 		CEDD92DA0FDD01640031C7B7 /* BRSingleLineFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDD92D70FDD01640031C7B7 /* BRSingleLineFormatter.m */; }; | ||||||
| 		CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; }; | 		CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; }; | ||||||
| 		CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; }; | 		CEEB135209C837A2004D2330 /* dupeguru.icns in Resources */ = {isa = PBXBuildFile; fileRef = CEEB135109C837A2004D2330 /* dupeguru.icns */; }; | ||||||
| @ -101,6 +102,8 @@ | |||||||
| 		CE76FDF5111EE561006618EA /* NSEventAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSEventAdditions.h; path = ../../cocoalib/NSEventAdditions.h; sourceTree = SOURCE_ROOT; }; | 		CE76FDF5111EE561006618EA /* NSEventAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSEventAdditions.h; path = ../../cocoalib/NSEventAdditions.h; sourceTree = SOURCE_ROOT; }; | ||||||
| 		CE76FDF6111EE561006618EA /* NSEventAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSEventAdditions.m; path = ../../cocoalib/NSEventAdditions.m; sourceTree = SOURCE_ROOT; }; | 		CE76FDF6111EE561006618EA /* NSEventAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSEventAdditions.m; path = ../../cocoalib/NSEventAdditions.m; sourceTree = SOURCE_ROOT; }; | ||||||
| 		CEAC6810109B0B7E00B43C85 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Preferences.xib; path = xib/Preferences.xib; sourceTree = "<group>"; }; | 		CEAC6810109B0B7E00B43C85 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Preferences.xib; path = xib/Preferences.xib; sourceTree = "<group>"; }; | ||||||
|  | 		CEBE4D72111F0EE1009AAC6D /* HSWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSWindowController.h; sourceTree = "<group>"; }; | ||||||
|  | 		CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSWindowController.m; sourceTree = "<group>"; }; | ||||||
| 		CEDD92D60FDD01640031C7B7 /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; }; | 		CEDD92D60FDD01640031C7B7 /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; }; | ||||||
| 		CEDD92D70FDD01640031C7B7 /* BRSingleLineFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRSingleLineFormatter.m; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.m; sourceTree = SOURCE_ROOT; }; | 		CEDD92D70FDD01640031C7B7 /* BRSingleLineFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BRSingleLineFormatter.m; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.m; sourceTree = SOURCE_ROOT; }; | ||||||
| 		CEE7EA110FE675C80004E467 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; }; | 		CEE7EA110FE675C80004E467 /* DetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailsPanel.h; path = ../base/DetailsPanel.h; sourceTree = SOURCE_ROOT; }; | ||||||
| @ -257,6 +260,8 @@ | |||||||
| 		CE76FDC7111EE38E006618EA /* controllers */ = { | 		CE76FDC7111EE38E006618EA /* controllers */ = { | ||||||
| 			isa = PBXGroup; | 			isa = PBXGroup; | ||||||
| 			children = ( | 			children = ( | ||||||
|  | 				CEBE4D72111F0EE1009AAC6D /* HSWindowController.h */, | ||||||
|  | 				CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */, | ||||||
| 				CE76FDDD111EE42F006618EA /* HSOutline.h */, | 				CE76FDDD111EE42F006618EA /* HSOutline.h */, | ||||||
| 				CE76FDDE111EE42F006618EA /* HSOutline.m */, | 				CE76FDDE111EE42F006618EA /* HSOutline.m */, | ||||||
| 				CE76FDC8111EE38E006618EA /* HSGUIController.h */, | 				CE76FDC8111EE38E006618EA /* HSGUIController.h */, | ||||||
| @ -454,6 +459,7 @@ | |||||||
| 				CE76FDD4111EE3A7006618EA /* DirectoryOutline.m in Sources */, | 				CE76FDD4111EE3A7006618EA /* DirectoryOutline.m in Sources */, | ||||||
| 				CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */, | 				CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */, | ||||||
| 				CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */, | 				CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */, | ||||||
|  | 				CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */, | ||||||
| 			); | 			); | ||||||
| 			runOnlyForDeploymentPostprocessing = 0; | 			runOnlyForDeploymentPostprocessing = 0; | ||||||
| 		}; | 		}; | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ | |||||||
| 
 | 
 | ||||||
| from hsutil.cocoa.objcmin import NSObject | from hsutil.cocoa.objcmin import NSObject | ||||||
| 
 | 
 | ||||||
| from hsutil.cocoa.inter import signature, PyOutline | from hsutil.cocoa.inter import signature, PyOutline, PyGUIObject | ||||||
| from hsutil.reg import InvalidCodeError | from hsutil.reg import InvalidCodeError | ||||||
| 
 | 
 | ||||||
| from .gui.details_panel import DetailsPanel | from .gui.details_panel import DetailsPanel | ||||||
| @ -21,10 +21,7 @@ from .gui.directory_tree import DirectoryTree | |||||||
| from core import app, app_cocoa, data, directories, engine, export, ignore, results, fs, scanner | from core import app, app_cocoa, data, directories, engine, export, ignore, results, fs, scanner | ||||||
| from hsutil import conflict | from hsutil import conflict | ||||||
| 
 | 
 | ||||||
| class PyApp(NSObject): | class PyDupeGuruBase(NSObject): | ||||||
|     pass #fake class |  | ||||||
| 
 |  | ||||||
| class PyDupeGuruBase(PyApp): |  | ||||||
|     #---Directories |     #---Directories | ||||||
|     def addDirectory_(self, directory): |     def addDirectory_(self, directory): | ||||||
|         return self.py.add_directory(directory) |         return self.py.add_directory(directory) | ||||||
| @ -198,13 +195,8 @@ class PyDupeGuruBase(PyApp): | |||||||
|         self.py.set_registration(code, email) |         self.py.set_registration(code, email) | ||||||
|      |      | ||||||
| 
 | 
 | ||||||
| class PyDetailsPanel(NSObject): | class PyDetailsPanel(PyGUIObject): | ||||||
|     def initWithCocoa_pyParent_(self, cocoa, pyparent): |     py_class = DetailsPanel | ||||||
|         super(PyDetailsPanel, self).init() |  | ||||||
|         self.cocoa = cocoa |  | ||||||
|         self.py = DetailsPanel(self, pyparent.py) |  | ||||||
|         return self |  | ||||||
|      |  | ||||||
|     @signature('i@:') |     @signature('i@:') | ||||||
|     def numberOfRows(self): |     def numberOfRows(self): | ||||||
|         return self.py.row_count() |         return self.py.row_count() | ||||||
| @ -213,10 +205,6 @@ class PyDetailsPanel(NSObject): | |||||||
|     def valueForColumn_row_(self, column, row): |     def valueForColumn_row_(self, column, row): | ||||||
|         return self.py.row(row)[int(column)] |         return self.py.row(row)[int(column)] | ||||||
|      |      | ||||||
|     # python --> cocoa |  | ||||||
|     def refresh(self): |  | ||||||
|         self.cocoa.refresh() |  | ||||||
|      |  | ||||||
| 
 | 
 | ||||||
| class PyDirectoryOutline(PyOutline): | class PyDirectoryOutline(PyOutline): | ||||||
|     py_class = DirectoryTree |     py_class = DirectoryTree | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user