1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Cfg: Fix multiple mis-mapped gui shortcut keys

This commit is contained in:
gnosygnu
2017-01-03 01:32:32 -05:00
parent ab4d7de36d
commit eee0a7de1d
7 changed files with 43 additions and 36 deletions

View File

@@ -34,17 +34,17 @@ public class Xocfg_mgr implements Gfo_invk {
public void Bind_many_app (Gfo_invk sub, String... keys) {Bind_many(Bool_.Y, sub, Xocfg_mgr.Ctx__app, keys);}
public void Bind_many_wiki (Gfo_invk sub, Xow_wiki wiki, String... keys) {Bind_many(Bool_.Y, sub, wiki.Domain_itm().Abrv_xo_str(), keys);}
private void Bind_many(boolean pub, Gfo_invk sub, String ctx, String... keys) {
try {
for (String key : keys) {
for (String key : keys) {
try {
cache_mgr.Sub(sub, ctx, key, key);
if (pub) {
String val = cache_mgr.Get(ctx, key);
cache_mgr.Pub(ctx, key, val);
}
}
}
catch (Exception e) {
Gfo_usr_dlg_.Instance.Warn_many("", "", "bind failed: ctx=~{0} keys=~{1} err=~{2}", ctx, String_.AryXtoStr(keys), Err_.Message_gplx_log(e));
catch (Exception e) {
Gfo_usr_dlg_.Instance.Warn_many("", "", "bind failed: ctx=~{0} key=~{1} err=~{2}", ctx, key, Err_.Message_gplx_log(e));
}
}
}
public boolean Get_bool_app_or(String key, boolean or) {

View File

@@ -73,6 +73,7 @@ public class Xocfg_cache_mgr {
public void Dflt(String key, String val) {
Xocfg_cache_grp grp = Grps__get_or_load(key);
grp.Dflt_(val);
grp.Pub(Xocfg_mgr.Ctx__app, val); // need to pub after dflt is changed; for now, just pub at app-level
}
public Xocfg_cache_grp Grps__get_or_load(String key) {
Xocfg_cache_grp grp = (Xocfg_cache_grp)grps.Get_by(key);

View File

@@ -28,8 +28,8 @@ public class Xocfg_dflt_mgr {
return (itm == null) ? or : (String)Gfo_invk_.Invk_by_key(itm, key);
}
public void Add(String key, String val) {
cache_mgr.Dflt(key, val);
hash.Add(key, new Xocfg_dflt_itm__static(val));
cache_mgr.Dflt(key, val);
}
public void Add(Gfo_invk invk, String... keys) {
for (String key : keys) {