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:
Generated
+1403
-572
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "champ"
|
||||
version = "0.1.0"
|
||||
version = "2025.3.6"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
fn main() {
|
||||
let config = slint_build::CompilerConfiguration::new()
|
||||
.with_style("fluent-dark".into());
|
||||
let config = slint_build::CompilerConfiguration::new().with_style("fluent-dark".into());
|
||||
slint_build::compile_with_config("ui/template.slint", config).unwrap();
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
use slint::ComponentHandle;
|
||||
|
||||
slint::slint!();
|
||||
slint::include_modules!();
|
||||
pub mod utils;
|
||||
@@ -13,6 +15,13 @@ fn main() {
|
||||
});
|
||||
let computermodulecallbacks: 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>();
|
||||
othertoolmodulecallbacks.on_killCherwell({
|
||||
move || {
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
pub mod othertoolmodules;
|
||||
pub mod computermodules;
|
||||
pub mod othertoolmodules;
|
||||
pub mod usermodules;
|
||||
@@ -1,5 +1,9 @@
|
||||
pub fn computer_file_explorer() {
|
||||
println!("Test");
|
||||
use crate::{ComputerModuleCallbacks, MainWindow};
|
||||
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() {
|
||||
|
||||
@@ -23,24 +23,22 @@ pub fn ip_gelocate_api(app: MainWindow) {
|
||||
.set_city(slint::SharedString::from("Failed to resolve IP/URL"));
|
||||
}
|
||||
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 isp: slint::SharedString = parsed["isp"].to_shared_string();
|
||||
let country: slint::SharedString = parsed["country"].to_shared_string();
|
||||
let region: slint::SharedString = parsed["regionName"].to_shared_string();
|
||||
let city: slint::SharedString = parsed["city"].to_shared_string();
|
||||
app.global::<OtherToolCallbacks>()
|
||||
.set_isp(slint::SharedString::from(isp));
|
||||
app.global::<OtherToolCallbacks>()
|
||||
.set_country(slint::SharedString::from(country));
|
||||
app.global::<OtherToolCallbacks>()
|
||||
.set_state(slint::SharedString::from(region));
|
||||
app.global::<OtherToolCallbacks>()
|
||||
.set_city(slint::SharedString::from(city));
|
||||
app.global::<OtherToolCallbacks>().set_isp(isp);
|
||||
app.global::<OtherToolCallbacks>().set_country(country);
|
||||
app.global::<OtherToolCallbacks>().set_state(region);
|
||||
app.global::<OtherToolCallbacks>().set_city(city);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update() {
|
||||
println!("Checking for Updates!");
|
||||
let version: &str = env!("CARGO_PKG_VERSION");
|
||||
println!("{}", version);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox } from "std-widgets.slint";
|
||||
|
||||
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 {
|
||||
@@ -19,6 +25,9 @@ export component ComputerModules inherits Window {
|
||||
|
||||
LineEdit {
|
||||
height: 35px;
|
||||
edited(text) => {
|
||||
ComputerModuleCallbacks.computername = self.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +37,9 @@ export component ComputerModules inherits Window {
|
||||
spacing: 5px;
|
||||
Button {
|
||||
text: "Computer File Explorer";
|
||||
clicked => {
|
||||
ComputerModuleCallbacks.CFE();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
|
||||
Reference in New Issue
Block a user