mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Converted details_panel to objp.
--HG-- branch : objp
This commit is contained in:
parent
12467c9493
commit
e6819781f6
5
build.py
5
build.py
@ -179,9 +179,10 @@ def build_cocoa_bridging_interfaces():
|
||||
import objp.p2o
|
||||
add_to_pythonpath('cocoa')
|
||||
add_to_pythonpath('cocoalib')
|
||||
from inter.stats_label import PyStatsLabel
|
||||
from inter.details_panel import PyDetailsPanel
|
||||
from inter.extra_fairware_reminder import PyExtraFairwareReminder
|
||||
for class_ in [PyStatsLabel, PyExtraFairwareReminder]:
|
||||
from inter.stats_label import PyStatsLabel
|
||||
for class_ in [PyDetailsPanel, PyExtraFairwareReminder, PyStatsLabel]:
|
||||
objp.o2p.generate_objc_code(class_, 'cocoa/autogen')
|
||||
for fn in os.listdir('cocoa/base/bridge'):
|
||||
basename = fn[:-2]
|
||||
|
@ -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
|
@ -1,13 +1,8 @@
|
||||
from cocoa.inter import signature, PyGUIObject
|
||||
|
||||
from core.gui.details_panel import DetailsPanel
|
||||
from cocoa.inter2 import PyGUIObject
|
||||
|
||||
class PyDetailsPanel(PyGUIObject):
|
||||
py_class = DetailsPanel
|
||||
@signature('i@:')
|
||||
def numberOfRows(self):
|
||||
return self.py.row_count()
|
||||
def numberOfRows(self) -> int:
|
||||
return self.model.row_count()
|
||||
|
||||
@signature('@@:@i')
|
||||
def valueForColumn_row_(self, column, row):
|
||||
return self.py.row(row)[int(column)]
|
||||
def valueForColumn_row_(self, column: str, row: int) -> object:
|
||||
return self.model.row(row)[int(column)]
|
||||
|
@ -21,6 +21,7 @@
|
||||
CE31819E13D85D9B00B6D649 /* ErrorReportWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE31819B13D85D9B00B6D649 /* ErrorReportWindow.xib */; };
|
||||
CE381C9609914ACE003581CE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9409914ACE003581CE /* AppDelegate.m */; };
|
||||
CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE381C9A09914ADF003581CE /* ResultWindow.m */; };
|
||||
CE3A3B4914BF19B8007898AB /* PyDetailsPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = CE3A3B4814BF19B8007898AB /* PyDetailsPanel.m */; };
|
||||
CE41672D141FE1E5004F3F0B /* HSSelectableList.m in Sources */ = {isa = PBXBuildFile; fileRef = CE41672B141FE1E5004F3F0B /* HSSelectableList.m */; };
|
||||
CE45579B0AE3BC2B005A9546 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE45579A0AE3BC2B005A9546 /* Sparkle.framework */; };
|
||||
CE4557B40AE3BC50005A9546 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE45579A0AE3BC2B005A9546 /* Sparkle.framework */; };
|
||||
@ -143,6 +144,8 @@
|
||||
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; };
|
||||
CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; };
|
||||
CE3A3B4714BF19B8007898AB /* PyDetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PyDetailsPanel.h; sourceTree = "<group>"; };
|
||||
CE3A3B4814BF19B8007898AB /* PyDetailsPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PyDetailsPanel.m; sourceTree = "<group>"; };
|
||||
CE41672A141FE1E5004F3F0B /* HSSelectableList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSSelectableList.h; sourceTree = "<group>"; };
|
||||
CE41672B141FE1E5004F3F0B /* HSSelectableList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSSelectableList.m; sourceTree = "<group>"; };
|
||||
CE41672C141FE1E5004F3F0B /* HSTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSTable.h; sourceTree = "<group>"; };
|
||||
@ -166,7 +169,6 @@
|
||||
CE6DD545124CAF1F0089A48D /* HSTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSTableView.h; path = ../../cocoalib/views/HSTableView.h; sourceTree = SOURCE_ROOT; };
|
||||
CE6DD546124CAF1F0089A48D /* HSTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSTableView.m; path = ../../cocoalib/views/HSTableView.m; sourceTree = SOURCE_ROOT; };
|
||||
CE6E0DFD1054E9EF008D9390 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = ../base/dsa_pub.pem; sourceTree = "<group>"; };
|
||||
CE6E7407111C997500C350E3 /* PyDetailsPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PyDetailsPanel.h; path = ../base/PyDetailsPanel.h; sourceTree = SOURCE_ROOT; };
|
||||
CE76FDBE111EE37C006618EA /* HSOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSOutlineView.h; sourceTree = "<group>"; };
|
||||
CE76FDBF111EE37C006618EA /* HSOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSOutlineView.m; sourceTree = "<group>"; };
|
||||
CE76FDC0111EE37C006618EA /* NSIndexPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSIndexPathAdditions.h; sourceTree = "<group>"; };
|
||||
@ -396,10 +398,12 @@
|
||||
children = (
|
||||
CE1D091414BE0C6400CA6B8C /* ObjP.h */,
|
||||
CE1D091514BE0C6400CA6B8C /* ObjP.m */,
|
||||
CE1D091614BE0C6400CA6B8C /* PyStatsLabel.h */,
|
||||
CE1D091714BE0C6400CA6B8C /* PyStatsLabel.m */,
|
||||
CE3A3B4714BF19B8007898AB /* PyDetailsPanel.h */,
|
||||
CE3A3B4814BF19B8007898AB /* PyDetailsPanel.m */,
|
||||
CE9D842814BE2AE900184165 /* PyExtraFairwareReminder.h */,
|
||||
CE9D842914BE2AE900184165 /* PyExtraFairwareReminder.m */,
|
||||
CE1D091614BE0C6400CA6B8C /* PyStatsLabel.h */,
|
||||
CE1D091714BE0C6400CA6B8C /* PyStatsLabel.m */,
|
||||
);
|
||||
name = autogen;
|
||||
path = ../autogen;
|
||||
@ -535,7 +539,6 @@
|
||||
CE665B2D13225ADD003F5CFB /* ExtraFairwareReminder.h */,
|
||||
CE665B2E13225ADD003F5CFB /* ExtraFairwareReminder.m */,
|
||||
CEFC7FB60FC951A700CD5728 /* PyDupeGuru.h */,
|
||||
CE6E7407111C997500C350E3 /* PyDetailsPanel.h */,
|
||||
CEFC7FB70FC951A700CD5728 /* ResultWindow.h */,
|
||||
CEFC7FB80FC951A700CD5728 /* ResultWindow.m */,
|
||||
CE647E541173024A006D28BA /* ProblemDialog.h */,
|
||||
@ -681,6 +684,7 @@
|
||||
CE1D091814BE0C6400CA6B8C /* ObjP.m in Sources */,
|
||||
CE1D091914BE0C6400CA6B8C /* PyStatsLabel.m in Sources */,
|
||||
CE9D842A14BE2AE900184165 /* PyExtraFairwareReminder.m in Sources */,
|
||||
CE3A3B4914BF19B8007898AB /* PyDetailsPanel.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -24,8 +24,9 @@ from hscommon.util import (delete_if_empty, first, escape, nonone, format_time_d
|
||||
from hscommon.trans import tr
|
||||
|
||||
from . import directories, results, scanner, export, fs
|
||||
from .gui.stats_label import StatsLabel
|
||||
from .gui.details_panel import DetailsPanel
|
||||
from .gui.extra_fairware_reminder import ExtraFairwareReminder
|
||||
from .gui.stats_label import StatsLabel
|
||||
|
||||
HAD_FIRST_LAUNCH_PREFERENCE = 'HadFirstLaunch'
|
||||
DEBUG_MODE_PREFERENCE = 'DebugMode'
|
||||
@ -102,8 +103,9 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
'ignore_hardlink_matches': False,
|
||||
}
|
||||
self.selected_dupes = []
|
||||
self.stats_label = StatsLabel(None, self)
|
||||
self.details_panel = DetailsPanel(None, self)
|
||||
self.extra_fairware_reminder = ExtraFairwareReminder(None, self)
|
||||
self.stats_label = StatsLabel(None, self)
|
||||
# subclasses must create self.result_table
|
||||
|
||||
#--- Virtual
|
||||
|
Loading…
x
Reference in New Issue
Block a user