From a34cb1194e45f19a3321d63323ba12e51d373fd5 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 6 Jul 2018 00:40:52 +0100 Subject: [PATCH] [ui] initial work for the display of a persistence option * This doesn't mean we'll get persistence support any time soon, but any UI work on this needs to be carried out *MONTHS* in advance because of the translators. --- src/format.c | 2 +- src/localization_data.h | 7 ++- src/resource.h | 9 ++- src/rufus.c | 127 +++++++++++++++++++++++----------------- src/rufus.h | 42 +++++++------ src/rufus.rc | 17 +++--- src/ui.h | 11 ++-- 7 files changed, 127 insertions(+), 88 deletions(-) diff --git a/src/format.c b/src/format.c index b5bfb052..a35af049 100644 --- a/src/format.c +++ b/src/format.c @@ -1683,7 +1683,7 @@ DWORD WINAPI FormatThread(void* param) char grub4dos_dst[] = "?:\\grldr"; use_large_fat32 = (fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32)); - windows_to_go = display_togo_option && (bt == BT_IMAGE) && HAS_WINTOGO(img_report) && + windows_to_go = (image_options & IMOP_WINTOGO) && (bt == BT_IMAGE) && HAS_WINTOGO(img_report) && (ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1); large_drive = (SelectedDrive.DiskSize > (1*TB)); if (large_drive) diff --git a/src/localization_data.h b/src/localization_data.h index 8a195e0a..95cd3e8c 100644 --- a/src/localization_data.h +++ b/src/localization_data.h @@ -54,6 +54,8 @@ const loc_control_id control_id[] = { LOC_CTRL(IDC_EXTENDED_LABEL), LOC_CTRL(IDC_RUFUS_MBR), LOC_CTRL(IDC_TARGET_SYSTEM), + LOC_CTRL(IDC_PERSISTENCE_SIZE), + LOC_CTRL(IDC_PERSISTENCE_UNITS), LOC_CTRL(IDC_DISK_ID), LOC_CTRL(IDC_OLD_BIOS_FIXES), LOC_CTRL(IDC_LIST_USB_HDD), @@ -61,6 +63,9 @@ const loc_control_id control_id[] = { LOC_CTRL(IDC_SAVE), LOC_CTRL(IDC_HASH), LOC_CTRL(IDC_IMAGE_OPTION), + LOC_CTRL(IDC_PERSISTENCE_SLIDER), + LOC_CTRL(IDC_ADVANCED_DRIVE_PROPERTIES), + LOC_CTRL(IDC_ADVANCED_FORMAT_OPTIONS), LOC_CTRL(IDC_ABOUT_LICENSE), LOC_CTRL(IDC_ABOUT_ICON), LOC_CTRL(IDC_ABOUT_COPYRIGHTS), @@ -133,8 +138,6 @@ const loc_control_id control_id[] = { LOC_CTRL(IDC_LIST_ITEM14), LOC_CTRL(IDC_LIST_ITEM15), LOC_CTRL(IDC_LIST_ITEMMAX), - LOC_CTRL(IDC_ADVANCED_DRIVE_PROPERTIES), - LOC_CTRL(IDC_ADVANCED_FORMAT_OPTIONS), LOC_CTRL(IDS_DEVICE_TXT), LOC_CTRL(IDS_PARTITION_TYPE_TXT), LOC_CTRL(IDS_FILE_SYSTEM_TXT), diff --git a/src/resource.h b/src/resource.h index 532dbf1c..7f71d7d8 100644 --- a/src/resource.h +++ b/src/resource.h @@ -108,6 +108,8 @@ #define IDC_EXTENDED_LABEL 1015 #define IDC_RUFUS_MBR 1016 #define IDC_TARGET_SYSTEM 1017 +#define IDC_PERSISTENCE_SIZE 1118 +#define IDC_PERSISTENCE_UNITS 1019 #define IDC_DISK_ID 1020 #define IDC_OLD_BIOS_FIXES 1021 #define IDC_LIST_USB_HDD 1022 @@ -115,6 +117,9 @@ #define IDC_SAVE 1024 #define IDC_HASH 1025 #define IDC_IMAGE_OPTION 1026 +#define IDC_PERSISTENCE_SLIDER 1027 +#define IDC_ADVANCED_DRIVE_PROPERTIES 1028 +#define IDC_ADVANCED_FORMAT_OPTIONS 1029 #define IDC_ABOUT_LICENSE 1030 #define IDC_ABOUT_ICON 1031 #define IDC_ABOUT_COPYRIGHTS 1032 @@ -187,8 +192,6 @@ #define IDC_LIST_ITEM14 1109 #define IDC_LIST_ITEM15 1110 #define IDC_LIST_ITEMMAX 1111 -#define IDC_ADVANCED_DRIVE_PROPERTIES 1112 -#define IDC_ADVANCED_FORMAT_OPTIONS 1113 #define IDS_DEVICE_TXT 2000 #define IDS_PARTITION_TYPE_TXT 2001 #define IDS_FILE_SYSTEM_TXT 2002 @@ -538,7 +541,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 505 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1114 +#define _APS_NEXT_CONTROL_VALUE 1112 #define _APS_NEXT_SYMED_VALUE 4000 #endif #endif diff --git a/src/rufus.c b/src/rufus.c index a9dd7faf..2fb4b975 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "rufus.h" #include "missing.h" @@ -96,37 +97,36 @@ extern const char* sfd_name; * Globals */ OPENED_LIBRARIES_VARS; +RUFUS_UPDATE update = { { 0,0,0 },{ 0,0 }, NULL, NULL }; HINSTANCE hMainInstance; HWND hMainDialog, hMultiToolbar, hSaveToolbar, hHashToolbar, hAdvancedDeviceToolbar, hAdvancedFormatToolbar, hUpdatesDlg = NULL; HIMAGELIST hUpImageList, hDownImageList; -char szFolderPath[MAX_PATH], app_dir[MAX_PATH], system_dir[MAX_PATH], temp_dir[MAX_PATH], sysnative_dir[MAX_PATH]; -char *image_path = NULL, *short_image_path; -float fScale = 1.0f; -int default_fs, fs, bt, pt, tt; // file system, boot type, partition type, target type -int cbw, ddw, ddbh = 0, bh = 0; // (empty) check box width, (empty) drop down width, button height (for and without dropdown match) -uint32_t dur_mins, dur_secs; +uint8_t image_options = 0x00; +uint16_t rufus_version[3], embedded_sl_version[2]; +uint32_t dur_mins, dur_secs, DrivePort[MAX_DRIVES];; loc_cmd* selected_locale = NULL; WORD selected_langid = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); DWORD MainThreadId; HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL; HWND hLogDialog = NULL, hProgress = NULL, hDiskID; -BOOL use_own_c32[NB_OLD_C32] = {FALSE, FALSE}, mbr_selected_by_user = FALSE, display_togo_option = FALSE; +BOOL use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE; BOOL iso_op_in_progress = FALSE, format_op_in_progress = FALSE, right_to_left_mode = FALSE, has_uefi_csm; BOOL enable_HDDs = FALSE, force_update = FALSE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE; BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32, usb_debug; BOOL use_fake_units, preserve_timestamps = FALSE; BOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, enable_file_indexing, large_drive = FALSE, write_as_image = FALSE; +float fScale = 1.0f; int dialog_showing = 0; -uint16_t rufus_version[3], embedded_sl_version[2]; +int default_fs, fs, bt, pt, tt; // file system, boot type, partition type, target type +int cbw, ddw, ddbh = 0, bh = 0; // (empty) check box width, (empty) drop down width, button height (for and without dropdown match) +char szFolderPath[MAX_PATH], app_dir[MAX_PATH], system_dir[MAX_PATH], temp_dir[MAX_PATH], sysnative_dir[MAX_PATH]; char embedded_sl_version_str[2][12] = { "?.??", "?.??" }; char embedded_sl_version_ext[2][32]; char ClusterSizeLabel[MAX_CLUSTER_SIZES][64]; -char msgbox[1024], msgbox_title[32], *ini_file = NULL; -RUFUS_UPDATE update = { {0,0,0}, {0,0}, NULL, NULL}; +char msgbox[1024], msgbox_title[32], *ini_file = NULL, *image_path = NULL, *short_image_path; StrArray DriveID, DriveLabel, DriveHub, BlockingProcess, ImageList; -uint32_t DrivePort[MAX_DRIVES]; -static void ToggleImageOption(void); +static void ToggleImageOption(uint8_t mask); /* * The following is used to allocate slots within the progress bar @@ -577,7 +577,7 @@ static void SetFSFromISO(void) { int i, fs_tmp, preferred_fs = FS_UNKNOWN; uint32_t fs_mask = 0; - BOOL windows_to_go = display_togo_option && (bt == BT_IMAGE) && HAS_WINTOGO(img_report) && + BOOL windows_to_go = (image_options & IMOP_WINTOGO) && (bt == BT_IMAGE) && HAS_WINTOGO(img_report) && (ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1); if (image_path == NULL) @@ -624,7 +624,7 @@ static void SetMBRProps(void) BOOL needs_masquerading = HAS_WINPE(img_report) && (!img_report.uses_minint); if ((!mbr_selected_by_user) && ((image_path == NULL) || (bt != BT_IMAGE) || (fs != FS_NTFS) || HAS_GRUB(img_report) || - ((display_togo_option) && (ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1)) )) { + ((image_options & IMOP_WINTOGO) && (ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1)) )) { CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, BST_UNCHECKED); IGNORE_RETVAL(ComboBox_SetCurSel(hDiskID, 0)); return; @@ -636,19 +636,23 @@ static void SetMBRProps(void) IGNORE_RETVAL(ComboBox_SetCurSel(hDiskID, needs_masquerading?1:0)); } -static void SetToGo(void) +static void SetImageOptions(void) { - HWND hCtrl = GetDlgItem(hMainDialog, IDC_IMAGE_OPTION); + if ((bt != BT_IMAGE) || (image_path == NULL)) { + if (image_options & IMOP_WINTOGO) + ToggleImageOption(IMOP_WINTOGO); + if (image_options & IMOP_PERSISTENCE) + ToggleImageOption(IMOP_PERSISTENCE); + return; + } - // Populate the dropdown - IGNORE_RETVAL(ComboBox_ResetContent(hCtrl)); - IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, lmprintf(MSG_117)), FALSE)); - IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, lmprintf(MSG_118)), TRUE)); - IGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, windows_to_go_selection)); - - if ((((bt != BT_IMAGE) || (image_path == NULL) || (!HAS_WINTOGO(img_report))) && (display_togo_option)) || - ((bt == BT_IMAGE) && (HAS_WINTOGO(img_report)) && (!display_togo_option))) { - ToggleImageOption(); + if ( (!HAS_WINTOGO(img_report) && ( (image_options & IMOP_WINTOGO))) || + ( HAS_WINTOGO(img_report) && (!(image_options & IMOP_WINTOGO))) ) { + ToggleImageOption(IMOP_WINTOGO); + } + if ( (!HAS_PERSISTENCE(img_report) && ( (image_options & IMOP_PERSISTENCE))) || + ( HAS_PERSISTENCE(img_report) && (!(image_options & IMOP_PERSISTENCE))) ) { + ToggleImageOption(IMOP_PERSISTENCE); } } @@ -1153,10 +1157,7 @@ static void DisplayISOProps(void) PRINT_ISO_PROP(img_report.has_symlinks, " Note: This ISO uses symbolic links, which will not be replicated due to file system limitations."); PRINT_ISO_PROP(img_report.has_symlinks, " Because of this, some features from this image may not work..."); - // We don't support ToGo on Windows 7 or earlier, for lack of native ISO mounting capabilities - if (nWindowsVersion >= WINDOWS_8) - if ( ((!display_togo_option) && (HAS_WINTOGO(img_report))) || ((display_togo_option) && (!HAS_WINTOGO(img_report))) ) - ToggleImageOption(); + SetImageOptions(); } // Move a control along the Y axis @@ -1283,32 +1284,47 @@ static void ToggleAdvancedFormatOptions(BOOL enable) InvalidateRect(hMainDialog, NULL, TRUE); } -// Toggle the Image Option dropdown (Windows To Go or Casper settings) -static void ToggleImageOption(void) +// Toggle the Image Option dropdown (Windows To Go or persistence settings) +static void ToggleImageOption(uint8_t mask) { - int i, shift = row_height; - // Windows To Go mode is only available for Windows 8 or later due to the lack - // of an ISO mounting API on previous versions. - // But we still need to be able to hide the Windows To Go option on startup. - if ((nWindowsVersion < WINDOWS_8) && (!display_togo_option)) - return; + int i, shift = (__popcnt16(image_options) >= 2) ? 0 : row_height; - display_togo_option = !display_togo_option; - if (!display_togo_option) - shift = -shift; - section_vpos[1] += shift; - section_vpos[2] += shift; + assert(__popcnt16(mask) <= 1); - // Move the controls up or down - for (i = 0; i= 2) + shift = 0; + + if (shift != 0) { + if ((mask == 0) || (image_options == 0)) + shift = -shift; + section_vpos[1] += shift; + section_vpos[2] += shift; + + if (__popcnt16(image_options) <= 1) { + // Move the controls up or down + for (i = 0; i < ARRAYSIZE(image_option_move_ids); i++) + MoveCtrlY(hMainDialog, image_option_move_ids[i], shift); + + // Resize the main dialog and log window + ResizeDialogs(shift); + } + } // Hide or show the boot options - for (i = 0; i < ARRAYSIZE(image_option_toggle_ids); i++) - ShowWindow(GetDlgItem(hMainDialog, image_option_toggle_ids[i]), display_togo_option ? SW_SHOW : SW_HIDE); + for (i = 0; i < ARRAYSIZE(image_option_toggle_ids); i++) { + ShowWindow(GetDlgItem(hMainDialog, image_option_toggle_ids[i][0]), + (image_options & image_option_toggle_ids[i][1]) ? SW_SHOW : SW_HIDE); + } // If you don't force a redraw here, all kind of bad UI artifacts happen... InvalidateRect(hMainDialog, NULL, TRUE); @@ -1486,7 +1502,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) ret = 0; goto out; } - if ((display_togo_option) && (ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1)) { + if ((image_options & IMOP_WINTOGO) && (ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1)) { if (fs != FS_NTFS) { // Windows To Go only works for NTFS MessageBoxExU(hMainDialog, lmprintf(MSG_097, "Windows To Go"), lmprintf(MSG_092), MB_OK|MB_ICONERROR|MB_IS_RTL, selected_langid); @@ -2544,6 +2560,7 @@ void OnPaint(HDC hdc) static void InitDialog(HWND hDlg) { DWORD len; + HWND hCtrl; HDC hDC; int i, lfHeight; char tmp[128], *token, *buf, *ext, *msg; @@ -2662,6 +2679,11 @@ static void InitDialog(HWND hDlg) // Fill up the boot options dropdown SetBootOptions(); + // Fill up the Image Options Windows To Go dropdown + hCtrl = GetDlgItem(hMainDialog, IDC_IMAGE_OPTION); + IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, lmprintf(MSG_117)), FALSE)); + IGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, lmprintf(MSG_118)), TRUE)); + // Fill up the MBR masqueraded disk IDs ("8 disks should be enough for anybody") IGNORE_RETVAL(ComboBox_SetItemData(hDiskID, ComboBox_AddStringU(hDiskID, lmprintf(MSG_030, LEFT_TO_RIGHT_EMBEDDING "0x80" POP_DIRECTIONAL_FORMATTING)), 0x80)); for (i=1; i<=7; i++) { @@ -2718,7 +2740,7 @@ static void InitDialog(HWND hDlg) ToggleAdvancedDeviceOptions(FALSE); if (!advanced_mode_format) ToggleAdvancedFormatOptions(FALSE); - SetToGo(); + ToggleImageOption(0); // Process commandline parameters if (iso_provided) { @@ -3206,7 +3228,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if ((selected_fs == -1) && (SelectedDrive.DeviceNumber != 0)) GetDrivePartitionData(SelectedDrive.DeviceNumber, tmp, sizeof(tmp), TRUE); SetFileSystemAndClusterSize(tmp); - SetToGo(); + SetImageOptions(); SetProposedLabel(ComboBox_GetCurSel(hDeviceList)); EnableControls(TRUE); tt = (int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme)); @@ -3388,7 +3410,6 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA safe_release_dc(hDlg, hDC); apply_localization(IDD_DIALOG, hDlg); SetUpdateCheck(); - display_togo_option = TRUE; // We display the ToGo controls by default and need to hide them first_log_display = TRUE; log_displayed = FALSE; hLogDialog = MyCreateDialog(hMainInstance, IDD_LOG, hDlg, (DLGPROC)LogCallback); diff --git a/src/rufus.h b/src/rufus.h index 62651b56..ebd649df 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -97,6 +97,9 @@ #define IsChecked(CheckBox_ID) (IsDlgButtonChecked(hMainDialog, CheckBox_ID) == BST_CHECKED) #define MB_IS_RTL (right_to_left_mode?MB_RTLREADING|MB_RIGHT:0) #define CHECK_FOR_USER_CANCEL if (IS_ERROR(FormatStatus)) goto out +// Bit masks used for the display of additional image options in the UI +#define IMOP_WINTOGO 0x01 +#define IMOP_PERSISTENCE 0x02 #define safe_free(p) do {free((void*)p); p = NULL;} while(0) #define safe_mm_free(p) do {_mm_free((void*)p); p = NULL;} while(0) @@ -279,6 +282,12 @@ enum checksum_type { #define IS_EFI_BOOTABLE(r) (r.has_efi != 0) #define IS_BIOS_BOOTABLE(r) (HAS_BOOTMGR(r) || HAS_SYSLINUX(r) || HAS_WINPE(r) || HAS_GRUB(r) || HAS_REACTOS(r) || HAS_KOLIBRIOS(r)) #define HAS_WINTOGO(r) (HAS_BOOTMGR(r) && IS_EFI_BOOTABLE(r) && HAS_INSTALL_WIM(r) && (r.install_wim_version < MAX_WIM_VERSION)) +#ifdef RUFUS_TEST +// TODO: have a better test for persistence/Linux +#define HAS_PERSISTENCE(r) HAS_SYSLINUX(r) +#else +#define HAS_PERSISTENCE(r) FALSE +#endif #define IS_FAT(fs) ((fs == FS_FAT16) || (fs == FS_FAT32)) typedef struct { @@ -393,31 +402,28 @@ enum WindowsVersion { /* * Globals */ +extern RUFUS_UPDATE update; +extern RUFUS_IMG_REPORT img_report; extern HINSTANCE hMainInstance; extern HWND hMainDialog, hLogDialog, hStatus, hDeviceList, hCapacity; extern HWND hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog; extern HWND hInfo, hProgress, hDiskID; +extern WORD selected_langid; +extern DWORD FormatStatus, DownloadStatus, MainThreadId; +extern BOOL use_own_c32[NB_OLD_C32], detect_fakes, iso_op_in_progress, format_op_in_progress, right_to_left_mode; +extern BOOL allow_dual_uefi_bios, large_drive, usb_debug; +extern int64_t iso_blocking_status; +extern uint8_t image_options; +extern uint16_t rufus_version[3], embedded_sl_version[2]; +extern size_t ubuffer_pos; +extern const int nb_steps[FS_MAX]; extern float fScale; +extern int nWindowsVersion, nWindowsBuildNumber, dialog_showing; +extern int fs, bt, pt, tt; +extern unsigned long syslinux_ldlinux_len[2]; +extern char WindowsVersionStr[128], ubuffer[UBUFFER_SIZE], embedded_sl_version_str[2][12]; extern char szFolderPath[MAX_PATH], app_dir[MAX_PATH], temp_dir[MAX_PATH], system_dir[MAX_PATH], sysnative_dir[MAX_PATH]; extern char* image_path; -extern DWORD FormatStatus, DownloadStatus, MainThreadId; -extern unsigned long syslinux_ldlinux_len[2]; -extern const int nb_steps[FS_MAX]; -extern BOOL use_own_c32[NB_OLD_C32], detect_fakes, iso_op_in_progress, format_op_in_progress, right_to_left_mode; -extern BOOL allow_dual_uefi_bios, display_togo_option, large_drive, usb_debug; -extern RUFUS_IMG_REPORT img_report; -extern int64_t iso_blocking_status; -extern uint16_t rufus_version[3], embedded_sl_version[2]; -extern int nWindowsVersion; -extern int nWindowsBuildNumber; -extern int fs, bt, pt, tt; -extern char WindowsVersionStr[128]; -extern size_t ubuffer_pos; -extern char ubuffer[UBUFFER_SIZE]; -extern char embedded_sl_version_str[2][12]; -extern RUFUS_UPDATE update; -extern int dialog_showing; -extern WORD selected_langid; /* * Shared prototypes diff --git a/src/rufus.rc b/src/rufus.rc index 9e76b862..b05e202e 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -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.2.1328" +CAPTION "Rufus 3.2.1329" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -45,7 +45,10 @@ BEGIN PUSHBUTTON "#",IDC_HASH,162,52,10,12,BS_FLAT | NOT WS_VISIBLE PUSHBUTTON "SELECT",IDC_SELECT,180,52,45,10 LTEXT "Image option",IDS_IMAGE_OPTION_TXT,8,65,216,8 - COMBOBOX IDC_IMAGE_OPTION,8,74,216,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_IMAGE_OPTION,8,74,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_PERSISTENCE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,125,76,34,8 + EDITTEXT IDC_PERSISTENCE_SIZE,160,74,36,12,ES_AUTOHSCROLL + COMBOBOX IDC_PERSISTENCE_UNITS,200,74,24,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Partition scheme",IDS_PARTITION_TYPE_TXT,8,87,96,8 COMBOBOX IDC_PARTITION_TYPE,8,96,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Target system",IDS_TARGET_SYSTEM_TXT,128,87,96,8 @@ -389,8 +392,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,2,1328,0 - PRODUCTVERSION 3,2,1328,0 + FILEVERSION 3,2,1329,0 + PRODUCTVERSION 3,2,1329,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -407,13 +410,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.2.1328" + VALUE "FileVersion", "3.2.1329" VALUE "InternalName", "Rufus" - VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)" + VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.2.1328" + VALUE "ProductVersion", "3.2.1329" END END BLOCK "VarFileInfo" diff --git a/src/ui.h b/src/ui.h index e4388755..ff3aeebb 100644 --- a/src/ui.h +++ b/src/ui.h @@ -85,9 +85,12 @@ static int image_option_move_ids[] = { IDC_STATUS_TOOLBAR, }; -static int image_option_toggle_ids[] = { - IDS_IMAGE_OPTION_TXT, - IDC_IMAGE_OPTION, +static int image_option_toggle_ids[][2] = { + { IDS_IMAGE_OPTION_TXT, 0x03 }, + { IDC_IMAGE_OPTION, 0x01 }, + { IDC_PERSISTENCE_SLIDER, 0x02 }, + { IDC_PERSISTENCE_SIZE, 0x02 }, + { IDC_PERSISTENCE_UNITS, 0x02 } }; static int advanced_device_move_ids[] = { @@ -192,7 +195,7 @@ static int half_width_ids[] = { static int adjust_dpi_ids[][5] = { {IDS_DEVICE_TXT, IDC_DEVICE, IDC_SAVE_TOOLBAR, 0, 0}, {IDS_BOOT_SELECTION_TXT, IDC_BOOT_SELECTION, IDC_HASH_TOOLBAR, IDC_SELECT, 0}, - {IDS_IMAGE_OPTION_TXT, IDC_IMAGE_OPTION, 0, 0, 0}, + {IDS_IMAGE_OPTION_TXT, IDC_IMAGE_OPTION, IDC_PERSISTENCE_SLIDER, IDC_PERSISTENCE_SIZE, IDC_PERSISTENCE_UNITS}, {IDS_PARTITION_TYPE_TXT, IDC_PARTITION_TYPE, IDS_TARGET_SYSTEM_TXT, IDC_TARGET_SYSTEM, IDS_CSM_HELP_TXT}, {IDC_ADVANCED_DEVICE_TOOLBAR, 0, 0, 0, 0}, {IDC_LIST_USB_HDD, 0, 0, 0, 0 },