Remove winrt-notification as a dependency

notify-rust works on Windows, Linux and macOS (and depends on
winrt-notification anyways) so I can just use notify-rust
This commit is contained in:
Rekai Musuka 2020-06-29 18:18:48 -05:00
parent 40c682515f
commit 01ce402595
3 changed files with 1 additions and 46 deletions

1
Cargo.lock generated
View File

@ -396,7 +396,6 @@ dependencies = [
"rodio",
"serde",
"toml",
"winrt-notification",
]
[[package]]

View File

@ -12,13 +12,7 @@ async-std = "1.6.2"
clap = "2.33.1"
crossterm = "0.17.5"
directories = "3.0.0"
notify-rust = "4.0.0"
rodio = "0.11.0"
serde = { version = "1.0.114", features = ["derive"] }
toml = "0.5.6"
[target.'cfg(windows)'.dependencies]
# winrt = "0.7.0"
winrt-notification = "0.2.2"
[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies]
notify-rust = "4.0.0"

View File

@ -144,7 +144,6 @@ impl Pomodoro {
tx.send(status).unwrap();
}
#[cfg(any(target_os = "macos", target_os = "linux"))]
fn notify(state: &State) {
let mut toast = notify_rust::Notification::new();
@ -172,43 +171,6 @@ impl Pomodoro {
}
}
}
#[cfg(target_os = "windows")]
fn notify(state: &State) {
use winrt_notification::{Duration, Sound, Toast};
let toast = Toast::new(Toast::POWERSHELL_APP_ID);
match state {
State::Work => {
toast
.title("Time to Work!")
.text1("Remember to stay focused!")
.sound(Some(Sound::Default))
.duration(Duration::Short)
.show()
.unwrap();
}
State::ShortBreak | State::LongBreak => {
toast
.title("Break Time!")
.text1("Enjoy your well deserved rest!")
.sound(Some(Sound::Default))
.duration(Duration::Short)
.show()
.unwrap();
}
State::Inactive => {
toast
.title("Pomodoro Cycle Complete.")
.text1("Now waiting for user input....")
.sound(Some(Sound::Default))
.duration(Duration::Short)
.show()
.unwrap();
}
}
}
}
#[derive(Copy, Clone, Debug)]