Mini window will now reopen on launch if it.

CQTexperiment
vspader 2009-02-22 11:56:28 -08:00
parent 8bdb68ae19
commit fcf886321f
7 changed files with 87 additions and 11 deletions

View File

@ -229,9 +229,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
- (void)awakeFromNib - (void)awakeFromNib
{ {
[mainWindow setExcludedFromWindowsMenu:YES];
[mainWindow setContentBorderThickness:24.0 forEdge:NSMinYEdge];
[[totalTimeField cell] setBackgroundStyle:NSBackgroundStyleRaised]; [[totalTimeField cell] setBackgroundStyle:NSBackgroundStyleRaised];
[[playbackButtons cell] setToolTip:NSLocalizedString(@"PlayButtonTooltip", @"") forSegment: 1]; [[playbackButtons cell] setToolTip:NSLocalizedString(@"PlayButtonTooltip", @"") forSegment: 1];

View File

@ -13,8 +13,9 @@
IBOutlet DualWindow *otherWindow; IBOutlet DualWindow *otherWindow;
} }
- (void)showWindow; - (void)show;
- (NSString *)hiddenDefaultsKey;
- (BOOL)isHidden; - (BOOL)isHidden;
- (void)setHidden:(BOOL)h; - (void)setHidden:(BOOL)h;

View File

@ -21,11 +21,19 @@
return self; return self;
} }
- (void)awakeFromNib
{
if (![self isHidden])
{
[self show];
}
}
- (NSString *)hiddenDefaultsKey - (NSString *)hiddenDefaultsKey
{ {
if ([self frameAutosaveName]) if ([self frameAutosaveName])
{ {
return [[self frameAutosaveName] stringByAppendingString:@" Window Content Height"]; return [[self frameAutosaveName] stringByAppendingString:@" Window Hidden"];
} }
return nil; return nil;
@ -43,11 +51,13 @@
- (void)toggleToolbarShown:(id)sender - (void)toggleToolbarShown:(id)sender
{ {
[otherWindow showWindow]; [otherWindow show];
} }
- (void)showWindow - (void)show
{ {
[self setHidden:NO];
[otherWindow setHidden:YES];
[otherWindow close]; [otherWindow close];
[self makeKeyAndOrderFront:self]; [self makeKeyAndOrderFront:self];
} }

16
Application/MainWindow.h Normal file
View File

@ -0,0 +1,16 @@
//
// MainWindow.h
// Cog
//
// Created by Vincent Spader on 2/22/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "DualWindow.h"
@interface MainWindow : DualWindow {
}
@end

38
Application/MainWindow.m Normal file
View File

@ -0,0 +1,38 @@
//
// MainWindow.m
// Cog
//
// Created by Vincent Spader on 2/22/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "MainWindow.h"
@implementation MainWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
if (self)
{
[self setExcludedFromWindowsMenu:YES];
[self setContentBorderThickness:24.0 forEdge:NSMinYEdge];
}
return self;
}
- (void)awakeFromNib
{
if ([self hiddenDefaultsKey]) {
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:[self hiddenDefaultsKey]]];
}
[super awakeFromNib];
}
@end

View File

@ -71,6 +71,7 @@
1791005F0CB44D6D0070BC5C /* Cog.scriptTerminology in Resources */ = {isa = PBXBuildFile; fileRef = 1791005D0CB44D6D0070BC5C /* Cog.scriptTerminology */; }; 1791005F0CB44D6D0070BC5C /* Cog.scriptTerminology in Resources */ = {isa = PBXBuildFile; fileRef = 1791005D0CB44D6D0070BC5C /* Cog.scriptTerminology */; };
1791FF900CB43A2C0070BC5C /* MediaKeysApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 1791FF8E0CB43A2C0070BC5C /* MediaKeysApplication.m */; }; 1791FF900CB43A2C0070BC5C /* MediaKeysApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 1791FF8E0CB43A2C0070BC5C /* MediaKeysApplication.m */; };
179571590F51DF4100E4168D /* MiniWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 179571580F51DF4100E4168D /* MiniWindow.m */; }; 179571590F51DF4100E4168D /* MiniWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 179571580F51DF4100E4168D /* MiniWindow.m */; };
179571730F51E21400E4168D /* MainWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 179571720F51E21400E4168D /* MainWindow.m */; };
179790E10C087AB7001D6996 /* OpenURLPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 179790DF0C087AB7001D6996 /* OpenURLPanel.m */; }; 179790E10C087AB7001D6996 /* OpenURLPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 179790DF0C087AB7001D6996 /* OpenURLPanel.m */; };
179D02EE0E0CB0B00064A77A /* SideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 179D02EB0E0CB0B00064A77A /* SideView.m */; }; 179D02EE0E0CB0B00064A77A /* SideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 179D02EB0E0CB0B00064A77A /* SideView.m */; };
179D02EF0E0CB0B00064A77A /* SideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 179D02ED0E0CB0B00064A77A /* SideViewController.m */; }; 179D02EF0E0CB0B00064A77A /* SideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 179D02ED0E0CB0B00064A77A /* SideViewController.m */; };
@ -598,6 +599,8 @@
1791FF8E0CB43A2C0070BC5C /* MediaKeysApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MediaKeysApplication.m; sourceTree = "<group>"; }; 1791FF8E0CB43A2C0070BC5C /* MediaKeysApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MediaKeysApplication.m; sourceTree = "<group>"; };
179571570F51DF4100E4168D /* MiniWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MiniWindow.h; sourceTree = "<group>"; }; 179571570F51DF4100E4168D /* MiniWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MiniWindow.h; sourceTree = "<group>"; };
179571580F51DF4100E4168D /* MiniWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MiniWindow.m; sourceTree = "<group>"; }; 179571580F51DF4100E4168D /* MiniWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MiniWindow.m; sourceTree = "<group>"; };
179571710F51E21400E4168D /* MainWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainWindow.h; sourceTree = "<group>"; };
179571720F51E21400E4168D /* MainWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainWindow.m; sourceTree = "<group>"; };
179790DE0C087AB7001D6996 /* OpenURLPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OpenURLPanel.h; sourceTree = "<group>"; }; 179790DE0C087AB7001D6996 /* OpenURLPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OpenURLPanel.h; sourceTree = "<group>"; };
179790DF0C087AB7001D6996 /* OpenURLPanel.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OpenURLPanel.m; sourceTree = "<group>"; }; 179790DF0C087AB7001D6996 /* OpenURLPanel.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OpenURLPanel.m; sourceTree = "<group>"; };
179D02EA0E0CB0B00064A77A /* SideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SideView.h; path = SideView/SideView.h; sourceTree = "<group>"; }; 179D02EA0E0CB0B00064A77A /* SideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SideView.h; path = SideView/SideView.h; sourceTree = "<group>"; };
@ -835,6 +838,8 @@
17BBE5BB0CD95CFA00258F7A /* DualWindow.m */, 17BBE5BB0CD95CFA00258F7A /* DualWindow.m */,
179571570F51DF4100E4168D /* MiniWindow.h */, 179571570F51DF4100E4168D /* MiniWindow.h */,
179571580F51DF4100E4168D /* MiniWindow.m */, 179571580F51DF4100E4168D /* MiniWindow.m */,
179571710F51E21400E4168D /* MainWindow.h */,
179571720F51E21400E4168D /* MainWindow.m */,
); );
path = Application; path = Application;
sourceTree = "<group>"; sourceTree = "<group>";
@ -1826,6 +1831,7 @@
173A43B80F3FD3B200676A7B /* VolumeButton.m in Sources */, 173A43B80F3FD3B200676A7B /* VolumeButton.m in Sources */,
1752C6B00F3FE3CC00FC3235 /* VolumeSlider.m in Sources */, 1752C6B00F3FE3CC00FC3235 /* VolumeSlider.m in Sources */,
179571590F51DF4100E4168D /* MiniWindow.m in Sources */, 179571590F51DF4100E4168D /* MiniWindow.m in Sources */,
179571730F51E21400E4168D /* MainWindow.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -8,9 +8,9 @@
<string key="IBDocument.HIToolboxVersion">353.00</string> <string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2234"/>
<integer value="21"/> <integer value="21"/>
<integer value="29"/> <integer value="29"/>
<integer value="2234"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -42,7 +42,7 @@
<string key="NSWindowRect">{{1051, 196}, {691, 397}}</string> <string key="NSWindowRect">{{1051, 196}, {691, 397}}</string>
<int key="NSWTFlags">1618479104</int> <int key="NSWTFlags">1618479104</int>
<string key="NSWindowTitle">Cog</string> <string key="NSWindowTitle">Cog</string>
<string key="NSWindowClass">DualWindow</string> <string key="NSWindowClass">MainWindow</string>
<object class="NSToolbar" key="NSViewClass" id="420567122"> <object class="NSToolbar" key="NSViewClass" id="420567122">
<object class="NSMutableString" key="NSToolbarIdentifier"> <object class="NSMutableString" key="NSToolbarIdentifier">
<characters key="NS.bytes">B4998081-90DD-45DD-8243-0F7039C7DEA2</characters> <characters key="NS.bytes">B4998081-90DD-45DD-8243-0F7039C7DEA2</characters>
@ -9982,7 +9982,7 @@ OQA</bytes>
<string>{{218, 54}, {691, 397}}</string> <string>{{218, 54}, {691, 397}}</string>
<string>{{218, 54}, {691, 397}}</string> <string>{{218, 54}, {691, 397}}</string>
<reference ref="9"/> <reference ref="9"/>
<reference ref="9"/> <boolean value="NO" id="6"/>
<string>{{25, 14}, {683, 396}}</string> <string>{{25, 14}, {683, 396}}</string>
<reference ref="8"/> <reference ref="8"/>
<string>{3.40282e+38, 3.40282e+38}</string> <string>{3.40282e+38, 3.40282e+38}</string>
@ -10033,7 +10033,7 @@ OQA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{398, 631}, {481, 0}}</string> <string>{{398, 631}, {481, 0}}</string>
<string>{{398, 631}, {481, 0}}</string> <string>{{398, 631}, {481, 0}}</string>
<boolean value="NO" id="6"/> <reference ref="6"/>
<reference ref="6"/> <reference ref="6"/>
<string>{10000, 100000}</string> <string>{10000, 100000}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -10525,6 +10525,14 @@ OQA</bytes>
<string key="minorKey"/> <string key="minorKey"/>
</object> </object>
</object> </object>
<object class="IBPartialClassDescription">
<string key="className">MainWindow</string>
<string key="superclassName">DualWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Application/MainWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription"> <object class="IBPartialClassDescription">
<string key="className">MiniWindow</string> <string key="className">MiniWindow</string>
<string key="superclassName">DualWindow</string> <string key="superclassName">DualWindow</string>