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