Capture editor file dates and make desktop ZIP import observable
This commit is contained in:
1 parent
0ea71d57a9
commit
fbc339f5c4
11 files changed
+231
-72
No files matched your search
Generated
+1
-1
@@ -3237,7 +3237,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "texrra-desktop"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"tauri",
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,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"
|
||||
|
||||
Reference in new issue
Block a user