diff --git a/README.md b/README.md index 408a5e0e..17c2004a 100644 --- a/README.md +++ b/README.md @@ -580,6 +580,7 @@ in the grid/thumbnail view, if the audio player panel is open, songs will start enabling `multiselect` lets you click files to select them, and then shift-click another file for range-select * `multiselect` is mostly intended for phones/tablets, but the `sel` option in the `[⚙️] settings` tab is better suited for desktop use, allowing selection by CTRL-clicking and range-selection with SHIFT-click, all without affecting regular clicking + * the `sel` option can be made default globally with `--gsel` or per-volume with volflag `gsel` ## zip downloads diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 3c7e46e3..a99eda6c 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1313,6 +1313,7 @@ def add_og(ap): def add_ui(ap, retry): ap2 = ap.add_argument_group('ui options') ap2.add_argument("--grid", action="store_true", help="show grid/thumbnails by default (volflag=grid)") + ap2.add_argument("--gsel", action="store_true", help="select files in grid by ctrl-click (volflag=gsel)") ap2.add_argument("--lang", metavar="LANG", type=u, default="eng", help="language; one of the following: \033[32meng nor\033[0m") ap2.add_argument("--theme", metavar="NUM", type=int, default=0, help="default theme to use (0..7)") ap2.add_argument("--themes", metavar="NUM", type=int, default=8, help="number of themes installed") diff --git a/copyparty/cfg.py b/copyparty/cfg.py index 4768db09..cd87dc2e 100644 --- a/copyparty/cfg.py +++ b/copyparty/cfg.py @@ -35,6 +35,7 @@ def vf_bmap() -> dict[str, str]: "e2vp", "exp", "grid", + "gsel", "hardlink", "magic", "no_sb_md", @@ -214,6 +215,7 @@ flagcats = { }, "client and ux": { "grid": "show grid/thumbnails by default", + "gsel": "select files in grid by ctrl-click", "sort": "default sort order", "unlist": "dont list files matching REGEX", "html_head=TXT": "includes TXT in the , or @PATH for file at PATH", diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 98edecc6..d03ad3e0 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -4461,6 +4461,7 @@ class HttpCli(object): "sb_md": "" if "no_sb_md" in vf else (vf.get("md_sbf") or "y"), "readme": readme, "dgrid": "grid" in vf, + "dgsel": "gsel" in vf, "dsort": vf["sort"], "dcrop": vf["crop"], "dth3x": vf["th3x"], diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index b789d63e..e2054ab2 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -5867,7 +5867,7 @@ var treectl = (function () { bcfg_bind(r, 'ireadme', 'ireadme', true); bcfg_bind(r, 'idxh', 'idxh', idxh, setidxh); bcfg_bind(r, 'dyn', 'dyntree', true, onresize); - bcfg_bind(r, 'csel', 'csel', false); + bcfg_bind(r, 'csel', 'csel', dgsel); bcfg_bind(r, 'dots', 'dotfiles', false, function (v) { r.goto(); var xhr = new XHR(); diff --git a/tests/util.py b/tests/util.py index aed6ca53..85fb202f 100644 --- a/tests/util.py +++ b/tests/util.py @@ -111,7 +111,7 @@ class Cfg(Namespace): def __init__(self, a=None, v=None, c=None, **ka0): ka = {} - ex = "daw dav_auth dav_inf dav_mac dav_rt e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp early_ban ed emp exp force_js getmod grid hardlink ih ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_lifetime no_logues no_mv no_pipe no_poll no_readme no_robots no_sb_md no_sb_lg no_scandir no_tarcmp no_thumb no_vthumb no_zip nrand nw og og_no_head og_s_title q rand smb srch_dbg stats uqe vague_403 vc ver xdev xlink xvol" + ex = "daw dav_auth dav_inf dav_mac dav_rt e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp early_ban ed emp exp force_js getmod grid gsel hardlink ih ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_lifetime no_logues no_mv no_pipe no_poll no_readme no_robots no_sb_md no_sb_lg no_scandir no_tarcmp no_thumb no_vthumb no_zip nrand nw og og_no_head og_s_title q rand smb srch_dbg stats uqe vague_403 vc ver xdev xlink xvol" ka.update(**{k: False for k in ex.split()}) ex = "dotpart dotsrch no_dhash no_fastboot no_rescan no_sendfile no_snap no_voldump re_dhash plain_ip"