From 1254d1695de5ae19bbbd2b258ab08442b8d15a7a Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 14 Feb 2018 22:20:42 +0000 Subject: [PATCH] * [internal] UI redesign, part 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Plus ça change... --- res/localization/ChangeLog.txt | 5 ++ res/localization/rufus.loc | 50 +++++++-------- src/license.h | 2 +- src/localization_data.h | 21 +++++-- src/resource.h | 31 +++++---- src/rufus.c | 111 ++++++++++++++++++++++----------- src/rufus.rc | 13 ++-- src/settings.h | 2 +- 8 files changed, 145 insertions(+), 90 deletions(-) diff --git a/res/localization/ChangeLog.txt b/res/localization/ChangeLog.txt index 3016958f..f214c63b 100644 --- a/res/localization/ChangeLog.txt +++ b/res/localization/ChangeLog.txt @@ -15,6 +15,11 @@ content. PLEASE, do not just look at this Changelog when updating your translation, but always use the English section of rufus.loc as your base. For instance, MSG_114, that was introduced in v1.0.8 is MORE than one line! +o Version 1.0.23 (2018.??.??) + - Changed MSG_280 "Image selection" -> "Disk or ISO image" + - Changed MSG_281 "(Please select an image)" -> "%s (Please select)" + MSG_281 + MSG_280 are used to create the message that appears in the boot selection dropdown when an image has not been selected. + o Version 1.0.22 (2017.07.17) - *NEW* MSG_295 "Warning: Unofficial version" - *NEW* MSG_296 "This version of Rufus was NOT produced by its official developer(s).\n\nAre you sure you want to run it?" diff --git a/res/localization/rufus.loc b/res/localization/rufus.loc index 4377e500..747c62e3 100644 --- a/res/localization/rufus.loc +++ b/res/localization/rufus.loc @@ -97,15 +97,14 @@ v 1.0.23 # Main dialog g IDD_DIALOG -t IDS_DEVICE_SETTINGS_TXT "Device Settings" +t IDS_DRIVE_PROPERTIES_TXT "Drive Properties" t IDS_DEVICE_TXT "Device" # TODO: use MSG_278 for translations t IDS_BOOT_TYPE_TXT "Boot selection" -t IDC_SELECT_IMAGE "SELECT" +t IDC_SELECT "SELECT" t IDS_IMAGE_OPTION_TXT "Image Option" t IDS_PARTITION_TYPE_TXT "Partition scheme" t IDS_TARGET_SYSTEM_TXT "Target system" -t IDC_ADVANCED_DEVICE_SETTINGS "Advanced Device Settings" t IDC_LIST_USB_HDD "List USB Hard Drives" # Note: It is acceptable to drop the parenthesis () below if you are running out of space # as there is a tooltip (MSG_169) providing these details. @@ -118,14 +117,12 @@ t IDS_FORMAT_OPTIONS_TXT "Format Options" t IDS_FILESYSTEM_TXT "File system" t IDS_CLUSTERSIZE_TXT "Cluster size" t IDS_LABEL_TXT "Volume label" -t IDC_ADVANCED_FORMAT_OPTIONS "Advanced Format Options" t IDC_QUICKFORMAT "Quick format" t IDC_BADBLOCKS "Check device for bad blocks" t IDC_EXTENDED_LABEL "Create extended label and icon files" t IDS_STATUS_TXT "Status" t IDCANCEL "CLOSE" t IDC_START "START" -t IDS_ADVANCED_OPTIONS_GRP "Advanced Options" # About dialog g IDD_ABOUTBOX @@ -540,12 +537,9 @@ t MSG_276 "Write in %s mode (Recommended)" t MSG_277 "Write in %s mode" # The following will be used for new controls of the Rufus 3.0 interface # They are added as messages, so that I will have them available when needed. -# 278 & 280 will be dropdown titles, similar to how IDS_DEVICE_TXT or IDS_PARTITION_TYPE_TXT are used -# 279 & 281 will be items that can appear in the dropdowns -t MSG_278 "Boot type" t MSG_279 "Non bootable" -t MSG_280 "Image selection" -t MSG_281 "(Please select an image)" +t MSG_280 "Disk or ISO image" +t MSG_281 "%s (Please select)" t MSG_282 "Exclusive USB drive locking" t MSG_283 "Invalid signature" t MSG_284 "The downloaded executable is missing a digital signature." @@ -574,15 +568,14 @@ t MSG_301 "Standard Windows installation" # Only translate if Microsoft has a specific name for http://en.wikipedia.org/wiki/Windows_To_Go in your language # Otherwise, you can add a parenthesis eg. "Windows To Go (hint at what it does)" and/or use the tooltip (MSG_200) t MSG_302 "Windows To Go" -t MSG_303 "Disk or ISO image" -t MSG_304 "%s (Please select)" -t MSG_305 "Settings" -# Was 'IDC_ABOUT' -t MSG_306 "About" -# Was 'IDC_LOG' -t MSG_307 "Log" - - +t MSG_305 "Show application settings" +t MSG_306 "Show information about this application" +t MSG_307 "Show the log" +t MSG_308 "advanced drive properties" +t MSG_309 "advanced format options" +t MSG_310 "Show %s" +t MSG_311 "Hide %s" +t MSG_312 "Create a disk image of the selected device" ################################################################################ ############################# TRANSLATOR END COPY ############################## @@ -5218,13 +5211,12 @@ v 1.0.23 b "en-US" g IDD_DIALOG -t IDS_DEVICE_SETTINGS_TXT "Options de Périphérique" +t IDS_DRIVE_PROPERTIES_TXT "Options de Périphérique" t IDS_DEVICE_TXT "Périphérique" t IDS_BOOT_TYPE_TXT "Type de démarrage" -t IDC_SELECT_IMAGE "SELECTION" +t IDC_SELECT "SELECTION" t IDS_IMAGE_OPTION_TXT "Option d'image" t IDS_PARTITION_TYPE_TXT "Schéma de partition" -t IDC_ADVANCED_DEVICE_SETTINGS "Options de Périphérique Avancées" t IDS_TARGET_SYSTEM_TXT "Système de destination" t IDS_FILESYSTEM_TXT "Système de fichiers" t IDS_CLUSTERSIZE_TXT "Taille d'unité d'allocation" @@ -5235,7 +5227,6 @@ t IDC_QUICKFORMAT "Formatage rapide" t IDC_BOOT "Créer un disque de démarrage" t IDC_WINDOWS_INSTALL "Installation standard de Windows" t IDC_EXTENDED_LABEL "Ajouter un label étendu et une icône" -t IDC_ADVANCED_FORMAT_OPTIONS "Options de Formatage Avancées" t IDS_STATUS_TXT "Statut" t IDC_ABOUT "A propos..." t IDCANCEL "FERMER" @@ -5605,8 +5596,8 @@ t MSG_268 "Application de l'image Windows..." t MSG_269 "Préservation des dates de fichiers" t MSG_270 "Debug USB" t MSG_271 "Calculation des checksums de l'image : %0.1f%% complété" -t MSG_272 "Calcule les checksums MD5, SHA1 et SHA256 pour l'image sélectionée" -t MSG_273 "Change la langue de l'application" +t MSG_272 "Calculer les checksums MD5, SHA1 et SHA256 pour l'image sélectionée" +t MSG_273 "Changer la langue de l'application" t MSG_274 "Image ISOHybrid détectée" t MSG_275 "L'image que vous avez sélectionnée est une image 'ISOHybrid'. Cela veut dire qu’elle peut " "être écrite soit en mode %s (copie de fichiers) ou en mode %s (image disque).\n" @@ -5643,7 +5634,14 @@ t MSG_298 "Le fichier ISO que vous avez sélectionné ne fait pas la bonne taill "cliquant le bouton '#'." t MSG_303 "Image disque ou ISO" t MSG_304 "%s (Veuillez sélectionner)" - +t MSG_305 "Afficher les paramètres de l'application" +t MSG_306 "Afficher les informations à propos de cette application" +t MSG_307 "Afficher le log" +t MSG_308 "options de périphérique avancées" +t MSG_309 "options de formatage avancées" +t MSG_310 "Afficher les %s" +t MSG_311 "Cacher les %s" +t MSG_312 "Créer une image disque à partir du périphérique sélectionné" ################################################################################ l "de-DE" "German (Deutsch)" 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407 diff --git a/src/license.h b/src/license.h index 931607a8..89b5fd45 100644 --- a/src/license.h +++ b/src/license.h @@ -34,7 +34,7 @@ RUFUS_URL "\\line\n" const char* additional_copyrights = "{\\rtf1\\ansi\n" -"Rufus 3.0 GUI redesign concept by Fahad Al-Riyami\\line\n" +"UI redesign concept by Fahad Al-Riyami\\line\n" "Used with kind authorization\\line\n" "\\line\n" "Icon by PC Unleashed:\\line\n" diff --git a/src/localization_data.h b/src/localization_data.h index 21667ce1..7011dcbc 100644 --- a/src/localization_data.h +++ b/src/localization_data.h @@ -43,16 +43,15 @@ const loc_control_id control_id[] = { LOC_CTRL(IDC_PARTITION_TYPE), LOC_CTRL(IDC_CLUSTERSIZE), LOC_CTRL(IDC_STATUS), - LOC_CTRL(IDC_ABOUT), LOC_CTRL(IDC_LABEL), LOC_CTRL(IDC_QUICKFORMAT), LOC_CTRL(IDC_SHOW_ADVANCED_TOOLBAR), LOC_CTRL(IDC_BADBLOCKS), LOC_CTRL(IDC_PROGRESS), - LOC_CTRL(IDC_BOOTTYPE), + LOC_CTRL(IDC_BOOT_TYPE), LOC_CTRL(IDC_NBPASSES), LOC_CTRL(IDC_TEST), - LOC_CTRL(IDC_SELECT_IMAGE), + LOC_CTRL(IDC_SELECT), LOC_CTRL(IDC_EXTENDED_LABEL), LOC_CTRL(IDC_RUFUS_MBR), LOC_CTRL(IDC_TARGET_SYSTEM), @@ -64,7 +63,6 @@ const loc_control_id control_id[] = { LOC_CTRL(IDC_STATUS_TOOLBAR), LOC_CTRL(IDC_HASH), LOC_CTRL(IDC_SAVE), - LOC_CTRL(IDC_SELECT), LOC_CTRL(IDC_IMAGE_OPTION), LOC_CTRL(IDC_ABOUT_LICENSE), LOC_CTRL(IDC_ABOUT_ICON), @@ -76,6 +74,7 @@ const loc_control_id control_id[] = { LOC_CTRL(IDC_NOTIFICATION_LINE), LOC_CTRL(IDC_ADVANCED_DEVICE_TOOLBAR), LOC_CTRL(IDC_ADVANCED_FORMAT_TOOLBAR), + LOC_CTRL(IDC_ABOUT), LOC_CTRL(IDC_LOG), LOC_CTRL(IDC_WINDOWS_INSTALL), LOC_CTRL(IDC_WINDOWS_TO_GO), @@ -137,7 +136,7 @@ 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_DEVICE_SETTINGS), + LOC_CTRL(IDC_ADVANCED_DRIVE_PROPERTIES), LOC_CTRL(IDC_ADVANCED_FORMAT_OPTIONS), LOC_CTRL(IDS_DEVICE_TXT), LOC_CTRL(IDS_PARTITION_TYPE_TXT), @@ -154,7 +153,7 @@ const loc_control_id control_id[] = { LOC_CTRL(IDS_TARGET_SYSTEM_TXT), LOC_CTRL(IDS_IMAGE_OPTION_TXT), LOC_CTRL(IDS_BOOT_TYPE_TXT), - LOC_CTRL(IDS_DEVICE_SETTINGS_TXT), + LOC_CTRL(IDS_DRIVE_PROPERTIES_TXT), LOC_CTRL(IDS_FORMAT_OPTIONS_TXT), LOC_CTRL(IDS_STATUS_TXT), LOC_CTRL(MSG_000), @@ -468,6 +467,16 @@ const loc_control_id control_id[] = { LOC_CTRL(MSG_308), LOC_CTRL(MSG_309), LOC_CTRL(MSG_310), + LOC_CTRL(MSG_311), + LOC_CTRL(MSG_312), + LOC_CTRL(MSG_313), + LOC_CTRL(MSG_314), + LOC_CTRL(MSG_315), + LOC_CTRL(MSG_316), + LOC_CTRL(MSG_317), + LOC_CTRL(MSG_318), + LOC_CTRL(MSG_319), + LOC_CTRL(MSG_320), LOC_CTRL(MSG_MAX), LOC_CTRL(IDOK), LOC_CTRL(IDCANCEL), diff --git a/src/resource.h b/src/resource.h index 159a1026..55c5d55e 100644 --- a/src/resource.h +++ b/src/resource.h @@ -79,16 +79,15 @@ #define IDC_PARTITION_TYPE 1004 #define IDC_CLUSTERSIZE 1005 #define IDC_STATUS 1006 -#define IDC_ABOUT 1007 #define IDC_LABEL 1008 #define IDC_QUICKFORMAT 1009 #define IDC_SHOW_ADVANCED_TOOLBAR 1010 #define IDC_BADBLOCKS 1011 #define IDC_PROGRESS 1012 -#define IDC_BOOTTYPE 1013 +#define IDC_BOOT_TYPE 1013 #define IDC_NBPASSES 1014 #define IDC_TEST 1015 -#define IDC_SELECT_IMAGE 1016 +#define IDC_SELECT 1016 #define IDC_EXTENDED_LABEL 1017 #define IDC_RUFUS_MBR 1018 #define IDC_TARGET_SYSTEM 1019 @@ -100,19 +99,19 @@ #define IDC_STATUS_TOOLBAR 1025 #define IDC_HASH 1026 #define IDC_SAVE 1027 -#define IDC_SELECT 1028 #define IDC_IMAGE_OPTION 1029 #define IDC_ABOUT_LICENSE 1030 #define IDC_ABOUT_ICON 1031 -#define IDC_ABOUT_COPYRIGHTS 1033 -#define IDC_ABOUT_BLURB 1034 -#define IDC_LICENSE_TEXT 1035 +#define IDC_ABOUT_COPYRIGHTS 1032 +#define IDC_ABOUT_BLURB 1033 +#define IDC_LICENSE_TEXT 1034 #define IDC_NOTIFICATION_ICON 1040 #define IDC_NOTIFICATION_TEXT 1041 #define IDC_NOTIFICATION_LINE 1042 #define IDC_ADVANCED_DEVICE_TOOLBAR 1043 #define IDC_ADVANCED_FORMAT_TOOLBAR 1044 -#define IDC_LOG 1045 +#define IDC_ABOUT 1045 +#define IDC_LOG 1046 #define IDC_WINDOWS_INSTALL 1047 #define IDC_WINDOWS_TO_GO 1048 #define IDC_SHOW_ADVANCED_OPTIONS 1049 @@ -173,7 +172,7 @@ #define IDC_LIST_ITEM14 1109 #define IDC_LIST_ITEM15 1110 #define IDC_LIST_ITEMMAX 1111 -#define IDC_ADVANCED_DEVICE_SETTINGS 1112 +#define IDC_ADVANCED_DRIVE_PROPERTIES 1112 #define IDC_ADVANCED_FORMAT_OPTIONS 1113 #define IDS_DEVICE_TXT 2000 #define IDS_PARTITION_TYPE_TXT 2001 @@ -190,7 +189,7 @@ #define IDS_TARGET_SYSTEM_TXT 2013 #define IDS_IMAGE_OPTION_TXT 2014 #define IDS_BOOT_TYPE_TXT 2015 -#define IDS_DEVICE_SETTINGS_TXT 2016 +#define IDS_DRIVE_PROPERTIES_TXT 2016 #define IDS_FORMAT_OPTIONS_TXT 2017 #define IDS_STATUS_TXT 2018 #define MSG_000 3000 @@ -504,7 +503,17 @@ #define MSG_308 3308 #define MSG_309 3309 #define MSG_310 3310 -#define MSG_MAX 3311 +#define MSG_311 3311 +#define MSG_312 3312 +#define MSG_313 3313 +#define MSG_314 3314 +#define MSG_315 3315 +#define MSG_316 3316 +#define MSG_317 3317 +#define MSG_318 3318 +#define MSG_319 3319 +#define MSG_320 3320 +#define MSG_MAX 3321 // Next default values for new objects // diff --git a/src/rufus.c b/src/rufus.c index ebbd008f..35c6ae90 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -177,6 +177,7 @@ static HANDLE format_thid = NULL, dialog_handle = NULL; static HWND hSelectImage = NULL, hStart = NULL; static HICON hIconSave, hIconDown, hIconUp, hIconLang, hIconAbout, hIconSettings, hIconLog; static char szTimer[12] = "00:00:00"; +static wchar_t wtbtext[2][128]; static unsigned int timer; extern BOOL enable_iso, enable_joliet, enable_rockridge, enable_ntfs_compression; @@ -318,7 +319,7 @@ static void SetBootOptions(void) IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, "FreeDOS"), BT_FREEDOS)); image_index = (nWindowsVersion < WINDOWS_10) ? 3 : 2; IGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, - (image_path == NULL) ? lmprintf(MSG_304, lmprintf(MSG_303)) : short_image_path), BT_IMAGE)); + (image_path == NULL) ? lmprintf(MSG_281, lmprintf(MSG_280)) : short_image_path), BT_IMAGE)); if (advanced_mode_device) { static_sprintf(tmp, "Syslinux %s", embedded_sl_version_str[0]); @@ -360,7 +361,6 @@ static void SetPartitionSchemeAndTargetSystem(BOOL only_target) allowed_target_system[0] = FALSE; allowed_target_system[1] = FALSE; allowed_target_system[2] = TRUE; - // TODO: Grey out target system break; case BT_IMAGE: if (pt == PARTITION_STYLE_GPT) @@ -427,7 +427,6 @@ static void SetPartitionSchemeAndTargetSystem(BOOL only_target) if (allowed_target_system[2]) IGNORE_RETVAL(ComboBox_SetItemData(hTargetSystem, ComboBox_AddStringU(hTargetSystem, lmprintf(MSG_033)), TT_BIOS)); - // TODO: use SetComboEntry to be more explicit IGNORE_RETVAL(ComboBox_SetCurSel(hTargetSystem, 0)); } @@ -1042,7 +1041,6 @@ void UpdateProgress(int op, float percent) // Toggle controls according to operation static void EnableControls(BOOL bEnable) { - // TODO - use a list? EnableWindow(GetDlgItem(hMainDialog, IDC_DEVICE), bEnable); EnableWindow(hStart, (ComboBox_GetCurSel(hDeviceList)<0)?FALSE:bEnable); EnableWindow(GetDlgItem(hMainDialog, IDC_ABOUT), bEnable); @@ -1052,7 +1050,9 @@ static void EnableControls(BOOL bEnable) EnableWindow(hNBPasses, bEnable); EnableWindow(hAdvancedDeviceToolBar, bEnable); EnableWindow(hAdvancedFormatToolBar, bEnable); - EnableWindow(hMultiToolbar, bEnable); + SendMessage(hMultiToolbar, TB_ENABLEBUTTON, (WPARAM)IDC_ABOUT, (LPARAM)bEnable); + SendMessage(hMultiToolbar, TB_ENABLEBUTTON, (WPARAM)IDC_SETTINGS, (LPARAM)bEnable); + SendMessage(hMultiToolbar, TB_ENABLEBUTTON, (WPARAM)IDC_LANG, (LPARAM)bEnable); EnableWindow(hStatusToolbar, bEnable); EnableWindow(GetDlgItem(hMainDialog, IDC_LIST_USB_HDD), bEnable); SetDlgItemTextU(hMainDialog, IDCANCEL, lmprintf(bEnable?MSG_006:MSG_007)); @@ -1275,10 +1275,12 @@ static void ResizeDialogs(int shift) Edit_Scroll(hLog, 0, Edit_GetLineCount(hLog)); } -// Toggle "advanced" mode +// Toggle "advanced" options static void ToggleAdvancedDeviceOptions(BOOL enable) { RECT rc; + SIZE sz; + TBBUTTONINFO button_info; int i, shift = advanced_device_section_height; if (!enable) @@ -1286,7 +1288,17 @@ static void ToggleAdvancedDeviceOptions(BOOL enable) format_vpos += shift; status_vpos += shift; + // Toggle the Hide/Show toolbar text + utf8_to_wchar_no_alloc(lmprintf((enable) ? MSG_311 : MSG_310, lmprintf(MSG_308)), wtbtext[0], ARRAYSIZE(wtbtext[0])); + button_info.cbSize = sizeof(button_info); + button_info.dwMask = TBIF_TEXT; + button_info.pszText = wtbtext[0]; + SendMessage(hAdvancedDeviceToolBar, TB_SETBUTTONINFO, (WPARAM)IDC_ADVANCED_DRIVE_PROPERTIES, (LPARAM)&button_info); SendMessage(hAdvancedDeviceToolBar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)((enable) ? hUpImageList : hDownImageList)); + GetWindowRect(hAdvancedDeviceToolBar, &rc); + MapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2); + SendMessage(hAdvancedDeviceToolBar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz); + SetWindowPos(hAdvancedDeviceToolBar, HWND_TOP, rc.left, rc.top, sz.cx, rc.bottom - rc.top, 0); // Move the controls up or down for (i = 0; i