OSDN Git Service

MacGui: Fix issue where switching formats causes the video encoder drop down to reset...
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 16 Dec 2008 15:33:40 +0000 (15:33 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 16 Dec 2008 15:33:40 +0000 (15:33 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@2034 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm

index cf5ad30..2f28702 100644 (file)
@@ -3703,6 +3703,10 @@ fWorkingCount = 0;
     [fDstMp4iPodFileCheck setHidden: YES];
     
     /* Update the Video Codec PopUp */
+    /* lets get the tag of the currently selected item first so we might reset it later */
+    int selectedVidEncoderTag;
+    selectedVidEncoderTag = [[fVidEncoderPopUp selectedItem] tag];
+    
     /* Note: we now store the video encoder int values from common.c in the tags of each popup for easy retrieval later */
     [fVidEncoderPopUp removeAllItems];
     NSMenuItem *menuItem;
@@ -3765,7 +3769,15 @@ fWorkingCount = 0;
                        [fCreateChapterMarkers setState: NSOffState];
                        break;
     }
-    [fVidEncoderPopUp selectItemAtIndex: 0];
+    /* if we have a previously selected vid encoder tag, then try to select it */
+    if (selectedVidEncoderTag)
+    {
+        [fVidEncoderPopUp selectItemWithTag: selectedVidEncoderTag];
+    }
+    else
+    {
+        [fVidEncoderPopUp selectItemAtIndex: 0];
+    }
 
     [self audioAddAudioTrackCodecs: fAudTrack1CodecPopUp];
     [self audioAddAudioTrackCodecs: fAudTrack2CodecPopUp];