Compare commits
1 Commits
9a8afd4dae
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57d3d839b2 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4062,7 +4062,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slint_test"
|
name = "slint_test"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"slint",
|
"slint",
|
||||||
"slint-build",
|
"slint-build",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "slint_test"
|
name = "slint_test"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
authors = ["3872006562@qq.com"]
|
authors = ["3872006562@qq.com"]
|
||||||
|
|||||||
@@ -31,6 +31,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
main_window.on_launch_taskmgr(|| {
|
main_window.on_launch_taskmgr(|| {
|
||||||
let _ = Command::new("taskmgr.exe").spawn();
|
let _ = Command::new("taskmgr.exe").spawn();
|
||||||
});
|
});
|
||||||
|
main_window.on_launch_cmd(|| {
|
||||||
|
if let Ok(user_profile) = std::env::var("USERPROFILE") {
|
||||||
|
let _ = Command::new("cmd.exe").current_dir(user_profile).spawn();
|
||||||
|
} else {
|
||||||
|
let _ = Command::new("cmd.exe").spawn();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let _ = main_window.run();
|
let _ = main_window.run();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export component MainWindow inherits Window {
|
|||||||
Button { text: "远程桌面连接"; clicked => { root.launch_mstsc(); } }
|
Button { text: "远程桌面连接"; clicked => { root.launch_mstsc(); } }
|
||||||
Button { text: "字符映射表"; clicked => { root.launch_charmap(); } }
|
Button { text: "字符映射表"; clicked => { root.launch_charmap(); } }
|
||||||
Button { text: "任务管理器"; clicked => { root.launch_taskmgr(); } }
|
Button { text: "任务管理器"; clicked => { root.launch_taskmgr(); } }
|
||||||
|
Button { text: "CMD"; clicked => { root.launch_cmd(); } }
|
||||||
}
|
}
|
||||||
callback launch_powershell();
|
callback launch_powershell();
|
||||||
callback launch_security_center();
|
callback launch_security_center();
|
||||||
@@ -25,4 +26,5 @@ export component MainWindow inherits Window {
|
|||||||
callback launch_mstsc();
|
callback launch_mstsc();
|
||||||
callback launch_charmap();
|
callback launch_charmap();
|
||||||
callback launch_taskmgr();
|
callback launch_taskmgr();
|
||||||
|
callback launch_cmd();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user