]> granicus.if.org Git - handbrake/commitdiff
Debug Language preference
authorprigaux <pri@nopapers.org>
Sat, 27 Jan 2007 18:40:34 +0000 (18:40 +0000)
committerprigaux <pri@nopapers.org>
Sat, 27 Jan 2007 18:40:34 +0000 (18:40 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/MediaFork_0.8.0@215 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm
macosx/PrefsController.m

index 98f60ccb59ca68152d76567e8c7b8f0c59972bd9..d02f6df67933317fb75a19dd73d93bff1de069cc 100644 (file)
@@ -890,6 +890,7 @@ static int FormatSettings[3][4] =
 
     /* Update lang popups */
        /* START Legacy */
+       /*
         hb_audio_t * audio;
     [fAudLang1PopUp removeAllItems];
     [fAudLang2PopUp removeAllItems];
@@ -908,10 +909,11 @@ static int FormatSettings[3][4] =
     }
     [fAudLang1PopUp selectItemAtIndex: 1];
     [fAudLang2PopUp selectItemAtIndex: 0];
+       */
        /* END Legacy */
        /* START pri */
-       /*
-    hb_audio_t * audio;
+       hb_audio_t * audio;
+
        // PRI CHANGES 02/12/06
        NSString * audiotmppri;
        NSString * audiosearchpri=[[NSUserDefaults standardUserDefaults] stringForKey:@"DefaultLanguage"];
@@ -925,11 +927,14 @@ static int FormatSettings[3][4] =
     {
         audio = (hb_audio_t *) hb_list_item( title->list_audio, i );
        // PRI CHANGES 02/12/06
-               audiotmppri=(NSString *) [NSString stringWithCString: audio->lang];
-               // Try to find the desired default language
-          if ([audiotmppri hasPrefix:audiosearchpri] && indxpri==0)
+               if (audiosearchpri!= NULL) 
                {
-                       indxpri=i+1;
+                       audiotmppri=(NSString *) [NSString stringWithCString: audio->lang];
+                       // Try to find the desired default language
+                       if ([audiotmppri hasPrefix:audiosearchpri] && indxpri==0)
+                       {
+                               indxpri=i+1;
+                       }
                }
        // End of pri changes 02/12/06
 
@@ -945,7 +950,7 @@ static int FormatSettings[3][4] =
          [fAudLang1PopUp selectItemAtIndex: indxpri];
        // End of pri changes 02/12/06
     [fAudLang2PopUp selectItemAtIndex: 0];
-       */
+       
        /* END pri */
 }
 
index 394b5950c5bdeec6784648e778883dd1d4176771..b2c72e242119faa5e92468d1a469678baeac88fc 100644 (file)
@@ -14,7 +14,7 @@
                    forKey:@"CheckForUpdates"];
        appDefaults = [NSDictionary dictionaryWithObject:@"English"
                    forKey:@"DefaultLanguage"];
-appDefaults = [NSDictionary dictionaryWithObject:@"NO"
+       appDefaults = [NSDictionary dictionaryWithObject:@"NO"
                    forKey:@"DefaultMpegName"];
        appDefaults = [NSDictionary dictionaryWithObject:@"NO"
                    forKey:@"DefaultCrf"];
@@ -191,9 +191,15 @@ appDefaults = [NSDictionary dictionaryWithObject:@"NO"
        [fdefaultlanguage addItemWithObjectValue: @"Yoruba"];
        [fdefaultlanguage addItemWithObjectValue: @"Zhuang"];
        [fdefaultlanguage addItemWithObjectValue: @"Zulu"];
+       [fdefaultlanguage setStringValue:@"English"];
+       
+       /* If a Default Language is selected then write it otherwise let English as default */
        
-       //[fdefaultlanguage setStringValue:[defaults stringForKey:@"DefaultLanguage"]];
-    [fdefaultlanguage selectItemWithObjectValue:[defaults stringForKey:@"DefaultLanguage"]];
+       if ([defaults stringForKey:@"DefaultLanguage"]!=NULL)
+       {
+               [fdefaultlanguage setStringValue:[defaults stringForKey:@"DefaultLanguage"]];
+    }
+       [fdefaultlanguage selectItemWithObjectValue:[defaults stringForKey:@"DefaultLanguage"]];