mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[ui] remember last selected device
* Closes #35 * Also update syslinux resources
This commit is contained in:
parent
a851d66e7c
commit
ce499c95d7
6 changed files with 33 additions and 20 deletions
Binary file not shown.
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
diff --git a/core/fs/lib/loadconfig.c b/core/fs/lib/loadconfig.c
|
diff --git a/core/fs/lib/loadconfig.c b/core/fs/lib/loadconfig.c
|
||||||
index c9652b6..4dfe1b9 100644
|
index c9652b6..8ed301e 100644
|
||||||
--- a/core/fs/lib/loadconfig.c
|
--- a/core/fs/lib/loadconfig.c
|
||||||
+++ b/core/fs/lib/loadconfig.c
|
+++ b/core/fs/lib/loadconfig.c
|
||||||
@@ -10,6 +10,8 @@
|
@@ -10,6 +10,8 @@
|
||||||
|
@ -11,13 +11,12 @@ index c9652b6..4dfe1b9 100644
|
||||||
*/
|
*/
|
||||||
int generic_load_config(void)
|
int generic_load_config(void)
|
||||||
{
|
{
|
||||||
@@ -17,12 +19,15 @@ int generic_load_config(void)
|
@@ -18,11 +20,14 @@ int generic_load_config(void)
|
||||||
NULL, /* CurrentDirName */
|
|
||||||
"/boot/syslinux",
|
"/boot/syslinux",
|
||||||
"/syslinux",
|
"/syslinux",
|
||||||
|
"/",
|
||||||
+ "/boot/isolinux",
|
+ "/boot/isolinux",
|
||||||
+ "/isolinux",
|
+ "/isolinux",
|
||||||
"/",
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
static const char *filenames[] = {
|
static const char *filenames[] = {
|
||||||
|
|
|
@ -397,7 +397,7 @@ try_iso:
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
i_joliet_level = iso9660_ifs_get_joliet_level(p_iso);
|
i_joliet_level = iso9660_ifs_get_joliet_level(p_iso);
|
||||||
uprintf("Disc image is an ISO9660 image (Joliet = %d)\n", i_joliet_level);
|
uprintf("Disc image is an ISO9660 image\n");
|
||||||
if (scan_only) {
|
if (scan_only) {
|
||||||
if (iso9660_ifs_get_volume_id(p_iso, &vol_id)) {
|
if (iso9660_ifs_get_volume_id(p_iso, &vol_id)) {
|
||||||
safe_strcpy(iso_report.label, sizeof(iso_report.label), vol_id);
|
safe_strcpy(iso_report.label, sizeof(iso_report.label), vol_id);
|
||||||
|
|
30
src/rufus.c
30
src/rufus.c
|
@ -392,7 +392,7 @@ static void SetFSFromISO(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i=ComboBox_GetCount(hFileSystem)-1; i>=0; i--) {
|
for (i=ComboBox_GetCount(hFileSystem)-1; i>=0; i--) {
|
||||||
fs = ComboBox_GetItemData(hFileSystem, i);
|
fs = (int)ComboBox_GetItemData(hFileSystem, i);
|
||||||
if ( ((iso_report.has_bootmgr) && (fs == FS_NTFS))
|
if ( ((iso_report.has_bootmgr) && (fs == FS_NTFS))
|
||||||
|| ((iso_report.has_isolinux) && ((fs == FS_FAT32) || (fs == FS_FAT16))) ) {
|
|| ((iso_report.has_isolinux) && ((fs == FS_FAT32) || (fs == FS_FAT16))) ) {
|
||||||
IGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i));
|
IGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i));
|
||||||
|
@ -521,9 +521,9 @@ BOOL CreatePartition(HANDLE hDrive)
|
||||||
/*
|
/*
|
||||||
* Refresh the list of USB devices
|
* Refresh the list of USB devices
|
||||||
*/
|
*/
|
||||||
static BOOL GetUSBDevices(void)
|
static BOOL GetUSBDevices(DWORD devnum)
|
||||||
{
|
{
|
||||||
BOOL r;
|
BOOL r, found = FALSE;
|
||||||
HDEVINFO dev_info = NULL;
|
HDEVINFO dev_info = NULL;
|
||||||
SP_DEVINFO_DATA dev_info_data;
|
SP_DEVINFO_DATA dev_info_data;
|
||||||
SP_DEVICE_INTERFACE_DATA devint_data;
|
SP_DEVICE_INTERFACE_DATA devint_data;
|
||||||
|
@ -626,7 +626,18 @@ static BOOL GetUSBDevices(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetupDiDestroyDeviceInfoList(dev_info);
|
SetupDiDestroyDeviceInfoList(dev_info);
|
||||||
IGNORE_RETVAL(ComboBox_SetCurSel(hDeviceList, 0));
|
|
||||||
|
if (devnum >= DRIVE_INDEX_MIN) {
|
||||||
|
for (i=0; i<ComboBox_GetCount(hDeviceList); i++) {
|
||||||
|
if ((DWORD)ComboBox_GetItemData(hDeviceList, i) == devnum) {
|
||||||
|
found = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
i = 0;
|
||||||
|
IGNORE_RETVAL(ComboBox_SetCurSel(hDeviceList, i));
|
||||||
SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_DEVICE, 0);
|
SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_DEVICE, 0);
|
||||||
SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_FILESYSTEM,
|
SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_FILESYSTEM,
|
||||||
ComboBox_GetCurSel(hFileSystem));
|
ComboBox_GetCurSel(hFileSystem));
|
||||||
|
@ -1136,7 +1147,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
{
|
{
|
||||||
DRAWITEMSTRUCT* pDI;
|
DRAWITEMSTRUCT* pDI;
|
||||||
int nDeviceIndex, fs, dt;
|
int nDeviceIndex, fs, dt;
|
||||||
DWORD DeviceNum;
|
static DWORD DeviceNum = 0;
|
||||||
char str[MAX_PATH], tmp[128];
|
char str[MAX_PATH], tmp[128];
|
||||||
static UINT uDOSChecked = BST_CHECKED;
|
static UINT uDOSChecked = BST_CHECKED;
|
||||||
|
|
||||||
|
@ -1145,14 +1156,14 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
case WM_DEVICECHANGE:
|
case WM_DEVICECHANGE:
|
||||||
if ( (format_thid == NULL) &&
|
if ( (format_thid == NULL) &&
|
||||||
((wParam == DBT_DEVICEARRIVAL) || (wParam == DBT_DEVICEREMOVECOMPLETE)) ) {
|
((wParam == DBT_DEVICEARRIVAL) || (wParam == DBT_DEVICEREMOVECOMPLETE)) ) {
|
||||||
GetUSBDevices();
|
GetUSBDevices((DWORD)ComboBox_GetItemData(hDeviceList, ComboBox_GetCurSel(hDeviceList)));
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
InitDialog(hDlg);
|
InitDialog(hDlg);
|
||||||
GetUSBDevices();
|
GetUSBDevices(0);
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
|
|
||||||
// The things one must do to get an ellipsis on the status bar...
|
// The things one must do to get an ellipsis on the status bar...
|
||||||
|
@ -1289,6 +1300,9 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
dt = (int)ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType));
|
dt = (int)ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType));
|
||||||
if ((dt == DT_ISO_NTFS) || (dt == DT_ISO_FAT)) {
|
if ((dt == DT_ISO_NTFS) || (dt == DT_ISO_FAT)) {
|
||||||
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hSelectISO, TRUE);
|
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hSelectISO, TRUE);
|
||||||
|
} else {
|
||||||
|
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);
|
||||||
|
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE);
|
||||||
}
|
}
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
case IDC_SELECT_ISO:
|
case IDC_SELECT_ISO:
|
||||||
|
@ -1397,7 +1411,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
EnableWindow(GetDlgItem(hISOProgressDlg, IDC_ISO_ABORT), TRUE);
|
EnableWindow(GetDlgItem(hISOProgressDlg, IDC_ISO_ABORT), TRUE);
|
||||||
EnableWindow(GetDlgItem(hMainDialog, IDCANCEL), TRUE);
|
EnableWindow(GetDlgItem(hMainDialog, IDCANCEL), TRUE);
|
||||||
EnableControls(TRUE);
|
EnableControls(TRUE);
|
||||||
GetUSBDevices();
|
GetUSBDevices(DeviceNum);
|
||||||
if (!IS_ERROR(FormatStatus)) {
|
if (!IS_ERROR(FormatStatus)) {
|
||||||
PrintStatus(0, FALSE, "DONE");
|
PrintStatus(0, FALSE, "DONE");
|
||||||
} else if (SCODE_CODE(FormatStatus) == ERROR_CANCELLED) {
|
} else if (SCODE_CODE(FormatStatus) == ERROR_CANCELLED) {
|
||||||
|
|
12
src/rufus.rc
12
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 206, 278
|
IDD_DIALOG DIALOGEX 12, 12, 206, 278
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_APPWINDOW
|
EXSTYLE WS_EX_APPWINDOW
|
||||||
CAPTION "Rufus v1.1.1.137"
|
CAPTION "Rufus v1.1.1.138"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,94,236,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,236,50,14
|
||||||
|
@ -71,7 +71,7 @@ BEGIN
|
||||||
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
|
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
|
||||||
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
|
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
|
||||||
"SysLink",WS_TABSTOP,46,47,114,9
|
"SysLink",WS_TABSTOP,46,47,114,9
|
||||||
LTEXT "Version 1.1.1 (Build 137)",IDC_STATIC,46,19,78,8
|
LTEXT "Version 1.1.1 (Build 138)",IDC_STATIC,46,19,78,8
|
||||||
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
|
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
|
||||||
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
|
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
|
||||||
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
|
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
|
||||||
|
@ -222,8 +222,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,1,1,137
|
FILEVERSION 1,1,1,138
|
||||||
PRODUCTVERSION 1,1,1,137
|
PRODUCTVERSION 1,1,1,138
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -240,13 +240,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "akeo.ie"
|
VALUE "CompanyName", "akeo.ie"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "1.1.1.137"
|
VALUE "FileVersion", "1.1.1.138"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "1.1.1.137"
|
VALUE "ProductVersion", "1.1.1.138"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue