feat(ipc): connect GUI to daemon via D-Bus reload and live status detection

This commit is contained in:
2026-10-02 18:00:29 +03:00
parent 5ba2cea3d8
commit 9e44bd4b32
5 changed files with 72 additions and 10 deletions
+13 -1
View File
@@ -88,6 +88,7 @@ impl BlockerApp {
}
let mut store = blocker_storage::Store::open(&path).map_err(|e| e.to_string())?;
store.save_schedules(&self.schedules).map_err(|e| e.to_string())?;
let _ = blocker_platform_linux::watcher::notify_daemon_reload();
Ok(())
}
}
@@ -174,7 +175,18 @@ impl BlockerApp {
Tab::Status => {
ui.heading("Current Status");
ui.add_space(12.0);
ui.label(format!("Daemon Status: Connected ({})", self.status_message));
let daemon_live = blocker_platform_linux::watcher::is_daemon_running();
if daemon_live {
ui.colored_label(
egui::Color32::from_rgb(0, 200, 100),
"Daemon Status: Running (D-Bus connected)",
);
} else {
ui.colored_label(
egui::Color32::from_rgb(220, 80, 80),
"Daemon Status: Inactive (not detected on D-Bus)",
);
}
ui.label(format!("Active Schedules: {}", self.schedules.len()));
ui.add_space(16.0);
if ui.button("Test Block Notification").clicked() {