mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Cfg: Convert 'App - Content Apps'
This commit is contained in:
@@ -108,4 +108,15 @@ public class Xocfg_mgr {
|
||||
cache_mgr.Del(ctx, key);
|
||||
}
|
||||
public static String Ctx__app = "app";
|
||||
public static String[] Parse_io_cmd(String raw) {
|
||||
String[] rv = new String[2];
|
||||
rv[0] = "";
|
||||
rv[1] = "";
|
||||
int pos = String_.FindFwd(raw, "\n");
|
||||
if (pos != Bry_find_.Not_found) {
|
||||
rv[0] = String_.Mid(raw, 0, pos);
|
||||
rv[1] = String_.Mid(raw, pos + 1);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class Xocfg_dflt_mgr {
|
||||
}
|
||||
public void Init_by_app(Xoa_app app) {
|
||||
Xocfg_dflt_loader loader = new Xocfg_dflt_loader();
|
||||
loader.Load_by_file(this, app.Fsys_mgr().Bin_plat_dir().GenSubFil_nest("cfg", "xo.cfg.dflt.json"));
|
||||
loader.Load_by_file(this, app.Fsys_mgr().Bin_plat_dir().GenSubFil_nest("xowa", "cfg", "xo.cfg.dflt.json"));
|
||||
}
|
||||
public String Get_or(String key, String or) {
|
||||
Xocfg_dflt_itm itm = (Xocfg_dflt_itm)hash.Get_by(key);
|
||||
|
||||
@@ -46,16 +46,14 @@ public class Xoedit_itm_html {
|
||||
bfr.Add_str_u8_fmt("</select>\n");
|
||||
break;
|
||||
case Xoitm_gui_tid.Tid__io_cmd:
|
||||
String[] fields = String_.Split(data, "\n");
|
||||
String exe = fields.length > 0 && !String_.Eq(fields[0], "") ? fields[0] : "";
|
||||
String arg = fields.length > 1 ? fields[1] : "";
|
||||
String[] lines = Xocfg_mgr.Parse_io_cmd(data);
|
||||
bfr.Add_str_u8_fmt
|
||||
( "<input class=\"xocfg__io_cmd__exe__txt\" id=\"{1}-exe\" data-xocfg-key=\"{1}\" data-xocfg-gui=\"{0}-exe\" accesskey=\"d\" type=\"text\" value=\"{2}\"></input>\n"
|
||||
+ "<button class=\"xocfg__io_cmd__exe__btn\" onclick='xowa_io_select(\"file\", \"{1}-exe\", \"Please select a file.\");'>...</button><br/>\n"
|
||||
, gui_type_key, key, exe);
|
||||
, gui_type_key, key, lines[0]);
|
||||
bfr.Add_str_u8_fmt
|
||||
( "<input class=\"xocfg__io_cmd__arg__txt\" id=\"{1}-arg\" data-xocfg-key=\"{1}\" data-xocfg-gui=\"{0}-arg\" accesskey=\"d\" type=\"text\" value='{2}'>\n"
|
||||
, gui_type_key, key, arg);
|
||||
, gui_type_key, key, lines[1]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user