Support for C$ File Explorer

1. Need to implement threaded file explorer to prevent parent thread blocking
https://pm.racooncity.org/project/champ/kanban
This commit is contained in:
brotoskyj
2025-03-11 03:04:00 +00:00
parent 0c0a081493
commit 7a8246905d
9 changed files with 1445 additions and 592 deletions
Generated
+1403 -572
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "champ" name = "champ"
version = "0.1.0" version = "2025.3.6"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
+1 -2
View File
@@ -1,5 +1,4 @@
fn main() { fn main() {
let config = slint_build::CompilerConfiguration::new() let config = slint_build::CompilerConfiguration::new().with_style("fluent-dark".into());
.with_style("fluent-dark".into());
slint_build::compile_with_config("ui/template.slint", config).unwrap(); slint_build::compile_with_config("ui/template.slint", config).unwrap();
} }
+9
View File
@@ -1,3 +1,5 @@
use slint::ComponentHandle;
slint::slint!(); slint::slint!();
slint::include_modules!(); slint::include_modules!();
pub mod utils; pub mod utils;
@@ -13,6 +15,13 @@ fn main() {
}); });
let computermodulecallbacks: ComputerModuleCallbacks<'_> = let computermodulecallbacks: ComputerModuleCallbacks<'_> =
app.global::<ComputerModuleCallbacks>(); app.global::<ComputerModuleCallbacks>();
computermodulecallbacks.on_CFE({
let app_weak = app.as_weak();
move || {
let app: MainWindow = app_weak.unwrap();
utils::computermodules::computer_file_explorer(app);
}
});
let othertoolmodulecallbacks: OtherToolCallbacks<'_> = app.global::<OtherToolCallbacks>(); let othertoolmodulecallbacks: OtherToolCallbacks<'_> = app.global::<OtherToolCallbacks>();
othertoolmodulecallbacks.on_killCherwell({ othertoolmodulecallbacks.on_killCherwell({
move || { move || {
+1 -1
View File
@@ -1,3 +1,3 @@
pub mod othertoolmodules;
pub mod computermodules; pub mod computermodules;
pub mod othertoolmodules;
pub mod usermodules; pub mod usermodules;
+6 -2
View File
@@ -1,5 +1,9 @@
pub fn computer_file_explorer() { use crate::{ComputerModuleCallbacks, MainWindow};
println!("Test"); use slint::ComponentHandle;
pub fn computer_file_explorer(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
println!("{}", computername);
} }
pub fn current_logged_on_user() { pub fn current_logged_on_user() {
+7 -9
View File
@@ -23,24 +23,22 @@ pub fn ip_gelocate_api(app: MainWindow) {
.set_city(slint::SharedString::from("Failed to resolve IP/URL")); .set_city(slint::SharedString::from("Failed to resolve IP/URL"));
} }
Ok(_t) => { Ok(_t) => {
let result: String = resp.unwrap().text().unwrap().into(); let result: String = resp.unwrap().text().unwrap();
let parsed: Value = serde_json::from_str(&result).unwrap(); let parsed: Value = serde_json::from_str(&result).unwrap();
let isp: slint::SharedString = parsed["isp"].to_shared_string(); let isp: slint::SharedString = parsed["isp"].to_shared_string();
let country: slint::SharedString = parsed["country"].to_shared_string(); let country: slint::SharedString = parsed["country"].to_shared_string();
let region: slint::SharedString = parsed["regionName"].to_shared_string(); let region: slint::SharedString = parsed["regionName"].to_shared_string();
let city: slint::SharedString = parsed["city"].to_shared_string(); let city: slint::SharedString = parsed["city"].to_shared_string();
app.global::<OtherToolCallbacks>() app.global::<OtherToolCallbacks>().set_isp(isp);
.set_isp(slint::SharedString::from(isp)); app.global::<OtherToolCallbacks>().set_country(country);
app.global::<OtherToolCallbacks>() app.global::<OtherToolCallbacks>().set_state(region);
.set_country(slint::SharedString::from(country)); app.global::<OtherToolCallbacks>().set_city(city);
app.global::<OtherToolCallbacks>()
.set_state(slint::SharedString::from(region));
app.global::<OtherToolCallbacks>()
.set_city(slint::SharedString::from(city));
} }
} }
} }
pub fn update() { pub fn update() {
println!("Checking for Updates!"); println!("Checking for Updates!");
let version: &str = env!("CARGO_PKG_VERSION");
println!("{}", version);
} }
+13 -1
View File
@@ -1,7 +1,13 @@
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox } from "std-widgets.slint"; import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox } from "std-widgets.slint";
export global ComputerModuleCallbacks { export global ComputerModuleCallbacks {
pure callback killCherwell(); pure callback CFE();
pure callback CLU();
pure callback LAPS();
pure callback RTC();
pure callback RRTC();
pure callback SLP();
in-out property <string> computername;
} }
export component ComputerModules inherits Window { export component ComputerModules inherits Window {
@@ -19,6 +25,9 @@ export component ComputerModules inherits Window {
LineEdit { LineEdit {
height: 35px; height: 35px;
edited(text) => {
ComputerModuleCallbacks.computername = self.text;
}
} }
} }
@@ -28,6 +37,9 @@ export component ComputerModules inherits Window {
spacing: 5px; spacing: 5px;
Button { Button {
text: "Computer File Explorer"; text: "Computer File Explorer";
clicked => {
ComputerModuleCallbacks.CFE();
}
} }
Button { Button {