From 80e35b66828e27d699eff3500cb75f1f7d45d643 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 22 Jun 2017 17:10:22 -0400 Subject: [PATCH 1/4] :apple: Fix treat packaged app as directory --- atom/browser/ui/file_dialog_mac.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index cea0050cd19b..af94e2517089 100644 --- a/atom/browser/ui/file_dialog_mac.mm +++ b/atom/browser/ui/file_dialog_mac.mm @@ -93,6 +93,7 @@ void SetupDialog(NSSavePanel* dialog, void SetupDialogForProperties(NSOpenPanel* dialog, int properties) { [dialog setCanChooseFiles:(properties & FILE_DIALOG_OPEN_FILE)]; + [dialog setTreatsFilePackagesAsDirectories:YES]; if (properties & FILE_DIALOG_OPEN_DIRECTORY) [dialog setCanChooseDirectories:YES]; if (properties & FILE_DIALOG_CREATE_DIRECTORY) From b25a1d10a22e64cabdb6c6d8c03bf98d3c5231e7 Mon Sep 17 00:00:00 2001 From: Shubham Date: Mon, 17 Jul 2017 21:40:57 -0400 Subject: [PATCH 2/4] :apple: Add treatPackageasDirectory as an option --- atom/browser/ui/file_dialog.h | 1 + atom/browser/ui/file_dialog_mac.mm | 3 ++- docs/api/dialog.md | 2 ++ lib/browser/api/dialog.js | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/atom/browser/ui/file_dialog.h b/atom/browser/ui/file_dialog.h index 6f33c46f2026..79353d03a5d5 100644 --- a/atom/browser/ui/file_dialog.h +++ b/atom/browser/ui/file_dialog.h @@ -30,6 +30,7 @@ enum FileDialogProperty { FILE_DIALOG_SHOW_HIDDEN_FILES = 1 << 4, FILE_DIALOG_PROMPT_TO_CREATE = 1 << 5, FILE_DIALOG_NO_RESOLVE_ALIASES = 1 << 6, + FILE_DIALOG_TREAT_PACKAGE_APP_AS_DIRECTORY = 1 << 7, }; typedef base::Callback Date: Tue, 18 Jul 2017 10:18:23 -0700 Subject: [PATCH 3/4] Mark treatPackageAsDirectory as mac only --- docs/api/dialog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/dialog.md b/docs/api/dialog.md index 7a41ade5cb71..f7379f1d1b85 100644 --- a/docs/api/dialog.md +++ b/docs/api/dialog.md @@ -46,8 +46,8 @@ The `dialog` module has the following methods: * `noResolveAliases` - Disable the automatic alias (symlink) path resolution. Selected aliases will now return the alias path instead of their target path. _macOS_ - * `treatPackageAsDirectory` - Treats file package(for example Electron.app) - as a directory instead of file + * `treatPackageAsDirectory` - Treats packages, such as `.app` folders, + as a directory instead of a file. _macOS_ * `message` String (optional) _macOS_ - Message to display above input boxes. * `callback` Function (optional) From 7db3009234a2180c717570e1257604b802c25cc9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 18 Jul 2017 10:19:00 -0700 Subject: [PATCH 4/4] Remove s --- docs/api/dialog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/dialog.md b/docs/api/dialog.md index f7379f1d1b85..c99a4cf29508 100644 --- a/docs/api/dialog.md +++ b/docs/api/dialog.md @@ -46,7 +46,7 @@ The `dialog` module has the following methods: * `noResolveAliases` - Disable the automatic alias (symlink) path resolution. Selected aliases will now return the alias path instead of their target path. _macOS_ - * `treatPackageAsDirectory` - Treats packages, such as `.app` folders, + * `treatPackageAsDirectory` - Treat packages, such as `.app` folders, as a directory instead of a file. _macOS_ * `message` String (optional) _macOS_ - Message to display above input boxes.