Bugfixes to session handler. Add extra profile commands

- Better handling of session tracking
- List all profile data
- Get active profile name
- Get active profile data
This commit is contained in:
Luke D Jones
2021-03-23 18:53:17 +13:00
parent 301c532b65
commit 5a7d31fdf6
19 changed files with 203 additions and 329 deletions

View File

@@ -42,7 +42,7 @@ trait Daemon {
fn profiles(&self) -> zbus::Result<String>;
/// ProfileNames method
fn profile_names(&self) -> zbus::Result<String>;
fn profile_names(&self) -> zbus::Result<Vec<String>>;
/// Remove method
fn remove(&self, profile: &str) -> zbus::Result<()>;
@@ -72,6 +72,16 @@ impl<'a> ProfileProxy<'a> {
self.0.active_profile_name()
}
#[inline]
pub fn active_profile_data(&self) -> Result<String> {
self.0.profile()
}
#[inline]
pub fn all_profile_data(&self) -> Result<String> {
self.0.profiles()
}
#[inline]
pub fn next_fan(&self) -> Result<()> {
self.0.next_profile()
@@ -89,7 +99,7 @@ impl<'a> ProfileProxy<'a> {
}
#[inline]
pub fn profile_names(&self) -> Result<String> {
pub fn profile_names(&self) -> Result<Vec<String>> {
self.0.profile_names()
}