Unified · Split
| @@ -804,6 +804,20 @@ let fillhelp () = · 803 unmodified lines | ||
| 804 | 804 | @ (("", 0, Noaction) :: loop [] sl) |> Array.of_list |
| 805 | 805 | ;; |
| 806 | 806 | |
| 807 | +let titlify path = | |
| 808 | + if emptystr path | |
| 809 | + then path | |
| 810 | + else | |
| 811 | + (if emptystr state.origin then path else state.origin) | |
| 812 | + |> Filename.basename |> Ffi.mbtoutf8; | |
| 813 | +;; | |
| 814 | + | |
| 815 | +let settitle title = | |
| 816 | + conf.title <- title; | |
| 817 | + if not !ignoredoctitlte | |
| 818 | + then Wsi.settitle @@ "llpp: " ^ title; | |
| 819 | +;; | |
| 820 | + | |
| 807 | 821 | let opendoc path password = |
| 808 | 822 | state.path <- path; |
| 809 | 823 | state.password <- password; |
| @@ -816,12 +830,7 @@ let opendoc path password = · 6 unmodified lines | ||
| 816 | 830 | Ffi.setpapercolor conf.papercolor; |
| 817 | 831 | Ffi.setdcf conf.dcf; |
| 818 | 832 | |
| 819 | − let titlepath = | |
| 820 | − if emptystr state.origin | |
| 821 | − then path | |
| 822 | − else state.origin | |
| 823 | − in | |
| 824 | − Wsi.settitle ("llpp: " ^ Ffi.mbtoutf8 (Filename.basename titlepath)); | |
| 833 | + Wsi.settitle @@ titlify path; | |
| 825 | 834 | wcmd U.dopen "%d %d %s\000%s\000%s\000" |
| 826 | 835 | (btod conf.usedoccss) !layouth |
| 827 | 836 | path password conf.css; |
| @@ -1375,8 +1384,7 @@ let act cmds = · 547 unmodified lines | ||
| 1375 | 1384 | let s = |
| 1376 | 1385 | match splitatchar args '\t' with |
| 1377 | 1386 | | "Title", v -> |
| 1378 | − conf.title <- v; | |
| 1379 | − if not !ignoredoctitlte then Wsi.settitle @@ "llpp: " ^ v; | |
| 1387 | + settitle v; | |
| 1380 | 1388 | args |
| 1381 | 1389 | | _, "" -> args |
| 1382 | 1390 | | c, v -> |
| @@ -4470,7 +4478,9 @@ let uioh = object · 3087 unmodified lines | ||
| 4470 | 4478 | method display = () |
| 4471 | 4479 | |
| 4472 | 4480 | method title = |
| 4473 | − if emptystr conf.title then Ffi.mbtoutf8 state.path else conf.title | |
| 4481 | + if emptystr conf.title | |
| 4482 | + then titlify state.path | |
| 4483 | + else conf.title | |
| 4474 | 4484 | |
| 4475 | 4485 | method key key mask = |
| 4476 | 4486 | begin match state.mode with |