Slint添加成功
This commit is contained in:
commit
3e346314a1
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# 编译输出目录
|
||||
/target/
|
||||
|
||||
# 依赖锁文件
|
||||
Cargo.lock
|
||||
|
||||
# 本地环境配置文件
|
||||
.env
|
||||
|
||||
# 编辑器和 IDE 产生的文件
|
||||
.idea/
|
||||
.vscode/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
# 日志文件
|
||||
*.log
|
||||
|
||||
# 临时文件
|
||||
temp/
|
||||
tmp/
|
||||
|
||||
# 覆盖配置文件
|
||||
Cargo.toml.orig
|
12
Cargo.toml
Normal file
12
Cargo.toml
Normal file
@ -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"
|
3
build.rs
Normal file
3
build.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
slint_build::compile("components/Window.slint").unwrap();
|
||||
}
|
5
components/Window.slint
Normal file
5
components/Window.slint
Normal file
@ -0,0 +1,5 @@
|
||||
export component MainWindow inherits Window {
|
||||
height: 180px;
|
||||
width: 320px;
|
||||
title: "VoileTftpTools";
|
||||
}
|
14
src/main.rs
Normal file
14
src/main.rs
Normal file
@ -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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user