mac: Add showHiddenFiles property for showOpenDialog
This commit is contained in:
parent
33e8d5e0aa
commit
f08ac07737
3 changed files with 10 additions and 6 deletions
|
@ -23,10 +23,11 @@ typedef std::pair<std::string, std::vector<std::string> > Filter;
|
||||||
typedef std::vector<Filter> Filters;
|
typedef std::vector<Filter> Filters;
|
||||||
|
|
||||||
enum FileDialogProperty {
|
enum FileDialogProperty {
|
||||||
FILE_DIALOG_OPEN_FILE = 1 << 0,
|
FILE_DIALOG_OPEN_FILE = 1 << 0,
|
||||||
FILE_DIALOG_OPEN_DIRECTORY = 1 << 1,
|
FILE_DIALOG_OPEN_DIRECTORY = 1 << 1,
|
||||||
FILE_DIALOG_MULTI_SELECTIONS = 1 << 2,
|
FILE_DIALOG_MULTI_SELECTIONS = 1 << 2,
|
||||||
FILE_DIALOG_CREATE_DIRECTORY = 1 << 3,
|
FILE_DIALOG_CREATE_DIRECTORY = 1 << 3,
|
||||||
|
FILE_DIALOG_SHOW_HIDDEN_FILES = 1 << 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::Callback<void(
|
typedef base::Callback<void(
|
||||||
|
|
|
@ -86,6 +86,8 @@ void SetupDialogForProperties(NSOpenPanel* dialog, int properties) {
|
||||||
[dialog setCanCreateDirectories:YES];
|
[dialog setCanCreateDirectories:YES];
|
||||||
if (properties & FILE_DIALOG_MULTI_SELECTIONS)
|
if (properties & FILE_DIALOG_MULTI_SELECTIONS)
|
||||||
[dialog setAllowsMultipleSelection:YES];
|
[dialog setAllowsMultipleSelection:YES];
|
||||||
|
if (properties & FILE_DIALOG_SHOW_HIDDEN_FILES)
|
||||||
|
[dialog setShowsHiddenFiles:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run modal dialog with parent window and return user's choice.
|
// Run modal dialog with parent window and return user's choice.
|
||||||
|
|
|
@ -6,11 +6,12 @@ const v8Util = process.atomBinding('v8_util')
|
||||||
|
|
||||||
var includes = [].includes
|
var includes = [].includes
|
||||||
|
|
||||||
var fileDialogProperties = {
|
const fileDialogProperties = {
|
||||||
openFile: 1 << 0,
|
openFile: 1 << 0,
|
||||||
openDirectory: 1 << 1,
|
openDirectory: 1 << 1,
|
||||||
multiSelections: 1 << 2,
|
multiSelections: 1 << 2,
|
||||||
createDirectory: 1 << 3
|
createDirectory: 1 << 3,
|
||||||
|
showHiddenFiles: 1 << 4
|
||||||
}
|
}
|
||||||
|
|
||||||
var messageBoxTypes = ['none', 'info', 'warning', 'error', 'question']
|
var messageBoxTypes = ['none', 'info', 'warning', 'error', 'question']
|
||||||
|
|
Loading…
Reference in a new issue