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 "HSWindowController.h" | ||||
| #import "PyApp.h" | ||||
| #import "PyDetailsPanel.h" | ||||
| 
 | ||||
| @interface DetailsPanel : NSWindowController | ||||
| @interface DetailsPanel : HSWindowController | ||||
| { | ||||
|     IBOutlet NSTableView *detailsTable; | ||||
|      | ||||
|     PyDetailsPanel *py; | ||||
| } | ||||
| - (id)initWithPy:(PyApp *)aPy; | ||||
| - (PyDetailsPanel *)py; | ||||
| 
 | ||||
| - (void)toggleVisibility; | ||||
| 
 | ||||
|  | ||||
| @ -12,17 +12,14 @@ http://www.hardcoded.net/licenses/hs_license | ||||
| @implementation DetailsPanel | ||||
| - (id)initWithPy:(PyApp *)aPy | ||||
| { | ||||
|     self = [super initWithWindowNibName:@"DetailsPanel"]; | ||||
|     self = [super initWithNibName:@"DetailsPanel" pyClassName:@"PyDetailsPanel" pyParent:aPy]; | ||||
|     [self window]; //So the detailsTable is initialized. | ||||
|     Class pyClass = [Utils classNamed:@"PyDetailsPanel"]; | ||||
|     py = [[pyClass alloc] initWithCocoa:self pyParent:aPy]; | ||||
|     return self; | ||||
| } | ||||
| 
 | ||||
| - (void)dealloc | ||||
| - (PyDetailsPanel *)py | ||||
| { | ||||
|     [py release]; | ||||
|     [super dealloc]; | ||||
|     return (PyDetailsPanel *)py; | ||||
| } | ||||
| 
 | ||||
| - (void)refreshDetails | ||||
| @ -44,12 +41,12 @@ http://www.hardcoded.net/licenses/hs_license | ||||
| /* NSTableView Delegate */ | ||||
| - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView | ||||
| { | ||||
|     return [py numberOfRows]; | ||||
|     return [[self py] numberOfRows]; | ||||
| } | ||||
| 
 | ||||
| - (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 */ | ||||
|  | ||||
| @ -7,9 +7,9 @@ http://www.hardcoded.net/licenses/hs_license | ||||
| */ | ||||
| 
 | ||||
| #import <Cocoa/Cocoa.h> | ||||
| #import "PyGUI.h" | ||||
| 
 | ||||
| @interface PyDetailsPanel : NSObject | ||||
| - (id)initWithCocoa:(id)cocoa pyParent:(id)pyParent; | ||||
| @interface PyDetailsPanel : PyGUI | ||||
| - (NSInteger)numberOfRows; | ||||
| - (id)valueForColumn:(NSString *)column row:(NSInteger)row; | ||||
| @end | ||||
| @ -28,6 +28,7 @@ | ||||
| 		CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDDE111EE42F006618EA /* HSOutline.m */; }; | ||||
| 		CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE76FDF6111EE561006618EA /* NSEventAdditions.m */; }; | ||||
| 		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 */; }; | ||||
| 		CEE7EA130FE675C80004E467 /* DetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE7EA120FE675C80004E467 /* DetailsPanel.m */; }; | ||||
| 		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; }; | ||||
| 		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>"; }; | ||||
| 		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; }; | ||||
| 		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; }; | ||||
| @ -257,6 +260,8 @@ | ||||
| 		CE76FDC7111EE38E006618EA /* controllers */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				CEBE4D72111F0EE1009AAC6D /* HSWindowController.h */, | ||||
| 				CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */, | ||||
| 				CE76FDDD111EE42F006618EA /* HSOutline.h */, | ||||
| 				CE76FDDE111EE42F006618EA /* HSOutline.m */, | ||||
| 				CE76FDC8111EE38E006618EA /* HSGUIController.h */, | ||||
| @ -454,6 +459,7 @@ | ||||
| 				CE76FDD4111EE3A7006618EA /* DirectoryOutline.m in Sources */, | ||||
| 				CE76FDDF111EE42F006618EA /* HSOutline.m in Sources */, | ||||
| 				CE76FDF7111EE561006618EA /* NSEventAdditions.m in Sources */, | ||||
| 				CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */, | ||||
| 			); | ||||
| 			runOnlyForDeploymentPostprocessing = 0; | ||||
| 		}; | ||||
|  | ||||
| @ -11,7 +11,7 @@ | ||||
| 
 | ||||
| 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 .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 hsutil import conflict | ||||
| 
 | ||||
| class PyApp(NSObject): | ||||
|     pass #fake class | ||||
| 
 | ||||
| class PyDupeGuruBase(PyApp): | ||||
| class PyDupeGuruBase(NSObject): | ||||
|     #---Directories | ||||
|     def addDirectory_(self, directory): | ||||
|         return self.py.add_directory(directory) | ||||
| @ -198,13 +195,8 @@ class PyDupeGuruBase(PyApp): | ||||
|         self.py.set_registration(code, email) | ||||
|      | ||||
| 
 | ||||
| class PyDetailsPanel(NSObject): | ||||
|     def initWithCocoa_pyParent_(self, cocoa, pyparent): | ||||
|         super(PyDetailsPanel, self).init() | ||||
|         self.cocoa = cocoa | ||||
|         self.py = DetailsPanel(self, pyparent.py) | ||||
|         return self | ||||
|      | ||||
| class PyDetailsPanel(PyGUIObject): | ||||
|     py_class = DetailsPanel | ||||
|     @signature('i@:') | ||||
|     def numberOfRows(self): | ||||
|         return self.py.row_count() | ||||
| @ -213,10 +205,6 @@ class PyDetailsPanel(NSObject): | ||||
|     def valueForColumn_row_(self, column, row): | ||||
|         return self.py.row(row)[int(column)] | ||||
|      | ||||
|     # python --> cocoa | ||||
|     def refresh(self): | ||||
|         self.cocoa.refresh() | ||||
|      | ||||
| 
 | ||||
| class PyDirectoryOutline(PyOutline): | ||||
|     py_class = DirectoryTree | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user