]> granicus.if.org Git - handbrake/commitdiff
MacGui: make sure to strip off any source file extensions from the output file name.
authordynaflash <dynaflashtech@gmail.com>
Fri, 25 Apr 2008 14:26:23 +0000 (14:26 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Fri, 25 Apr 2008 14:26:23 +0000 (14:26 +0000)
- Fixes an issue where a .mpg file would come out as "mymovie.mpg.mp4" in the destination field.
- Also cleans up some formatting in my previous commit.

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

macosx/Controller.mm

index f953f9c004756c85bb1e396d2a4104c6902968fb..9c1f31192837ae4b5e4bea50791ce3f6de61293b 100644 (file)
@@ -1158,6 +1158,7 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
                 {
                     [self writeToActivityLog:"trying to open video_ts folder (parent directory chosen)"];
                     /* if not the VIDEO_TS Folder, we can assume the chosen folder is the source name */
+                    /* make sure we remove any path extension as this can also be an '.mpg' file */
                     browsedSourceDisplayName = [[NSString stringWithFormat:@"%@",[path lastPathComponent]] retain];
                 }
                 [self performScan:path scanTitleNum:0];
@@ -1337,15 +1338,15 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
                        /* Use the dvd name in the default output field here 
                                May want to add code to remove blank spaces for some dvd names*/
                        /* Check to see if the last destination has been set,use if so, if not, use Desktop */
-                       if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"])
+            if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"])
                        {
                                [fDstFile2Field setStringValue: [NSString stringWithFormat:
-                                       @"%@/%@.mp4", [[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"],browsedSourceDisplayName]];
+                                       @"%@/%@.mp4", [[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"],[browsedSourceDisplayName stringByDeletingPathExtension]]];
                        }
                        else
                        {
                                [fDstFile2Field setStringValue: [NSString stringWithFormat:
-                                       @"%@/Desktop/%@.mp4", NSHomeDirectory(),browsedSourceDisplayName]];
+                                       @"%@/Desktop/%@.mp4", NSHomeDirectory(),[browsedSourceDisplayName stringByDeletingPathExtension]]];
                        }
                        
                        if (longuestpri < title->hours*60*60 + title->minutes *60 + title->seconds)
@@ -2881,10 +2882,10 @@ the user is using "Custom" settings by determining the sender*/
     }
     else if ([[fAudTrack1MixPopUp selectedItem] tag] == HB_ACODEC_AC3)
     {
-    [fAudTrack1RatePopUp setEnabled: NO];
-    [fAudTrack1BitratePopUp setEnabled: NO];
-    [fAudTrack1DrcSlider setEnabled: NO];
-    [fAudTrack1DrcField setEnabled: NO];
+        [fAudTrack1RatePopUp setEnabled: NO];
+        [fAudTrack1BitratePopUp setEnabled: NO];
+        [fAudTrack1DrcSlider setEnabled: NO];
+        [fAudTrack1DrcField setEnabled: NO];
     }
     
     /* enable/disable the mixdown text and popupbutton for audio track 2 */
@@ -2905,10 +2906,10 @@ the user is using "Custom" settings by determining the sender*/
     }
     else if ([[fAudTrack2MixPopUp selectedItem] tag] == HB_ACODEC_AC3)
     {
-    [fAudTrack2RatePopUp setEnabled: NO];
-    [fAudTrack2BitratePopUp setEnabled: NO];
-    [fAudTrack2DrcSlider setEnabled: NO];
-    [fAudTrack2DrcField setEnabled: NO];
+        [fAudTrack2RatePopUp setEnabled: NO];
+        [fAudTrack2BitratePopUp setEnabled: NO];
+        [fAudTrack2DrcSlider setEnabled: NO];
+        [fAudTrack2DrcField setEnabled: NO];
     }
     
     /* enable/disable the mixdown text and popupbutton for audio track 3 */
@@ -2929,10 +2930,10 @@ the user is using "Custom" settings by determining the sender*/
     }
     else if ([[fAudTrack3MixPopUp selectedItem] tag] == HB_ACODEC_AC3)
     {
-    [fAudTrack3RatePopUp setEnabled: NO];
-    [fAudTrack3BitratePopUp setEnabled: NO];
-    [fAudTrack3DrcSlider setEnabled: NO];
-    [fAudTrack3DrcField setEnabled: NO];
+        [fAudTrack3RatePopUp setEnabled: NO];
+        [fAudTrack3BitratePopUp setEnabled: NO];
+        [fAudTrack3DrcSlider setEnabled: NO];
+        [fAudTrack3DrcField setEnabled: NO];
     }
     
     /* enable/disable the mixdown text and popupbutton for audio track 4 */
@@ -2953,10 +2954,10 @@ the user is using "Custom" settings by determining the sender*/
     }
     else if ([[fAudTrack4MixPopUp selectedItem] tag] == HB_ACODEC_AC3)
     {
-    [fAudTrack4RatePopUp setEnabled: NO];
-    [fAudTrack4BitratePopUp setEnabled: NO];
-    [fAudTrack4DrcSlider setEnabled: NO];
-    [fAudTrack4DrcField setEnabled: NO];
+        [fAudTrack4RatePopUp setEnabled: NO];
+        [fAudTrack4BitratePopUp setEnabled: NO];
+        [fAudTrack4DrcSlider setEnabled: NO];
+        [fAudTrack4DrcField setEnabled: NO];
     }
     
 }