mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Converted extra_fairware_reminder to objp.
--HG-- branch : objp
This commit is contained in:
parent
0c7d73854d
commit
12467c9493
28
build.py
28
build.py
@ -180,17 +180,23 @@ def build_cocoa_bridging_interfaces():
|
||||
add_to_pythonpath('cocoa')
|
||||
add_to_pythonpath('cocoalib')
|
||||
from inter.stats_label import PyStatsLabel
|
||||
objp.o2p.generate_objc_code(PyStatsLabel, 'cocoa/autogen')
|
||||
objp.p2o.generate_python_proxy_code('cocoa/base/bridge/StatsLabelView.h', 'build/StatsLabelView.m')
|
||||
exts = [
|
||||
Extension("StatsLabelView", ['build/StatsLabelView.m', 'build/ObjP.m'],
|
||||
extra_link_args=["-framework", "Foundation"]),
|
||||
]
|
||||
setup(
|
||||
script_args = ['build_ext', '--inplace'],
|
||||
ext_modules = exts,
|
||||
)
|
||||
move_all('StatsLabelView*', 'cocoa/inter')
|
||||
from inter.extra_fairware_reminder import PyExtraFairwareReminder
|
||||
for class_ in [PyStatsLabel, PyExtraFairwareReminder]:
|
||||
objp.o2p.generate_objc_code(class_, 'cocoa/autogen')
|
||||
for fn in os.listdir('cocoa/base/bridge'):
|
||||
basename = fn[:-2]
|
||||
header_path = op.join('cocoa/base/bridge', fn)
|
||||
extmodule_path = op.join('build', basename + '.m')
|
||||
objp.p2o.generate_python_proxy_code(header_path, extmodule_path)
|
||||
exts = [
|
||||
Extension(basename, [extmodule_path, 'build/ObjP.m'],
|
||||
extra_link_args=["-framework", "Foundation"]),
|
||||
]
|
||||
setup(
|
||||
script_args = ['build_ext', '--inplace'],
|
||||
ext_modules = exts,
|
||||
)
|
||||
move_all('*.so', 'cocoa/inter')
|
||||
|
||||
def build_pe_modules(ui):
|
||||
print("Building PE Modules")
|
||||
|
@ -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
|
@ -1,25 +1,21 @@
|
||||
from cocoa.inter import PyGUIObject
|
||||
|
||||
from core.gui.extra_fairware_reminder import ExtraFairwareReminder
|
||||
from cocoa.inter2 import PyGUIObject
|
||||
|
||||
class PyExtraFairwareReminder(PyGUIObject):
|
||||
py_class = ExtraFairwareReminder
|
||||
|
||||
def start(self):
|
||||
self.py.start()
|
||||
self.model.start()
|
||||
|
||||
def updateButton(self):
|
||||
self.py.update_button()
|
||||
self.model.update_button()
|
||||
|
||||
# model --> view
|
||||
def start_timer(self):
|
||||
self.cocoa.startTimer()
|
||||
self.callback.startTimer()
|
||||
|
||||
def stop_timer(self):
|
||||
self.cocoa.stopTimer()
|
||||
self.callback.stopTimer()
|
||||
|
||||
def enable_button(self):
|
||||
self.cocoa.enableButton()
|
||||
self.callback.enableButton()
|
||||
|
||||
def set_button_text(self, text):
|
||||
self.cocoa.setButtonText_(text)
|
||||
self.callback.setButtonText_(text)
|
||||
|
@ -55,6 +55,7 @@
|
||||
CE9777CD141F8C2500C13FB5 /* PrioritizeDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9777CC141F8C2500C13FB5 /* PrioritizeDialog.m */; };
|
||||
CE9777D1141F8CB400C13FB5 /* PrioritizeDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE9777CF141F8CB400C13FB5 /* PrioritizeDialog.xib */; };
|
||||
CE9777D5141F9D7600C13FB5 /* HSPopUpList.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */; };
|
||||
CE9D842A14BE2AE900184165 /* PyExtraFairwareReminder.m in Sources */ = {isa = PBXBuildFile; fileRef = CE9D842914BE2AE900184165 /* PyExtraFairwareReminder.m */; };
|
||||
CEA175CA1461E8E600776591 /* locale in Resources */ = {isa = PBXBuildFile; fileRef = CEA175C91461E8E600776591 /* locale */; };
|
||||
CEA450B814BDDFD7002DAAF2 /* dg_cocoa.py in Resources */ = {isa = PBXBuildFile; fileRef = CEA450B714BDDFD7002DAAF2 /* dg_cocoa.py */; };
|
||||
CEBE4D74111F0EE1009AAC6D /* HSWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBE4D73111F0EE1009AAC6D /* HSWindowController.m */; };
|
||||
@ -157,7 +158,6 @@
|
||||
CE647E561173024A006D28BA /* PyProblemDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyProblemDialog.h; path = ../base/PyProblemDialog.h; sourceTree = SOURCE_ROOT; };
|
||||
CE665B2D13225ADD003F5CFB /* ExtraFairwareReminder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtraFairwareReminder.h; path = ../base/ExtraFairwareReminder.h; sourceTree = SOURCE_ROOT; };
|
||||
CE665B2E13225ADD003F5CFB /* ExtraFairwareReminder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtraFairwareReminder.m; path = ../base/ExtraFairwareReminder.m; sourceTree = SOURCE_ROOT; };
|
||||
CE665B2F13225ADD003F5CFB /* PyExtraFairwareReminder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyExtraFairwareReminder.h; path = ../base/PyExtraFairwareReminder.h; sourceTree = SOURCE_ROOT; };
|
||||
CE665B3213225AF8003F5CFB /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = ../base/en.lproj/ExtraFairwareReminder.xib; sourceTree = SOURCE_ROOT; };
|
||||
CE665B3413225B07003F5CFB /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = ../base/fr.lproj/ExtraFairwareReminder.xib; sourceTree = SOURCE_ROOT; };
|
||||
CE6DD4E4124CA3070089A48D /* PyResultTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyResultTable.h; path = ../base/PyResultTable.h; sourceTree = SOURCE_ROOT; };
|
||||
@ -228,6 +228,8 @@
|
||||
CE9777D2141F9D6500C13FB5 /* PySelectableList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PySelectableList.h; sourceTree = "<group>"; };
|
||||
CE9777D3141F9D7600C13FB5 /* HSPopUpList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSPopUpList.h; sourceTree = "<group>"; };
|
||||
CE9777D4141F9D7600C13FB5 /* HSPopUpList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSPopUpList.m; sourceTree = "<group>"; };
|
||||
CE9D842814BE2AE900184165 /* PyExtraFairwareReminder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyExtraFairwareReminder.h; sourceTree = "<group>"; };
|
||||
CE9D842914BE2AE900184165 /* PyExtraFairwareReminder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PyExtraFairwareReminder.m; sourceTree = "<group>"; };
|
||||
CEA175C91461E8E600776591 /* locale */ = {isa = PBXFileReference; lastKnownFileType = folder; name = locale; path = ../../build/locale; sourceTree = "<group>"; };
|
||||
CEA450B714BDDFD7002DAAF2 /* dg_cocoa.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = dg_cocoa.py; path = ../../build/dg_cocoa.py; sourceTree = "<group>"; };
|
||||
CEB57990146ADC5100EDF7D7 /* HSConsts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSConsts.h; path = ../../cocoalib/HSConsts.h; sourceTree = "<group>"; };
|
||||
@ -396,6 +398,8 @@
|
||||
CE1D091514BE0C6400CA6B8C /* ObjP.m */,
|
||||
CE1D091614BE0C6400CA6B8C /* PyStatsLabel.h */,
|
||||
CE1D091714BE0C6400CA6B8C /* PyStatsLabel.m */,
|
||||
CE9D842814BE2AE900184165 /* PyExtraFairwareReminder.h */,
|
||||
CE9D842914BE2AE900184165 /* PyExtraFairwareReminder.m */,
|
||||
);
|
||||
name = autogen;
|
||||
path = ../autogen;
|
||||
@ -537,7 +541,6 @@
|
||||
CE647E541173024A006D28BA /* ProblemDialog.h */,
|
||||
CE647E551173024A006D28BA /* ProblemDialog.m */,
|
||||
CE647E561173024A006D28BA /* PyProblemDialog.h */,
|
||||
CE665B2F13225ADD003F5CFB /* PyExtraFairwareReminder.h */,
|
||||
CE9777CB141F8C2500C13FB5 /* PrioritizeDialog.h */,
|
||||
CE9777CC141F8C2500C13FB5 /* PrioritizeDialog.m */,
|
||||
CE89240814239CC30024CE4E /* PyPrioritizeDialog.h */,
|
||||
@ -677,6 +680,7 @@
|
||||
CE54A87E148046F9008EEA77 /* HSColumns.m in Sources */,
|
||||
CE1D091814BE0C6400CA6B8C /* ObjP.m in Sources */,
|
||||
CE1D091914BE0C6400CA6B8C /* PyStatsLabel.m in Sources */,
|
||||
CE9D842A14BE2AE900184165 /* PyExtraFairwareReminder.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -25,6 +25,7 @@ from hscommon.trans import tr
|
||||
|
||||
from . import directories, results, scanner, export, fs
|
||||
from .gui.stats_label import StatsLabel
|
||||
from .gui.extra_fairware_reminder import ExtraFairwareReminder
|
||||
|
||||
HAD_FIRST_LAUNCH_PREFERENCE = 'HadFirstLaunch'
|
||||
DEBUG_MODE_PREFERENCE = 'DebugMode'
|
||||
@ -102,6 +103,7 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
}
|
||||
self.selected_dupes = []
|
||||
self.stats_label = StatsLabel(None, self)
|
||||
self.extra_fairware_reminder = ExtraFairwareReminder(None, self)
|
||||
# subclasses must create self.result_table
|
||||
|
||||
#--- Virtual
|
||||
|
Loading…
x
Reference in New Issue
Block a user