diff --git a/cocoa/base/DetailsPanel.m b/cocoa/base/DetailsPanel.m index 0ea4931a..31d67dc3 100644 --- a/cocoa/base/DetailsPanel.m +++ b/cocoa/base/DetailsPanel.m @@ -6,22 +6,15 @@ which should be included with this package. The terms are also available at http://www.hardcoded.net/licenses/bsd_license */ -#import #import "DetailsPanel.h" -#import "ObjP.h" +#import "Utils.h" @implementation DetailsPanel - (id)init { self = [super initWithWindowNibName:@"DetailsPanel"]; [self window]; //So the detailsTable is initialized. - 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 = createPyWrapper(@"PyDetailsPanel", @"details_panel", @"DetailsPanelView", self); [py connect]; return self; } diff --git a/cocoa/base/ExtraFairwareReminder.m b/cocoa/base/ExtraFairwareReminder.m index 89bac3de..ef70b6fa 100644 --- a/cocoa/base/ExtraFairwareReminder.m +++ b/cocoa/base/ExtraFairwareReminder.m @@ -6,9 +6,8 @@ which should be included with this package. The terms are also available at http://www.hardcoded.net/licenses/bsd_license */ -#import #import "ExtraFairwareReminder.h" -#import "ObjP.h" +#import "Utils.h" @implementation ExtraFairwareReminder - (id)init @@ -16,13 +15,7 @@ http://www.hardcoded.net/licenses/bsd_license 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 *pExtraFairwareReminder = PyObject_GetAttrString(pAppInstance, "extra_fairware_reminder"); - PyObject *pCallback = ObjP_classInstanceWithRef(@"ExtraFairwareReminderView", @"inter.ExtraFairwareReminderView", self); - py = [[PyExtraFairwareReminder alloc] initWithModel:pExtraFairwareReminder Callback:pCallback]; - PyGILState_Release(gilState); + py = createPyWrapper(@"PyExtraFairwareReminder", @"extra_fairware_reminder", @"ExtraFairwareReminderView", self); return self; } diff --git a/cocoa/base/StatsLabel.m b/cocoa/base/StatsLabel.m index b2ea972b..ab282219 100644 --- a/cocoa/base/StatsLabel.m +++ b/cocoa/base/StatsLabel.m @@ -6,22 +6,15 @@ which should be included with this package. The terms are also available at http://www.hardcoded.net/licenses/bsd_license */ -#import #import "StatsLabel.h" -#import "ObjP.h" +#import "Utils.h" @implementation StatsLabel - (id)initWithLabelView:(NSTextField *)aLabelView { self = [self init]; view = [aLabelView retain]; - PyGILState_STATE gilState = PyGILState_Ensure(); - PyObject *pModule = PyImport_AddModule("__main__"); - PyObject *pAppInstance = PyObject_GetAttrString(pModule, "APP_INSTANCE"); - PyObject *pStatsLabel = PyObject_GetAttrString(pAppInstance, "stats_label"); - PyObject *pCallback = ObjP_classInstanceWithRef(@"StatsLabelView", @"inter.StatsLabelView", self); - py = [[PyStatsLabel alloc] initWithModel:pStatsLabel Callback:pCallback]; - PyGILState_Release(gilState); + py = createPyWrapper(@"PyStatsLabel", @"stats_label", @"StatsLabelView", self); [[self py] connect]; return self; } diff --git a/cocoa/se/dupeguru.xcodeproj/project.pbxproj b/cocoa/se/dupeguru.xcodeproj/project.pbxproj index f1c140b2..66dc9416 100644 --- a/cocoa/se/dupeguru.xcodeproj/project.pbxproj +++ b/cocoa/se/dupeguru.xcodeproj/project.pbxproj @@ -244,6 +244,7 @@ CECFFF2013CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/ProblemDialog.xib; sourceTree = SOURCE_ROOT; }; CECFFF2113CDF8D0003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = ../base/de.lproj/ResultWindow.xib; sourceTree = SOURCE_ROOT; }; CECFFF2413CDF8E5003A4518 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/Preferences.xib; sourceTree = ""; }; + CED569C614BF312900C6AC25 /* PyGUI2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyGUI2.h; sourceTree = ""; }; CED64CEB145EF06000572B00 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = ../base/cs.lproj/Localizable.strings; sourceTree = ""; }; CED64CF8145EF07700572B00 /* cs */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = cs; path = ../base/cs.lproj/DetailsPanel.xib; sourceTree = ""; }; CED64CF9145EF07700572B00 /* cs */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = cs; path = ../base/cs.lproj/DirectoryPanel.xib; sourceTree = ""; }; @@ -452,6 +453,7 @@ children = ( CE54A87A14804687008EEA77 /* PyColumns.h */, CE76FDCD111EE38E006618EA /* PyGUI.h */, + CED569C614BF312900C6AC25 /* PyGUI2.h */, CE76FDCE111EE38E006618EA /* PyOutline.h */, CE8C53B61173248F0011B41F /* PyTable.h */, CE9777D2141F9D6500C13FB5 /* PySelectableList.h */,