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:
parent
40c682515f
commit
01ce402595
|
@ -396,7 +396,6 @@ dependencies = [
|
|||
"rodio",
|
||||
"serde",
|
||||
"toml",
|
||||
"winrt-notification",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in New Issue