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

Converted PyStatsLabel to a core instance mode.

--HG--
branch : objp
This commit is contained in:
Virgil Dupras
2012-01-09 11:15:20 -05:00
parent f636333938
commit 989026051c
7 changed files with 18 additions and 15 deletions

View File

@@ -8,11 +8,13 @@ http://www.hardcoded.net/licenses/bsd_license
#import <Cocoa/Cocoa.h>
#import "PyResultTable.h"
#import "PyStatsLabel.h"
#import "PyApp.h"
@interface PyDupeGuruBase : PyApp
- (void)bindCocoa:(id)cocoa;
- (PyResultTable *)resultTable;
- (PyStatsLabel *)statsLabel;
//Actions
- (NSNumber *)addDirectory:(NSString *)name;
- (void)loadResultsFrom:(NSString *)filename;

View File

@@ -25,7 +25,7 @@ http://www.hardcoded.net/licenses/bsd_license
/* Put a cute iTunes-like bottom bar */
[[self window] setContentBorderThickness:28 forEdge:NSMinYEdge];
table = [[ResultTable alloc] initWithPy:[py resultTable] view:matches];
statsLabel = [[StatsLabel alloc] initWithPyParent:py labelView:stats];
statsLabel = [[StatsLabel alloc] initWithPy:[py statsLabel] labelView:stats];
problemDialog = [[ProblemDialog alloc] initWithPy:py];
[self initResultColumns];
[self fillColumnsMenu];

View File

@@ -10,10 +10,8 @@ http://www.hardcoded.net/licenses/bsd_license
#import "HSGUIController.h"
#import "PyStatsLabel.h"
@interface StatsLabel : HSGUIController
{
NSTextField *labelView;
}
- (id)initWithPyParent:(id)aPyParent labelView:(NSTextField *)aLabelView;
@interface StatsLabel : HSGUIController {}
- (id)initWithPy:(id)aPy labelView:(NSTextField *)aLabelView;
- (PyStatsLabel *)py;
- (NSTextField *)labelView;
@end

View File

@@ -10,10 +10,9 @@ http://www.hardcoded.net/licenses/bsd_license
#import "Utils.h"
@implementation StatsLabel
- (id)initWithPyParent:(id)aPyParent labelView:(NSTextField *)aLabelView
- (id)initWithPy:(id)aPy labelView:(NSTextField *)aLabelView
{
self = [super initWithPyClassName:@"PyStatsLabel" pyParent:aPyParent];
labelView = [aLabelView retain];
self = [super initWithPy:aPy view:aLabelView];
[self connect];
return self;
}
@@ -21,7 +20,6 @@ http://www.hardcoded.net/licenses/bsd_license
- (void)dealloc
{
[self disconnect];
[labelView release];
[super dealloc];
}
@@ -30,9 +28,14 @@ http://www.hardcoded.net/licenses/bsd_license
return (PyStatsLabel *)py;
}
- (NSTextField *)labelView
{
return (NSTextField *)[self view];
}
/* Python --> Cocoa */
- (void)refresh
{
[labelView setStringValue:[[self py] display]];
[[self labelView] setStringValue:[[self py] display]];
}
@end