Fix config file when removing system accels.
We assign the `NOOP` id for every command disabled by the user, but not the command name (just `NOOP`). When updating the configuration file, any command with `NOOP` id is valid, even if the label does not match `NOOP`. Hence this weird issue. - Fix #502.
This commit is contained in:
parent
1c6b016853
commit
10f5576ecf
|
@ -803,6 +803,11 @@ void update_opts()
|
||||||
if (cmdtab[cmd].cmd_id == cmd_id)
|
if (cmdtab[cmd].cmd_id == cmd_id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// NOOP overwrittes commands removed by the user
|
||||||
|
wxString command = cmdtab[cmd].cmd;
|
||||||
|
if (cmdtab[cmd].cmd_id == XRCID("NOOP"))
|
||||||
|
command = wxT("NOOP");
|
||||||
|
|
||||||
wxAcceleratorEntry_v::iterator j;
|
wxAcceleratorEntry_v::iterator j;
|
||||||
|
|
||||||
for (j = i + 1; j < gopts.accels.end(); ++j)
|
for (j = i + 1; j < gopts.accels.end(); ++j)
|
||||||
|
@ -812,8 +817,8 @@ void update_opts()
|
||||||
wxAcceleratorEntry_v nv(i, j);
|
wxAcceleratorEntry_v nv(i, j);
|
||||||
wxString nvs = wxKeyTextCtrl::ToString(nv);
|
wxString nvs = wxKeyTextCtrl::ToString(nv);
|
||||||
|
|
||||||
if (nvs != cfg->Read(cmdtab[cmd].cmd))
|
if (nvs != cfg->Read(command))
|
||||||
cfg->Write(cmdtab[cmd].cmd, nvs);
|
cfg->Write(command, nvs);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg->SetPath(wxT("/"));
|
cfg->SetPath(wxT("/"));
|
||||||
|
|
Loading…
Reference in New Issue