From 739ae4a99a71d41bfc7a31411d3a5abab890b5d8 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 18 Jun 2012 01:33:27 +0000 Subject: [PATCH] Don't call setRestorationClass: on 10.6. --- macosx/CreatorWindowController.m | 4 +++- macosx/MessageWindowController.m | 3 ++- macosx/PrefsController.m | 4 +++- macosx/StatsWindowController.m | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/macosx/CreatorWindowController.m b/macosx/CreatorWindowController.m index ededd8303..834680fe9 100644 --- a/macosx/CreatorWindowController.m +++ b/macosx/CreatorWindowController.m @@ -24,6 +24,7 @@ #import "CreatorWindowController.h" #import "Controller.h" +#import "NSApplicationAdditions.h" #import "NSStringAdditions.h" #import "transmission.h" // required by utils.h @@ -139,7 +140,8 @@ - (void) awakeFromNib { - [[self window] setRestorationClass: [self class]]; + if ([NSApp isOnLionOrBetter]) + [[self window] setRestorationClass: [self class]]; NSString * name = [fPath lastPathComponent]; diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index c5f0ee08f..58d9ba1db 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -58,7 +58,8 @@ [window setFrameAutosaveName: @"MessageWindowFrame"]; [window setFrameUsingName: @"MessageWindowFrame"]; - [window setRestorationClass: [self class]]; + if ([NSApp isOnLionOrBetter]) + [window setRestorationClass: [self class]]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resizeColumn) name: @"NSTableViewColumnDidResizeNotification" object: fMessageTable]; diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 29df4d40b..58800e4dc 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -28,6 +28,7 @@ #import "Controller.h" #import "PortChecker.h" #import "BonjourController.h" +#import "NSApplicationAdditions.h" #import "NSStringAdditions.h" #import "UKKQueue.h" @@ -160,7 +161,8 @@ { fHasLoaded = YES; - [[self window] setRestorationClass: [self class]]; + if ([NSApp isOnLionOrBetter]) + [[self window] setRestorationClass: [self class]]; NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"]; [toolbar setDelegate: self]; diff --git a/macosx/StatsWindowController.m b/macosx/StatsWindowController.m index a026df041..7c902cebb 100644 --- a/macosx/StatsWindowController.m +++ b/macosx/StatsWindowController.m @@ -24,6 +24,7 @@ #import "StatsWindowController.h" #import "Controller.h" +#import "NSApplicationAdditions.h" #import "NSStringAdditions.h" #define UPDATE_SECONDS 1.0 @@ -66,7 +67,8 @@ tr_session * fLib = NULL; [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode]; [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode]; - [[self window] setRestorationClass: [self class]]; + if ([NSApp isOnLionOrBetter]) + [[self window] setRestorationClass: [self class]]; [[self window] setTitle: NSLocalizedString(@"Statistics", "Stats window -> title")];