[ui] use Downloads as initial image directory rather than My Documents

* With thanks to win32diskimager for figuring that one out
This commit is contained in:
Pete Batard 2018-10-06 14:21:13 +02:00
parent 19d9bdbed0
commit 846857a549
2 changed files with 24 additions and 11 deletions

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.4.1405"
CAPTION "Rufus 3.4.1406"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -392,8 +392,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,4,1405,0
PRODUCTVERSION 3,4,1405,0
FILEVERSION 3,4,1406,0
PRODUCTVERSION 3,4,1406,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -411,13 +411,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.4.1405"
VALUE "FileVersion", "3.4.1406"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.4.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.4.1405"
VALUE "ProductVersion", "3.4.1406"
END
END
BLOCK "VarFileInfo"

View File

@ -280,13 +280,26 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
// Set the file extension filters
pfd->lpVtbl->SetFileTypes(pfd, (UINT)ext->count + 1, filter_spec);
// Set the default directory
wpath = utf8_to_wchar(path);
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
if (SUCCEEDED(hr)) {
pfd->lpVtbl->SetFolder(pfd, si_path);
if (path == NULL) {
// Try to use the "Downloads" folder as the initial default directory
const GUID download_dir_guid =
{ 0x374de290, 0x123f, 0x4565, { 0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b } };
hr = SHGetKnownFolderPath(&download_dir_guid, 0, 0, &wpath);
if (SUCCEEDED(hr)) {
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
if (SUCCEEDED(hr)) {
pfd->lpVtbl->SetDefaultFolder(pfd, si_path);
}
CoTaskMemFree(wpath);
}
} else {
wpath = utf8_to_wchar(path);
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
if (SUCCEEDED(hr)) {
pfd->lpVtbl->SetFolder(pfd, si_path);
}
safe_free(wpath);
}
safe_free(wpath);
// Set the default filename
wfilename = utf8_to_wchar((ext->filename == NULL) ? "" : ext->filename);