From: Eran Tiktin Date: Sun, 27 Sep 2015 23:12:47 +0000 (+0300) Subject: Set default extension in Windows file dialog X-Git-Tag: v0.33.4~18^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6dcc752f6742d150ce909ffffae270355234c608;p=electron.git Set default extension in Windows file dialog On Windows when you open the save dialog and switch the filter, the extension is supposed to change accordingly. It didn't happen with the existing code, since the existing code didn't set the default extension (should be set to the first filter). This resolves #2915. --- diff --git a/atom/browser/ui/file_dialog_win.cc b/atom/browser/ui/file_dialog_win.cc index b169471c..da00dc54 100644 --- a/atom/browser/ui/file_dialog_win.cc +++ b/atom/browser/ui/file_dialog_win.cc @@ -79,6 +79,9 @@ class FileDialog { if (!title.empty()) GetPtr()->SetTitle(base::UTF8ToUTF16(title).c_str()); + if (!filterspec.empty()) + GetPtr()->SetDefaultExtension(filterspec.front().pszSpec); + SetDefaultFolder(default_path); }