mirror of
https://github.com/electron/electron.git
synced 2026-01-25 23:38:18 -05:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user