-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add serde_json, serde_yaml, smol-timeout, tracing, and tracing-subscr…
…iber dependencies; implement server list retrieval and settings UI in geph5-client-gui
- Loading branch information
1 parent
795988c
commit 99834f5
Showing
6 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use geph5_client::Config; | ||
|
||
use crate::prefs::{pref_read, pref_write}; | ||
|
||
pub fn get_config() -> anyhow::Result<Config> { | ||
let settings = pref_read("settings")?; | ||
let yaml: serde_yaml::Value = serde_yaml::from_str(&settings)?; | ||
let json: serde_json::Value = serde_json::to_value(&yaml)?; | ||
Ok(serde_json::from_value(json)?) | ||
} | ||
|
||
pub fn render_settings(ui: &mut egui::Ui) -> anyhow::Result<()> { | ||
let mut settings_yaml = pref_read("settings").unwrap_or_default().to_string(); | ||
ui.centered_and_justified(|ui| { | ||
egui::ScrollArea::vertical().show(ui, |ui| ui.code_editor(&mut settings_yaml)) | ||
}); | ||
pref_write("settings", &settings_yaml)?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub use broker::broker_client; | ||
pub use client::Client; | ||
pub use client::Config; | ||
|
||
|