commit 3e346314a1156e225f8e0c69ae74b4ce99737120 Author: iorebuild Date: Tue Aug 5 23:28:35 2025 +0800 Slint添加成功 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2726850 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# 编译输出目录 +/target/ + +# 依赖锁文件 +Cargo.lock + +# 本地环境配置文件 +.env + +# 编辑器和 IDE 产生的文件 +.idea/ +.vscode/ +*.iml +*.ipr +*.iws + +# 日志文件 +*.log + +# 临时文件 +temp/ +tmp/ + +# 覆盖配置文件 +Cargo.toml.orig \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..d491ae3 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "VoiletTftp" +version = "1.0.0" +edition = "2024" + +[dependencies] +smol = "1" # or any other runtime/executor +async-tftp = "0.3.6" +slint = "1.12.1" + +[build-dependencies] +slint-build = "1.12" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..b20a192 --- /dev/null +++ b/build.rs @@ -0,0 +1,3 @@ +fn main() { + slint_build::compile("components/Window.slint").unwrap(); +} \ No newline at end of file diff --git a/components/Window.slint b/components/Window.slint new file mode 100644 index 0000000..9e12b93 --- /dev/null +++ b/components/Window.slint @@ -0,0 +1,5 @@ +export component MainWindow inherits Window { + height: 180px; + width: 320px; + title: "VoileTftpTools"; +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..d30fafd --- /dev/null +++ b/src/main.rs @@ -0,0 +1,14 @@ +use async_tftp::server::TftpServerBuilder; +use async_tftp::Result; +slint::include_modules!(); +// fn main() -> Result<()> { +// smol::block_on(async { +// let tftpd = TftpServerBuilder::with_dir_ro("C:/Users/anonymous/Desktop/Rust/VoiletTftp/target/debug")?.build().await?; +// tftpd.serve().await?; +// Ok(()) +// }) +// } + +fn main() { + MainWindow::new().unwrap().run().unwrap(); +} \ No newline at end of file