]> granicus.if.org Git - transmission/commitdiff
#4920 On Lion, use window restoration on the message log and stats window
authorMitchell Livingston <livings124@transmissionbt.com>
Sun, 27 May 2012 22:31:58 +0000 (22:31 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Sun, 27 May 2012 22:31:58 +0000 (22:31 +0000)
Transmission.xcodeproj/project.pbxproj
macosx/Controller.h
macosx/Controller.m
macosx/MessageWindow.xib
macosx/MessageWindowController.m
macosx/PrefsController.m
macosx/StatsWindow.xib
macosx/StatsWindowController.h
macosx/StatsWindowController.m

index 524276141e5c325db18cfa31242be8df42319bbd..a97cb81dedbfb503ab6500eed71822644a6a091e 100644 (file)
                        buildSettings = {
                                FRAMEWORK_SEARCH_PATHS = macosx;
                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
-                               INFOPLIST_FILE = macosx/Info.plist;
                                LIBRARY_SEARCH_PATHS = (
                                        "$(inherited)",
                                        "\"$(SRCROOT)/third-party/curl/lib\"",
                        buildSettings = {
                                FRAMEWORK_SEARCH_PATHS = macosx;
                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
-                               INFOPLIST_FILE = macosx/Info.plist;
                                LIBRARY_SEARCH_PATHS = (
                                        "$(inherited)",
                                        "\"$(SRCROOT)/third-party/curl/lib\"",
                        buildSettings = {
                                FRAMEWORK_SEARCH_PATHS = macosx;
                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
-                               INFOPLIST_FILE = macosx/Info.plist;
                                LIBRARY_SEARCH_PATHS = (
                                        "$(inherited)",
                                        "\"$(SRCROOT)/third-party/curl/lib\"",
index 48f4c86715e47991839348e84b4d95fc19d153ff..198228d637b62adb9ce3a4f3bb07699081f0445b 100644 (file)
@@ -57,7 +57,6 @@ typedef enum
     
     PrefsController                 * fPrefsController;
     InfoWindowController            * fInfoController;
-    MessageWindowController         * fMessageController;
     
     NSUserDefaults                  * fDefaults;
     
@@ -135,6 +134,8 @@ typedef enum
 
 - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo;
 
+- (tr_session *) sessionHandle;
+
 - (void) createFile: (id) sender;
 
 - (void) resumeSelectedTorrents:    (id) sender;
@@ -181,6 +182,7 @@ typedef enum
 - (void) resetInfo;
 - (void) setInfoTab: (id) sender;
 
+@property (retain, readonly) MessageWindowController * messageWindowController;
 - (void) showMessageWindow: (id) sender;
 - (void) showStatsWindow: (id) sender;
 
index 1636b46ead7e1a5ea6a6d0c3af0cab3f02ae6b00..25e0202f5fbf7689c0c7b03ce4b0b72ee7b489b9 100644 (file)
@@ -157,6 +157,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
 
 @implementation Controller
 
+@synthesize messageWindowController = fMessageController;
+
 + (void) initialize
 {
     //make sure another Transmission.app isn't running already
@@ -732,6 +734,11 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
     tr_sessionClose(fLib);
 }
 
+- (tr_session *) sessionHandle
+{
+    return fLib;
+}
+
 - (void) handleOpenContentsEvent: (NSAppleEventDescriptor *) event replyEvent: (NSAppleEventDescriptor *) replyEvent
 {
     NSString * urlString = nil;
@@ -1744,16 +1751,22 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
         [fInfoController setPreviousTab];
 }
 
-- (void) showMessageWindow: (id) sender
+- (MessageWindowController *) messageWindowController
 {
     if (!fMessageController)
         fMessageController = [[MessageWindowController alloc] init];
-    [fMessageController showWindow: nil];
+    
+    return fMessageController;
+}
+
+- (void) showMessageWindow: (id) sender
+{
+    [[self messageWindowController] showWindow: nil];
 }
 
 - (void) showStatsWindow: (id) sender
 {
-    [[StatsWindowController statsWindow: fLib] showWindow: nil];
+    [[StatsWindowController statsWindow] showWindow: nil];
 }
 
 - (void) updateUI
index 9c8e7e6dabe5514453d1154cc74677de19b05b78..8c05e7d8efbb194d529b42d80d2dc1cb3256b43f 100644 (file)
@@ -2,13 +2,13 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
        <data>
                <int key="IBDocument.SystemTarget">1060</int>
-               <string key="IBDocument.SystemVersion">11B26</string>
-               <string key="IBDocument.InterfaceBuilderVersion">1617</string>
-               <string key="IBDocument.AppKitVersion">1138</string>
-               <string key="IBDocument.HIToolboxVersion">566.00</string>
+               <string key="IBDocument.SystemVersion">11E53</string>
+               <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+               <string key="IBDocument.AppKitVersion">1138.47</string>
+               <string key="IBDocument.HIToolboxVersion">569.00</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                       <string key="NS.object.0">1617</string>
+                       <string key="NS.object.0">2182</string>
                </object>
                <array key="IBDocument.IntegratedClassDependencies">
                        <string>NSPopUpButton</string>
                <array key="IBDocument.PluginDependencies">
                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                </array>
-               <dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
+               <object class="NSMutableDictionary" key="IBDocument.Metadata">
+                       <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+                       <integer value="1" key="NS.object.0"/>
+               </object>
                <array class="NSMutableArray" key="IBDocument.RootObjects" id="667254319">
                        <object class="NSCustomObject" id="135867518">
                                <string key="NSClassName">MessageWindowController</string>
@@ -58,7 +61,7 @@
                                <nil key="NSUserInterfaceItemIdentifier"/>
                                <string key="NSWindowContentMinSize">{550, 200}</string>
                                <object class="NSView" key="NSWindowView" id="459370864">
-                                       <nil key="NSNextResponder"/>
+                                       <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                        <array class="NSMutableArray" key="NSSubviews">
                                                <object class="NSButton" id="324840191">
@@ -66,6 +69,8 @@
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{509, 5}, {82, 25}}</string>
                                                        <reference key="NSSuperview" ref="459370864"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSButtonCell" key="NSCell" id="56180972">
                                                                <int key="NSCellFlags">67239424</int>
                                                        <int key="NSvFlags">292</int>
                                                        <string key="NSFrame">{{20, 5}, {101, 25}}</string>
                                                        <reference key="NSSuperview" ref="459370864"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="945411764"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSPopUpButtonCell" key="NSCell" id="462670475">
                                                        <int key="NSvFlags">292</int>
                                                        <string key="NSFrame">{{129, 5}, {82, 25}}</string>
                                                        <reference key="NSSuperview" ref="459370864"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="619449639"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSButtonCell" key="NSCell" id="45431789">
                                                                                        <int key="NSvFlags">4370</int>
                                                                                        <string key="NSFrameSize">{611, 276}</string>
                                                                                        <reference key="NSSuperview" ref="417557193"/>
-                                                                                       <reference key="NSNextKeyView" ref="998736021"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="546510574"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSTableHeaderView" key="NSHeaderView" id="956628727">
                                                                                                <reference key="NSNextResponder" ref="449180771"/>
                                                                                                <int key="NSvFlags">256</int>
                                                                                                <string key="NSFrameSize">{611, 17}</string>
                                                                                                <reference key="NSSuperview" ref="449180771"/>
+                                                                                               <reference key="NSWindow"/>
                                                                                                <reference key="NSNextKeyView" ref="417557193"/>
                                                                                                <reference key="NSTableView" ref="422137489"/>
                                                                                        </object>
@@ -291,60 +300,61 @@ DiBgDFgGgWBIFg+B4BnyGhSj4HZDhSD4IAmbxuHOeJxm8dp0m6dZ6HGbZ1Hsb5qnGe5pnCeB8HScx5wS
 f6BG6jgMATCAfhMBwtGqc58GRpp9G6f2RnsldRvAACYoEeSBzogR+oGfyAgADwEAAAMAAAABAA4AAAEB
 AA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AAAAAAAQABAAAAAAAAAAEAAAAB
+AAAAAAAAAAEAAAABAAAAAAAAAAEAAG5kaW4AAAAAAAAANgAAp0AAAFWAAABMwAAAnsAAACWAAAAMwAAA
+UAAAAFRAAAIzMwACMzMAAjMzAAAAAAAAAABzZjMyAAAAAAABDHIAAAX4///zHQAAB7oAAP1y///7nf//
+/aQAAAPZAADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                                                                                                                                </object>
                                                                                                                                                <string key="NSCacheWindowColorSpace">NSCalibratedRGBColorSpace</string>
                                                                                                                                                <int key="NSCacheWindowBPS">8</int>
@@ -530,6 +540,7 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                                        </array>
                                                                        <string key="NSFrame">{{1, 17}, {611, 276}}</string>
                                                                        <reference key="NSSuperview" ref="104571253"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="422137489"/>
                                                                        <reference key="NSDocView" ref="422137489"/>
                                                                        <reference key="NSBGColor" ref="211157132"/>
@@ -540,6 +551,7 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                                        <int key="NSvFlags">256</int>
                                                                        <string key="NSFrame">{{597, 17}, {15, 276}}</string>
                                                                        <reference key="NSSuperview" ref="104571253"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="539084345"/>
                                                                        <reference key="NSTarget" ref="104571253"/>
                                                                        <string key="NSAction">_doScroller:</string>
@@ -550,6 +562,7 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                                        <int key="NSvFlags">-2147483392</int>
                                                                        <string key="NSFrame">{{-100, -100}, {596, 15}}</string>
                                                                        <reference key="NSSuperview" ref="104571253"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="449180771"/>
                                                                        <int key="NSsFlags">1</int>
                                                                        <reference key="NSTarget" ref="104571253"/>
@@ -564,6 +577,7 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                                        </array>
                                                                        <string key="NSFrame">{{1, 0}, {611, 17}}</string>
                                                                        <reference key="NSSuperview" ref="104571253"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="956628727"/>
                                                                        <reference key="NSDocView" ref="956628727"/>
                                                                        <reference key="NSBGColor" ref="211157132"/>
@@ -572,7 +586,8 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                        </array>
                                                        <string key="NSFrame">{{-1, 35}, {613, 294}}</string>
                                                        <reference key="NSSuperview" ref="459370864"/>
-                                                       <reference key="NSNextKeyView" ref="417557193"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView" ref="998736021"/>
                                                        <int key="NSsFlags">133138</int>
                                                        <reference key="NSVScroller" ref="546510574"/>
                                                        <reference key="NSHScroller" ref="998736021"/>
@@ -585,6 +600,7 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{351, 7}, {150, 22}}</string>
                                                        <reference key="NSSuperview" ref="459370864"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="324840191"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSSearchFieldCell" key="NSCell" id="788421673">
@@ -640,12 +656,14 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                                </object>
                                        </array>
                                        <string key="NSFrameSize">{611, 328}</string>
+                                       <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="104571253"/>
                                </object>
-                               <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+                               <string key="NSScreenRect">{{0, 0}, {2560, 1440}}</string>
                                <string key="NSMinSize">{550, 222}</string>
                                <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
-                               <bool key="NSWindowIsRestorable">NO</bool>
+                               <bool key="NSWindowIsRestorable">YES</bool>
                        </object>
                </array>
                <object class="IBObjectContainer" key="IBDocument.Objects">
@@ -690,22 +708,6 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                        </object>
                                        <int key="connectionID">25</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">dataSource</string>
-                                               <reference key="source" ref="422137489"/>
-                                               <reference key="destination" ref="135867518"/>
-                                       </object>
-                                       <int key="connectionID">38</int>
-                               </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="422137489"/>
-                                               <reference key="destination" ref="135867518"/>
-                                       </object>
-                                       <int key="connectionID">40</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">fMessageTable</string>
@@ -714,14 +716,6 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                        </object>
                                        <int key="connectionID">42</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="905673783"/>
-                                               <reference key="destination" ref="135867518"/>
-                                       </object>
-                                       <int key="connectionID">67</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">fSaveButton</string>
@@ -754,6 +748,30 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                        </object>
                                        <int key="connectionID">75</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="905673783"/>
+                                               <reference key="destination" ref="135867518"/>
+                                       </object>
+                                       <int key="connectionID">67</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">dataSource</string>
+                                               <reference key="source" ref="422137489"/>
+                                               <reference key="destination" ref="135867518"/>
+                                       </object>
+                                       <int key="connectionID">38</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="422137489"/>
+                                               <reference key="destination" ref="135867518"/>
+                                       </object>
+                                       <int key="connectionID">40</int>
+                               </object>
                        </array>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <array key="orderedObjects">
@@ -1001,6 +1019,7 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                                <string key="39.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="5.IBWindowTemplateEditedContentRect">{{215, 593}, {611, 328}}</string>
+                               <string key="5.userInterfaceItemIdentifier">MessageWindow</string>
                                <string key="55.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="59.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1076,13 +1095,13 @@ AAAAAAAAAAAAAAAAAAA</bytes>
                </object>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
-                       <integer value="1060" key="NS.object.0"/>
+                       <real value="1070" key="NS.object.0"/>
                </object>
                <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
                <int key="IBDocument.defaultPropertyAccessControl">3</int>
                <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-                       <string key="NSMenuCheckmark">{9, 8}</string>
-                       <string key="NSMenuMixedState">{7, 2}</string>
+                       <string key="NSMenuCheckmark">{11, 11}</string>
+                       <string key="NSMenuMixedState">{10, 3}</string>
                        <string key="PurpleDot">{16, 16}</string>
                        <string key="RedDot">{16, 16}</string>
                        <string key="YellowDot">{16, 16}</string>
index cefa0945d162f08f9f9c5a6317af1e6bcf294a49..a2570fdba069ebf46904ff78915a66f6b3c36cf3 100644 (file)
@@ -23,6 +23,7 @@
  *****************************************************************************/
 
 #import "MessageWindowController.h"
+#import "Controller.h"
 #import "NSApplicationAdditions.h"
 #import "NSMutableArrayAdditions.h"
 #import "NSStringAdditions.h"
@@ -57,6 +58,8 @@
     [window setFrameAutosaveName: @"MessageWindowFrame"];
     [window setFrameUsingName: @"MessageWindowFrame"];
     
+    [window setRestorationClass: [self class]];
+    
     [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resizeColumn)
         name: @"NSTableViewColumnDidResizeNotification" object: fMessageTable];
     
 {
     if (!fTimer)
     {
-        fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self
-                    selector: @selector(updateLog:) userInfo: nil repeats: YES];
+        fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self selector: @selector(updateLog:) userInfo: nil repeats: YES];
         [self updateLog: nil];
     }
 }
     fTimer = nil;
 }
 
++ (void) restoreWindowWithIdentifier: (NSString *) identifier state: (NSCoder *) state completionHandler: (void (^)(NSWindow *, NSError *)) completionHandler
+{
+    NSAssert1([identifier isEqualToString: @"MessageWindow"], @"Trying to restore unexpected identifier %@", identifier);
+    
+    NSWindow * window = [[(Controller *)[NSApp delegate] messageWindowController] window];
+    completionHandler(window, nil);
+}
+
+- (void) window: (NSWindow *) window didDecodeRestorableState: (NSCoder *) coder
+{
+    [fTimer invalidate];
+    fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self selector: @selector(updateLog:) userInfo: nil repeats: YES];
+    [self updateLog: nil];
+}
+
 - (void) updateLog: (NSTimer *) timer
 {
     tr_msg_list * messages;
index a5489017508b342171b7caa872b3f3f828d8020e..b7f9026992e8b1caddf1e5ab45158fc88a46975b 100644 (file)
@@ -65,6 +65,7 @@
 
 @implementation PrefsController
 
+#warning just call method in Controller?
 tr_session * fHandle;
 + (void) setHandle: (tr_session *) handle
 {
index 86660b34eacb2e03354467128a3ae87200f67110..3d5478c8bcae82009b41a5d9e71e75c37c498854 100644 (file)
@@ -2,13 +2,13 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
        <data>
                <int key="IBDocument.SystemTarget">1060</int>
-               <string key="IBDocument.SystemVersion">11B26</string>
-               <string key="IBDocument.InterfaceBuilderVersion">1617</string>
-               <string key="IBDocument.AppKitVersion">1138</string>
-               <string key="IBDocument.HIToolboxVersion">566.00</string>
+               <string key="IBDocument.SystemVersion">11E53</string>
+               <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+               <string key="IBDocument.AppKitVersion">1138.47</string>
+               <string key="IBDocument.HIToolboxVersion">569.00</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                       <string key="NS.object.0">1617</string>
+                       <string key="NS.object.0">2182</string>
                </object>
                <array key="IBDocument.IntegratedClassDependencies">
                        <string>NSTextField</string>
                <array key="IBDocument.PluginDependencies">
                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                </array>
-               <dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
+               <object class="NSMutableDictionary" key="IBDocument.Metadata">
+                       <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+                       <integer value="1" key="NS.object.0"/>
+               </object>
                <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
                        <object class="NSCustomObject" id="1001">
                                <string key="NSClassName">StatsWindowController</string>
@@ -45,7 +48,7 @@
                                <string key="NSWindowContentMaxSize">{326, 191}</string>
                                <string key="NSWindowContentMinSize">{326, 191}</string>
                                <object class="NSView" key="NSWindowView" id="1006">
-                                       <nil key="NSNextResponder"/>
+                                       <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                        <array class="NSMutableArray" key="NSSubviews">
                                                <object class="NSTextField" id="848189093">
@@ -53,6 +56,7 @@
                                                        <int key="NSvFlags">268</int>
                                                        <string key="NSFrame">{{17, 157}, {94, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="703685169"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="629427970">
@@ -90,6 +94,7 @@
                                                        <int key="NSvFlags">268</int>
                                                        <string key="NSFrame">{{17, 125}, {94, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="253460222"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="312992390">
                                                        <int key="NSvFlags">268</int>
                                                        <string key="NSFrame">{{17, 93}, {94, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="536006120"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="420769084">
                                                        <int key="NSvFlags">268</int>
                                                        <string key="NSFrame">{{17, 61}, {94, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="941353735"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="696962666">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 157}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="431969193"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="151460568">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 125}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="550850235"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="614134720">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 93}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="892058372"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="61598779">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 61}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="1005247565"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="82355756">
                                                        <int key="NSvFlags">268</int>
                                                        <string key="NSFrame">{{17, 29}, {94, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="857281737"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="186010722">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 29}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="200761340"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="46835883">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 141}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="21891891"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="525326017">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 109}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="64479925"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="835967372">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 77}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="496824416"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="294338636">
                                                        <int key="NSvFlags">265</int>
                                                        <string key="NSFrame">{{113, 45}, {196, 14}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="586749298"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="29319324">
                                                        <int key="NSvFlags">289</int>
                                                        <string key="NSFrame">{{246, 3}, {65, 28}}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
+                                                       <reference key="NSWindow"/>
+                                                       <reference key="NSNextKeyView"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSButtonCell" key="NSCell" id="992392450">
                                                                <int key="NSCellFlags">67239424</int>
                                                </object>
                                        </array>
                                        <string key="NSFrameSize">{326, 191}</string>
+                                       <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="848189093"/>
                                </object>
-                               <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+                               <string key="NSScreenRect">{{0, 0}, {2560, 1440}}</string>
                                <string key="NSMinSize">{326, 213}</string>
                                <string key="NSMaxSize">{326, 213}</string>
                                <string key="NSFrameAutosaveName"/>
-                               <bool key="NSWindowIsRestorable">NO</bool>
+                               <bool key="NSWindowIsRestorable">YES</bool>
                        </object>
                </array>
                <object class="IBObjectContainer" key="IBDocument.Objects">
                                        </object>
                                        <int key="connectionID">29</int>
                                </object>
-                               <object class="IBConnectionRecord">
-                                       <object class="IBOutletConnection" key="connection">
-                                               <string key="label">delegate</string>
-                                               <reference key="source" ref="1005"/>
-                                               <reference key="destination" ref="1001"/>
-                                       </object>
-                                       <int key="connectionID">30</int>
-                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">fUploadedField</string>
                                        </object>
                                        <int key="connectionID">67</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="1005"/>
+                                               <reference key="destination" ref="1001"/>
+                                       </object>
+                                       <int key="connectionID">30</int>
+                               </object>
                        </array>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <array key="orderedObjects">
                                <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="1.IBWindowTemplateEditedContentRect">{{612, 485}, {284, 191}}</string>
                                <integer value="1" key="1.NSWindowTemplate.visibleAtLaunch"/>
+                               <boolean value="NO" key="1.showNotes"/>
+                               <string key="1.userInterfaceItemIdentifier">StatsWindow</string>
                                <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="13.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                </object>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
-                       <integer value="1060" key="NS.object.0"/>
+                       <real value="1070" key="NS.object.0"/>
                </object>
                <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
                <int key="IBDocument.defaultPropertyAccessControl">3</int>
index f18649c600d7aab4074457b8f93560cdd7764ace..daeb490831b9cc8eab62fbc487d79cdc2e52668b 100644 (file)
@@ -34,7 +34,7 @@
     NSTimer * fTimer;
 }
 
-+ (StatsWindowController *) statsWindow: (tr_session *) lib;
++ (StatsWindowController *) statsWindow;
 
 - (void) resetStats: (id) sender;
 
index c72c8162812a944381aa7437ad5c0c85fa135df7..a026df041623dc864f8ff78bb020aa17e7b0bbb7 100644 (file)
@@ -23,6 +23,7 @@
  *****************************************************************************/
 
 #import "StatsWindowController.h"
+#import "Controller.h"
 #import "NSStringAdditions.h"
 
 #define UPDATE_SECONDS 1.0
 @implementation StatsWindowController
 
 StatsWindowController * fStatsWindowInstance = nil;
-tr_session * fLib;
-+ (StatsWindowController *) statsWindow: (tr_session *) lib
+tr_session * fLib = NULL;
++ (StatsWindowController *) statsWindow
 {
     if (!fStatsWindowInstance)
     {
-        if ((fStatsWindowInstance = [[self alloc] initWithWindowNibName: @"StatsWindow"]))
+        if ((fStatsWindowInstance = [[self alloc] init]))
         {
-            fLib = lib;
+            fLib = [(Controller *)[NSApp delegate] sessionHandle];
         }
     }
     return fStatsWindowInstance;
 }
 
+- (id) init
+{
+    return [super initWithWindowNibName: @"StatsWindow"];
+}
+
 - (void) awakeFromNib
 {
     [self updateStats];
     
-    fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self
-                selector: @selector(updateStats) userInfo: nil repeats: YES];
+    fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self selector: @selector(updateStats) userInfo: nil repeats: YES];
     [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
     [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
     
+    [[self window] setRestorationClass: [self class]];
+    
     [[self window] setTitle: NSLocalizedString(@"Statistics", "Stats window -> title")];
     
     //set label text
@@ -68,8 +75,7 @@ tr_session * fLib;
     [fDownloadedLabelField setStringValue: [NSLocalizedString(@"Downloaded", "Stats window -> label") stringByAppendingString: @":"]];
     [fRatioLabelField setStringValue: [NSLocalizedString(@"Ratio", "Stats window -> label") stringByAppendingString: @":"]];
     [fTimeLabelField setStringValue: [NSLocalizedString(@"Running Time", "Stats window -> label") stringByAppendingString: @":"]];
-    [fNumOpenedLabelField setStringValue: [NSLocalizedString(@"Program Started", "Stats window -> label")
-                                            stringByAppendingString: @":"]];
+    [fNumOpenedLabelField setStringValue: [NSLocalizedString(@"Program Started", "Stats window -> label") stringByAppendingString: @":"]];
     
     //size all elements
     const CGFloat oldWidth = [fUploadedLabelField frame].size.width;
@@ -130,6 +136,13 @@ tr_session * fLib;
     fStatsWindowInstance = nil;
 }
 
++ (void) restoreWindowWithIdentifier: (NSString *) identifier state: (NSCoder *) state completionHandler: (void (^)(NSWindow *, NSError *)) completionHandler
+{
+    NSAssert1([identifier isEqualToString: @"StatsWindow"], @"Trying to restore unexpected identifier %@", identifier);
+    
+    completionHandler([[StatsWindowController statsWindow] window], nil);
+}
+
 - (void) resetStats: (id) sender
 {
     if (![[NSUserDefaults standardUserDefaults] boolForKey: @"WarningResetStats"])