mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-23 07:01:39 +00:00
Converted extra_fairware_reminder to objp.
--HG-- branch : objp
This commit is contained in:
@@ -207,9 +207,10 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
/* model --> view */
|
||||
- (void)showExtraFairwareReminder
|
||||
{
|
||||
ExtraFairwareReminder *dialog = [[ExtraFairwareReminder alloc] initWithPy:py];
|
||||
ExtraFairwareReminder *dialog = [[ExtraFairwareReminder alloc] init];
|
||||
[dialog start];
|
||||
[NSApp runModalForWindow:[dialog window]];
|
||||
[dialog close];
|
||||
[dialog release];
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,14 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "HSWindowController.h"
|
||||
#import "PyApp.h"
|
||||
|
||||
@interface ExtraFairwareReminder : HSWindowController
|
||||
@interface ExtraFairwareReminder : NSWindowController
|
||||
{
|
||||
IBOutlet NSButton *continueButton;
|
||||
|
||||
PyExtraFairwareReminder *py;
|
||||
NSTimer *timer;
|
||||
}
|
||||
- (id)initWithPy:(PyApp *)aPy;
|
||||
- (id)init;
|
||||
- (PyExtraFairwareReminder *)py;
|
||||
|
||||
- (void)start;
|
||||
|
||||
@@ -6,19 +6,29 @@ which should be included with this package. The terms are also available at
|
||||
http://www.hardcoded.net/licenses/bsd_license
|
||||
*/
|
||||
|
||||
#import <Python.h>
|
||||
#import "ExtraFairwareReminder.h"
|
||||
#import "ObjP.h"
|
||||
|
||||
@implementation ExtraFairwareReminder
|
||||
- (id)initWithPy:(PyApp *)aPy
|
||||
- (id)init
|
||||
{
|
||||
self = [super initWithNibName:@"ExtraFairwareReminder" pyClassName:@"PyExtraFairwareReminder" pyParent:aPy];
|
||||
self = [super initWithWindowNibName:@"ExtraFairwareReminder"];
|
||||
[self window];
|
||||
[continueButton setEnabled:NO];
|
||||
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 *pCallback = ObjP_classInstanceWithRef(@"ExtraFairwareReminderView", @"inter.ExtraFairwareReminderView", self);
|
||||
py = [[PyExtraFairwareReminder alloc] initWithModel:pStatsLabel Callback:pCallback];
|
||||
PyGILState_Release(gilState);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[py release];
|
||||
[timer release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -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 PyExtraFairwareReminder : PyGUI
|
||||
- (void)start;
|
||||
- (void)updateButton;
|
||||
@end
|
||||
8
cocoa/base/bridge/ExtraFairwareReminderView.h
Normal file
8
cocoa/base/bridge/ExtraFairwareReminderView.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@protocol ExtraFairwareReminderView <NSObject>
|
||||
- (void)startTimer;
|
||||
- (void)stopTimer;
|
||||
- (void)setButtonText:(NSString *)text;
|
||||
- (void)enableButton;
|
||||
@end
|
||||
Reference in New Issue
Block a user