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

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)]