From 25832dff5382e2a92a393f463d1669758e449b80 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 28 Aug 2008 15:39:20 -0400 Subject: [PATCH] Show the help window for each new version * English.lproj/MainMenu.xib: Don't make the main window key in the NIB * Source/AppController.m: (awakeFromNib): Make the main window key here, and then the help window if the version number is different --- English.lproj/MainMenu.xib | 9 +++------ Source/AppController.m | 10 ++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index ea5f472..45c92ae 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -10,7 +10,6 @@ YES - YES @@ -1219,7 +1218,7 @@ {3.40282e+38, 3.40282e+38} - + 256 YES @@ -1248,7 +1247,6 @@ {{0, 45}, {634, 551}} - @@ -1304,7 +1302,6 @@ {634, 596} - {{0, 0}, {1440, 878}} {3.40282e+38, 3.40282e+38} @@ -3183,7 +3180,7 @@ {{21, 388}, {480, 434}} - + {{542, 257}, {480, 434}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3232,7 +3229,7 @@ {{395, 148}, {634, 596}} com.apple.InterfaceBuilder.CocoaPlugin {{395, 148}, {634, 596}} - + {3.40282e+38, 3.40282e+38} com.apple.InterfaceBuilder.CocoaPlugin com.apple.WebKitIBPlugin diff --git a/Source/AppController.m b/Source/AppController.m index 2cd9d9d..126f527 100644 --- a/Source/AppController.m +++ b/Source/AppController.m @@ -80,6 +80,16 @@ [helpWindow center]; NSString *helpPath = [[NSBundle mainBundle] pathForResource:@"Help" ofType:@"html"]; [[helpWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:helpPath]]]; + + [window makeKeyAndOrderFront:self]; + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *hash = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleVersion"]; + if (![[defaults valueForKey:@"LastVersionHelpWindow"] isEqualToString:hash]) + { + [helpWindow makeKeyAndOrderFront:self]; + [defaults setObject:hash forKey:@"LastVersionHelpWindow"]; + } } /** -- 2.22.5