diff --git a/src/AccRingGeneralVC.mm b/src/AccRingGeneralVC.mm index c6e6f6518a0029ea1cfe68330f9aacfba8e109c7..974d03255197d4d71be4511b996ccd58f2ba75b5 100644 --- a/src/AccRingGeneralVC.mm +++ b/src/AccRingGeneralVC.mm @@ -36,7 +36,6 @@ #import <interfaces/pixmapmanipulatori.h> #import "RegisterNameWC.h" -#import "RestoreAccountWC.h" #import "BackupAccountWC.h" #import "views/NSColor+RingTheme.h" #import "views/NSImage+Extensions.h" diff --git a/src/BackupAccountWC.mm b/src/BackupAccountWC.mm index 55b674df2144cea469d0cad2a25d44d4db481b95..5422d865d87c5887c409e33e4e440796b4d6b75f 100644 --- a/src/BackupAccountWC.mm +++ b/src/BackupAccountWC.mm @@ -53,7 +53,12 @@ - (void)windowDidLoad { [super windowDidLoad]; - [path setURL: [NSURL fileURLWithPath:NSHomeDirectory()]]; + NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDownloadsDirectory, NSUserDomainMask, YES); + if(paths.count <= 0) { + return; + } + NSString * downloadPath = [paths objectAtIndex:0]; + [path setURL: [NSURL URLWithString: downloadPath]]; } - (void)setDelegate:(id <BackupAccountDelegate>)aDelegate @@ -107,10 +112,14 @@ } - (void)pathControl:(NSPathControl *)pathControl willDisplayOpenPanel:(NSOpenPanel *)openPanel { - NSLog(@"willDisplayOpenPanel"); [openPanel setAllowsMultipleSelection:NO]; [openPanel setResolvesAliases:YES]; - [openPanel setDirectory:NSHomeDirectory()]; + NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDownloadsDirectory, NSUserDomainMask, YES); + if(paths.count <= 0) { + return; + } + NSString * downloadPath = [paths objectAtIndex:0]; + [openPanel setDirectoryURL:[NSURL URLWithString: downloadPath]]; [openPanel setDelegate:self]; }