mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.2.4.1
This commit is contained in:
@@ -18,11 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.xowa.gui.views.*;
|
||||
public class Xoa_cur implements GfoInvkAble {
|
||||
public Xoa_cur(Xoa_app app) {this.app = app;} private Xoa_app app;
|
||||
public Xoa_cur(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_wiki)) {
|
||||
Xog_win_itm win = app.Gui_mgr().Browser_win();
|
||||
return win.Active_tab() == null ? GfoInvkAble_.Null : win.Active_page().Wiki(); // null check when called from mass html gen; DATE:2014-06-04
|
||||
return win.Active_tab() == null ? GfoInvkAble_.Null : win.Active_page().Wikie(); // null check when called from mass html gen; DATE:2014-06-04
|
||||
}
|
||||
else if (ctx.Match(k, Invk_win)) return app.Gui_mgr().Browser_win();
|
||||
else if (ctx.Match(k, Invk_user)) return app.User();
|
||||
|
||||
@@ -16,12 +16,12 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.core.primitives.*; import gplx.xowa.tdbs.*;
|
||||
public class Xoa_hive_mgr {
|
||||
public Xoa_hive_mgr(Xoa_app app) {this.app = app;} private Xoa_app app;
|
||||
public Xoa_hive_mgr(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
public Xob_xdat_itm Itm() {return xdat_itm;}
|
||||
public int Find_fil(Io_url hive_root, byte[] ttl) {
|
||||
Io_url hive_url = hive_root.GenSubFil(Xow_dir_info_.Name_reg_fil);
|
||||
Io_url hive_url = hive_root.GenSubFil(Xotdb_dir_info_.Name_reg_fil);
|
||||
if (!hive_url.Eq(regy_mgr.Fil()))
|
||||
regy_mgr.Init(hive_url);
|
||||
return regy_mgr.Files_find(ttl);
|
||||
@@ -30,7 +30,7 @@ public class Xoa_hive_mgr {
|
||||
public Xob_xdat_file Get_rdr(Io_url hive_root, byte[] fil_ext_bry, int fil_idx) {
|
||||
Bry_bfr tmp_bfr = app.Utl_bry_bfr_mkr().Get_m001();
|
||||
byte[] tmp_bry = tmp_bfr.Bfr(); bry_len.Val_zero_();
|
||||
Io_url file = Xow_fsys_mgr.Url_fil(hive_root, fil_idx, fil_ext_bry);
|
||||
Io_url file = Xotdb_fsys_mgr.Url_fil(hive_root, fil_idx, fil_ext_bry);
|
||||
tmp_bry = Io_mgr._.LoadFilBry_reuse(file, tmp_bry, bry_len);
|
||||
xdat_rdr.Clear().Parse(tmp_bry, bry_len.Val(), file);
|
||||
tmp_bfr.Mkr_rls().Clear();
|
||||
|
||||
@@ -16,9 +16,10 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.xowa.langs.*;
|
||||
public class Xoa_sys_cfg implements GfoInvkAble {
|
||||
private Xoa_app app;
|
||||
public Xoa_sys_cfg(Xoa_app app) {this.app = app;}
|
||||
private Xoae_app app;
|
||||
public Xoa_sys_cfg(Xoae_app app) {this.app = app;}
|
||||
public byte[] Lang() {return lang_key;}
|
||||
public Xoa_sys_cfg Lang_(byte[] v) {
|
||||
lang_key = Xol_lang_itm_.Get_by_key_or_en(v).Key();
|
||||
@@ -58,7 +59,7 @@ class Options_list_lang_ {
|
||||
if (translated.Has(itm.Key())) continue;
|
||||
untranslated.Add(itm);
|
||||
}
|
||||
untranslated.SortBy(Xol_lang_itm_.Comparer_code);
|
||||
untranslated.SortBy(Xol_lang_itm_.Comparer_key);
|
||||
|
||||
KeyVal[] rv = new KeyVal[len];
|
||||
int translated_max = translated.Count();
|
||||
@@ -71,7 +72,7 @@ class Options_list_lang_ {
|
||||
}
|
||||
private static KeyVal new_itm(Xol_lang_itm itm) {
|
||||
String key_str = String_.new_utf8_(itm.Key());
|
||||
String name_str = String_.new_utf8_(itm.Local_name());
|
||||
String name_str = String_.new_utf8_(itm.Localized_name());
|
||||
return KeyVal_.new_(key_str, name_str + " [" + key_str + "]");
|
||||
}
|
||||
private static void Add_itm_many(OrderedHash translated, int... langs) {
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//namespace gplx.xowa {
|
||||
// public class Xoa_url_alias_mgr : GfoInvkAble {
|
||||
// private Hash_adp_bry hash = Hash_adp_bry.cs_(); private Bry_fmtr fmtr = Bry_fmtr.new_("", "");
|
||||
// public Xoa_url_alias_mgr(Xoa_app app) {this.app = app;} private Xoa_app app;
|
||||
// public Xoa_url_alias_mgr(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
// public byte[] Fmt_or_null(byte[] raw) {
|
||||
// int colon_pos = Bry_finder.Find_fwd(raw, Byte_ascii.Colon); if (colon_pos == Bry_.NotFound) return null;
|
||||
// byte[] fmt = (byte[])hash.Get_by_mid(raw, 0, colon_pos); if (fmt == null) return null;
|
||||
|
||||
@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ), KeyVal_.new_("w:Earth", "en.wikipedia.org/wiki/Earth"), KeyVal_.new_("d:Earth", "en.wiktionary.org/wiki/Earth"), KeyVal_.new_("x:Earth", null));
|
||||
// }
|
||||
// private void Add_bulk_tst(String raw_str, params KeyVal[] expd_ary) {
|
||||
// Xoa_app app = Xoa_app_fxt.app_();
|
||||
// Xoae_app app = Xoa_app_fxt.app_();
|
||||
// Xoa_url_alias_mgr mgr = new Xoa_url_alias_mgr(app);
|
||||
// byte[] raw_bry = Bry_.new_ascii_(raw_str);
|
||||
// mgr.Add_bulk(raw_bry);
|
||||
|
||||
@@ -83,7 +83,7 @@ public class Xoac_lang_grp_tst {
|
||||
class Xoac_lang_grp_fxt {
|
||||
Xoa_lang_mgr lang_mgr; Tst_mgr tst_mgr = new Tst_mgr();
|
||||
public void Clear() {
|
||||
Xoa_app app = Xoa_app_fxt.app_();
|
||||
Xoae_app app = Xoa_app_fxt.app_();
|
||||
lang_mgr = app.Lang_mgr();
|
||||
}
|
||||
public Xoac_lang_itm_chkr itm_(String key) {return new Xoac_lang_itm_chkr(key);}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Xoac_wiki_grp_tst {
|
||||
class Xoac_wiki_grp_fxt {
|
||||
Xoa_wiki_mgr wiki_mgr; Tst_mgr tst_mgr = new Tst_mgr();
|
||||
public void Clear() {
|
||||
Xoa_app app = Xoa_app_fxt.app_();
|
||||
Xoae_app app = Xoa_app_fxt.app_();
|
||||
wiki_mgr = app.Wiki_mgr();
|
||||
}
|
||||
public Xoac_wiki_itm_chkr itm_(String key) {return new Xoac_wiki_itm_chkr(key);}
|
||||
|
||||
Reference in New Issue
Block a user