🍎 Add additional options for Mac's save dialog

Support additional attributes available in macOS's NSSavePanel: message,
nameFieldLabel and showsTagField
This commit is contained in:
Tan Wang Leng 2017-02-01 23:34:21 +08:00
parent 9163b601a4
commit 1d612a12a1
9 changed files with 72 additions and 9 deletions

View file

@ -92,6 +92,9 @@ void ShowSaveDialog(const std::string& title,
const std::string& button_label,
const base::FilePath& default_path,
const file_dialog::Filters& filters,
const std::string& message,
const std::string& name_field_label,
const bool& shows_tag_field,
atom::NativeWindow* window,
mate::Arguments* args) {
v8::Local<v8::Value> peek = args->PeekNext();
@ -100,11 +103,13 @@ void ShowSaveDialog(const std::string& title,
peek,
&callback)) {
file_dialog::ShowSaveDialog(window, title, button_label, default_path,
filters, callback);
filters, message, name_field_label,
shows_tag_field, callback);
} else {
base::FilePath path;
if (file_dialog::ShowSaveDialog(window, title, button_label, default_path,
filters, &path))
filters, message, name_field_label,
shows_tag_field, &path))
args->Return(path);
}
}