]> granicus.if.org Git - handbrake/commitdiff
MacGui: Close Main Window issue fixed.
authordynaflash <dynaflashtech@gmail.com>
Tue, 19 Jun 2007 17:44:09 +0000 (17:44 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Tue, 19 Jun 2007 17:44:09 +0000 (17:44 +0000)
- Can now close the main HB window while HB is running and then re-open it with the "Main Window" selection in the "Window" toolbar menu without disturbing the current encode.

- Note: should probably add "Main Window" to the Dock Icon Context menu as well.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@626 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.mm
macosx/English.lproj/MainMenu.nib/classes.nib
macosx/English.lproj/MainMenu.nib/info.nib
macosx/English.lproj/MainMenu.nib/keyedobjects.nib

index 8fd68ac4299e8a7da126d992e8535fac6ea6eb8a..ee3b8b6de816f309f223bfa159b907c9821dd95a 100644 (file)
 
 - (IBAction) ShowPicturePanel: (id) sender;
 - (IBAction) CalculatePictureSizing: (id) sender;
-
+- (IBAction) OpenMainWindow: (id) sender;
 
 - (IBAction) AddToQueue: (id) sender;
 - (IBAction) ShowQueuePanel: (id) sender;
index e07f925d0ba36b027573bdac3618d8b0dc7ac8f9..954a84e2ba3f4dc9960027465b595118ee601be5 100644 (file)
@@ -719,11 +719,31 @@ return registrationDictionary;
     [fScanController Show];
 }
 
+- (IBAction) OpenMainWindow: (id) sender
+{
+[fWindow  makeKeyAndOrderFront:nil];
+[fWindow setReleasedWhenClosed: YES];
+}
 - (BOOL) windowShouldClose: (id) sender
 {
-    /* Stop the application when the user closes the window */
-    [NSApp terminate: self];
-    return YES;
+
+       /* See if we are currently running */
+       hb_state_t s;
+       hb_get_state( fHandle, &s );
+       if ( s.state ==  HB_STATE_WORKING)
+       {
+          /* If we are running, leave in memory when closing main window */
+          [fWindow setReleasedWhenClosed: NO];
+          return YES;
+
+       }
+       else
+       {
+               /* Stop the application when the user closes the window */
+               [NSApp terminate: self];
+               return YES;
+       }
+       
 }
 
 - (IBAction) VideoMatrixChanged: (id) sender;
index 72d4dc396ad06a090f6e17c84e574c1e1dae8b2e..ecc18c019d508781f87aaf47aa4d45edf415867e 100644 (file)
@@ -23,6 +23,7 @@
                 InsertPreset = id; 
                 OpenForums = id; 
                 OpenHomepage = id; 
+                OpenMainWindow = id; 
                 OpenUserGuide = id; 
                 Pause = id; 
                 QualitySliderChanged = id; 
index 0973bee1845b5d603c4a8e327508d904622b752d..b1714dc724547b81a88707f48b7ceef4c4a7a154 100644 (file)
@@ -20,7 +20,6 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>1162</integer>
-               <integer>21</integer>
                <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
index 9dcc7ae58d6c5458d51086b5f07416cae0b87731..cc8e15e18621dc9ece2746e2711198ab0110991e 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ