win: Accept parent window in ShowOpenDialog.
This commit is contained in:
parent
ac76017702
commit
53c6d51d56
1 changed files with 7 additions and 5 deletions
|
@ -162,7 +162,8 @@ class FileDialog {
|
||||||
SetDefaultFolder(default_path);
|
SetDefaultFolder(default_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Show(HWND window) {
|
bool Show(atom::NativeWindow* parent_window) {
|
||||||
|
HWND window = parent_window ? parent_window->GetNativeWindow() : NULL;
|
||||||
return dialog_->DoModal(window) == IDOK;
|
return dialog_->DoModal(window) == IDOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +199,8 @@ class FileDialog {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool ShowOpenDialog(const std::string& title,
|
bool ShowOpenDialog(atom::NativeWindow* parent_window,
|
||||||
|
const std::string& title,
|
||||||
const base::FilePath& default_path,
|
const base::FilePath& default_path,
|
||||||
int properties,
|
int properties,
|
||||||
std::vector<base::FilePath>* paths) {
|
std::vector<base::FilePath>* paths) {
|
||||||
|
@ -214,7 +216,7 @@ bool ShowOpenDialog(const std::string& title,
|
||||||
options,
|
options,
|
||||||
std::vector<std::wstring>(),
|
std::vector<std::wstring>(),
|
||||||
std::vector<std::wstring>());
|
std::vector<std::wstring>());
|
||||||
if (!open_dialog.Show(::GetActiveWindow()))
|
if (!open_dialog.Show(parent_window))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ATL::CComPtr<IShellItemArray> items;
|
ATL::CComPtr<IShellItemArray> items;
|
||||||
|
@ -247,7 +249,7 @@ bool ShowOpenDialog(const std::string& title,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShowSaveDialog(atom::NativeWindow* window,
|
bool ShowSaveDialog(atom::NativeWindow* parent_window,
|
||||||
const std::string& title,
|
const std::string& title,
|
||||||
const base::FilePath& default_path,
|
const base::FilePath& default_path,
|
||||||
base::FilePath* path) {
|
base::FilePath* path) {
|
||||||
|
@ -263,7 +265,7 @@ bool ShowSaveDialog(atom::NativeWindow* window,
|
||||||
FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT,
|
FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | FOS_OVERWRITEPROMPT,
|
||||||
file_ext,
|
file_ext,
|
||||||
std::vector<std::wstring>());
|
std::vector<std::wstring>());
|
||||||
if (!save_dialog.Show(window->GetNativeWindow()))
|
if (!save_dialog.Show(parent_window))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wchar_t file_name[MAX_PATH];
|
wchar_t file_name[MAX_PATH];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue