mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-22 10:55:19 -04:00
[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:
parent
19d9bdbed0
commit
846857a549
2 changed files with 24 additions and 11 deletions
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.4.1405"
|
CAPTION "Rufus 3.4.1406"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -392,8 +392,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,4,1405,0
|
FILEVERSION 3,4,1406,0
|
||||||
PRODUCTVERSION 3,4,1405,0
|
PRODUCTVERSION 3,4,1406,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -411,13 +411,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://akeo.ie"
|
VALUE "Comments", "https://akeo.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.4.1405"
|
VALUE "FileVersion", "3.4.1406"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.4.exe"
|
VALUE "OriginalFilename", "rufus-3.4.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.4.1405"
|
VALUE "ProductVersion", "3.4.1406"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
25
src/stdlg.c
25
src/stdlg.c
|
@ -280,13 +280,26 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
||||||
// Set the file extension filters
|
// Set the file extension filters
|
||||||
pfd->lpVtbl->SetFileTypes(pfd, (UINT)ext->count + 1, filter_spec);
|
pfd->lpVtbl->SetFileTypes(pfd, (UINT)ext->count + 1, filter_spec);
|
||||||
|
|
||||||
// Set the default directory
|
if (path == NULL) {
|
||||||
wpath = utf8_to_wchar(path);
|
// Try to use the "Downloads" folder as the initial default directory
|
||||||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
const GUID download_dir_guid =
|
||||||
if (SUCCEEDED(hr)) {
|
{ 0x374de290, 0x123f, 0x4565, { 0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b } };
|
||||||
pfd->lpVtbl->SetFolder(pfd, si_path);
|
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
|
// Set the default filename
|
||||||
wfilename = utf8_to_wchar((ext->filename == NULL) ? "" : ext->filename);
|
wfilename = utf8_to_wchar((ext->filename == NULL) ? "" : ext->filename);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue