Fix building on Windows

This commit is contained in:
Cheng Zhao 2016-05-16 10:09:41 +09:00
parent 54c654530e
commit e53bfad018
2 changed files with 8 additions and 5 deletions

View file

@ -203,7 +203,7 @@ bool ShowOpenDialog(atom::NativeWindow* parent_window,
options |= FOS_ALLOWMULTISELECT; options |= FOS_ALLOWMULTISELECT;
FileDialog<CShellFileOpenDialog> open_dialog( FileDialog<CShellFileOpenDialog> open_dialog(
default_path, title, filters, options); default_path, title, button_label, filters, options);
if (!open_dialog.Show(parent_window)) if (!open_dialog.Show(parent_window))
return false; return false;
@ -253,7 +253,7 @@ void ShowOpenDialog(atom::NativeWindow* parent,
run_state.dialog_thread->message_loop()->PostTask( run_state.dialog_thread->message_loop()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(&RunOpenDialogInNewThread, run_state, parent, title, base::Bind(&RunOpenDialogInNewThread, run_state, parent, title,
default_path, filters, properties, callback)); button_label, default_path, filters, properties, callback));
} }
bool ShowSaveDialog(atom::NativeWindow* parent_window, bool ShowSaveDialog(atom::NativeWindow* parent_window,
@ -263,7 +263,7 @@ bool ShowSaveDialog(atom::NativeWindow* parent_window,
const Filters& filters, const Filters& filters,
base::FilePath* path) { base::FilePath* path) {
FileDialog<CShellFileSaveDialog> save_dialog( FileDialog<CShellFileSaveDialog> save_dialog(
default_path, title, filters, default_path, title, button_label, filters,
FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT); FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT);
if (!save_dialog.Show(parent_window)) if (!save_dialog.Show(parent_window))
return false; return false;
@ -292,7 +292,7 @@ void ShowSaveDialog(atom::NativeWindow* parent,
run_state.dialog_thread->message_loop()->PostTask( run_state.dialog_thread->message_loop()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(&RunSaveDialogInNewThread, run_state, parent, title, base::Bind(&RunSaveDialogInNewThread, run_state, parent, title,
default_path, filters, callback)); button_label, default_path, filters, callback));
} }
} // namespace file_dialog } // namespace file_dialog

View file

@ -28,7 +28,8 @@ The `dialog` module has the following methods:
* `options` Object * `options` Object
* `title` String * `title` String
* `defaultPath` String * `defaultPath` String
* `buttonLabel` String * `buttonLabel` String - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` Array * `filters` Array
* `properties` Array - Contains which features the dialog should use, can * `properties` Array - Contains which features the dialog should use, can
contain `openFile`, `openDirectory`, `multiSelections` and contain `openFile`, `openDirectory`, `multiSelections` and
@ -70,6 +71,8 @@ shown.
* `options` Object * `options` Object
* `title` String * `title` String
* `defaultPath` String * `defaultPath` String
* `buttonLabel` String - Custom label for the confirmation button, when
left empty the default label will be used.
* `filters` Array * `filters` Array
* `callback` Function (optional) * `callback` Function (optional)