From 75e2f18d7c6973c10b430e82506edd8b75ee0c94 Mon Sep 17 00:00:00 2001 From: akruphi <92621645+akruphi@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:46:10 +0300 Subject: [PATCH 1/3] Minor after #2542 --- WinPort/src/ConsoleInput.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WinPort/src/ConsoleInput.cpp b/WinPort/src/ConsoleInput.cpp index 45ceee5a9..c0a0c2252 100644 --- a/WinPort/src/ConsoleInput.cpp +++ b/WinPort/src/ConsoleInput.cpp @@ -256,7 +256,8 @@ const char* VirtualKeyNames[] = { "VK_ZOOM", // 0xFB "VK_NONAME", // 0xFC "VK_PA1", // 0xFD - "VK_OEM_CLEAR" // 0xFE + "VK_OEM_CLEAR", // 0xFE + "0xFF" // 0xFF }; char* FormatKeyState(uint16_t state) { From cc4fb69c18ffad96edba2eefe27a7f9cb5d9b420 Mon Sep 17 00:00:00 2001 From: akruphi <92621645+akruphi@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:33:48 +0300 Subject: [PATCH 2/3] Yet more customization via menu/dialogs after #2452 --- far2l/bootstrap/scripts/FarEng.hlf.m4 | 8 +-- far2l/bootstrap/scripts/FarHun.hlf.m4 | 8 +-- far2l/bootstrap/scripts/FarRus.hlf.m4 | 8 +-- far2l/bootstrap/scripts/FarUkr.hlf.m4 | 2 +- far2l/bootstrap/scripts/farlang.templ.m4 | 71 +++++++++++++++++------- far2l/src/cfg/config.cpp | 63 +++++++++++++++------ 6 files changed, 111 insertions(+), 49 deletions(-) diff --git a/far2l/bootstrap/scripts/FarEng.hlf.m4 b/far2l/bootstrap/scripts/FarEng.hlf.m4 index 8c951856c..5a14b90ea 100644 --- a/far2l/bootstrap/scripts/FarEng.hlf.m4 +++ b/far2l/bootstrap/scripts/FarEng.hlf.m4 @@ -2531,14 +2531,14 @@ $ #Settings dialog: panel# #Highlight files# Enable ~files highlighting~@Highlight@. - #Highlight files - Marking# Button for open dialog - (works only if #Highlight files# enabled) + #Highlight files# Button for open dialog + # - Marking# (works only if #Highlight files# enabled) for customize show/align markers in panel (from the panel it can be switched by #Ctrl-Alt-N# and #Ctrl-Alt-M#). - #Directory showas settings# Button for open dialog, which can be - also open from panel by #Ctrl-Alt-D#. + #Dirs and symlinks# Button for open dialog, which can be + #in Size column# also open from panel by #Ctrl-Alt-D#. #Auto change folder# If checked, cursor moves in the ~tree panel~@TreePanel@ diff --git a/far2l/bootstrap/scripts/FarHun.hlf.m4 b/far2l/bootstrap/scripts/FarHun.hlf.m4 index 13ae4ee2e..deaac55f0 100644 --- a/far2l/bootstrap/scripts/FarHun.hlf.m4 +++ b/far2l/bootstrap/scripts/FarHun.hlf.m4 @@ -2227,14 +2227,14 @@ $ #Beállítások: panel beállítások# #Fájlok kiemelése# A ~fájlkiemelések~@Highlight@ engedélyezése. - #Fájlok kiemelése - Jelzés# Button for open dialog - (works only if #Fájlok kiemelése# enabled) + #Fájlok kiemelése# Button for open dialog + # - Jelzés# (works only if #Fájlok kiemelése# enabled) for customize show/align markers in panel (from the panel it can be switched by #Ctrl-Alt-N# and #Ctrl-Alt-M#). - #Könyvtár megjelenítési beállításai# Button for open dialog, which can be - also open from panel by #Ctrl-Alt-D#. + #Dirs and symlinks# Button for open dialog, which can be + #in Size column# also open from panel by #Ctrl-Alt-D#. #Automatikus# Ha engedélyezett, a ~fastruktúra panelen~@TreePanel@ diff --git a/far2l/bootstrap/scripts/FarRus.hlf.m4 b/far2l/bootstrap/scripts/FarRus.hlf.m4 index 1ac180b5f..15411ee3e 100644 --- a/far2l/bootstrap/scripts/FarRus.hlf.m4 +++ b/far2l/bootstrap/scripts/FarRus.hlf.m4 @@ -2575,14 +2575,14 @@ $ #Настройка панели# #Раскраска файлов# Разрешает ~раскраску файлов~@Highlight@ - #Раскраска файлов - Маркировка# Кнопка для открытия диалога - (работает только, если #Раскраска файлов# включена) + #Раскраска файлов# Кнопка для открытия диалога + # - Маркировка# (работает только, если #Раскраска файлов# включена) для настройки показа/выравнивания маркеров на панели (также могут быть переключены из панели по #Ctrl-Alt-N# и #Ctrl-Alt-M#). - #Настройки отображения каталога# Кнопка для открытия диалога, который - также может быть открыт из панели по #Ctrl-Alt-D#. + #Каталоги и симлинки# Кнопка для открытия диалога, который + #в столбце Размер# также может быть открыт из панели по #Ctrl-Alt-D#. #Автосмена папки# Если эта опция включена, то передвижения diff --git a/far2l/bootstrap/scripts/FarUkr.hlf.m4 b/far2l/bootstrap/scripts/FarUkr.hlf.m4 index cf3de1da5..b87e4b6c9 100644 --- a/far2l/bootstrap/scripts/FarUkr.hlf.m4 +++ b/far2l/bootstrap/scripts/FarUkr.hlf.m4 @@ -2422,7 +2422,7 @@ $ #Налаштування панелі# (from the panel it can be switched by #Ctrl-Alt-N# and #Ctrl-Alt-M#). - #Налаштування відображення каталогу# Button for open dialog, which can be + #Dirs and symlinks in Size column# Button for open dialog, which can be also open from panel by #Ctrl-Alt-D#. diff --git a/far2l/bootstrap/scripts/farlang.templ.m4 b/far2l/bootstrap/scripts/farlang.templ.m4 index 5b8fa8171..265a30c2f 100644 --- a/far2l/bootstrap/scripts/farlang.templ.m4 +++ b/far2l/bootstrap/scripts/farlang.templ.m4 @@ -2422,15 +2422,26 @@ upd:"Input settings" "Налады увода" DirSettingsTitle -"Настройки отображения каталога" -"Directory showas settings" -"Nastavení zobrazení adresáře" -"Einstellungen zur Anzeige des Verzeichnisses" -"Könyvtár megjelenítési beállításai" -"Ustawienia wyświetlania katalogu" -"Configuración de visualización del directorio" -"Налаштування відображення каталогу" -"Налады адлюстравання каталога" +"Каталоги и симлинки в столбце Размер" +"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" +upd:"Dirs and symlinks in Size column" + +DirSettingsHint +"Ctrl-Alt-D для быстрого открытия с панелей" +"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" +upd:"Use Ctrl-Alt-D to quick open from panel" DirSettingsCenter "Выравнивать по центру" @@ -2465,16 +2476,27 @@ DirSettingsShowAs "Показувати каталог як:" "Паказваць каталог як:" -DirSettingsEmpty -"-" -"-" -"-" -"-" -"-" -"-" -"-" -"-" -"-" +DirSettingsSymlinkText +"Для симлинка на файлы показывать:" +"For symlink to file show:" +upd:"For symlink to file show:" +upd:"For symlink to file show:" +upd:"For symlink to file show:" +upd:"For symlink to file show:" +upd:"For symlink to file show:" +upd:"For symlink to file show:" +upd:"For symlink to file show:" + +DirSettingsSymlinkRadio2 +"размер целевого файла" +"size of target file" +upd:"size of target file" +upd:"size of target file" +upd:"size of target file" +upd:"size of target file" +upd:"size of target file" +upd:"size of target file" +upd:"size of target file" DirSettingsApply "Применить" @@ -2487,6 +2509,17 @@ DirSettingsApply "Застосувати" "Ужыць" +DirSettingsSymlinkSizeHint +"Ctrl-Alt-L для переключения из панелей" +"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" +upd:"Use Ctrl-Alt-L to quick toggle from panel" + ConfigClock "&Часы в панелях" "&Clock in panels" diff --git a/far2l/src/cfg/config.cpp b/far2l/src/cfg/config.cpp index 2615fe031..e850ab037 100644 --- a/far2l/src/cfg/config.cpp +++ b/far2l/src/cfg/config.cpp @@ -314,14 +314,20 @@ enum enumDirCfgDialog { ID_DIRCFG_TITLE = 0, + ID_DIRCFG_STYLE_HINT_D, ID_DIRCFG_STYLE_TEXT, ID_DIRCFG_STYLE_COMBO, - ID_DIRCFG_SEPARATOR, ID_DIRCFG_CHECKBOX_CENTER, ID_DIRCFG_CHECKBOX_SURR, ID_DIRCFG_SURR_COMBO, + ID_DIRCFG_SEPARATOR, + ID_DIRCFG_SYMLINK_TEXT, + ID_DIRCFG_SYMLINK_RADIO1_TEXT, + ID_DIRCFG_SYMLINK_RADIO2_SIZE, + ID_DIRCFG_STYLE_HINT_L, + ID_DIRCFG_SEPARATOR2, ID_DIRCFG_BUTTON_OK, ID_DIRCFG_BUTTON_CANCEL, @@ -380,6 +386,9 @@ static LONG_PTR WINAPI DirCfgDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR SendDlgMessage(hDlg, DM_LISTSET, ID_DIRCFG_STYLE_COMBO, (LONG_PTR)&farlist); // SendDlgMessage(hDlg, DM_LISTSETCURPOS, dircfg_data->DirNameStyleComboID, (LONG_PTR)&flpos); update_surrcombo( ); + + swprintf(tmp, 48, L"\"%ls\"", SymLinkNames[dircfg_data->DirNameStyle].CPtr()); + SendDlgMessage(hDlg, DM_SETTEXTPTR, ID_DIRCFG_SYMLINK_RADIO1_TEXT, (LONG_PTR)tmp); } break; @@ -388,6 +397,8 @@ static LONG_PTR WINAPI DirCfgDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR dircfg_data->DirNameStyle = SendDlgMessage(hDlg, DM_LISTGETCURPOS, ID_DIRCFG_STYLE_COMBO, (LONG_PTR)0); update_surrcombo( ); + swprintf(tmp, 48, L"\"%ls\"", SymLinkNames[dircfg_data->DirNameStyle].CPtr()); + SendDlgMessage(hDlg, DM_SETTEXTPTR, ID_DIRCFG_SYMLINK_RADIO1_TEXT, (LONG_PTR)tmp); SendDlgMessage(hDlg, DM_REDRAW, 0, 0); } else if (Param1 == ID_DIRCFG_SURR_COMBO) { @@ -409,6 +420,11 @@ static LONG_PTR WINAPI DirCfgDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR Opt.DirNameStyle |= DIRNAME_STYLE_CENTERED * dircfg_data->bCentered; Opt.DirNameStyle |= DIRNAME_STYLE_SURR_CH * dircfg_data->bSurr; + if (BSTATE_CHECKED == SendDlgMessage(hDlg, DM_GETCHECK, ID_DIRCFG_SYMLINK_RADIO1_TEXT, 0)) + Opt.ShowSymlinkSize = 0; + else if (BSTATE_CHECKED == SendDlgMessage(hDlg, DM_GETCHECK, ID_DIRCFG_SYMLINK_RADIO2_SIZE, 0)) + Opt.ShowSymlinkSize = 1; + SendDlgMessage(hDlg, DM_SHOWDIALOG, 0, 0); UpdateDefaultColumnTypeWidths( ); CtrlObject->Cp()->LeftPanel->Update(UPDATE_KEEP_SELECTION); @@ -429,22 +445,29 @@ void DirectoryNameSettings() { dircfg_data_t dircfg_data; DialogDataEx DirCfgDlgData[] = { - - {DI_DOUBLEBOX, 3, 1, 47, 10, {}, 0, Msg::DirSettingsTitle}, - {DI_TEXT, 5, 2, 35, 2, {}, 0, Msg::DirSettingsShowAs}, - {DI_COMBOBOX, 5, 3, 5+40, 3, {}, DIF_DROPDOWNLIST | DIF_LISTNOAMPERSAND | DIF_LISTWRAPMODE, L""}, - {DI_TEXT, 0, 4, 0, 4, {}, DIF_SEPARATOR, L""}, - - {DI_CHECKBOX, 5, 5, 20, 5, {}, DIF_AUTOMATION, Msg::DirSettingsCenter}, - {DI_CHECKBOX, 5, 6, 20, 6, {}, DIF_AUTOMATION, Msg::DirSettingsSurround}, - {DI_COMBOBOX, 9, 7, 26, 7, {}, DIF_DROPDOWNLIST | DIF_LISTNOAMPERSAND | DIF_LISTWRAPMODE, L""}, - - {DI_TEXT, 0, 8, 0, 8, {}, DIF_SEPARATOR, L""}, - {DI_BUTTON, 0, 9, 0, 9, {}, DIF_DEFAULT | DIF_CENTERGROUP, Msg::Ok}, - {DI_BUTTON, 0, 9, 0, 9, {}, DIF_CENTERGROUP, Msg::Cancel}, - {DI_BUTTON, 0, 9, 0, 9, {}, DIF_CENTERGROUP | DIF_BTNNOCLOSE, Msg::DirSettingsApply}, + {DI_DOUBLEBOX, 3, 1, 48, 15, {}, 0, Msg::DirSettingsTitle}, + {DI_TEXT, 5, 2, 46, 2, {}, DIF_DISABLE, Msg::DirSettingsHint}, + {DI_TEXT, 5, 3, 46, 3, {}, 0, Msg::DirSettingsShowAs}, + {DI_COMBOBOX, 5, 4, 5+40, 4, {}, DIF_DROPDOWNLIST | DIF_LISTNOAMPERSAND | DIF_LISTWRAPMODE, L""}, + + {DI_CHECKBOX, 5, 5, 46, 5, {}, DIF_AUTOMATION, Msg::DirSettingsCenter}, + {DI_CHECKBOX, 5, 6, 46, 6, {}, DIF_AUTOMATION, Msg::DirSettingsSurround}, + {DI_COMBOBOX, 9, 7, 26, 7, {}, DIF_DROPDOWNLIST | DIF_LISTNOAMPERSAND | DIF_LISTWRAPMODE, L""}, + + {DI_TEXT, 0, 8, 0, 8, {}, DIF_SEPARATOR, L""}, + {DI_TEXT, 5, 9, 46, 9, {}, 0, Msg::DirSettingsSymlinkText}, + {DI_RADIOBUTTON, 5, 10, 46, 10, {}, DIF_GROUP, Msg::SymLinkName}, + {DI_RADIOBUTTON, 5, 11, 46, 11, {}, 0, Msg::DirSettingsSymlinkRadio2}, + {DI_TEXT, 5, 12, 46, 12, {}, DIF_DISABLE, Msg::DirSettingsSymlinkSizeHint}, + + {DI_TEXT, 0, 13, 0, 13, {}, DIF_SEPARATOR, L""}, + {DI_BUTTON, 0, 14, 0, 14, {}, DIF_DEFAULT | DIF_CENTERGROUP, Msg::Ok}, + {DI_BUTTON, 0, 14, 0, 14, {}, DIF_CENTERGROUP, Msg::Cancel}, + {DI_BUTTON, 0, 14, 0, 14, {}, DIF_CENTERGROUP | DIF_BTNNOCLOSE, Msg::DirSettingsApply}, }; + const int dialogsizex = 52; + const int dialogsizey = 17; MakeDialogItemsEx(DirCfgDlgData, DirCfgDlg); @@ -459,10 +482,10 @@ void DirectoryNameSettings() if (!dircfg_data.bSurr) DirCfgDlg[ID_DIRCFG_SURR_COMBO].Flags |= DIF_DISABLE; + DirCfgDlg[ID_DIRCFG_SYMLINK_RADIO1_TEXT + (Opt.ShowSymlinkSize ? 1 : 0)].Selected = TRUE; + Dialog Dlg(DirCfgDlg, ARRAYSIZE(DirCfgDlg), DirCfgDlgProc, (LONG_PTR)&dircfg_data); - int dialogsizex = 51; - int dialogsizey = 12; Dlg.SetPosition(-1, -1, dialogsizex, dialogsizey); Dlg.SetAutomation(ID_DIRCFG_CHECKBOX_SURR, ID_DIRCFG_SURR_COMBO, DIF_DISABLE, DIF_NONE, DIF_NONE, DIF_DISABLE); @@ -475,7 +498,13 @@ void DirectoryNameSettings() Opt.DirNameStyle |= DIRNAME_STYLE_CENTERED * dircfg_data.bCentered; Opt.DirNameStyle |= DIRNAME_STYLE_SURR_CH * dircfg_data.bSurr; + if (DirCfgDlg[ID_DIRCFG_SYMLINK_RADIO1_TEXT].Selected) + Opt.ShowSymlinkSize = 0; + else if (DirCfgDlg[ID_DIRCFG_SYMLINK_RADIO2_SIZE].Selected) + Opt.ShowSymlinkSize = 1; + UpdateDefaultColumnTypeWidths( ); + //UpdateAutoColumnWidth(); CtrlObject->Cp()->LeftPanel->Update(UPDATE_KEEP_SELECTION); CtrlObject->Cp()->RightPanel->Update(UPDATE_KEEP_SELECTION); CtrlObject->Cp()->Redraw(); From a2c819aa4e41e026e8f2f12fb703ea6f047b76f0 Mon Sep 17 00:00:00 2001 From: akruphi <92621645+akruphi@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:05:19 +0300 Subject: [PATCH 3/3] minor correction --- far2l/bootstrap/scripts/farlang.templ.m4 | 2 +- far2l/src/cfg/config.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/far2l/bootstrap/scripts/farlang.templ.m4 b/far2l/bootstrap/scripts/farlang.templ.m4 index 265a30c2f..65dac2a2e 100644 --- a/far2l/bootstrap/scripts/farlang.templ.m4 +++ b/far2l/bootstrap/scripts/farlang.templ.m4 @@ -2477,7 +2477,7 @@ DirSettingsShowAs "Паказваць каталог як:" DirSettingsSymlinkText -"Для симлинка на файлы показывать:" +"Для симлинка на файл показывать:" "For symlink to file show:" upd:"For symlink to file show:" upd:"For symlink to file show:" diff --git a/far2l/src/cfg/config.cpp b/far2l/src/cfg/config.cpp index e850ab037..2bd90a3cd 100644 --- a/far2l/src/cfg/config.cpp +++ b/far2l/src/cfg/config.cpp @@ -387,7 +387,7 @@ static LONG_PTR WINAPI DirCfgDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR // SendDlgMessage(hDlg, DM_LISTSETCURPOS, dircfg_data->DirNameStyleComboID, (LONG_PTR)&flpos); update_surrcombo( ); - swprintf(tmp, 48, L"\"%ls\"", SymLinkNames[dircfg_data->DirNameStyle].CPtr()); + swprintf(tmp, ARRAYSIZE(tmp), L"\"%ls\"", SymLinkNames[dircfg_data->DirNameStyle].CPtr()); SendDlgMessage(hDlg, DM_SETTEXTPTR, ID_DIRCFG_SYMLINK_RADIO1_TEXT, (LONG_PTR)tmp); } break; @@ -397,7 +397,7 @@ static LONG_PTR WINAPI DirCfgDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR dircfg_data->DirNameStyle = SendDlgMessage(hDlg, DM_LISTGETCURPOS, ID_DIRCFG_STYLE_COMBO, (LONG_PTR)0); update_surrcombo( ); - swprintf(tmp, 48, L"\"%ls\"", SymLinkNames[dircfg_data->DirNameStyle].CPtr()); + swprintf(tmp, ARRAYSIZE(tmp), L"\"%ls\"", SymLinkNames[dircfg_data->DirNameStyle].CPtr()); SendDlgMessage(hDlg, DM_SETTEXTPTR, ID_DIRCFG_SYMLINK_RADIO1_TEXT, (LONG_PTR)tmp); SendDlgMessage(hDlg, DM_REDRAW, 0, 0); } @@ -504,7 +504,6 @@ void DirectoryNameSettings() Opt.ShowSymlinkSize = 1; UpdateDefaultColumnTypeWidths( ); - //UpdateAutoColumnWidth(); CtrlObject->Cp()->LeftPanel->Update(UPDATE_KEEP_SELECTION); CtrlObject->Cp()->RightPanel->Update(UPDATE_KEEP_SELECTION); CtrlObject->Cp()->Redraw();