mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Simplified model --> cocoa communication.
This commit is contained in:
parent
f0441db88a
commit
b44e52689f
@ -49,7 +49,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification;
|
||||
- (void)recentFileClicked:(NSString *)path;
|
||||
- (void)showExtraFairwareReminder:(NSNotification *)aNotification;
|
||||
|
||||
/* Actions */
|
||||
- (IBAction)loadResults:(id)sender;
|
||||
@ -60,4 +59,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (IBAction)showPreferencesPanel:(id)sender;
|
||||
- (IBAction)showResultWindow:(id)sender;
|
||||
- (IBAction)startScanning:(id)sender;
|
||||
|
||||
/* model --> view */
|
||||
- (void)showExtraFairwareReminder;
|
||||
@end
|
||||
|
@ -18,6 +18,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
@implementation AppDelegateBase
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[py bindCocoa:self];
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
/* Because the pref pane is lazily loaded, we have to manually do the update check if the
|
||||
preference is set.
|
||||
@ -33,8 +34,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
_aboutBox = nil; // Lazily loaded
|
||||
_preferencesPanel = nil; // Lazily loaded
|
||||
[[[self directoryPanel] window] makeKeyAndOrderFront:self];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(showExtraFairwareReminder:) name:ShowExtraFairwareReminder object:nil];
|
||||
}
|
||||
|
||||
/* Virtual */
|
||||
@ -207,7 +206,9 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[py loadResultsFrom:path];
|
||||
}
|
||||
|
||||
- (void)showExtraFairwareReminder:(NSNotification *)aNotification
|
||||
|
||||
/* model --> view */
|
||||
- (void)showExtraFairwareReminder
|
||||
{
|
||||
ExtraFairwareReminder *dialog = [[ExtraFairwareReminder alloc] initWithPy:py];
|
||||
[dialog start];
|
||||
|
@ -10,7 +10,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
#define JobStarted @"JobStarted"
|
||||
#define JobInProgress @"JobInProgress"
|
||||
#define ShowExtraFairwareReminder @"ShowExtraFairwareReminder"
|
||||
|
||||
#define jobLoad @"job_load"
|
||||
#define jobScan @"job_scan"
|
||||
|
@ -10,6 +10,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "PyApp.h"
|
||||
|
||||
@interface PyDupeGuruBase : PyApp
|
||||
- (void)bindCocoa:(id)cocoa;
|
||||
//Actions
|
||||
- (NSNumber *)addDirectory:(NSString *)name;
|
||||
- (void)removeDirectory:(NSNumber *)index;
|
||||
|
@ -44,6 +44,9 @@ class PyDupeGuruBase(PyFairware):
|
||||
self.py = modelclass(self, appdata)
|
||||
self.progress = cocoa.ThreadedJobPerformer()
|
||||
|
||||
def bindCocoa_(self, cocoa):
|
||||
self.cocoa = cocoa
|
||||
|
||||
#---Directories
|
||||
def addDirectory_(self, directory):
|
||||
return self.py.add_directory(directory)
|
||||
@ -211,7 +214,7 @@ class PyDupeGuruBase(PyFairware):
|
||||
NSUserDefaults.standardUserDefaults().setObject_forKey_(value, key_name)
|
||||
|
||||
def show_extra_fairware_reminder(self):
|
||||
NSNotificationCenter.defaultCenter().postNotificationName_object_userInfo_('ShowExtraFairwareReminder', self, None)
|
||||
self.cocoa.showExtraFairwareReminder()
|
||||
|
||||
class PyDetailsPanel(PyGUIObject):
|
||||
py_class = DetailsPanel
|
||||
|
Loading…
x
Reference in New Issue
Block a user