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:
@@ -59,7 +59,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (DetailsPanel *)createDetailsPanel
|
||||
{
|
||||
return [[DetailsPanel alloc] initWithPy:py];
|
||||
return [[DetailsPanel alloc] init];
|
||||
}
|
||||
|
||||
- (NSString *)homepageURL
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
5
cocoa/base/bridge/DetailsPanelView.h
Normal file
5
cocoa/base/bridge/DetailsPanelView.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@protocol DetailsPanelView <NSObject>
|
||||
- (void)refresh;
|
||||
@end
|
||||
Reference in New Issue
Block a user