]> granicus.if.org Git - handbrake/commitdiff
MacGui: Remember last destination ripped to and use it at next launch.
authordynaflash <dynaflashtech@gmail.com>
Mon, 5 Mar 2007 21:39:57 +0000 (21:39 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Mon, 5 Mar 2007 21:39:57 +0000 (21:39 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.8.0_beta2_5.1@419 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm
macosx/PrefsController.m

index 2ddbb9de75ef15be8b6ce31d1d2184491acd0315..5651f19656e25bddbdb203536dcb4eea9512456e 100644 (file)
@@ -372,11 +372,20 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                                
                                /* 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"])
+                               {
+                               [fDstFile2Field setStringValue: [NSString stringWithFormat:
+                @"%@/%@.mp4", [[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"],[NSString
+                  stringWithUTF8String: title->name]]];
+                               }
+                               else
+                               {
                                [fDstFile2Field setStringValue: [NSString stringWithFormat:
                 @"%@/Desktop/%@.mp4", NSHomeDirectory(),[NSString
                   stringWithUTF8String: title->name]]];
-                               
+                               }
+
                   
                 if (longuestpri < title->hours*60*60 + title->minutes *60 + title->seconds)
                 {
@@ -870,6 +879,8 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                        job->pass = 0;
                        hb_add( fHandle, job );
                }
+       
+       [[NSUserDefaults standardUserDefaults] setObject:destinationDirectory forKey:@"LastDestinationDirectory"];
        }
 }
 
@@ -914,6 +925,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
        }
        else
        {
+       [[NSUserDefaults standardUserDefaults] setObject:destinationDirectory forKey:@"LastDestinationDirectory"];
                [self _Rip];
        }
        
index 25d3ee4d4f5bb3bae28212ccb3288fe7d6de249f..b417416b50144b6dc18166c140f014e4453cb40b 100644 (file)
@@ -30,6 +30,9 @@
                    forKey:@"DefAdvancedx264Flags"];
        appDefaults = [NSDictionary dictionaryWithObject:@"YES"
                    forKey:@"DefaultPresetsDrawerShow"];
+       NSString *defDestDirectory =  @"~/Desktop";
+       defDestDirectory = [defDestDirectory stringByExpandingTildeInPath];
+       appDefaults = [NSDictionary dictionaryWithObject:defDestDirectory forKey:@"LastDestinationDirectory"];
        
     [defaults registerDefaults: appDefaults];