Skip to content

Commit

Permalink
hist.menu: extend F3 dialog (touch #1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
elfmz committed Jun 13, 2023
1 parent e86b581 commit ff0f7e5
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 29 deletions.
86 changes: 65 additions & 21 deletions far2l/bootstrap/scripts/farlang.templ.m4
Original file line number Diff line number Diff line change
Expand Up @@ -25208,27 +25208,71 @@ upd:"Other panel"
"Інш. панель"
"Іншая панэль"

CommandDirectory
"Каталог"
"Directory"
"Adresář"
"Verzeichnis"
"Mappa"
"Katalog"
"Directorio"
"Каталог"
"Каталог"

CommandDirectoryRunUp
"Подготовить"
"Run-up"
upd:"Run-up"
upd:"Run-up"
upd:"Run-up"
upd:"Run-up"
upd:"Run-up"
"Підготувати"
"Падрыхтаваць"
HistoryCommandTitle
"Информация о команде"
"History Command Info"
upd:"History Command Info"
upd:"History Command Info"
upd:"History Command Info"
upd:"History Command Info"
upd:"History Command Info"
"Інформація про команду"
"Інфармацыя аб камандзе"

HistoryCommandLine
" Команда: "
" Command: "
upd:" Command: "
upd:" Command: "
upd:" Command: "
upd:" Command: "
upd:" Command: "
" Команда: "
" Каманда: "

HistoryCommandDir
"Директория: "
"Directory: "
upd:"Directory: "
upd:"Directory: "
upd:"Directory: "
upd:"Directory: "
upd:"Directory: "
"Директорія: "
"Дырэкторыя: "

HistoryCommandClose
"Закрыть"
"Close"
upd:"Close"
upd:"Close"
upd:"Close"
upd:"Close"
upd:"Close"
"Закрити"
"Закрыць"

HistoryCommandChDir
"В &дир"
"To &dir"
upd:"To &dir"
upd:"To &dir"
upd:"To &dir"
upd:"To &dir"
upd:"To &dir"
"У &дир"
"У &дыр"

HistoryCommandRunUp
"&Подготовить"
"&Run-up"
upd:"&Run-up"
upd:"&Run-up"
upd:"&Run-up"
upd:"&Run-up"
upd:"&Run-up"
"&Підготувати"
"&Падрыхтаваць"

#Must be the last
NewFileName
Expand Down
2 changes: 2 additions & 0 deletions far2l/src/cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ int CommandLine::ProcessKey(int Key)
ChangeDirFromHistory(Type == 1, 1, strStr.SubStr(0, p));
strStr.Remove(0, p + 1);
SetString(strStr);
} else {
ChangeDirFromHistory(Type == 1, 1, strStr);
}

} else if ((SelectType > 0 && SelectType <= 3) || SelectType == 7) {
Expand Down
28 changes: 20 additions & 8 deletions far2l/src/hist/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,26 @@ int History::ProcessMenu(FARString &strStr, const wchar_t *Title, VMenu &History
break;
}
case KEY_F3:
if (TypeHistory == HISTORYTYPE_CMD && CurrentRecord && !CurrentRecord->strExtra.IsEmpty()) {
if (Message(0, 2, Msg::CommandDirectory,
CurrentRecord->strExtra, Msg::Ok, Msg::CommandDirectoryRunUp) == 1) {
strStr = CurrentRecord->strExtra;
strStr+= L'\n';
strStr+= CurrentRecord->strName;
Type = CurrentRecord->Type;
return 8;
if (TypeHistory == HISTORYTYPE_CMD && CurrentRecord) {
FARString strCmd = CurrentRecord->strName;
FARString strDir = CurrentRecord->strExtra;
TruncStrFromCenter(strCmd, std::max(ScrX - 32, 32));
TruncStrFromCenter(strDir, std::max(ScrX - 32, 32));
strCmd.Insert(0, Msg::HistoryCommandLine);
strDir.Insert(0, Msg::HistoryCommandDir);
switch (Message(MSG_LEFTALIGN, 3, Msg::HistoryCommandTitle, strCmd, strDir,
Msg::HistoryCommandClose, Msg::HistoryCommandChDir, Msg::HistoryCommandRunUp)) {
case 1:
strStr = CurrentRecord->strExtra;
Type = CurrentRecord->Type;
return 8;

case 2:
strStr = CurrentRecord->strExtra;
strStr+= L'\n';
strStr+= CurrentRecord->strName;
Type = CurrentRecord->Type;
return 8;
}
break;
} // else fall through
Expand Down

0 comments on commit ff0f7e5

Please sign in to comment.