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

Converted details_panel to objp.

--HG--
branch : objp
This commit is contained in:
Virgil Dupras
2012-01-12 09:41:03 -05:00
parent 12467c9493
commit e6819781f6
10 changed files with 46 additions and 43 deletions

View File

@@ -59,7 +59,7 @@ http://www.hardcoded.net/licenses/bsd_license
- (DetailsPanel *)createDetailsPanel
{
return [[DetailsPanel alloc] initWithPy:py];
return [[DetailsPanel alloc] init];
}
- (NSString *)homepageURL

View File

@@ -11,11 +11,13 @@ http://www.hardcoded.net/licenses/bsd_license
#import "PyApp.h"
#import "PyDetailsPanel.h"
@interface DetailsPanel : HSWindowController
@interface DetailsPanel : NSWindowController
{
IBOutlet NSTableView *detailsTable;
PyDetailsPanel *py;
}
- (id)initWithPy:(PyApp *)aPy;
- (id)init;
- (PyDetailsPanel *)py;
- (BOOL)isVisible;

View File

@@ -6,21 +6,30 @@ which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import <Python.h>
#import "DetailsPanel.h"
#import "Utils.h"
#import "ObjP.h"
@implementation DetailsPanel
- (id)initWithPy:(PyApp *)aPy
- (id)init
{
self = [super initWithNibName:@"DetailsPanel" pyClassName:@"PyDetailsPanel" pyParent:aPy];
self = [super initWithWindowNibName:@"DetailsPanel"];
[self window]; //So the detailsTable is initialized.
[self connect];
PyGILState_STATE gilState = PyGILState_Ensure();
PyObject *pModule = PyImport_AddModule("__main__");
PyObject *pAppInstance = PyObject_GetAttrString(pModule, "APP_INSTANCE");
PyObject *pDetailsPanel = PyObject_GetAttrString(pAppInstance, "details_panel");
PyObject *pCallback = ObjP_classInstanceWithRef(@"DetailsPanelView", @"inter.DetailsPanelView", self);
py = [[PyDetailsPanel alloc] initWithModel:pDetailsPanel Callback:pCallback];
PyGILState_Release(gilState);
[py connect];
return self;
}
- (void)dealloc
{
[self disconnect];
[py disconnect];
[py release];
[super dealloc];
}

View File

@@ -19,9 +19,9 @@ http://www.hardcoded.net/licenses/bsd_license
PyGILState_STATE gilState = PyGILState_Ensure();
PyObject *pModule = PyImport_AddModule("__main__");
PyObject *pAppInstance = PyObject_GetAttrString(pModule, "APP_INSTANCE");
PyObject *pStatsLabel = PyObject_GetAttrString(pAppInstance, "extra_fairware_reminder");
PyObject *pExtraFairwareReminder = PyObject_GetAttrString(pAppInstance, "extra_fairware_reminder");
PyObject *pCallback = ObjP_classInstanceWithRef(@"ExtraFairwareReminderView", @"inter.ExtraFairwareReminderView", self);
py = [[PyExtraFairwareReminder alloc] initWithModel:pStatsLabel Callback:pCallback];
py = [[PyExtraFairwareReminder alloc] initWithModel:pExtraFairwareReminder Callback:pCallback];
PyGILState_Release(gilState);
return self;
}

View File

@@ -1,15 +0,0 @@
/*
Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import <Cocoa/Cocoa.h>
#import "PyGUI.h"
@interface PyDetailsPanel : PyGUI
- (NSInteger)numberOfRows;
- (id)valueForColumn:(NSString *)column row:(NSInteger)row;
@end

View File

@@ -0,0 +1,5 @@
#import <Cocoa/Cocoa.h>
@protocol DetailsPanelView <NSObject>
- (void)refresh;
@end