diff options
author | dynaflash <[email protected]> | 2007-04-05 17:28:16 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-04-05 17:28:16 +0000 |
commit | c229a3e74ddde33566cdf5dc48a304801b0810b7 (patch) | |
tree | f63dca20475b95e1e5b82fdbb1b876d923b3fc4d /macosx | |
parent | f6a3ce6f12886c183ef325528011b673e3783c63 (diff) |
MacGui: Last source directory used is now remembered and used the next time instead of being reset by browsing for a new destination directory each time.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@481 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 2 | ||||
-rw-r--r-- | macosx/PrefsController.m | 5 | ||||
-rw-r--r-- | macosx/ScanController.mm | 16 |
3 files changed, 20 insertions, 3 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index e4314c4e8..7ebcd9a91 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -939,7 +939,7 @@ static int FormatSettings[3][4] = [fDstFile2Field stringValue]] ); return; } - /* We get the destination directory from the destingation field here */ + /* We get the destination directory from the destination field here */ NSString *destinationDirectory = [[fDstFile2Field stringValue] stringByDeletingLastPathComponent]; /* We check for a valid destination here */ if ([[NSFileManager defaultManager] fileExistsAtPath:destinationDirectory] == 0) diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 8f5dd61d8..9ce02435a 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -33,6 +33,11 @@ NSString *defDestDirectory = @"~/Desktop"; defDestDirectory = [defDestDirectory stringByExpandingTildeInPath]; appDefaults = [NSDictionary dictionaryWithObject:defDestDirectory forKey:@"LastDestinationDirectory"]; + + NSString *defSrcDirectory = @"~/Desktop"; + defSrcDirectory = [defSrcDirectory stringByExpandingTildeInPath]; + appDefaults = [NSDictionary dictionaryWithObject:defSrcDirectory forKey:@"LastSourceDirectory"]; + appDefaults = [NSDictionary dictionaryWithObject:@"NO" forKey:@"DefaultAutoNaming"]; appDefaults = [NSDictionary dictionaryWithObject:@"NO" diff --git a/macosx/ScanController.mm b/macosx/ScanController.mm index 9ce44f8fe..cad783377 100644 --- a/macosx/ScanController.mm +++ b/macosx/ScanController.mm @@ -196,8 +196,17 @@ [panel setAllowsMultipleSelection: NO]; [panel setCanChooseFiles: YES]; [panel setCanChooseDirectories: YES ]; - - [panel beginSheetForDirectory: nil file: nil types: nil + NSString * sourceDirectory; + if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastSourceDirectory"]) + { + sourceDirectory = [[NSUserDefaults standardUserDefaults] stringForKey:@"LastSourceDirectory"]; + } + else + { + sourceDirectory = @"~/Desktop"; + sourceDirectory = [sourceDirectory stringByExpandingTildeInPath]; + } + [panel beginSheetForDirectory: sourceDirectory file: nil types: nil modalForWindow: [NSApp mainWindow] modalDelegate: self didEndSelector: @selector( BrowseDone:returnCode:contextInfo: ) contextInfo: nil]; @@ -239,6 +248,9 @@ if( [fMatrix selectedRow] ) { + /* we set the last source directory in the prefs here */ + NSString *sourceDirectory = [[fFolderField stringValue] stringByDeletingLastPathComponent]; + [[NSUserDefaults standardUserDefaults] setObject:sourceDirectory forKey:@"LastSourceDirectory"]; hb_scan( fHandle, [[fFolderField stringValue] UTF8String], 0 ); } else |