Rename BatteryTray to StatusTray
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::time::Duration;
|
||||
|
||||
mod battery_tray;
|
||||
use battery_tray::{BatteryTray, TrayHandler};
|
||||
mod status_tray;
|
||||
use status_tray::{StatusTray, TrayHandler};
|
||||
use hyper_x_cloud_ii_wireless::devices::{connect_compatible_device, Device, DeviceError};
|
||||
|
||||
fn handle_error(error: DeviceError) -> String {
|
||||
@@ -32,7 +32,7 @@ fn main() {
|
||||
std::thread::sleep(Duration::from_secs(1));
|
||||
};
|
||||
|
||||
let tray_handler = TrayHandler::new(BatteryTray::new());
|
||||
let tray_handler = TrayHandler::new(StatusTray::new());
|
||||
|
||||
// Run loop
|
||||
loop {
|
||||
|
||||
@@ -3,11 +3,11 @@ use ksni::{menu::StandardItem, Handle, MenuItem, ToolTip, Tray, TrayService};
|
||||
use std::sync::{Arc, RwLock, RwLockReadGuard};
|
||||
|
||||
pub struct TrayHandler {
|
||||
handle: Handle<BatteryTray>,
|
||||
handle: Handle<StatusTray>,
|
||||
}
|
||||
|
||||
impl TrayHandler {
|
||||
pub fn new(tray: BatteryTray) -> Self {
|
||||
pub fn new(tray: StatusTray) -> Self {
|
||||
let tray_service = TrayService::new(tray);
|
||||
let handle = tray_service.handle();
|
||||
tray_service.spawn();
|
||||
@@ -28,21 +28,21 @@ impl TrayHandler {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BatteryTray {
|
||||
pub struct StatusTray {
|
||||
device_name: Option<String>,
|
||||
message: Option<String>,
|
||||
}
|
||||
|
||||
impl BatteryTray {
|
||||
impl StatusTray {
|
||||
pub fn new() -> Self {
|
||||
BatteryTray {
|
||||
StatusTray {
|
||||
device_name: None,
|
||||
message: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Tray for BatteryTray {
|
||||
impl Tray for StatusTray {
|
||||
fn id(&self) -> String {
|
||||
env!("CARGO_PKG_NAME").into()
|
||||
}
|
||||
Reference in New Issue
Block a user