Update dependencies
This commit is contained in:
parent
d637688699
commit
d11501c43d
4 changed files with 520 additions and 495 deletions
865
Cargo.lock
generated
865
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -21,13 +21,13 @@ xdg = "2.5.2"
|
|||
tokio = { workspace = true, features = ["full"] }
|
||||
wayland-client = "0.31.2"
|
||||
# For network status using networkmanager feature
|
||||
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "3644bc909984842f35adb1057ef6e0a277c1aa6a", optional = true }
|
||||
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "badfc6a", optional = true }
|
||||
# For logind integration using logind feature
|
||||
logind-zbus = { version = "3.1.2", optional = true }
|
||||
logind-zbus = { version = "4", optional = true }
|
||||
# Fix zbus compilation by manually adding nix with user feature
|
||||
nix = { workspace = true, optional = true }
|
||||
# For power status with upower feature
|
||||
upower_dbus = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "3644bc909984842f35adb1057ef6e0a277c1aa6a", optional = true }
|
||||
upower_dbus = { git = "https://github.com/pop-os/dbus-settings-bindings", rev = "badfc6a", optional = true }
|
||||
# Required for some features
|
||||
zbus = { workspace = true, optional = true }
|
||||
# Internationalization
|
||||
|
|
@ -58,7 +58,7 @@ pwd = "1.4.0"
|
|||
ron = "0.8"
|
||||
serde = "1"
|
||||
tokio = "1.33.0"
|
||||
zbus = "3.14.1"
|
||||
zbus = "4"
|
||||
|
||||
[workspace.dependencies.cosmic-bg-config]
|
||||
git = "https://github.com/pop-os/cosmic-bg"
|
||||
|
|
|
|||
132
src/greeter.rs
132
src/greeter.rs
|
|
@ -738,41 +738,39 @@ impl cosmic::Application for App {
|
|||
Message::DialogCancel => {
|
||||
self.dialog_page_opt = None;
|
||||
}
|
||||
Message::DialogConfirm => {
|
||||
match self.dialog_page_opt.take() {
|
||||
Some(DialogPage::Restart(_)) => {
|
||||
#[cfg(feature = "logind")]
|
||||
return Command::perform(
|
||||
async move {
|
||||
match crate::logind::reboot().await {
|
||||
Ok(()) => (),
|
||||
Err(err) => {
|
||||
log::error!("failed to reboot: {:?}", err);
|
||||
}
|
||||
Message::DialogConfirm => match self.dialog_page_opt.take() {
|
||||
Some(DialogPage::Restart(_)) => {
|
||||
#[cfg(feature = "logind")]
|
||||
return Command::perform(
|
||||
async move {
|
||||
match crate::logind::reboot().await {
|
||||
Ok(()) => (),
|
||||
Err(err) => {
|
||||
log::error!("failed to reboot: {:?}", err);
|
||||
}
|
||||
message::none()
|
||||
},
|
||||
|x| x,
|
||||
);
|
||||
},
|
||||
Some(DialogPage::Shutdown(_)) => {
|
||||
#[cfg(feature = "logind")]
|
||||
return Command::perform(
|
||||
async move {
|
||||
match crate::logind::power_off().await {
|
||||
Ok(()) => (),
|
||||
Err(err) => {
|
||||
log::error!("failed to power off: {:?}", err);
|
||||
}
|
||||
}
|
||||
message::none()
|
||||
},
|
||||
|x| x,
|
||||
);
|
||||
},
|
||||
None => {}
|
||||
}
|
||||
message::none()
|
||||
},
|
||||
|x| x,
|
||||
);
|
||||
}
|
||||
}
|
||||
Some(DialogPage::Shutdown(_)) => {
|
||||
#[cfg(feature = "logind")]
|
||||
return Command::perform(
|
||||
async move {
|
||||
match crate::logind::power_off().await {
|
||||
Ok(()) => (),
|
||||
Err(err) => {
|
||||
log::error!("failed to power off: {:?}", err);
|
||||
}
|
||||
}
|
||||
message::none()
|
||||
},
|
||||
|x| x,
|
||||
);
|
||||
}
|
||||
None => {}
|
||||
},
|
||||
Message::Suspend => {
|
||||
#[cfg(feature = "logind")]
|
||||
return Command::perform(
|
||||
|
|
@ -794,16 +792,14 @@ impl cosmic::Application for App {
|
|||
Message::Shutdown => {
|
||||
self.dialog_page_opt = Some(DialogPage::Shutdown(Instant::now()));
|
||||
}
|
||||
Message::Heartbeat => {
|
||||
match self.dialog_page_opt {
|
||||
Some(DialogPage::Restart(instant)) | Some(DialogPage::Shutdown(instant)) => {
|
||||
if DialogPage::remaining(instant).is_none() {
|
||||
return self.update(Message::DialogConfirm);
|
||||
}
|
||||
},
|
||||
None => {}
|
||||
Message::Heartbeat => match self.dialog_page_opt {
|
||||
Some(DialogPage::Restart(instant)) | Some(DialogPage::Shutdown(instant)) => {
|
||||
if DialogPage::remaining(instant).is_none() {
|
||||
return self.update(Message::DialogConfirm);
|
||||
}
|
||||
}
|
||||
}
|
||||
None => {}
|
||||
},
|
||||
Message::Exit => {
|
||||
let mut commands = Vec::new();
|
||||
for (_output, surface_id) in self.surface_ids.drain() {
|
||||
|
|
@ -1107,31 +1103,39 @@ impl cosmic::Application for App {
|
|||
Some(DialogPage::Restart(instant)) => {
|
||||
let remaining = DialogPage::remaining(instant).unwrap_or_default();
|
||||
popover
|
||||
.popup(
|
||||
widget::dialog(fl!("restart-now"))
|
||||
.icon(widget::icon::from_name("system-restart-symbolic").size(64))
|
||||
.body(fl!("restart-timeout", seconds = remaining.as_secs()))
|
||||
.primary_action(widget::button::suggested(fl!("restart")).on_press(Message::DialogConfirm))
|
||||
.secondary_action(
|
||||
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
|
||||
),
|
||||
)
|
||||
.into()
|
||||
},
|
||||
.popup(
|
||||
widget::dialog(fl!("restart-now"))
|
||||
.icon(widget::icon::from_name("system-restart-symbolic").size(64))
|
||||
.body(fl!("restart-timeout", seconds = remaining.as_secs()))
|
||||
.primary_action(
|
||||
widget::button::suggested(fl!("restart"))
|
||||
.on_press(Message::DialogConfirm),
|
||||
)
|
||||
.secondary_action(
|
||||
widget::button::standard(fl!("cancel"))
|
||||
.on_press(Message::DialogCancel),
|
||||
),
|
||||
)
|
||||
.into()
|
||||
}
|
||||
Some(DialogPage::Shutdown(instant)) => {
|
||||
let remaining = DialogPage::remaining(instant).unwrap_or_default();
|
||||
popover
|
||||
.popup(
|
||||
widget::dialog(fl!("shutdown-now"))
|
||||
.icon(widget::icon::from_name("system-shutdown-symbolic").size(64))
|
||||
.body(fl!("shutdown-timeout", seconds = remaining.as_secs()))
|
||||
.primary_action(widget::button::suggested(fl!("shutdown")).on_press(Message::DialogConfirm))
|
||||
.secondary_action(
|
||||
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
|
||||
),
|
||||
)
|
||||
.into()
|
||||
},
|
||||
.popup(
|
||||
widget::dialog(fl!("shutdown-now"))
|
||||
.icon(widget::icon::from_name("system-shutdown-symbolic").size(64))
|
||||
.body(fl!("shutdown-timeout", seconds = remaining.as_secs()))
|
||||
.primary_action(
|
||||
widget::button::suggested(fl!("shutdown"))
|
||||
.on_press(Message::DialogConfirm),
|
||||
)
|
||||
.secondary_action(
|
||||
widget::button::standard(fl!("cancel"))
|
||||
.on_press(Message::DialogCancel),
|
||||
),
|
||||
)
|
||||
.into()
|
||||
}
|
||||
None => popover.into(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,7 @@ use logind_zbus::{
|
|||
manager::{InhibitType, ManagerProxy},
|
||||
session::SessionProxy,
|
||||
};
|
||||
use std::{
|
||||
any::TypeId,
|
||||
error::Error,
|
||||
os::fd::{FromRawFd, IntoRawFd, OwnedFd},
|
||||
process,
|
||||
sync::Arc,
|
||||
};
|
||||
use std::{any::TypeId, error::Error, os::fd::OwnedFd, process, sync::Arc};
|
||||
use tokio::time;
|
||||
use zbus::Connection;
|
||||
|
||||
|
|
@ -47,7 +41,7 @@ async fn inhibit(manager: &ManagerProxy<'_>) -> zbus::Result<OwnedFd> {
|
|||
.call("Inhibit", &(what, who, why, mode))
|
||||
.await?;
|
||||
// Have to convert to std type to avoid leaking zbus dependency
|
||||
Ok(unsafe { OwnedFd::from_raw_fd(fd.into_raw_fd()) })
|
||||
Ok(fd.into())
|
||||
}
|
||||
|
||||
pub fn subscription() -> Subscription<Message> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue