Capture editor file dates and make desktop ZIP import observable

This commit is contained in:
gloamxun committed 2026-12-02 10:07:43 +08:00
1 parent 0ea71d57a9
commit fbc339f5c4
11 files changed
+231 -72

No files matched your search

+3 -1
View File
@@ -2,7 +2,9 @@
Tauri 将现有项目库和原生预览工作台放入 Windows 窗口。安装包携带本轮的
Route-D 引擎、已验证的 LaTeX 格式和 Web 界面。此版面向已有
FedoraLinux-44、对应 TeX 资源和 WebView2 的当前测试电脑。
FedoraLinux-44、对应 TeX 资源和 WebView2 的当前测试电脑。桌面版使用
Windows 当前默认的 WSL 发行版。配置多个发行版时可用 TEXRRA_WSL_DISTRO
指定具备相同 TeX 资源的发行版。项目工作目录在启动时按当前 Fedora 用户生成。
安装后从开始菜单打开 Texrra。也可以解压便携包,运行同目录的
Texrra 桌面程序。在项目库导入包含主 .tex 文件的 ZIP,打开项目后编辑
+1 -1
View File
@@ -3237,7 +3237,7 @@ dependencies = [
[[package]]
name = "texrra-desktop"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"serde_json",
"tauri",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "texrra-desktop"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
rust-version = "1.92"
license = "MIT OR Apache-2.0"
+7 -4
View File
@@ -12,7 +12,6 @@ use std::{
use tauri::{Manager, RunEvent, Url, WebviewUrl, WebviewWindow, WebviewWindowBuilder};
const DISTRO: &str = "FedoraLinux-44";
const HIDE_CONSOLE: u32 = 0x08000000;
const READY_PREFIX: &str = "Native editor ";
@@ -41,7 +40,10 @@ impl Backend {
fn wsl() -> Command {
let mut command = Command::new("wsl.exe");
command.creation_flags(HIDE_CONSOLE);
command.args(["--distribution", DISTRO, "--exec"]);
if let Some(distribution) = std::env::var_os("TEXRRA_WSL_DISTRO").filter(|d| !d.is_empty()) {
command.arg("--distribution").arg(distribution);
}
command.arg("--exec");
command
}
@@ -50,7 +52,7 @@ fn linux_path(path: &Path) -> Result<String, String> {
.args(["wslpath", "-a", "-u"])
.arg(path)
.output()
.map_err(|e| format!("无法打开 {DISTRO}。{e}"))?;
.map_err(|e| format!("无法启动 Windows 的 WSL 环境。{e}"))?;
if !result.status.success() {
return Err(format!(
"无法读取桌面版引擎资源。{}",
@@ -113,7 +115,7 @@ fn start_engine(backend: &Backend, launcher: &Path) -> Result<Url, String> {
.map_err(|error| match error {
mpsc::RecvTimeoutError::Timeout => "启动本地引擎超时。".to_owned(),
mpsc::RecvTimeoutError::Disconnected => {
format!("本地引擎启动失败。请确认 {DISTRO} 可以正常打开。")
"本地引擎启动失败。请确认当前默认的 WSL 发行版可以正常打开。".to_owned()
}
})?
}
@@ -156,6 +158,7 @@ fn main() {
.title("Texrra")
.inner_size(1280.0, 900.0)
.min_inner_size(780.0, 540.0)
.disable_drag_drop_handler()
.on_navigation(move |url| {
matches!(
url.as_str(),
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Texrra",
"version": "0.1.0",
"version": "0.1.1",
"identifier": "org.texrra.desktop",
"build": {
"frontendDist": "../startup"