I almost finished making user interface (colors are steel bad)
added settings in witch you can change units of measurement
if you are on Arch based distribution of gnu/linux
you can download not complited version of my application from Arch user repository
now my app won’t crush if you dont have internet connection
Log in to leave a comment
My app finale have usear interface ( note: Colors are placecholders)
i created popups for typing in location and exiting
i created battery level indicator ( in response to Adam Duda question)
My app have some note that is suppose to help users
I will change collors to 1) better looking 2) same acros all terminals
i will add popup in witch you will be able to change for example units like °C
Log in to leave a comment
i added location search mechanism.
pub fn get_location(path: PathBuf, query: &str, ) -> Result<Option<Location>, Box<dyn std::Error>> {
let mut rdr = csv::ReaderBuilder::new().from_path(path)?;
for result in rdr.deserialize() {
let record: Record = result?;
if record.city == query {
return Ok(Some(Location {
latitude: record.lat,
longitude: record.lng,
}));
}
}
Ok(None)
}
Log in to leave a comment
and this is this somthing
and this is this somthing
pub async fn downloading_data(path:PathBuf) -> Result<(),String> {
//dbg!(&path);
let reqs = reqwest::Client::new().get("https://raw.githubusercontent.com/Detalexpl/TuiWeather/refs/heads/master/worldcities.csv")
.send().await.map_err(|e| e.to_string())?.text().await.map_err(|e| e.to_string())?;
create_dir(&path).await.map_err(|e| e.to_string())?;
let mut out = File::create(path.join("cities.csv")).map_err(|e| e.to_string())?;
out.write_all(reqs.as_bytes()).map_err(|e| e.to_string())?;
Ok(())
}
Log in to leave a comment