From 9d54757bbc35ce50dc0d971b9cf3687ab29354e1 Mon Sep 17 00:00:00 2001 From: Giacomo Tommaso Petrucci Date: Thu, 26 Oct 2023 13:39:04 +0200 Subject: [PATCH 1/2] Updated dependencies --- Cargo.toml | 2 +- dog-app/Cargo.toml | 8 ++++---- ecommerce-site/Cargo.toml | 4 ++-- file-explorer/Cargo.toml | 8 ++++---- image_generator_open_ai/Cargo.toml | 6 +++--- ios_demo/Cargo.toml | 8 ++++---- jsframework-benchmark/Cargo.toml | 6 +++--- todomvc/Cargo.toml | 6 +++--- weatherapp/Cargo.toml | 6 +++--- wifi-scanner/Cargo.toml | 8 ++++---- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index af4e86c..c1e3c40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ members = [ # It is not meant to be published, but is used so "cargo run --example XYZ" works properly [package] name = "dioxus-example-projects" -version = "0.0.0" +version = "0.0.1" edition = "2021" description = "Top level crate for the Dioxus examples repository" authors = ["Jonathan Kelley"] diff --git a/dog-app/Cargo.toml b/dog-app/Cargo.toml index 7ccdb21..653f334 100644 --- a/dog-app/Cargo.toml +++ b/dog-app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dog-app" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Search the Dog CEO API for your favorite doggo" license = "MIT/Apache-2.0" @@ -10,15 +10,15 @@ documentation = "https://dioxuslabs.com" keywords = ["dom", "ui", "gui", "react", "wasm"] [dependencies] -dioxus = "0.3" -dioxus-desktop = "0.3" +dioxus = "0.4.0" +dioxus-desktop = "0.4.0" reqwest = { version = "0.11.8", features = ["json"] } serde = { version = "1.0.132", features = ["derive"] } [package.metadata.bundle] name = "Dog Search Engine" identifier = "com.jon.dogsearch" -version = "1.0.0" +version = "1.0.1" copyright = "Copyright (c) Jane Doe 2016. All rights reserved." category = "Developer Tool" short_description = "An example application." diff --git a/ecommerce-site/Cargo.toml b/ecommerce-site/Cargo.toml index ca9b2f8..acdaf4d 100644 --- a/ecommerce-site/Cargo.toml +++ b/ecommerce-site/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "ecommerce-site" -version = "0.1.0" +version = "0.1.1" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] axum = { version = "0.6.16", features = ["ws"] } -cached = "0.43.0" +cached = "0.44.0" dioxus = { git = "https://github.com/DioxusLabs/dioxus" } dioxus-ssr = { git = "https://github.com/DioxusLabs/dioxus" } dioxus-liveview = { git = "https://github.com/DioxusLabs/dioxus", features = ["axum"] } diff --git a/file-explorer/Cargo.toml b/file-explorer/Cargo.toml index 317cf04..8abfc4a 100644 --- a/file-explorer/Cargo.toml +++ b/file-explorer/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "file-explorer" -version = "0.1.0" +version = "0.1.1" edition = "2018" description = "File Explorer with Dioxus" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus = { version = "0.3" } -dioxus-desktop = { version = "0.3" } +dioxus = { version = "0.4.0" } +dioxus-desktop = { version = "0.4.0" } log = "0.4.14" -simple_logger = "1.13.0" +simple_logger = "4.2.0" [package.metadata.bundle] diff --git a/image_generator_open_ai/Cargo.toml b/image_generator_open_ai/Cargo.toml index 21dc9a3..1b2e6cf 100644 --- a/image_generator_open_ai/Cargo.toml +++ b/image_generator_open_ai/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "image_generator_open_ai" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus = { version = "0.3" } -dioxus-desktop = { version = "0.3" } +dioxus = { version = "0.4.0" } +dioxus-desktop = { version = "0.4.0" } reqwest = "0.11.13" tokio = { version = "1", features = ["full"] } serde_json = "1.0.91" diff --git a/ios_demo/Cargo.toml b/ios_demo/Cargo.toml index ac5bb9e..0728f93 100644 --- a/ios_demo/Cargo.toml +++ b/ios_demo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-ios-demo" -version = "0.1.0" +version = "0.1.1" authors = ["Jonathan Kelley "] edition = "2018" @@ -13,9 +13,9 @@ path = "gen/bin/desktop.rs" [dependencies] mobile-entry-point = "0.1.0" -dioxus = { version = "0.3" } -dioxus-mobile = { version = "0.3" } -simple_logger = "1.11.0" +dioxus = { version = "0.4.0" } +dioxus-mobile = { version = "0.4.0" } +simple_logger = "4.2.0" im-rc = "15.0.0" diff --git a/jsframework-benchmark/Cargo.toml b/jsframework-benchmark/Cargo.toml index b65b2ae..0b8058f 100644 --- a/jsframework-benchmark/Cargo.toml +++ b/jsframework-benchmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsframework-benchmark" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -12,5 +12,5 @@ wasm-bindgen = { version = "0.2.79", features = ["enable-interning"] } # for local iteration # dioxus = { path = "../../../dioxus", features = ["web"] } -dioxus = { version = "0.3" } -dioxus-web = { version = "0.3" } +dioxus = { version = "0.4.0" } +dioxus-web = { version = "0.4.0" } diff --git a/todomvc/Cargo.toml b/todomvc/Cargo.toml index 9259601..6d9e595 100644 --- a/todomvc/Cargo.toml +++ b/todomvc/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "todomvc" -version = "0.1.0" +version = "0.1.1" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus = { version = "0.3" } -dioxus-web = { version = "0.3" } +dioxus = { version = "0.4.0" } +dioxus-web = { version = "0.4.0" } wasm-logger = "0.2.0" wasm-bindgen = "0.2.78" log = "0.4.14" diff --git a/weatherapp/Cargo.toml b/weatherapp/Cargo.toml index 4494f66..d36dcd6 100644 --- a/weatherapp/Cargo.toml +++ b/weatherapp/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "weatherapp" -version = "0.1.0" +version = "0.1.1" edition = "2021" [dependencies] chrono = { version = "0.4.26", features = ["serde"] } -dioxus = "0.3" -dioxus-web = "0.3" +dioxus = "0.4.0" +dioxus-web = "0.4.0" reqwest = { version = "0.11.18", features = ["json"] } serde = "1.0.171" serde_json = "1.0.102" diff --git a/wifi-scanner/Cargo.toml b/wifi-scanner/Cargo.toml index a56ea1c..a7ae4bd 100644 --- a/wifi-scanner/Cargo.toml +++ b/wifi-scanner/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "wifi-scanner" -version = "0.1.0" +version = "0.1.1" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1.0.52" -pretty_env_logger = "0.4.0" +pretty_env_logger = "0.5.0" tokio = { version = "1.12.0", features = ["full"] } -dioxus = { version = "0.3" } -dioxus-desktop = { version = "0.3" } +dioxus = { version = "0.4.0" } +dioxus-desktop = { version = "0.4.0" } wifiscanner = "0.5.1" futures-channel = "0.3.19" futures = "0.3.19" From 9ca61c82614b9672a00262ee70d0c109d246a8fb Mon Sep 17 00:00:00 2001 From: Giacomo Tommaso Petrucci Date: Thu, 26 Oct 2023 15:09:08 +0200 Subject: [PATCH 2/2] file-explorer now can also open files using OS' default application --- file-explorer/Cargo.toml | 1 + file-explorer/src/main.rs | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/file-explorer/Cargo.toml b/file-explorer/Cargo.toml index 8abfc4a..2ef8f75 100644 --- a/file-explorer/Cargo.toml +++ b/file-explorer/Cargo.toml @@ -10,6 +10,7 @@ description = "File Explorer with Dioxus" dioxus = { version = "0.4.0" } dioxus-desktop = { version = "0.4.0" } log = "0.4.14" +open = "5.0.0" simple_logger = "4.2.0" diff --git a/file-explorer/src/main.rs b/file-explorer/src/main.rs index 8101fd6..61fd78f 100644 --- a/file-explorer/src/main.rs +++ b/file-explorer/src/main.rs @@ -9,6 +9,7 @@ use dioxus::prelude::*; use dioxus_desktop::{Config, WindowBuilder}; + fn main() { // simple_logger::init_with_level(log::Level::Debug).unwrap(); dioxus_desktop::launch_cfg( @@ -87,11 +88,20 @@ impl Files { log::info!("Reloading path list for {:?}", cur_path); let paths = match std::fs::read_dir(cur_path) { Ok(e) => e, - Err(err) => { - let err = format!("An error occurred: {:?}", err); - self.err = Some(err); - self.path_stack.pop(); - return; + Err(err) => { //Likely we're trying to open a file, so let's open it! + match open::that(cur_path){ + Ok(_) => { + log::info!("Opened file"); + return; + }, + Err(err) => { + let err = format!("An error occurred: {:?}", err); + self.err = Some(err); + self.path_stack.pop(); + return; + } + } + } }; let collected = paths.collect::>(); @@ -105,7 +115,7 @@ impl Files { self.path_names .push(path.unwrap().path().display().to_string()); } - log::info!("path namees are {:#?}", self.path_names); + log::info!("path names are {:#?}", self.path_names); } fn go_up(&mut self) {