Permalink
Browse files

use nsbundle version attribute

  • Loading branch information...
1 parent 76a8017 commit c8408f6bcd55be7d6f2d2379d2e7302dfeb4f971 @bububa committed May 3, 2010
Showing with 8 additions and 0 deletions.
  1. +2 −0 MongoHub_AppDelegate.h
  2. +6 −0 MongoHub_AppDelegate.m
View
@@ -25,6 +25,7 @@
IBOutlet ConnectionsArrayController *connectionsArrayController;
AddConnectionController *addConnectionController;
EditConnectionController *editConnectionController;
+ IBOutlet NSTextField *bundleVersion;
}
@property (nonatomic, retain) IBOutlet NSWindow *window;
@@ -37,6 +38,7 @@
@property (nonatomic, retain) ConnectionsArrayController *connectionsArrayController;
@property (nonatomic, retain) AddConnectionController *addConnectionController;
@property (nonatomic, retain) EditConnectionController *editConnectionController;
+@property (nonatomic, retain) NSTextField *bundleVersion;
- (IBAction)saveAction:sender;
- (IBAction)showAddConnectionPanel:(id)sender;
View
@@ -25,6 +25,7 @@ @implementation MongoHub_AppDelegate
@synthesize connectionsArrayController;
@synthesize addConnectionController;
@synthesize editConnectionController;
+@synthesize bundleVersion;
/**
Returns the support directory for the application, used to store the Core Data
@@ -277,12 +278,17 @@ - (void)dealloc {
[addConnectionController release];
[editConnectionController release];
+ [bundleVersion release];
+
[super dealloc];
}
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addConection:) name:kNewConnectionWindowWillClose object:nil];
+ NSString *appVersion = [[NSString alloc] initWithFormat:@"version(%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey] ];
+ [bundleVersion setStringValue: appVersion];
+ [appVersion release];
}
#pragma mark connections related method

0 comments on commit c8408f6

Please sign in to comment.