mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-25 08:59:24 +00:00
Added simple settings
This commit is contained in:
@@ -11,16 +11,19 @@
|
||||
#import "MPDatabaseDocument.h"
|
||||
#import "MPOutlineDataSource.h"
|
||||
#import "MPOutlineViewDelegate.h"
|
||||
#import "MPSettingsController.h"
|
||||
|
||||
NSString *const kColumnIdentifier = @"OutlineColumn";
|
||||
NSString *const kOutlineViewIdentifier = @"OutlineView";
|
||||
|
||||
@interface MPAppDelegate ()
|
||||
@property (assign) IBOutlet NSOutlineView *outlineView;
|
||||
@property (retain) MPSettingsController *settingsController;
|
||||
@property (retain) MPOutlineDataSource *datasource;
|
||||
@property (retain) MPOutlineViewDelegate *outlineDelegate;
|
||||
@property (retain) MPDatabaseDocument *database;
|
||||
- (void)updateData;
|
||||
- (IBAction)showPreferences:(id)sender;
|
||||
@end
|
||||
|
||||
@implementation MPAppDelegate
|
||||
@@ -30,6 +33,7 @@ NSString *const kOutlineViewIdentifier = @"OutlineView";
|
||||
@synthesize database = _database;
|
||||
@synthesize outlineDelegate = _outlineDelegate;
|
||||
@synthesize datasource = _datasource;
|
||||
@synthesize settingsController = _settingsController;
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
@@ -37,8 +41,7 @@ NSString *const kOutlineViewIdentifier = @"OutlineView";
|
||||
_datasource = [[MPOutlineDataSource alloc] init];
|
||||
[[_outlineView outlineTableColumn] setIdentifier:kColumnIdentifier];
|
||||
[_outlineView setDelegate:_outlineDelegate];
|
||||
[_outlineView setDataSource:_datasource];
|
||||
|
||||
[_outlineView setDataSource:_datasource];
|
||||
// register for sucessfull document loads
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateData) name:MPDidLoadDataBaseNotification object:_database];
|
||||
}
|
||||
@@ -47,4 +50,13 @@ NSString *const kOutlineViewIdentifier = @"OutlineView";
|
||||
[_outlineView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark IBActions
|
||||
- (void)showPreferences:(id)sender {
|
||||
if(_settingsController == nil) {
|
||||
_settingsController = [[MPSettingsController alloc] init];
|
||||
}
|
||||
[_settingsController showWindow:_settingsController.window];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user