]> granicus.if.org Git - handbrake/commitdiff
MacGui: Advanced Options tab
authordynaflash <dynaflashtech@gmail.com>
Tue, 8 May 2007 18:07:15 +0000 (18:07 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Tue, 8 May 2007 18:07:15 +0000 (18:07 +0000)
- fix bug where setting an option when the string field is empty caused a malformed value.

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

macosx/Controller.mm

index d17bcfbbc0160db7f9feafe64cea70e61e8e0542..f090f6106d3711bd57b771f2cd68bb3444ced2c3 100644 (file)
@@ -2206,8 +2206,16 @@ the user is using "Custom" settings by determining the sender*/
                }
                else // if none exists, add it to the string
                {
+                       if ([[fDisplayX264Options stringValue] isEqualToString: @""])
+                       {
+                       [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@=%@", 
+                               [NSString stringWithFormat:optNameToChange],[NSString stringWithFormat:@"%d",[sender indexOfSelectedItem]-1]]];
+                       }
+                       else
+                       {
                        [fDisplayX264Options setStringValue:[NSString stringWithFormat:@"%@:%@=%@",[NSString stringWithFormat:[fDisplayX264Options stringValue]], 
                                [NSString stringWithFormat:optNameToChange],[NSString stringWithFormat:@"%d",[sender indexOfSelectedItem]-1]]];
+                       }
                }
                /* We now need to reset the opt widgets since we changed some stuff */          
                [self X264AdvancedOptionsSet:NULL];