Fix 'cancel' button when downloading
This commit is contained in:
parent
4a501b497a
commit
dd95df6e07
|
@ -172,8 +172,11 @@ static NSMenuItem *menuItemForItem(id item) {
|
|||
-(NSURL*)requestDownloadDestination {
|
||||
NSSavePanel *savePanel = [NSOpenPanel savePanel];
|
||||
[savePanel setDirectory: NSHomeDirectory()];
|
||||
[savePanel runModal];
|
||||
return [savePanel URL];
|
||||
if ([savePanel runModal] == NSOKButton) {
|
||||
return [savePanel URL];
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)openWebsite: (Website*)aWebsite {
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
static struct gui_download_window *gnustep_download_create(struct download_context *ctx, struct gui_window *parent) {
|
||||
NSLog(@"gnustep_download_create");
|
||||
NSURL *url = [[NSApp delegate] requestDownloadDestination];
|
||||
if (url == nil)
|
||||
return NULL;
|
||||
DownloadItem *download = [[DownloadManager defaultDownloadManager]
|
||||
createDownloadForDestination: url withContext: ctx];
|
||||
[[NSApp delegate] showDownloadsWindow: nil];
|
||||
|
|
Loading…
Reference in New Issue