job: Add JobManagerInterface to emit JobStarted signal

This adds the JobManagerInterface helper object to emit a signal when a job is
started. It also renames the job prefix to be its own path so that the
JobManagerInterface can claim that as an object.
This commit is contained in:
Vicki Pfau 2024-06-27 19:55:32 -07:00
parent 8412adcd4a
commit 8e3fc1afeb
4 changed files with 100 additions and 9 deletions

View file

@ -176,3 +176,14 @@ trait Job {
/// Wait method
fn wait(&self) -> zbus::Result<i32>;
}
#[proxy(
default_service = "com.steampowered.SteamOSManager1",
default_path = "/com/steampowered/SteamOSManager1/Jobs",
interface = "com.steampowered.SteamOSManager1.JobManager"
)]
trait JobManager {
/// JobStarted signal
#[zbus(signal)]
fn job_started(&self, job: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
}