merge systemd + machinectl into one module/applet (step 1)
This commit is contained in:
parent
96bfc1fd5a
commit
6fc7e8bc8a
1 changed files with 261 additions and 1029 deletions
|
|
@ -12,7 +12,7 @@ use cxx_qt_lib::QString;
|
|||
use serde::Serialize;
|
||||
use std::sync::OnceLock;
|
||||
use tokio::runtime::Runtime;
|
||||
use zbus::{proxy, Connection};
|
||||
use zbus::{Connection, proxy};
|
||||
|
||||
#[cxx_qt::bridge]
|
||||
pub mod qobject {
|
||||
|
|
@ -72,11 +72,8 @@ trait SystemdManager {
|
|||
|
||||
fn list_units_filtered(&self, states: Vec<&str>) -> zbus::Result<Vec<UnitTuple>>;
|
||||
|
||||
fn restart_unit(
|
||||
&self,
|
||||
name: &str,
|
||||
mode: &str,
|
||||
) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
|
||||
fn restart_unit(&self, name: &str, mode: &str)
|
||||
-> zbus::Result<zbus::zvariant::OwnedObjectPath>;
|
||||
}
|
||||
|
||||
#[proxy(
|
||||
|
|
@ -242,9 +239,11 @@ impl qobject::SystemdService {
|
|||
|
||||
self.as_mut().set_system_state(QString::from(sys_state));
|
||||
self.as_mut().set_user_state(QString::from(user_state));
|
||||
self.as_mut().set_failed_units_json(QString::from(failed_json));
|
||||
self.as_mut()
|
||||
.set_failed_units_json(QString::from(failed_json));
|
||||
self.as_mut().set_failed_count(count);
|
||||
self.as_mut().set_containers_json(QString::from(containers_json));
|
||||
self.as_mut()
|
||||
.set_containers_json(QString::from(containers_json));
|
||||
}
|
||||
|
||||
fn restart_unit(self: Pin<&mut Self>, name: QString, scope: QString, machine: QString) {
|
||||
|
|
|
|||
Reference in a new issue