Added a new command for the Log window that enable/disable the auto hint.

Добавлена команда (hotkey F9) отключение/включение автоматически всплывающих подсказок для лога сервера.
По умолчанию подсказки отключены.
Описание команды храниться в JSON в разделе LogNavigatePanel.
Добавляется после первого открытия окна лога сервера.
This commit is contained in:
lsv 2026-02-06 17:33:54 +05:00
parent c15f9bf0b4
commit 44988fa8dc
4 changed files with 29 additions and 1 deletions

View file

@ -35,6 +35,7 @@ ctlListView::ctlListView(wxWindow* p, int id, wxPoint pos, wxSize siz, long attr
: wxListView(p, id, pos, siz, attr | wxLC_REPORT)
{
nosort = false;
autohint=false;
order = 1;
prev_col = -1;
storelongstring = false;

View file

@ -75,6 +75,11 @@ void ctlNavigatePanel::Init(bool reorganization) {
cm8["hotkey"] = wxString("F8");
cm8["description"] = wxString(_("Find all strings content current row State."));
cmds.Append(cm8);
wxJSONValue cm9(wxJSONType::wxJSONTYPE_OBJECT);
cm9["name"] = wxString("AutoHint");
cm9["hotkey"] = wxString("F9");
cm9["description"] = wxString(_("Enable/disable auto hint."));
cmds.Append(cm9);
@ -164,6 +169,20 @@ void ctlNavigatePanel::Init(bool reorganization) {
if (pr >= 0 && pr <= 100) {
findwidth = pr;
}
// check
wxJSONValue r=opt["commands"];
bool isok=false;
for (int j = 0; j < r.Size(); j++) {
wxJSONValue ccm = r[j];
if (ccm["name"].AsString()=="AutoHint") {
isok=true;
break;
};
}
if (!isok) {
opt["commands"].Append(cm9);
settings->WriteJsonObect("LogNavigatePanel", opt);
}
}
else opt = def;
}
@ -300,6 +319,11 @@ bool ctlNavigatePanel::RunKeyCommand(wxKeyEvent& event,int numCmd) {
bool shift = false;
bool directionUp = false;
if (isok && cmdName == "Help") help = true;
if (isok && cmdName == "AutoHint") {
bool curr=ctrl->ToggleAutoHint();
return true;
}
if (isok && cmdName == "FindNext") {
// F3
if (logFindString.IsEmpty()) cmdName = "Find";