diff options
author | dynaflash <[email protected]> | 2009-01-27 17:47:35 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2009-01-27 17:47:35 +0000 |
commit | 22ad6f6931e51738146c0e01b169d0c65bee312d (patch) | |
tree | 73b1ccccecb1fa25e04b442ad13be3d17ef41991 /macosx | |
parent | 37d64db75be1ed276961e1adfa9dca39bb645b43 (diff) |
MacGui: remember window postion and open/close state of the Picture Filter and Picture sizing inspectors and restore them at the next launch.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2101 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 31 | ||||
-rw-r--r-- | macosx/English.lproj/PictureFilters.xib | 20 | ||||
-rw-r--r-- | macosx/English.lproj/PictureSettings.xib | 10 | ||||
-rw-r--r-- | macosx/HBFilterController.mm | 11 | ||||
-rw-r--r-- | macosx/HBPreviewController.mm | 16 | ||||
-rw-r--r-- | macosx/PictureController.mm | 7 |
6 files changed, 62 insertions, 33 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index dfa73ed4b..116cf457c 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1539,18 +1539,25 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It SuccessfulScan = YES; [self enableUI: YES]; - /* if its the initial successful scan after awakeFromNib */ - if (currentSuccessfulScanCount == 1) - { - [self selectDefaultPreset:nil]; - /* initially set deinterlace to 0, will be overridden reset by the default preset anyway */ - //[fPictureController setDeinterlace:0]; - - /* lets set Denoise to index 0 or "None" since this is the first scan */ - //[fPictureController setDenoise:0]; - - [fPictureFilterController setInitialPictureFilters]; - } + /* if its the initial successful scan after awakeFromNib */ + if (currentSuccessfulScanCount == 1) + { + [self selectDefaultPreset:nil]; + + [fPictureFilterController setInitialPictureFilters]; + + // Open preview window now if it was visible when HB was closed + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"PreviewWindowIsOpen"]) + [self showPreviewWindow:nil]; + + // Open picture sizing window now if it was visible when HB was closed + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"PictureSizeWindowIsOpen"]) + [self showPicturePanel:nil]; + + // Open filters window now if it was visible when HB was closed + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"PictureFiltersWindowIsOpen"]) + [self showFiltersPanel:nil]; + } } diff --git a/macosx/English.lproj/PictureFilters.xib b/macosx/English.lproj/PictureFilters.xib index 1e961a16e..20e831ce4 100644 --- a/macosx/English.lproj/PictureFilters.xib +++ b/macosx/English.lproj/PictureFilters.xib @@ -28,7 +28,7 @@ <object class="NSWindowTemplate" id="616825745"> <int key="NSWindowStyleMask">8215</int> <int key="NSWindowBacking">2</int> - <string key="NSWindowRect">{{1211, 475}, {345, 400}}</string> + <string key="NSWindowRect">{{1211, 502}, {266, 373}}</string> <int key="NSWTFlags">1886913536</int> <string key="NSWindowTitle">Picture Filters</string> <string key="NSWindowClass">NSPanel</string> @@ -39,7 +39,7 @@ <string key="NSWindowContentMinSize">{230, 250}</string> <object class="NSView" key="NSWindowView" id="49161063"> <reference key="NSNextResponder"/> - <int key="NSvFlags">256</int> + <int key="NSvFlags">274</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSBox" id="309105014"> @@ -458,7 +458,7 @@ <reference key="NSSuperview" ref="309105014"/> </object> </object> - <string key="NSFrame">{{62, 48}, {232, 303}}</string> + <string key="NSFrame">{{17, 22}, {232, 303}}</string> <reference key="NSSuperview" ref="49161063"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> @@ -489,7 +489,7 @@ <object class="NSButton" id="892118626"> <reference key="NSNextResponder" ref="49161063"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{119, 372}, {57, 16}}</string> + <string key="NSFrame">{{19, 345}, {57, 16}}</string> <reference key="NSSuperview" ref="49161063"/> <bool key="NSViewIsLayerTreeHost">YES</bool> <object class="NSArray" key="NSViewContentFilters"> @@ -523,7 +523,7 @@ <object class="NSButton" id="565292660"> <reference key="NSNextResponder" ref="49161063"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{229, 372}, {88, 16}}</string> + <string key="NSFrame">{{159, 345}, {88, 16}}</string> <reference key="NSSuperview" ref="49161063"/> <bool key="NSViewIsLayerTreeHost">YES</bool> <object class="NSArray" key="NSViewContentFilters"> @@ -535,7 +535,7 @@ <float key="blue">7.019608e-01</float> <float key="alpha">1.000000e+00</float> </object> - <real value="1.000000e+00" key="CI_inputIntensity"/> + <reference key="CI_inputIntensity" ref="559925184"/> <bool key="CIEnabled">YES</bool> </object> </object> @@ -555,7 +555,7 @@ </object> </object> </object> - <string key="NSFrameSize">{345, 400}</string> + <string key="NSFrameSize">{266, 373}</string> <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> @@ -755,9 +755,9 @@ <reference key="object" ref="49161063"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="892118626"/> <reference ref="309105014"/> <reference ref="565292660"/> - <reference ref="892118626"/> </object> <reference key="parent" ref="616825745"/> </object> @@ -1150,10 +1150,10 @@ <reference ref="559925184"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="559925184"/> - <string>{{654, 453}, {345, 400}}</string> + <string>{{654, 483}, {266, 373}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="559925184"/> - <string>{{654, 453}, {345, 400}}</string> + <string>{{654, 483}, {266, 373}}</string> <reference ref="559925184"/> <string>{{221, 276}, {533, 580}}</string> <reference ref="8"/> diff --git a/macosx/English.lproj/PictureSettings.xib b/macosx/English.lproj/PictureSettings.xib index 1d0ecf334..34e8c0011 100644 --- a/macosx/English.lproj/PictureSettings.xib +++ b/macosx/English.lproj/PictureSettings.xib @@ -873,7 +873,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA</bytes> <object class="NSButton" id="892118626"> <reference key="NSNextResponder" ref="49161063"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{156, 490}, {57, 16}}</string> + <string key="NSFrame">{{19, 491}, {57, 16}}</string> <reference key="NSSuperview" ref="49161063"/> <bool key="NSViewIsLayerTreeHost">YES</bool> <object class="NSArray" key="NSViewContentFilters"> @@ -907,7 +907,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA</bytes> <object class="NSButton" id="91459209"> <reference key="NSNextResponder" ref="49161063"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{18, 490}, {84, 16}}</string> + <string key="NSFrame">{{118, 491}, {84, 16}}</string> <reference key="NSSuperview" ref="49161063"/> <bool key="NSViewIsLayerTreeHost">YES</bool> <object class="NSArray" key="NSViewContentFilters"> @@ -919,7 +919,7 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA</bytes> <float key="blue">7.019608e-01</float> <float key="alpha">1.000000e+00</float> </object> - <real value="1.000000e+00" key="CI_inputIntensity"/> + <reference key="CI_inputIntensity" ref="559925184"/> <bool key="CIEnabled">YES</bool> </object> </object> @@ -1846,10 +1846,10 @@ AAB0ZXh0AAAAAENvcHlyaWdodCBBcHBsZSBDb21wdXRlciwgSW5jLiwgMjAwNQAAAAA</bytes> <reference ref="559925184"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="559925184"/> - <string>{{563, 338}, {229, 518}}</string> + <string>{{423, 339}, {229, 518}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="559925184"/> - <string>{{563, 338}, {229, 518}}</string> + <string>{{423, 339}, {229, 518}}</string> <reference ref="559925184"/> <string>{{221, 276}, {533, 580}}</string> <reference ref="8"/> diff --git a/macosx/HBFilterController.mm b/macosx/HBFilterController.mm index c5ec6836f..29759de64 100644 --- a/macosx/HBFilterController.mm +++ b/macosx/HBFilterController.mm @@ -45,6 +45,7 @@ else { [self showWindow:sender]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PictureFiltersWindowIsOpen"]; if ([fPreviewController fullScreen] == YES) { [self setToFullScreenMode]; @@ -83,21 +84,27 @@ - (void)setHBController: (HBController *)controller { + fHBController = controller; - //[fPreviewController setHBController: controller]; } - (void)awakeFromNib { [fFilterWindow setDelegate:self]; + + if( ![[self window] setFrameUsingName:@"PictureFilters"] ) + [[self window] center]; + [self setWindowFrameAutosaveName:@"PictureFilters"]; + [[self window] setExcludedFromWindowsMenu:YES]; + [self setInitialPictureFilters]; } - (void)windowWillClose:(NSNotification *)aNotification { - +[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"PictureFiltersWindowIsOpen"]; } - (BOOL)windowShouldClose:(id)fPictureWindow diff --git a/macosx/HBPreviewController.mm b/macosx/HBPreviewController.mm index 8d78b945b..a74282c50 100644 --- a/macosx/HBPreviewController.mm +++ b/macosx/HBPreviewController.mm @@ -49,6 +49,8 @@ - (IBAction) showPreviewWindow: (id)sender { [self showWindow:sender]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PreviewWindowIsOpen"]; + /* lets set the preview window to accept mouse moved events */ [fPreviewWindow setAcceptsMouseMovedEvents:YES]; hudTimerSeconds = 0; @@ -64,6 +66,11 @@ - (void)awakeFromNib { [fPreviewWindow setDelegate:self]; + if( ![[self window] setFrameUsingName:@"Preview"] ) + [[self window] center]; + [self setWindowFrameAutosaveName:@"Preview"]; + [[self window] setExcludedFromWindowsMenu:YES]; + /* lets set the preview window to accept mouse moved events */ [fPreviewWindow setAcceptsMouseMovedEvents:YES]; //[self pictureSliderChanged:nil]; @@ -118,6 +125,7 @@ return YES; isFullScreen = NO; hudTimerSeconds = 0; + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"PreviewWindowIsOpen"]; } - (BOOL)windowShouldClose:(id)fPictureWindow @@ -187,10 +195,10 @@ return YES; - (void) SetTitle: (hb_title_t *) title { hb_job_t * job = title->job; - + fTitle = title; -fPicture = 0; -MaxOutputWidth = title->width - job->crop[2] - job->crop[3]; + fPicture = 0; + MaxOutputWidth = title->width - job->crop[2] - job->crop[3]; MaxOutputHeight = title->height - job->crop[0] - job->crop[1]; [self SettingsChanged: nil]; } @@ -329,11 +337,13 @@ MaxOutputWidth = title->width - job->crop[2] - job->crop[3]; else { [self showWindow:sender]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PreviewWindowIsOpen"]; [fPreviewWindow setAcceptsMouseMovedEvents:YES]; isFullScreen = NO; scaleToScreen = NO; hudTimerSeconds = 0; [self startHudTimer]; + } } diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm index 1ffb3ae48..4965f76f8 100644 --- a/macosx/PictureController.mm +++ b/macosx/PictureController.mm @@ -44,6 +44,7 @@ else { [self showWindow:sender]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PictureSizeWindowIsOpen"]; if ([fPreviewController fullScreen] == YES) { [self setToFullScreenMode]; @@ -92,12 +93,16 @@ - (void)awakeFromNib { [fPictureWindow setDelegate:self]; + if( ![[self window] setFrameUsingName:@"PictureSizing"] ) + [[self window] center]; + [self setWindowFrameAutosaveName:@"PictureSizing"]; + [[self window] setExcludedFromWindowsMenu:YES]; } - (void)windowWillClose:(NSNotification *)aNotification { - +[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"PictureSizeWindowIsOpen"]; } - (BOOL)windowShouldClose:(id)fPictureWindow |