diff options
author | dynaflash <[email protected]> | 2007-08-24 19:38:08 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-08-24 19:38:08 +0000 |
commit | 056b3e7f595b417c956b633ab20e79f6747aa70e (patch) | |
tree | 57e30194d58e50036ff97008701c67e30fc3b72a /macosx | |
parent | dddd220d43479ed9296a375b5b0e94848cd4096c (diff) |
MacGui: Fix main window closing to it doesnt crash HB and allow you to get it back. Also, closing main window now does NOT quit HandBrake.
- Courtesy of Ritsuka. Thanks Ritsuka!
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@864 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 741a0448a..4e281b388 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -111,7 +111,9 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) app { - if( [[fRipButton title] isEqualToString: _( @"Cancel" )] ) + hb_state_t s; + hb_get_state2( fHandle, &s ); + if ( s.state == HB_STATE_WORKING) { [self Cancel: NULL]; return NSTerminateCancel; @@ -1157,7 +1159,7 @@ list = hb_get_titles( fHandle ); /* See if we are currently running */ hb_state_t s; - hb_get_state( fHandle, &s ); + hb_get_state2( fHandle, &s ); if ( s.state == HB_STATE_WORKING) { /* If we are running, leave in memory when closing main window */ @@ -1167,9 +1169,13 @@ list = hb_get_titles( fHandle ); } else { - /* Stop the application when the user closes the window */ - [NSApp terminate: self]; - return YES; + /* If we are running, leave in memory when closing main window */ + [fWindow setReleasedWhenClosed: NO]; + return YES; + + /* Stop the application when the user closes the window */ + //[NSApp terminate: self]; + //return YES; } } |