2009-08-05 08:59:46 +00:00
|
|
|
/*
|
2010-01-01 20:11:34 +00:00
|
|
|
Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 08:59:46 +00:00
|
|
|
|
|
|
|
This software is licensed under the "HS" 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/hs_license
|
|
|
|
*/
|
|
|
|
|
2009-06-15 12:33:58 +00:00
|
|
|
#import "DetailsPanel.h"
|
2009-06-15 12:53:47 +00:00
|
|
|
#import "Consts.h"
|
2009-06-15 12:33:58 +00:00
|
|
|
|
2010-02-05 16:15:45 +00:00
|
|
|
@implementation DetailsPanel
|
2009-06-15 12:33:58 +00:00
|
|
|
- (id)initWithPy:(PyApp *)aPy
|
|
|
|
{
|
2009-10-25 10:42:00 +00:00
|
|
|
self = [super initWithWindowNibName:@"DetailsPanel"];
|
2009-06-15 12:33:58 +00:00
|
|
|
[self window]; //So the detailsTable is initialized.
|
|
|
|
[detailsTable setPy:aPy];
|
2009-06-15 12:53:47 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(duplicateSelectionChanged:) name:DuplicateSelectionChangedNotification object:nil];
|
2009-06-15 12:33:58 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)refresh
|
|
|
|
{
|
|
|
|
[detailsTable reloadData];
|
|
|
|
}
|
2009-06-15 12:53:47 +00:00
|
|
|
|
2009-11-02 15:16:34 +00:00
|
|
|
- (void)toggleVisibility
|
|
|
|
{
|
|
|
|
if ([[self window] isVisible])
|
|
|
|
[[self window] close];
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[self refresh]; // selection might have changed since last time
|
|
|
|
[[self window] orderFront:nil];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-15 12:53:47 +00:00
|
|
|
/* Notifications */
|
|
|
|
- (void)duplicateSelectionChanged:(NSNotification *)aNotification
|
|
|
|
{
|
|
|
|
if ([[self window] isVisible])
|
|
|
|
[self refresh];
|
|
|
|
}
|
2009-06-15 12:33:58 +00:00
|
|
|
@end
|